2006-02-18 05:49:24 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2009-04-17 21:34:28 +00:00
|
|
|
# This file is part of BOINC.
|
2006-02-18 05:49:24 +00:00
|
|
|
# http://boinc.berkeley.edu
|
2009-04-17 21:34:28 +00:00
|
|
|
# Copyright (C) 2008 University of California
|
2006-02-18 05:49:24 +00:00
|
|
|
#
|
2009-04-17 21:34:28 +00:00
|
|
|
# BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
# under the terms of the GNU Lesser General Public License
|
|
|
|
# as published by the Free Software Foundation,
|
|
|
|
# either version 3 of the License, or (at your option) any later version.
|
2005-12-22 02:33:59 +00:00
|
|
|
#
|
2009-04-17 21:34:28 +00:00
|
|
|
# BOINC is distributed in the hope that it will be useful,
|
2006-02-18 05:49:24 +00:00
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the GNU Lesser General Public License for more details.
|
2005-12-22 02:33:59 +00:00
|
|
|
#
|
2009-04-17 21:34:28 +00:00
|
|
|
# You should have received a copy of the GNU Lesser General Public License
|
|
|
|
# along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
2005-12-22 02:33:59 +00:00
|
|
|
#
|
2006-01-31 12:21:34 +00:00
|
|
|
#
|
2013-11-12 11:46:59 +00:00
|
|
|
# Script to build the wxMac-3.0.0 wxCocoa library for BOINC
|
2007-05-02 10:09:47 +00:00
|
|
|
#
|
2007-12-17 13:20:03 +00:00
|
|
|
# by Charlie Fenton 7/21/06
|
2009-04-17 11:28:27 +00:00
|
|
|
# Updated for wx-Mac 2.8.10 and Unicode 4/17/09
|
2011-09-26 08:58:34 +00:00
|
|
|
# Updated for OS 10.7 and XCode 4.1 with OS 10.4 compatibility 9/26/11
|
2012-07-27 12:29:16 +00:00
|
|
|
# Updated for partial OS 10.8 and XCode 4.5 compatibility 7/27/12
|
2013-08-23 12:02:06 +00:00
|
|
|
# Updated for wxCocoa 2.9.5 8/20/13
|
2013-11-12 11:46:59 +00:00
|
|
|
# Updated for wxCocoa 3.0.0 11/12/13
|
2014-02-13 13:59:10 +00:00
|
|
|
# Fix for wxCocoa 3.0.0 2/13/14
|
2014-02-18 13:46:39 +00:00
|
|
|
# Patch to fix crash on OS 10.5 or 10.6 when built on OS 10.7+ 2/18/14
|
2014-03-06 12:53:19 +00:00
|
|
|
# Enable wxWidgets asserts in Release build 3/6/14
|
2007-05-02 10:09:47 +00:00
|
|
|
#
|
2012-06-28 09:32:56 +00:00
|
|
|
## This script requires OS 10.6 or later
|
|
|
|
##
|
2013-10-22 07:36:18 +00:00
|
|
|
## In Terminal, CD to the wxWidgets-3.0.0 directory.
|
|
|
|
## cd [path]/wxWidgets-3.0.0/
|
2006-02-18 05:49:24 +00:00
|
|
|
## then run this script:
|
|
|
|
## source [ path_to_this_script ] [ -clean ]
|
|
|
|
##
|
|
|
|
## the -clean argument will force a full rebuild.
|
|
|
|
#
|
|
|
|
|
2010-10-08 08:41:36 +00:00
|
|
|
Path=$PWD
|
|
|
|
echo "${Path}" | grep " " > /dev/null 2>&1
|
|
|
|
if [ "$?" -eq "0" ]; then
|
|
|
|
echo "**********************************************************"
|
|
|
|
echo "**********************************************************"
|
|
|
|
echo "********** **********"
|
|
|
|
echo "********** ERROR: Path must not contain spaces! **********"
|
|
|
|
echo "********** **********"
|
|
|
|
echo "**********************************************************"
|
|
|
|
echo "**********************************************************"
|
|
|
|
echo "**********************************************************"
|
|
|
|
return 1
|
|
|
|
fi
|
2005-12-22 02:33:59 +00:00
|
|
|
|
2014-02-18 13:46:39 +00:00
|
|
|
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
|
2014-02-25 15:42:06 +00:00
|
|
|
if [ ! -f build/osx/setup/cocoa/include/wx/setup.h.orig ]; then
|
2014-02-18 13:46:39 +00:00
|
|
|
|
|
|
|
# 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 ../..
|
|
|
|
|
2014-02-25 15:42:06 +00:00
|
|
|
cat >> /tmp/setup_h_diff << ENDOFFILE
|
2014-02-18 13:46:39 +00:00
|
|
|
--- 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 ""
|
|
|
|
|
|
|
|
|
2005-12-22 02:33:59 +00:00
|
|
|
if [ "$1" = "-clean" ]; then
|
|
|
|
doclean="clean "
|
|
|
|
else
|
|
|
|
doclean=""
|
|
|
|
fi
|
|
|
|
|
2013-08-23 12:02:06 +00:00
|
|
|
if [ "$1" != "-clean" ] && [ -f build/osx/build/Release/libwx_osx_cocoa_static.a ]; then
|
|
|
|
echo "Release libwx_osx_cocoa_static.a already built"
|
2012-07-06 12:11:28 +00:00
|
|
|
else
|
|
|
|
|
|
|
|
## export DEVELOPER_SDK_DIR="/Developer/SDKs"
|
2010-10-11 11:59:05 +00:00
|
|
|
## We must override some of the build settings in wxWindows.xcodeproj
|
2014-03-06 12:53:19 +00:00
|
|
|
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 -fvisibility=hidden" OTHER_CPLUSPLUSFLAGS="-Wall -Wundef -fno-strict-aliasing -fno-common -DHAVE_LOCALTIME_R=1 -DHAVE_GMTIME_R=1 -DwxUSE_UNICODE=1 -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"
|
2007-05-23 01:29:11 +00:00
|
|
|
|
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
|
|
|
fi
|
|
|
|
|
2013-08-23 12:02:06 +00:00
|
|
|
if [ "$1" != "-clean" ] && [ -f build/osx/build/Debug/libwx_osx_cocoa_static.a ]; then
|
|
|
|
echo "Debug libwx_osx_cocoa_static.a already built"
|
2007-05-23 01:29:11 +00:00
|
|
|
else
|
2012-07-06 12:11:28 +00:00
|
|
|
## export DEVELOPER_SDK_DIR="/Developer/SDKs"
|
2010-10-11 11:59:05 +00:00
|
|
|
## We must override some of the build settings in wxWindows.xcodeproj
|
2014-02-18 13:46:39 +00:00
|
|
|
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"
|
2005-12-22 11:37:36 +00:00
|
|
|
|
2006-07-22 03:35:48 +00:00
|
|
|
if [ $? -ne 0 ]; then return 1; fi
|
2005-12-22 11:37:36 +00:00
|
|
|
fi
|
2005-12-22 02:33:59 +00:00
|
|
|
|
|
|
|
return 0
|
2005-12-22 11:37:36 +00:00
|
|
|
|