Ticket #2442: blind_SpiderMonkeyMacOsX.patch

File blind_SpiderMonkeyMacOsX.patch, 3.4 KB (added by Yves, 10 years ago)
  • libraries/osx/build-osx-libs.sh

    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  
    524524# --------------------------------------------------------------------
    525525echo -e "Building Spidermonkey..."
    526526
    527 LIB_VERSION="js185-1.0.0"
    528 LIB_ARCHIVE="$LIB_VERSION.tar.gz"
    529 LIB_DIRECTORY="js-1.8.5"
     527LIB_VERSION="mozjs-24.2.0"
     528LIB_ARCHIVE="$LIB_VERSION.tar.bz2"
     529LIB_DIRECTORY="mozjs24"
     530INCLUDE_DIR_DEBUG=include-unix-debug
     531INCLUDE_DIR_RELEASE=include-unix-release
    530532
    531533pushd ../source/spidermonkey/ > /dev/null
    532534
    then  
    538540  rm -f lib/*.a
    539541  rm -rf $LIB_DIRECTORY
    540542  tar -xf $LIB_ARCHIVE
     543  # rename the extracted directory to something shorter
     544  mv $LIB_VERSION $LIB_DIRECTORY
    541545  pushd $LIB_DIRECTORY/js/src
    542546
     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
    543552  # 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
    545554
    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"
    547556  # Uncomment this line for 32-bit 10.5 cross compile:
    548557  #CONF_OPTS="$CONF_OPTS --target=i386-apple-darwin9.0.0"
    549558  if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then
    then  
    555564
    556565  mkdir -p build-debug
    557566  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}/
    559571  popd
    560572  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
    563573
     574  perl -i.bak -pe 's/(^STATIC_LIBRARY_NAME\s+=).*/$1mozjs24-ps-release/' Makefile.in
    564575  mkdir -p build-release
    565576  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}/
    567581  popd
    568582  mv Makefile.in.bak Makefile.in
    569583