diff options
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rwxr-xr-x | contrib/build-scripts/build-arabica-macosx.sh | 33 | ||||
-rwxr-xr-x | contrib/build-scripts/build-glog-macosx.sh | 32 | ||||
-rwxr-xr-x | contrib/build-scripts/build-libevent-macosx.sh | 32 | ||||
-rwxr-xr-x | contrib/build-scripts/build-swi-macosx.sh | 4 |
5 files changed, 62 insertions, 41 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 768b8f7..facdd3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -369,7 +369,7 @@ elseif (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-string-plus-int") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-non-literal-null-conversion") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-null-conversion") - SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libstdc++") + #SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -stdlib=libstdc++") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -read_only_relocs suppress") diff --git a/contrib/build-scripts/build-arabica-macosx.sh b/contrib/build-scripts/build-arabica-macosx.sh index 98a0b0e..4f2dddf 100755 --- a/contrib/build-scripts/build-arabica-macosx.sh +++ b/contrib/build-scripts/build-arabica-macosx.sh @@ -9,7 +9,9 @@ set -e ME=`basename $0` DIR="$( cd "$( dirname "$0" )" && pwd )" -DEST_DIR="${DIR}/../prebuilt/darwin-i386/gnu" +MACOSX_VER=`/usr/bin/sw_vers -productVersion` +MACOSX_COMP=(`echo $MACOSX_VER | tr '.' ' '`) +DEST_DIR="${DIR}/../prebuilt/darwin-i386/${MACOSX_COMP[0]}.${MACOSX_COMP[1]}/gnu" if [ ! -f src/arabica.cpp ]; then echo @@ -24,10 +26,14 @@ if [ -f Makefile ]; then make clean fi +if [ ${MACOSX_COMP[1]} -lt 9 ]; then + MACOSX_VERSION_MIN="-mmacosx-version-min=10.6" +fi + ./configure \ -CFLAGS="-g -mmacosx-version-min=10.6 -arch x86_64" \ -CXXFLAGS="-g -mmacosx-version-min=10.6 -arch x86_64" \ -LDFLAGS="-g -mmacosx-version-min=10.6 -arch x86_64" \ +CFLAGS="-g ${MACOSX_VERSION_MIN} -arch x86_64" \ +CXXFLAGS="-g ${MACOSX_VERSION_MIN} -arch x86_64" \ +LDFLAGS="-g ${MACOSX_VERSION_MIN} -arch x86_64" \ --with-libxml2=${SYSROOT}/usr \ --with-parser=libxml2 \ --with-tests=no \ @@ -46,9 +52,9 @@ make clean ./configure \ -CFLAGS="-mmacosx-version-min=10.6 -arch x86_64" \ -CXXFLAGS="-mmacosx-version-min=10.6 -arch x86_64" \ -LDFLAGS="-mmacosx-version-min=10.6 -arch x86_64" \ +CFLAGS="${MACOSX_VERSION_MIN} -arch x86_64" \ +CXXFLAGS="${MACOSX_VERSION_MIN} -arch x86_64" \ +LDFLAGS="${MACOSX_VERSION_MIN} -arch x86_64" \ --with-libxml2=${SYSROOT}/usr \ --with-parser=libxml2 \ --with-tests=no \ @@ -63,9 +69,9 @@ make clean ./configure \ -CFLAGS="-g -mmacosx-version-min=10.6 -arch i386" \ -CXXFLAGS="-g -mmacosx-version-min=10.6 -arch i386" \ -LDFLAGS="-g -mmacosx-version-min=10.6 -arch i386" \ +CFLAGS="-g ${MACOSX_VERSION_MIN} -arch i386" \ +CXXFLAGS="-g ${MACOSX_VERSION_MIN} -arch i386" \ +LDFLAGS="-g ${MACOSX_VERSION_MIN} -arch i386" \ --with-libxml2=${SYSROOT}/usr \ --with-parser=libxml2 \ --with-tests=no \ @@ -79,9 +85,9 @@ cp ./src/.libs/libarabica.a ./libarabica_d.i386.a make clean ./configure \ -CFLAGS="-mmacosx-version-min=10.6 -arch i386" \ -CXXFLAGS="-mmacosx-version-min=10.6 -arch i386" \ -LDFLAGS="-mmacosx-version-min=10.6 -arch i386" \ +CFLAGS="${MACOSX_VERSION_MIN} -arch i386" \ +CXXFLAGS="${MACOSX_VERSION_MIN} -arch i386" \ +LDFLAGS="${MACOSX_VERSION_MIN} -arch i386" \ --with-libxml2=${SYSROOT}/usr \ --with-parser=libxml2 \ --with-tests=no \ @@ -94,6 +100,7 @@ make cp ./src/.libs/libarabica.a ./libarabica.i386.a make clean +exit lipo -create ./libarabica.i386.a ./libarabica.x86_64.a -output ${DEST_DIR}/lib/libarabica.a lipo -create ./libarabica_d.i386.a ./libarabica_d.x86_64.a -output ${DEST_DIR}/lib/libarabica_d.a diff --git a/contrib/build-scripts/build-glog-macosx.sh b/contrib/build-scripts/build-glog-macosx.sh index 81437d9..3363883 100755 --- a/contrib/build-scripts/build-glog-macosx.sh +++ b/contrib/build-scripts/build-glog-macosx.sh @@ -9,7 +9,9 @@ set -e ME=`basename $0` DIR="$( cd "$( dirname "$0" )" && pwd )" -DEST_DIR="${DIR}/../prebuilt/darwin-i386/gnu" +MACOSX_VER=`/usr/bin/sw_vers -productVersion` +MACOSX_COMP=(`echo $MACOSX_VER | tr '.' ' '`) +DEST_DIR="${DIR}/../prebuilt/darwin-i386/${MACOSX_COMP[0]}.${MACOSX_COMP[1]}/gnu" if [ ! -f src/glog/log_severity.h ]; then echo @@ -23,10 +25,14 @@ if [ -f Makefile ]; then make clean fi +if [ ${MACOSX_COMP[1]} -lt 9 ]; then + MACOSX_VERSION_MIN="-mmacosx-version-min=10.6" +fi + ./configure \ -CFLAGS="-g -mmacosx-version-min=10.6 -arch x86_64" \ -CXXFLAGS="-g -mmacosx-version-min=10.6 -arch x86_64" \ -LDFLAGS="-g -mmacosx-version-min=10.6 -arch x86_64" \ +CFLAGS="-g ${MACOSX_VERSION_MIN} -arch x86_64" \ +CXXFLAGS="-g ${MACOSX_VERSION_MIN} -arch x86_64" \ +LDFLAGS="-g ${MACOSX_VERSION_MIN} -arch x86_64" \ --disable-rtti \ --enable-static \ --with-pic \ @@ -40,9 +46,9 @@ make clean ./configure \ -CFLAGS="-mmacosx-version-min=10.6 -arch x86_64" \ -CXXFLAGS="-mmacosx-version-min=10.6 -arch x86_64" \ -LDFLAGS="-mmacosx-version-min=10.6 -arch x86_64" \ +CFLAGS="${MACOSX_VERSION_MIN} -arch x86_64" \ +CXXFLAGS="${MACOSX_VERSION_MIN} -arch x86_64" \ +LDFLAGS="${MACOSX_VERSION_MIN} -arch x86_64" \ --disable-rtti \ --enable-static \ --with-pic @@ -53,9 +59,9 @@ make clean ./configure \ -CFLAGS="-g -mmacosx-version-min=10.6 -arch i386" \ -CXXFLAGS="-g -mmacosx-version-min=10.6 -arch i386" \ -LDFLAGS="-g -mmacosx-version-min=10.6 -arch i386" \ +CFLAGS="-g ${MACOSX_VERSION_MIN} -arch i386" \ +CXXFLAGS="-g ${MACOSX_VERSION_MIN} -arch i386" \ +LDFLAGS="-g ${MACOSX_VERSION_MIN} -arch i386" \ --disable-rtti \ --enable-static \ --with-pic @@ -66,9 +72,9 @@ make clean ./configure \ -CFLAGS="-mmacosx-version-min=10.6 -arch i386" \ -CXXFLAGS="-mmacosx-version-min=10.6 -arch i386" \ -LDFLAGS="-mmacosx-version-min=10.6 -arch i386" \ +CFLAGS="${MACOSX_VERSION_MIN} -arch i386" \ +CXXFLAGS="${MACOSX_VERSION_MIN} -arch i386" \ +LDFLAGS="${MACOSX_VERSION_MIN} -arch i386" \ --disable-rtti \ --enable-static \ --with-pic diff --git a/contrib/build-scripts/build-libevent-macosx.sh b/contrib/build-scripts/build-libevent-macosx.sh index 8c00242..23f288b 100755 --- a/contrib/build-scripts/build-libevent-macosx.sh +++ b/contrib/build-scripts/build-libevent-macosx.sh @@ -9,7 +9,9 @@ set -e ME=`basename $0` DIR="$( cd "$( dirname "$0" )" && pwd )" -DEST_DIR="${DIR}/../prebuilt/darwin-i386/gnu" +MACOSX_VER=`/usr/bin/sw_vers -productVersion` +MACOSX_COMP=(`echo $MACOSX_VER | tr '.' ' '`) +DEST_DIR="${DIR}/../prebuilt/darwin-i386/${MACOSX_COMP[0]}.${MACOSX_COMP[1]}/gnu" if [ ! -f event.c ]; then echo @@ -23,10 +25,14 @@ if [ -f Makefile ]; then make clean fi +if [ ${MACOSX_COMP[1]} -lt 9 ]; then + MACOSX_VERSION_MIN="-mmacosx-version-min=10.6" +fi + ./configure \ -CFLAGS="-g -mmacosx-version-min=10.6 -arch x86_64" \ -CXXFLAGS="-g -mmacosx-version-min=10.6 -arch x86_64" \ -LDFLAGS="-g -mmacosx-version-min=10.6 -arch x86_64" \ +CFLAGS="-g ${MACOSX_VERSION_MIN} -arch x86_64" \ +CXXFLAGS="-g ${MACOSX_VERSION_MIN} -arch x86_64" \ +LDFLAGS="-g ${MACOSX_VERSION_MIN} -arch x86_64" \ --enable-gcc-hardening \ --with-pic \ --prefix=${DEST_DIR} @@ -45,9 +51,9 @@ rm ${DEST_DIR}/lib/libevent* make clean ./configure \ -CFLAGS="-mmacosx-version-min=10.6 -arch x86_64" \ -CXXFLAGS="-mmacosx-version-min=10.6 -arch x86_64" \ -LDFLAGS="-mmacosx-version-min=10.6 -arch x86_64" \ +CFLAGS="${MACOSX_VERSION_MIN} -arch x86_64" \ +CXXFLAGS="${MACOSX_VERSION_MIN} -arch x86_64" \ +LDFLAGS="${MACOSX_VERSION_MIN} -arch x86_64" \ --enable-gcc-hardening \ --with-pic \ --disable-debug-mode \ @@ -65,9 +71,9 @@ make clean ./configure \ -CFLAGS="-g -mmacosx-version-min=10.6 -arch i386" \ -CXXFLAGS="-g -mmacosx-version-min=10.6 -arch i386" \ -LDFLAGS="-g -mmacosx-version-min=10.6 -arch i386" \ +CFLAGS="-g ${MACOSX_VERSION_MIN} -arch i386" \ +CXXFLAGS="-g ${MACOSX_VERSION_MIN} -arch i386" \ +LDFLAGS="-g ${MACOSX_VERSION_MIN} -arch i386" \ --enable-gcc-hardening \ --with-pic \ --disable-libevent-install @@ -83,9 +89,9 @@ cp ./.libs/libevent_pthreads.a ./libevent_pthreads_d.i386.a make clean ./configure \ -CFLAGS="-mmacosx-version-min=10.6 -arch i386" \ -CXXFLAGS="-mmacosx-version-min=10.6 -arch i386" \ -LDFLAGS="-mmacosx-version-min=10.6 -arch i386" \ +CFLAGS="${MACOSX_VERSION_MIN} -arch i386" \ +CXXFLAGS="${MACOSX_VERSION_MIN} -arch i386" \ +LDFLAGS="${MACOSX_VERSION_MIN} -arch i386" \ --enable-gcc-hardening \ --with-pic \ --disable-debug-mode \ diff --git a/contrib/build-scripts/build-swi-macosx.sh b/contrib/build-scripts/build-swi-macosx.sh index 2bea261..b2618cc 100755 --- a/contrib/build-scripts/build-swi-macosx.sh +++ b/contrib/build-scripts/build-swi-macosx.sh @@ -9,7 +9,9 @@ set -e ME=`basename $0` DIR="$( cd "$( dirname "$0" )" && pwd )" -DEST_DIR="${DIR}/../prebuilt/darwin-i386/gnu" +MACOSX_VER=`/usr/bin/sw_vers -productVersion` +MACOSX_COMP=(`echo $MACOSX_VER | tr '.' ' '`) +DEST_DIR="${DIR}/../prebuilt/darwin-i386/${MACOSX_COMP[0]}.${MACOSX_COMP[1]}/gnu" VERSION=`cat VERSION` if [ ! -f src/pl-main.c ]; then |