[tbb-commits] [tor-browser-build/master] macosx-toolchain-gcc: add option to use 10.7 SDK

boklm at torproject.org boklm at torproject.org
Wed Feb 1 22:56:58 UTC 2017


commit a226f20743c19cf7930264d76e0b914bd425cec5
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Wed Feb 1 23:35:44 2017 +0100

    macosx-toolchain-gcc: add option to use 10.7 SDK
    
    We need the 10.7 SDK to build GO.
---
 projects/macosx-toolchain-gcc/build  |  1 +
 projects/macosx-toolchain-gcc/config | 22 +++++++++++++++++-----
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/projects/macosx-toolchain-gcc/build b/projects/macosx-toolchain-gcc/build
index 1b21d76..778194d 100644
--- a/projects/macosx-toolchain-gcc/build
+++ b/projects/macosx-toolchain-gcc/build
@@ -4,4 +4,5 @@ rootdir=$(pwd)
 destdir='[% dest_dir _ '/' _ c('filename') %]'
 mkdir -p "$destdir"
 mv -f [% c('input_files_by_name/SDK') %] "$destdir"/apple-uni-sdk.deb
+mv -f [% c('input_files_by_name/SDK_10_7') %] "$destdir"/MacOSX10.7.sdk.tar.gz
 mv -f [% c('input_files_by_name/toolchain') %] "$destdir"/toolchain.tar.xz
diff --git a/projects/macosx-toolchain-gcc/config b/projects/macosx-toolchain-gcc/config
index 1a56401..31ac46f 100644
--- a/projects/macosx-toolchain-gcc/config
+++ b/projects/macosx-toolchain-gcc/config
@@ -6,7 +6,6 @@ var:
   setup: |
     macosx_toolchain_gcc_dir=/var/tmp/dist/macosx-toolchain-gcc
     mkdir -p $macosx_toolchain_gcc_dir
-    dpkg-deb -x [% c("compiler_tarfile") %]/apple-uni-sdk.deb $macosx_toolchain_gcc_dir
     tar -C $macosx_toolchain_gcc_dir -xf [% c("compiler_tarfile") %]/toolchain.tar.xz
     export PATH="$macosx_toolchain_gcc_dir/apple-osx/bin:$PATH"
     # For OpenSSL
@@ -14,15 +13,28 @@ var:
     #For gmp, need to trick it so it knows we're doing a 64 bit build
     for i in $macosx_toolchain_gcc_dir/apple-osx/bin/i686-apple-darwin11-*; do j=`echo $i | sed 's/i686/x86_64/'`; ln -s $i $j; done;
 
-    # XXX Clean up these flags?
-    export CFLAGS="-m64 -I$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/include/ -I$macosx_toolchain_gcc_dir/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I.  -L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/ -L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/system/ -mmacosx-version-min=10.5"
-    export CXXFLAGS="-m64 -I$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/include/ -I$macosx_toolchain_gcc_dir/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I.  -L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/ -L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/system/ -L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/i686-apple-darwin10/4.2.1 -mmacosx-version-min=10.5"
-    export LDFLAGS="-L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/ -L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/system/ -mmacosx-version-min=10.5"
+
+    [% IF pc(c('origin_project'), "var/10_7_SDK") %]
+      export AR=$macosx_toolchain_gcc_dir/apple-osx/bin/apple-osx-ar
+      export CC=$macosx_toolchain_gcc_dir/apple-osx/bin/apple-osx-gcc
+      export CXX=$macosx_toolchain_gcc_dir/apple-osx/bin/apple-osx-g++
+      tar -C $macosx_toolchain_gcc_dir -xf [% c("compiler_tarfile") %]/MacOSX10.7.sdk.tar.gz
+      export CFLAGS="-isysroot $macosx_toolchain_gcc_dir/MacOSX10.7.sdk"
+    [% ELSE %]
+      dpkg-deb -x [% c("compiler_tarfile") %]/apple-uni-sdk.deb $macosx_toolchain_gcc_dir
+      # XXX Clean up these flags?
+      export CFLAGS="-m64 -I$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/include/ -I$macosx_toolchain_gcc_dir/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I.  -L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/ -L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/system/ -mmacosx-version-min=10.5"
+      export CXXFLAGS="-m64 -I$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/include/ -I$macosx_toolchain_gcc_dir/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I.  -L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/ -L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/system/ -L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/i686-apple-darwin10/4.2.1 -mmacosx-version-min=10.5"
+      export LDFLAGS="-L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/ -L$macosx_toolchain_gcc_dir/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/system/ -mmacosx-version-min=10.5"
+    [% END %]
 
 input_files:
   - name: SDK
     URL: https://launchpad.net/~flosoft/+archive/cross-apple/+files/apple-uni-sdk-10.6_20110407-0.flosoft1_i386.deb
     sha256sum: 6602d8d5ddb371fbc02e2a5967d9bd0cd7358d46f9417753c8234b923f2ea6fc
+  - name: SDK_10_7
+    URL: https://people.torproject.org/~mikeperry/mirrors/sources/MacOSX10.7.sdk.tar.gz
+    sha256sum: da77bb0003fcca5ea8c4e8cb2da8828ded750c54afdcac29ec6f3b46ad5e3adf
   - name: toolchain
     URL: https://people.torproject.org/~mikeperry/mirrors/sources/multiarch-darwin11-cctools127.2-gcc42-5666.3-llvmgcc42-2336.1-Linux-120724.tar.xz
     sha256sum: 65c1b2d302358a6b95a26c6828a66908a199276193bb0b268f2dcc1a997731e9





More information about the tbb-commits mailing list