Skip to content

Commit

Permalink
dev-lang/spidermonkey: fix cross-compiling logic
Browse files Browse the repository at this point in the history
  • Loading branch information
vapier committed Jan 13, 2016
1 parent 35cf1b4 commit cc362d5
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 35 deletions.
28 changes: 17 additions & 11 deletions dev-lang/spidermonkey/spidermonkey-1.8.5-r4.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -83,26 +83,32 @@ src_configure() {
$(use_enable test tests)
}

cross_make() {
emake \
CFLAGS="${BUILD_CFLAGS}" \
CXXFLAGS="${BUILD_CXXFLAGS}" \
AR="${BUILD_AR}" \
CC="${BUILD_CC}" \
CXX="${BUILD_CXX}" \
RANLIB="${BUILD_RANLIB}" \
"$@"
}
src_compile() {
cd "${BUILDDIR}" || die
if tc-is-cross-compiler; then
make CFLAGS="" CXXFLAGS="" \
CC=$(tc-getBUILD_CC) CXX=$(tc-getBUILD_CXX) \
AR=$(tc-getBUILD_AR) RANLIB=$(tc-getBUILD_RANLIB) \
jscpucfg host_jsoplengen host_jskwgen || die
make CFLAGS="" CXXFLAGS="" \
CC=$(tc-getBUILD_CC) CXX=$(tc-getBUILD_CXX) \
AR=$(tc-getBUILD_AR) RANLIB=$(tc-getBUILD_RANLIB) \
-C config nsinstall || die
tc-export_build_env BUILD_{AR,CC,CXX,RANLIB}
cross_make jscpucfg host_jsoplengen host_jskwgen
cross_make -C config nsinstall
mv {,native-}jscpucfg || die
mv {,native-}host_jskwgen || die
mv {,native-}host_jsoplengen || die
mv config/{,native-}nsinstall || die
sed -e 's@./jscpucfg@./native-jscpucfg@' \
sed -i \
-e 's@./jscpucfg@./native-jscpucfg@' \
-e 's@./host_jskwgen@./native-host_jskwgen@' \
-e 's@./host_jsoplengen@./native-host_jsoplengen@' \
-i Makefile || die
sed -e 's@/nsinstall@/native-nsinstall@' -i config/config.mk || die
Makefile || die
sed -i -e 's@/nsinstall@/native-nsinstall@' config/config.mk || die
rm -f config/host_nsinstall.o \
config/host_pathsub.o \
host_jskwgen.o \
Expand Down
28 changes: 16 additions & 12 deletions dev-lang/spidermonkey/spidermonkey-17.0.0-r4.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -80,26 +80,30 @@ src_configure() {
$(use_enable test tests)
}

cross_make() {
emake \
CFLAGS="${BUILD_CFLAGS}" \
CXXFLAGS="${BUILD_CXXFLAGS}" \
AR="${BUILD_AR}" \
CC="${BUILD_CC}" \
CXX="${BUILD_CXX}" \
RANLIB="${BUILD_RANLIB}" \
"$@"
}
src_compile() {
cd "${BUILDDIR}" || die
if tc-is-cross-compiler; then
make CFLAGS="" CXXFLAGS="" \
CC=$(tc-getBUILD_CC) CXX=$(tc-getBUILD_CXX) \
AR=$(tc-getBUILD_AR) RANLIB=$(tc-getBUILD_RANLIB) \
jscpucfg host_jsoplengen host_jskwgen || die
make CFLAGS="" CXXFLAGS="" \
CC=$(tc-getBUILD_CC) CXX=$(tc-getBUILD_CXX) \
AR=$(tc-getBUILD_AR) RANLIB=$(tc-getBUILD_RANLIB) \
-C config nsinstall || die
mv {,native-}jscpucfg || die
tc-export_build_env BUILD_{AR,CC,CXX,RANLIB}
cross_make host_jsoplengen host_jskwgen
cross_make -C config nsinstall
mv {,native-}host_jskwgen || die
mv {,native-}host_jsoplengen || die
mv config/{,native-}nsinstall || die
sed -e 's@./jscpucfg@./native-jscpucfg@' \
sed -i \
-e 's@./host_jskwgen@./native-host_jskwgen@' \
-e 's@./host_jsoplengen@./native-host_jsoplengen@' \
-i Makefile || die
sed -e 's@/nsinstall@/native-nsinstall@' -i config/config.mk || die
Makefile || die
sed -i -e 's@/nsinstall@/native-nsinstall@' config/config.mk || die
rm -f config/host_nsinstall.o \
config/host_pathsub.o \
host_jskwgen.o \
Expand Down
30 changes: 18 additions & 12 deletions dev-lang/spidermonkey/spidermonkey-24.2.0-r3.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -88,30 +88,36 @@ src_configure() {
$(use_enable test tests)
}

cross_make() {
emake \
CFLAGS="${BUILD_CFLAGS}" \
CXXFLAGS="${BUILD_CXXFLAGS}" \
AR="${BUILD_AR}" \
CC="${BUILD_CC}" \
CXX="${BUILD_CXX}" \
RANLIB="${BUILD_RANLIB}" \
"$@"
}
src_compile() {
cd "${BUILDDIR}" || die
if tc-is-cross-compiler; then
make CFLAGS="" CXXFLAGS="" \
CC=$(tc-getBUILD_CC) CXX=$(tc-getBUILD_CXX) \
AR=$(tc-getBUILD_AR) RANLIB=$(tc-getBUILD_RANLIB) \
tc-export_build_env BUILD_{AR,CC,CXX,RANLIB}
cross_make \
MOZ_OPTIMIZE_FLAGS="" MOZ_DEBUG_FLAGS="" \
HOST_OPTIMIZE_FLAGS="" MODULE_OPTIMIZE_FLAGS="" \
MOZ_PGO_OPTIMIZE_FLAGS="" \
jscpucfg host_jsoplengen host_jskwgen || die
make CFLAGS="" CXXFLAGS="" \
CC=$(tc-getBUILD_CC) CXX=$(tc-getBUILD_CXX) \
AR=$(tc-getBUILD_AR) RANLIB=$(tc-getBUILD_RANLIB) \
host_jsoplengen host_jskwgen
cross_make \
MOZ_OPTIMIZE_FLAGS="" MOZ_DEBUG_FLAGS="" HOST_OPTIMIZE_FLAGS="" \
-C config nsinstall || die
mv {,native-}jscpucfg || die
-C config nsinstall
mv {,native-}host_jskwgen || die
mv {,native-}host_jsoplengen || die
mv config/{,native-}nsinstall || die
sed -e 's@./jscpucfg@./native-jscpucfg@' \
sed -i \
-e 's@./host_jskwgen@./native-host_jskwgen@' \
-e 's@./host_jsoplengen@./native-host_jsoplengen@' \
-i Makefile || die
sed -e 's@/nsinstall@/native-nsinstall@' -i config/config.mk || die
Makefile || die
sed -i -e 's@/nsinstall@/native-nsinstall@' config/config.mk || die
rm -f config/host_nsinstall.o \
config/host_pathsub.o \
host_jskwgen.o \
Expand Down

0 comments on commit cc362d5

Please sign in to comment.