Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Suppresses noisy Boost header warnings on OS X by including them as s…

…ystem headers, refs #1076.

Bumps default SDK in build-osx-bundle.sh to 10.7 (newer Xcode doesn't include 10.6).
Fixes using xml2-config from SDK when needed.
Fixes more linker warnings about symbol visibility by compiling libs with fvisibility=hidden.
Updates some comments in the build scripts.

git-svn-id: http://svn.wildfiregames.com/public/ps/trunk@13172 3db68df2-c116-0410-a063-a993310a9797
  • Loading branch information...
commit 59bae5a43a45db055064dde15789864aac63bb47 1 parent 0c3cb7a
ben authored
5 build/premake/extern_libs4.lua
@@ -224,8 +224,11 @@ end
224 224 extern_lib_defs = {
225 225 boost = {
226 226 compile_settings = function()
227   - if os.is("windows") or os.is("macosx") then
  227 + if os.is("windows") then
228 228 add_default_include_paths("boost")
  229 + elseif os.is("macosx") then
  230 + -- Suppress all the Boost warnings on OS X by including it as a system directory
  231 + buildoptions { "-isystem../" .. libraries_dir .. "boost/include" }
229 232 end
230 233 if os.getversion().description == "OpenBSD" then
231 234 includedirs { "/usr/local/include" }
36 build/workspaces/build-osx-bundle.sh
@@ -5,44 +5,46 @@
5 5 # App bundles are intended to be self-contained and portable.
6 6 # An SDK is required, usually included with Xcode. The SDK ensures
7 7 # that only those system libraries are used which are available on
8   -# the chosen target and compatible systems (10.6 by default).
  8 +# the chosen target and compatible systems.
9 9 #
10 10 # Steps to build a 0 A.D. bundle are:
11 11 # 1. confirm ARCH is set to desired target architecture
12   -# 2. confirm SYSROOT points to the target SDK
  12 +# 2. confirm SYSROOT points to the correct target SDK
13 13 # 3. confirm MIN_OSX_VERSION matches the target OS X version
14 14 # 4. update BUNDLE_VERSION to match current 0 A.D. version
15 15 # 5. if building 32-bit 10.5 bundle, read the accompanying documentation
16 16 # 6. run this script
17 17 #
18 18
19   -die()
20   -{
21   - echo ERROR: $*
22   - exit 1
23   -}
24   -
25 19 # Force build architecture, as sometimes environment is broken.
26   -# Using multiple values would in theory produce a "universal"
27   -# or fat binary, but this is untested.
28   -# Choices are: x86_64 i386 (ppc and ppc64 not supported)
  20 +# For a universal fat binary, the approach would be to build every
  21 +# dependency with both archs and combine them with lipo, then do the
  22 +# same thing with the game itself.
  23 +# Choices are "x86_64" or "i386" (ppc and ppc64 not supported)
29 24 export ARCH=${ARCH:="x86_64"}
30 25
31 26 # Set SDK and mimimum required OSX version
32   -# (As of Xcode 4.3, the SDKs are located directly in Xcode.app,
33   -# but previously they were in /Developer/SDKs)
34   -# TODO: we could get this from xcode-select but the user must set that up
  27 +# (As of Xcode 4.3, the SDKs are located directly in Xcode.app,
  28 +# but previously they were in /Developer/SDKs)
  29 +# TODO: we could get this from xcode-select but the user must set that up
35 30 #export SYSROOT=${SYSROOT="/Developer/SDKs/MacOSX10.5.sdk"}
36   -export SYSROOT=${SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk"}
  31 +export SYSROOT=${SYSROOT="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk"}
37 32 export MIN_OSX_VERSION=${MIN_OSX_VERSION="10.6"}
38 33
39 34 # 0 A.D. release version, e.g. Alpha 12 is 0.0.12
40 35 BUNDLE_VERSION=${BUNDLE_VERSION:="0.0.0"}
41 36
42   -# Define compiler as GCC (in case anything expects e.g. gcc-4.2)
43   -# TODO: should use the compiler provided by the SDK
  37 +# Define compiler as "gcc" (in case anything expects e.g. gcc-4.2)
  38 +# On newer OS X versions, this will be a symbolic link to LLVM GCC
  39 +# TODO: don't rely on that
44 40 export CC=${CC:="gcc"} CXX=${CXX:="g++"}
45 41
  42 +die()
  43 +{
  44 + echo ERROR: $*
  45 + exit 1
  46 +}
  47 +
46 48 # Check that we're actually on OS X
47 49 if [ "`uname -s`" != "Darwin" ]; then
48 50 die "This script is intended for OS X only"
2  build/workspaces/update-workspaces.sh
@@ -66,6 +66,8 @@ if [ "`uname -s`" = "Darwin" ]; then
66 66 # Set *_CONFIG variables on OS X, to override the path to e.g. sdl-config
67 67 export SDL_CONFIG=${SDL_CONFIG:="$(pwd)/../../libraries/osx/sdl/bin/sdl-config"}
68 68 export WX_CONFIG=${WX_CONFIG:="$(pwd)/../../libraries/osx/wxwidgets/bin/wx-config"}
  69 + # use xml2-config from system or SDK
  70 + export XML2_CONFIG=${XML2_CONFIG:="$SYSROOT/usr/bin/xml2-config"}
69 71 fi
70 72
71 73 # Don't want to build bundled libs on OS X
64 libraries/osx/build-osx-libs.sh
@@ -18,26 +18,6 @@
18 18 # as not all build environments contain the Developer SDKs
19 19 # (Xcode does, but the Command Line Tools package does not)
20 20 #
21   -
22   -set -e
23   -
24   -die()
25   -{
26   - echo ERROR: $*
27   - exit 1
28   -}
29   -
30   -download_lib()
31   -{
32   - local url=$1
33   - local filename=$2
34   -
35   - if [ ! -e $filename ]; then
36   - echo "Downloading $filename"
37   - curl -L -O ${url}${filename} || die "Download of $url$filename failed"
38   - fi
39   -}
40   -
41 21 # --------------------------------------------------------------
42 22 # Library versions for ease of updating:
43 23 # * SDL 1.2.15+ required for Lion support
@@ -55,7 +35,7 @@ VORBIS_VERSION="libvorbis-1.3.3"
55 35 # --------------------------------------------------------------
56 36 # Bundled with the game:
57 37 # * SpiderMonkey 1.8.5
58   -# * ENet
  38 +# * ENet 1.3.3
59 39 # * NVTT
60 40 # * FCollada
61 41 # --------------------------------------------------------------
@@ -67,18 +47,16 @@ VORBIS_VERSION="libvorbis-1.3.3"
67 47 # * zlib
68 48 # --------------------------------------------------------------
69 49
70   -# Force build architecture, as sometimes configure is broken.
71   -# (Using multiple values would in theory produce a "universal"
72   -# or fat binary, but this is untested)
73   -#
74   -# Choices are: x86_64 i386 (ppc and ppc64 NOT supported)
  50 +# Force build architecture, as sometimes environment is broken.
  51 +# For a universal fat binary, the approach would be to build every
  52 +# dependency with both archs and combine them with lipo, then do the
  53 +# same thing with the game itself.
  54 +# Choices are "x86_64" or "i386" (ppc and ppc64 not supported)
75 55 ARCH=${ARCH:="x86_64"}
76 56
77   -# Define compiler as simply gcc (if anything expects e.g. gcc-4.2)
78   -# sometimes the OS X build environment will be messed up because
79   -# Apple dropped GCC support and removed the symbolic links, but
80   -# after everyone complained they added them again. Now it is
81   -# merely a GCC-like frontend to LLVM.
  57 +# Define compiler as "gcc" (in case anything expects e.g. gcc-4.2)
  58 +# On newer OS X versions, this will be a symbolic link to LLVM GCC
  59 +# TODO: don't rely on that
82 60 export CC=${CC:="gcc"} CXX=${CXX:="g++"}
83 61
84 62 # The various libs offer inconsistent configure options, some allow
@@ -99,11 +77,31 @@ if [[ $MIN_OSX_VERSION && ${MIN_OSX_VERSION-_} ]]; then
99 77 LDFLAGS="$LDFLAGS -mmacosx-version-min=$MIN_OSX_VERSION"
100 78 fi
101 79 CFLAGS="$CFLAGS -arch $ARCH"
102   -CPPFLAGS="$CPPFLAGS $CFLAGS"
  80 +# Avoid linker warnings about compiling translation units with different visibility settings
  81 +CPPFLAGS="$CPPFLAGS $CFLAGS -fvisibility=hidden"
103 82 LDFLAGS="$LDFLAGS -arch $ARCH"
104 83
105 84 JOBS=${JOBS:="-j2"}
106 85
  86 +set -e
  87 +
  88 +die()
  89 +{
  90 + echo ERROR: $*
  91 + exit 1
  92 +}
  93 +
  94 +download_lib()
  95 +{
  96 + local url=$1
  97 + local filename=$2
  98 +
  99 + if [ ! -e $filename ]; then
  100 + echo "Downloading $filename"
  101 + curl -L -O ${url}${filename} || die "Download of $url$filename failed"
  102 + fi
  103 +}
  104 +
107 105 # Check that we're actually on OS X
108 106 if [ "`uname -s`" != "Darwin" ]; then
109 107 die "This script is intended for OS X only"
@@ -210,8 +208,6 @@ then
210 208 mkdir -p build-release
211 209 pushd build-release
212 210
213   - # Avoid linker warnings about compiling translation units with different visibility settings
214   - CPPFLAGS="$CPPFLAGS -fvisibility=hidden"
215 211 (../configure CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" --prefix=$INSTALL_DIR --disable-shared --enable-unicode --with-cocoa --with-opengl && make ${JOBS} && make install) || die "wxWidgets build failed"
216 212 popd
217 213 popd

0 comments on commit 59bae5a

Please sign in to comment.
Something went wrong with that request. Please try again.