diff --git a/libraries/osx/build-osx-libs.sh b/libraries/osx/build-osx-libs.sh
index f3a0a2b..cf05511 100755
a
|
b
|
popd > /dev/null
|
524 | 524 | # -------------------------------------------------------------------- |
525 | 525 | echo -e "Building Spidermonkey..." |
526 | 526 | |
527 | | LIB_VERSION="js185-1.0.0" |
528 | | LIB_ARCHIVE="$LIB_VERSION.tar.gz" |
529 | | LIB_DIRECTORY="js-1.8.5" |
| 527 | LIB_VERSION="mozjs-24.2.0" |
| 528 | LIB_ARCHIVE="$LIB_VERSION.tar.bz2" |
| 529 | LIB_DIRECTORY="mozjs24" |
| 530 | INCLUDE_DIR_DEBUG=include-unix-debug |
| 531 | INCLUDE_DIR_RELEASE=include-unix-release |
530 | 532 | |
531 | 533 | pushd ../source/spidermonkey/ > /dev/null |
532 | 534 | |
… |
… |
then
|
538 | 540 | rm -f lib/*.a |
539 | 541 | rm -rf $LIB_DIRECTORY |
540 | 542 | tar -xf $LIB_ARCHIVE |
| 543 | # rename the extracted directory to something shorter |
| 544 | mv $LIB_VERSION $LIB_DIRECTORY |
541 | 545 | pushd $LIB_DIRECTORY/js/src |
542 | 546 | |
| 547 | # nspr must be installed for a threadsafe build |
| 548 | # (download if not preinstalled: https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/) |
| 549 | NSPR_INCLUDES="`pkg-config nspr --cflags`" |
| 550 | NSPR_LIBS="`pkg-config nspr --libs`" |
| 551 | |
543 | 552 | # We want separate debug/release versions of the library, so change their install name in the Makefile |
544 | | sed -i.bak -e 's/\(STATIC_LIBRARY_NAME),mozjs185-\)\(\$(SRCREL_ABI_VERSION)\)\{0,1\}/\1ps-debug/' Makefile.in |
| 553 | perl -i.bak -pe 's/(^STATIC_LIBRARY_NAME\s+=).*/$1mozjs24-ps-debug/' Makefile.in |
545 | 554 | |
546 | | CONF_OPTS="--prefix=${INSTALL_DIR} --disable-tests --disable-shared-js" |
| 555 | CONF_OPTS="--prefix=${INSTALL_DIR} --enable-threadsafe --disable-tests --disable-shared-js" # --enable-trace-logging" |
547 | 556 | # Uncomment this line for 32-bit 10.5 cross compile: |
548 | 557 | #CONF_OPTS="$CONF_OPTS --target=i386-apple-darwin9.0.0" |
549 | 558 | if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then |
… |
… |
then
|
555 | 564 | |
556 | 565 | mkdir -p build-debug |
557 | 566 | pushd build-debug |
558 | | (CC="$CC -arch $ARCH" CXX="$CXX -arch $ARCH" AR=ar CROSS_COMPILE=1 ../configure $CONF_OPTS --enable-debug --disable-optimize && make ${JOBS} && make install) || die "Spidermonkey build failed" |
| 567 | (CC="clang -arch $ARCH" CXX="clang++ -arch $ARCH" AR=ar CROSS_COMPILE=1 ../configure $CONF_OPTS --enable-debug --disable-optimize --enable-js-diagnostics --enable-gczeal --with-nspr-libs="$NSPR_LIBS" --with-nspr-cflags="$NSPR_INCLUDES" && make ${JOBS} && make install) || die "Spidermonkey build failed" |
| 568 | # js-config.h is different for debug and release builds, so we need different include directories for both |
| 569 | mkdir -p ${INCLUDE_DIR_DEBUG} |
| 570 | cp -R -L dist/include/* ${INCLUDE_DIR_DEBUG}/ |
559 | 571 | popd |
560 | 572 | mv Makefile.in.bak Makefile.in |
561 | | |
562 | | sed -i.bak -e 's/\(STATIC_LIBRARY_NAME),mozjs185-\)\(\$(SRCREL_ABI_VERSION)\)\{0,1\}/\1ps-release/' Makefile.in |
563 | 573 | |
| 574 | perl -i.bak -pe 's/(^STATIC_LIBRARY_NAME\s+=).*/$1mozjs24-ps-release/' Makefile.in |
564 | 575 | mkdir -p build-release |
565 | 576 | pushd build-release |
566 | | (CC="$CC -arch $ARCH" CXX="$CXX -arch $ARCH" AR=ar CROSS_COMPILE=1 ../configure $CONF_OPTS && make ${JOBS} && make install) || die "Spidermonkey build failed" |
| 577 | (CC="clang -arch $ARCH" CXX="clang++ -arch $ARCH" AR=ar CROSS_COMPILE=1 ../configure $CONF_OPTS --enable-optimize --with-nspr-libs="$NSPR_LIBS" --with-nspr-cflags="$NSPR_INCLUDES" && make ${JOBS} && make install) || die "Spidermonkey build failed" |
| 578 | # js-config.h is different for debug and release builds, so we need different include directories for both |
| 579 | mkdir -p ${INCLUDE_DIR_RELEASE} |
| 580 | cp -R -L dist/include/* ${INCLUDE_DIR_RELEASE}/ |
567 | 581 | popd |
568 | 582 | mv Makefile.in.bak Makefile.in |
569 | 583 | |