From e9b2d6e07e4930b4bc6b86b0140d541bd1ad8617 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Mon, 26 Sep 2011 08:58:34 +0000 Subject: [PATCH] Mac: update wxMac build script for XCode 4.1 and OS 10.4 compatibility svn path=/trunk/boinc/; revision=24294 --- checkin_notes | 9 ++++++++- mac_build/buildWxMac.sh | 28 +++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/checkin_notes b/checkin_notes index b8ddffa7d0..d56ea323c7 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6483,4 +6483,11 @@ David 26 Sept 2011 client/ sim.cpp,h cs_prefs.cpp - makefile_sim + +Charlie 26 Sep 2011 + - Mac: update wxMac build script for building with XCode 4.1 + under OS 10.7 while maintaining OS 10.4 compatibility. + (checked into 6.13.6 tag) + + mac_build/ + buildWxMac.sh diff --git a/mac_build/buildWxMac.sh b/mac_build/buildWxMac.sh index 4cb8f6dbd7..750f2d163b 100644 --- a/mac_build/buildWxMac.sh +++ b/mac_build/buildWxMac.sh @@ -22,7 +22,7 @@ # # by Charlie Fenton 7/21/06 # Updated for wx-Mac 2.8.10 and Unicode 4/17/09 -# Updated 10/11/10 +# Updated for OS 10.7 and XCode 4.1 with OS 10.4 compatibility 9/26/11 # ## In Terminal, CD to the wxMac-2.8.10 directory. @@ -53,12 +53,30 @@ else doclean="" fi -if [ ! -d /Developer/SDKs/MacOSX10.4u.sdk/ ]; then - echo "ERROR: System 10.4 SDK is missing. For details, see build instructions at" +if [ ! -d /Developer/SDKs/MacOSX10.5.sdk/ ]; then + echo "ERROR: System 10.5 SDK is missing. For details, see build instructions at" echo "boinc/mac_build/HowToBuildBOINC_XCode.rtf or http://boinc.berkeley.edu/trac/wiki/MacBuild" return 1 fi +## By default, wxMac 2.8.10 links with libiconv.dyld, but building with OS 10.5 SDK +## makes it require libiconv.2.4.0.dylib, while OS 10.4 supplies only libiconv.2.2.0.dylib. +## This causes the Manager to fail under OS 10.4 with a dyld error. +## But libiconv is not really needed for BOINC Manager, so we patch wxMac's config file to +## avoid using libiconv. +if [ ! -f "include/wx/mac/carbon/config_xcode.h.orig" ]; then + ## Make sure sed uses UTF-8 text encoding + unset LC_CTYPE + unset LC_MESSAGES + unset __CF_USER_TEXT_ENCODING + export LANG=en_US.UTF-8 + + echo "patching file include/wx/mac/carbon/config_xcode.h" + sed -i ".orig" s%"#define HAVE_ICONV 1"%"//#undef HAVE_ICONV"%g "include/wx/mac/carbon/config_xcode.h" +else + echo "config_xcode.h already patched" +fi + ## Fix a bug in wxMutex. This patch should not be needed for wxMac-2.8.11 and later if [ ! -f src/mac/carbon/thread.cpp.orig ]; then @@ -90,7 +108,7 @@ if [ "$1" != "-clean" ] && [ -f src/build/Deployment/libwx_mac_static.a ]; then else export DEVELOPER_SDK_DIR="/Developer/SDKs" ## We must override some of the build settings in wxWindows.xcodeproj - xcodebuild -project src/wxWindows.xcodeproj -target static -configuration Deployment $doclean build GCC_VERSION_ppc=4.0 MACOSX_DEPLOYMENT_TARGET_ppc=10.3 SDKROOT=/Developer/SDKs/MacOSX10.4u.sdk GCC_VERSION_i386=4.0 MACOSX_DEPLOYMENT_TARGET_i386=10.4 ARCHS="i386 ppc" OTHER_CPLUSPLUSFLAGS="-DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DwxUSE_UNICODE=1 -fvisibility=hidden -fvisibility-inlines-hidden" + xcodebuild -project src/wxWindows.xcodeproj -target static -configuration Deployment $doclean build SDKROOT=/Developer/SDKs/MacOSX10.6.sdk GCC_VERSION_i386=4.2 MACOSX_DEPLOYMENT_TARGET_i386=10.4 ARCHS="i386" OTHER_CPLUSPLUSFLAGS="-DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DwxUSE_UNICODE=1 -fvisibility=hidden -fvisibility-inlines-hidden" if [ $? -ne 0 ]; then return 1; fi fi @@ -100,7 +118,7 @@ if [ "$1" != "-clean" ] && [ -f src/build/Development/libwx_mac_static.a ]; then else export DEVELOPER_SDK_DIR="/Developer/SDKs" ## We must override some of the build settings in wxWindows.xcodeproj - xcodebuild -project src/wxWindows.xcodeproj -target static -configuration Development $doclean build GCC_VERSION_ppc=4.0 MACOSX_DEPLOYMENT_TARGET_ppc=10.3 GCC_VERSION_i386=4.0 MACOSX_DEPLOYMENT_TARGET_i386=10.4 SDKROOT=/Developer/SDKs/MacOSX10.4u.sdk OTHER_CPLUSPLUSFLAGS="-DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DwxUSE_UNICODE=1 -fvisibility=hidden -fvisibility-inlines-hidden" + xcodebuild -project src/wxWindows.xcodeproj -target static -configuration Development $doclean build SDKROOT=/Developer/SDKs/MacOSX10.6.sdk GCC_VERSION_i386=4.2 MACOSX_DEPLOYMENT_TARGET_i386=10.4 ARCHS="i386" OTHER_CPLUSPLUSFLAGS="-DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DwxUSE_UNICODE=1 -fvisibility=hidden -fvisibility-inlines-hidden" if [ $? -ne 0 ]; then return 1; fi fi