Skip to content
This repository was archived by the owner on Aug 16, 2019. It is now read-only.

Commit 0b0cfc1

Browse files
committed
due to setup.py insert mac osx system includes in front of our secified includes, compilers has a wrong defined macros, which caused building symbols with suffix such as $UNIX2003 or $INODE64. new patch changed it
1 parent 8d12eb0 commit 0b0cfc1

File tree

3 files changed

+30
-17
lines changed

3 files changed

+30
-17
lines changed

build_libpython.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,17 @@ do
217217
fi
218218
done
219219

220-
#ARCH=${ARCHS[0]}
221-
#echo "Copying lib files ..."
222-
#cp -v -r $ARCH/lib/python$PYTHON_MAJOR_VER universal/lib/
223-
#echo "Copying include headers ..."
224-
#cp -r $ARCH/include/python$PYTHON_MAJOR_VER universal/include/
225-
#echo "Removing .pyc files .."
226-
#find universal -iname "*.pyc" -exec rm -f {} \;
227-
#echo "Removing .py files .."
228-
#find universal -iname "*.py" -exec rm -f {} \;
229-
#echo "Removing lib-dynload ..."
230-
#rm -rf universal/lib/python$PYTHON_MAJOR_VER/lib-dynload
220+
ARCH=${ARCHS[0]}
221+
echo "Copying lib files ..."
222+
cp -v -r $ARCH/lib/python$PYTHON_MAJOR_VER universal/lib/
223+
echo "Copying include headers ..."
224+
cp -r $ARCH/include/python$PYTHON_MAJOR_VER universal/include/
225+
echo "Removing .pyc files .."
226+
find universal -iname "*.pyc" -exec rm -f {} \;
227+
echo "Removing .py files .."
228+
find universal -iname "*.py" -exec rm -f {} \;
229+
echo "Removing lib-dynload ..."
230+
rm -rf universal/lib/python$PYTHON_MAJOR_VER/lib-dynload
231231

232232
cd $ROOT
233233
echo "Done."

environment.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ fi
3535
DEVELOPER="$XCODE/Platforms/$PLATFORM.platform/Developer"
3636
SDKROOT="$DEVELOPER/SDKs/$PLATFORM$SDKVERSION.sdk"
3737
export CC="$DEVELOPER/usr/bin/llvm-gcc"
38-
export CFLAGS+=" -D__DARWIN_64_BIT_INO_T=0 -D__DARWIN_ONLY_UNIX_CONFORMANCE -g -pipe -arch $ARCH -O2 -I$SDKROOT/usr/include -isysroot $SDKROOT -miphoneos-version-min=$IPHONEOS_MIN_VERSION -F$SDKROOT/System/Library/Frameworks -g -Wall "
38+
# http://developer.apple.com/library/mac/#releasenotes/Darwin/SymbolVariantsRelNotes/index.html
39+
# sys/cdefs.h
40+
#
41+
export CFLAGS+=" -D__DARWIN_ONLY_VERS_1050=1 -D__DARWIN_ONLY_64_BIT_INO_T=1 -D__DARWIN_ONLY_UNIX_CONFORMANCE=1 -g -pipe -arch $ARCH -O2 -I$SDKROOT/usr/include -isysroot $SDKROOT -miphoneos-version-min=$IPHONEOS_MIN_VERSION -F$SDKROOT/System/Library/Frameworks -g -Wall "
3942
export CPP="$CPP"
4043
export CPPFLAGS=$CFLAGS
4144

setup.py-ios-2.7.5.patch

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
--- setup.py 2013-07-21 23:16:34.000000000 +0800
2-
+++ setup.py.static 2013-07-21 23:12:54.000000000 +0800
3-
@@ -33,7 +33,8 @@
1+
--- setup.py 2013-05-12 11:32:54.000000000 +0800
2+
+++ setup.py.static 2013-07-22 18:33:58.000000000 +0800
3+
@@ -33,14 +33,17 @@
44
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
55

66
# This global variable is used to hold the list of modules to be disabled.
@@ -10,7 +10,17 @@
1010

1111
def add_dir_to_list(dirlist, dir):
1212
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
13-
@@ -166,8 +167,13 @@
13+
1) 'dir' is not already in 'dirlist'
14+
2) 'dir' actually exists, and is a directory."""
15+
if dir is not None and os.path.isdir(dir) and dir not in dirlist:
16+
- dirlist.insert(0, dir)
17+
+ # hack: will not insert at the front, to prevent from including wrong headers
18+
+ #dirlist.insert(0, dir)
19+
+ dirlist.append(dir)
20+
21+
def macosx_sdk_root():
22+
"""
23+
@@ -166,8 +169,13 @@
1424
missing = self.detect_modules()
1525

1626
# Remove modules that are present on the disabled list
@@ -26,7 +36,7 @@
2636
# move ctypes to the end, it depends on other modules
2737
ext_map = dict((ext.name, i) for i, ext in enumerate(extensions))
2838
if "_ctypes" in ext_map:
29-
@@ -245,10 +251,27 @@
39+
@@ -245,10 +253,27 @@
3040
# compilers
3141
if compiler is not None:
3242
(ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS')

0 commit comments

Comments
 (0)