diff --git a/build/premake/extern_libs4.lua b/build/premake/extern_libs4.lua index 4ae473f4ce..416556c697 100644 --- a/build/premake/extern_libs4.lua +++ b/build/premake/extern_libs4.lua @@ -361,16 +361,19 @@ extern_lib_defs = { add_default_include_paths("iconv") defines { "HAVE_ICONV_CONST" } defines { "LIBICONV_STATIC" } + elseif os.is("macosx") then + add_default_include_paths("iconv") + defines { "LIBICONV_STATIC" } end end, link_settings = function() - if os.is("windows") then + if os.is("windows") or os.is("macosx") then add_default_lib_paths("iconv") end add_default_links({ win_names = { "iconv" }, -- TODO: glibc provides symbols for this, so we should only include that (and depend on libiconv) on non-glibc unix - --unix_names = { "iconv" }, + osx_names = { "iconv" }, dbg_suffix = "", }) end, diff --git a/build/workspaces/build-osx-bundle.sh b/build/workspaces/build-osx-bundle.sh index ae09be7aee..a6a878ff9a 100755 --- a/build/workspaces/build-osx-bundle.sh +++ b/build/workspaces/build-osx-bundle.sh @@ -28,8 +28,8 @@ export ARCH=${ARCH:="x86_64"} # but previously they were in /Developer/SDKs) # TODO: we could get this from xcode-select but the user must set that up #export SYSROOT=${SYSROOT="/Developer/SDKs/MacOSX10.5.sdk"} -export SYSROOT=${SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"} -export MIN_OSX_VERSION=${MIN_OSX_VERSION="10.6"} +export SYSROOT=${SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk"} +export MIN_OSX_VERSION=${MIN_OSX_VERSION="10.8"} # 0 A.D. release version, e.g. Alpha 12 is 0.0.12 BUNDLE_VERSION=${BUNDLE_VERSION:="0.0.0"} @@ -37,7 +37,7 @@ BUNDLE_VERSION=${BUNDLE_VERSION:="0.0.0"} # Define compiler as "gcc" (in case anything expects e.g. gcc-4.2) # On newer OS X versions, this will be a symbolic link to LLVM GCC # TODO: don't rely on that -export CC=${CC:="gcc"} CXX=${CXX:="g++"} +export CC=${CC:="clang"} CXX=${CXX:="clang++"} die() { diff --git a/libraries/osx/build-osx-libs.sh b/libraries/osx/build-osx-libs.sh index a98691afe8..c8401bba31 100755 --- a/libraries/osx/build-osx-libs.sh +++ b/libraries/osx/build-osx-libs.sh @@ -65,7 +65,7 @@ ARCH=${ARCH:="x86_64"} # Define compiler as "gcc" (in case anything expects e.g. gcc-4.2) # On newer OS X versions, this will be a symbolic link to LLVM GCC # TODO: don't rely on that -export CC=${CC:="gcc"} CXX=${CXX:="g++"} +export CC=${CC:="clang"} CXX=${CXX:="clang++"} # The various libs offer inconsistent configure options, some allow # setting sysroot and OS X-specific options, others don't. Adding to @@ -208,8 +208,8 @@ LIB_ARCHIVE="$LIB_VERSION.tar.gz" LIB_DIRECTORY="$LIB_VERSION" LIB_URL="http://ftp.gnu.org/pub/gnu/libiconv/" -mkdir -p libiconv -pushd libiconv > /dev/null +mkdir -p iconv +pushd iconv > /dev/null ICONV_DIR="$(pwd)" @@ -317,7 +317,7 @@ then pushd $LIB_DIRECTORY # Can't use macosx-version, see above comment. - (./bootstrap.sh --with-libraries=filesystem,system,signals --prefix=$INSTALL_DIR && ./b2 cflags="$CFLAGS" cxxflags="$CXXFLAGS" linkflags="$LDFLAGS" ${JOBS} -d2 --layout=tagged --debug-configuration link=static threading=multi variant=release,debug install) || die "Boost build failed" +(./bootstrap.sh --with-libraries=filesystem,system,signals --prefix=$INSTALL_DIR && ./b2 cflags="$CFLAGS" toolset=clang cxxflags="$CXXFLAGS" linkflags="$LDFLAGS" ${JOBS} -d2 --layout=tagged --debug-configuration link=static threading=multi variant=release,debug install) || die "Boost build failed" popd touch .already-built @@ -546,7 +546,7 @@ then tar -xf $LIB_ARCHIVE pushd $LIB_DIRECTORY/nspr - (CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" ./configure --prefix="$NSPR_DIR" && make ${JOBS} && make install) || die "NSPR build failed" + (CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" ./configure --prefix="$NSPR_DIR" && make ${JOBS} && make install) || die "NSPR build failed" popd # TODO: how can we not build the dylibs? rm -f lib/*.dylib @@ -581,7 +581,7 @@ then mkdir -p source/build pushd source/build - (CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" ../runConfigureICU MacOSX --prefix=$INSTALL_DIR --disable-shared --enable-static --disable-samples --enable-extras --enable-icuio --enable-layout --enable-tools && make ${JOBS} && make install) || die "ICU build failed" +(CXX="clang" CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS -stdlib=libstdc++" LDFLAGS="$LDFLAGS -lstdc++" ../runConfigureICU MacOSX --prefix=$INSTALL_DIR --disable-shared --enable-static --disable-samples --enable-extras --enable-icuio --enable-layout --enable-tools && make ${JOBS} && make install) || die "ICU build failed" popd popd touch .already-built