Mac: In build script, Patch wxWidgets source files to fix crashes on OS 10.5 or 10.6 when built on OS 10.7 or later

This commit is contained in:
Charlie Fenton 2014-02-18 05:46:39 -08:00
parent aa055b41cc
commit 66650bc0be
1 changed files with 66 additions and 2 deletions

View File

@ -27,6 +27,7 @@
# Updated for wxCocoa 2.9.5 8/20/13
# Updated for wxCocoa 3.0.0 11/12/13
# Fix for wxCocoa 3.0.0 2/13/14
# Patch to fix crash on OS 10.5 or 10.6 when built on OS 10.7+ 2/18/14
#
## This script requires OS 10.6 or later
##
@ -52,6 +53,69 @@ if [ "$?" -eq "0" ]; then
return 1
fi
echo ""
# Patch wxWidgets-3.0.0/src/png/pngstruct.h
if [ ! -f src/png/pngstruct.h.orig ]; then
cat >> /tmp/pngstruct_h_diff << ENDOFFILE
--- pngstruct.h 2013-11-11 05:10:39.000000000 -0800
+++ pngstruct_patched.h 2014-02-18 01:31:53.000000000 -0800
@@ -34,6 +34,13 @@
# undef const
#endif
+/* BOINC workaround patch to fix crashes on OS 10.5 or 10.6 when
+ * built with OS 10.7 SDK or later.
+ */
+#undef ZLIB_VERNUM
+#define ZLIB_VERNUM 0x1230
+/* End of BOINC workaround patch */
+
/* zlib.h has mediocre z_const use before 1.2.6, this stuff is for compatibility
* with older builds.
*/
ENDOFFILE
patch -bfi /tmp/pngstruct_h_diff src/png/pngstruct.h
rm -f /tmp/pngstruct_h_diff
else
echo "src/png/pngstruct.h already patched"
fi
echo ""
# Patch build/osx/setup/cocoa/include/wx/setup.h
f [ ! -f build/osx/setup/cocoa/include/wx/setup.h.orig ]; then
# First run wxWidget's built-in script to copy setup.h into place
cd build/osx
../../distrib/mac/pbsetup-sh ../../src ../../build/osx/setup/cocoa
cd ../..
i cat >> /tmp/setup_h_diff << ENDOFFILE
--- setup.h 2014-02-18 05:17:45.000000000 -0800
+++ setup_patched.h 2014-02-18 05:19:50.000000000 -0800
@@ -339,7 +339,10 @@
// Recommended setting: 1 if you use the standard streams anyhow and so
// dependency on the standard streams library is not a
// problem
-#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
+/* BOINC workaround patch to fix crashes on OS 10.5 when built
+ * with OS 10.7 SDK or later.
+ */
+#define wxUSE_STD_IOSTREAM 0 // wxUSE_STD_DEFAULT
// Enable minimal interoperability with the standard C++ string class if 1.
// "Minimal" means that wxString can be constructed from std::string or
ENDOFFILE
patch -bfi /tmp/setup_h_diff build/osx/setup/cocoa/include/wx/setup.h
rm -f /tmp/setup_h_diff
else
echo "build/osx/setup/cocoa/include/wx/setup.h already patched"
fi
echo ""
if [ "$1" = "-clean" ]; then
doclean="clean "
else
@ -64,7 +128,7 @@ else
## export DEVELOPER_SDK_DIR="/Developer/SDKs"
## We must override some of the build settings in wxWindows.xcodeproj
xcodebuild -project build/osx/wxcocoa.xcodeproj -target static -configuration Release $doclean build ARCHS="i386" OTHER_CFLAGS="-Wall -Wundef -fno-strict-aliasing -fno-common -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DwxUSE_UNICODE=1 -DwxDEBUG_LEVEL=0 -fvisibility=hidden" OTHER_CPLUSPLUSFLAGS="-Wall -Wundef -fno-strict-aliasing -fno-common -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DwxUSE_UNICODE=1 -DwxDEBUG_LEVEL=0 -fvisibility=hidden -fvisibility-inlines-hidden" GCC_PREPROCESSOR_DEFINITIONS="WXBUILDING __WXOSX_COCOA__ __WX__ wxUSE_BASE=1 _FILE_OFFSET_BITS=64 _LARGE_FILES MACOS_CLASSIC __WXMAC_XCODE__=1 SCI_LEXER WX_PRECOMP=1 wxUSE_UNICODE_UTF8=1 wxUSE_UNICODE_WCHAR=0"
xcodebuild -project build/osx/wxcocoa.xcodeproj -target static -configuration Release $doclean build ARCHS="i386" OTHER_CFLAGS="-Wall -Wundef -fno-strict-aliasing -fno-common -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DwxUSE_UNICODE=1 -DwxDEBUG_LEVEL=0 -DNDEBUG -fvisibility=hidden" OTHER_CPLUSPLUSFLAGS="-Wall -Wundef -fno-strict-aliasing -fno-common -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DwxUSE_UNICODE=1 -DwxDEBUG_LEVEL=0 -DNDEBUG -fvisibility=hidden -fvisibility-inlines-hidden" GCC_PREPROCESSOR_DEFINITIONS="WXBUILDING __WXOSX_COCOA__ __WX__ wxUSE_BASE=1 _FILE_OFFSET_BITS=64 _LARGE_FILES MACOS_CLASSIC __WXMAC_XCODE__=1 SCI_LEXER WX_PRECOMP=1 wxUSE_UNICODE_UTF8=1 wxUSE_UNICODE_WCHAR=0"
if [ $? -ne 0 ]; then return 1; fi
fi
@ -74,7 +138,7 @@ if [ "$1" != "-clean" ] && [ -f build/osx/build/Debug/libwx_osx_cocoa_static.a ]
else
## export DEVELOPER_SDK_DIR="/Developer/SDKs"
## We must override some of the build settings in wxWindows.xcodeproj
xcodebuild -project build/osx/wxcocoa.xcodeproj -target static -configuration Debug $doclean build ARCHS="i386" OTHER_CFLAGS="-Wall -Wundef -fno-strict-aliasing -fno-common -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DwxUSE_UNICODE=1 -DwxDEBUG_LEVEL=0 -fvisibility=hidden" OTHER_CPLUSPLUSFLAGS="-Wall -Wundef -fno-strict-aliasing -fno-common -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DwxUSE_UNICODE=1 -DwxUSE_UNICODE_UTF8=1 -DwxUSE_UNICODE_WCHAR=0 -fvisibility=hidden -fvisibility-inlines-hidden" GCC_PREPROCESSOR_DEFINITIONS="WXBUILDING __WXOSX_COCOA__ __WX__ wxUSE_BASE=1 _FILE_OFFSET_BITS=64 _LARGE_FILES MACOS_CLASSIC __WXMAC_XCODE__=1 SCI_LEXER WX_PRECOMP=1 wxUSE_UNICODE_UTF8=1 wxUSE_UNICODE_WCHAR=0"
xcodebuild -project build/osx/wxcocoa.xcodeproj -target static -configuration Debug $doclean build ARCHS="i386" OTHER_CFLAGS="-Wall -Wundef -fno-strict-aliasing -fno-common -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DwxUSE_UNICODE=1 -DDEBUG -fvisibility=hidden" OTHER_CPLUSPLUSFLAGS="-Wall -Wundef -fno-strict-aliasing -fno-common -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DwxUSE_UNICODE=1 -DDEBUG -fvisibility=hidden -fvisibility-inlines-hidden" GCC_PREPROCESSOR_DEFINITIONS="WXBUILDING __WXOSX_COCOA__ __WX__ wxUSE_BASE=1 _FILE_OFFSET_BITS=64 _LARGE_FILES MACOS_CLASSIC __WXMAC_XCODE__=1 SCI_LEXER WX_PRECOMP=1 wxUSE_UNICODE_UTF8=1 wxUSE_UNICODE_WCHAR=0"
if [ $? -ne 0 ]; then return 1; fi
fi