Skip to content

Fix makefile style and fallback to general cc commands & temp windows builds fix #342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ jobs:
.\install.ps1 -RunAsAdmin
scoop install [email protected] --global
echo "C:\ProgramData\scoop\shims;C:\Users\runneradmin\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@1.66
- name: Build uwp
if: contains(matrix.target, 'uwp')
shell: cmd
env:
TOOLCHAIN: nightly-2023-02-02
MOZTOOLS_PATH: 'C:\mozilla-build\msys\bin;C:\mozilla-build\bin'
AUTOCONF: "C:/mozilla-build/msys/local/bin/autoconf-2.13"
LINKER: "lld-link.exe"
Expand All @@ -87,11 +88,11 @@ jobs:
PYTHON3: "C:\\mozilla-build\\python3\\python3.exe"
LIBCLANG_PATH: "C:\\ProgramData\\scoop\\apps\\llvm\\current\\lib"
run: |
rustup install nightly-2022-11-20
rustup default nightly-2022-11-20
rustup component add rust-src
rustup install ${{ env.TOOLCHAIN }}
rustup default ${{ env.TOOLCHAIN }}
rustup component add rust-src --toolchain ${{ env.TOOLCHAIN }}-x86_64-pc-windows-msvc
rustc --version --verbose
cargo build --verbose ${{ matrix.features }} -Z build-std=std,panic_abort --target ${{ matrix.target }}
cargo +${{ env.TOOLCHAIN }} build --verbose ${{ matrix.features }} -Z build-std=std,panic_abort --target ${{ matrix.target }}
- name: Build Windows
if: contains(matrix.target, 'uwp') != true
shell: cmd
Expand Down
52 changes: 26 additions & 26 deletions mozjs/makefile.cargo
Original file line number Diff line number Diff line change
Expand Up @@ -79,37 +79,37 @@ ifneq ($(HOST),$(TARGET))
endif
endif

ifeq ($(WINDOWS),)
CC ?= $(TARGET)-gcc
CPP ?= $(TARGET)-gcc -E
CXX ?= $(TARGET)-g++
AR ?= $(TARGET)-ar
CONFIGURE_FLAGS += --target=$(TARGET) --disable-gold
endif
ifeq ($(WINDOWS),)
CC ?= $(TARGET)-gcc
CPP ?= $(TARGET)-gcc -E
CXX ?= $(TARGET)-g++
AR ?= $(TARGET)-ar
CONFIGURE_FLAGS += --target=$(TARGET) --disable-gold
endif

else

ifeq (,$(WINDOWS))
ifeq (freebsd,$(findstring freebsd,$(TARGET)))
# Does not symlink clang as "gcc" like macOS does
CC ?= clang
CPP ?= clang -E
CXX ?= clang++
else
CC ?= gcc
CPP ?= gcc -E
CXX ?= g++
endif
AR ?= ar
ifeq (,$(WINDOWS))
ifeq (freebsd,$(findstring freebsd,$(TARGET)))
# Does not symlink clang as "gcc" like macOS does
CC ?= clang
CPP ?= clang -E
CXX ?= clang++
else
CC ?= cc
CPP ?= cc -E
CXX ?= c++
endif
AR ?= ar

# check if python2 is a valid Python executable, otherwise fall back to python
ifeq (, $(findstring Python 2.,$(shell python2 --version 2> /dev/null)))
PYTHON ?= python2
else
PYTHON ?= python
endif
# check if python2 is a valid Python executable, otherwise fall back to python
ifeq (, $(findstring Python 2.,$(shell python2 --version 2> /dev/null)))
PYTHON ?= python2
else
PYTHON ?= python
endif

endif
endif

endif

Expand Down