Skip to content

Commit

Permalink
Get it working with XCode 5.1+
Browse files Browse the repository at this point in the history
  • Loading branch information
smcmahon committed Apr 18, 2014
1 parent 7c6c630 commit f8ec9cc
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 35 deletions.
2 changes: 2 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
4.3.3 - 2014-04-17
==================

- Set the magic flags for C-language component builds under XCode 5.1+.

- Adapt to 4.3.3.

- Use newest version of Pillow; adapt jpeg_decoder tests for it.
Expand Down
18 changes: 17 additions & 1 deletion README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ Outline of this document
- `Customizing the installation`_

- `Third-party products installed`_

- `Platform Notes`_

- `Mac OS X`_
- `Mac OS X Server`_
- `MacPorts`_
- `OpenBSD/NetBSD`_
Expand Down Expand Up @@ -617,6 +619,20 @@ needs, you may force a particular choice by editing the script.
Note that readline installation is forced on OS X, where the default
readline library is incomplete.

Mac OS X
~~~~~~~~

OS X users will generally need to install XCode and XCode Command Line Tools.
Some have had luck using Homebrew to provide GNU build tools.
We only test with XCode.

XCode command-line tools have a separate step in recent versions of XCode.
If you seem to be missing gcc, you've missed that install step.

Building Python libraries with C-language components requires an extra step in XCode 5.1+.
See Apple's release notes for 5.1. https://developer.apple.com/library/mac/releasenotes/DeveloperTools/RN-Xcode/xc5_release_notes/xc5_release_notes.html#//apple_ref/doc/uid/TP40001051-CH2-SW1
The Unified Installer takes care of this for you when building the initial Plone, but you need to supply the environment flags when adding new Python eggs that have C-language components.

MacPorts
~~~~~~~~

Expand Down Expand Up @@ -675,7 +691,7 @@ bzip2-1.0.4

python-2.7.3
interpreted object-oriented programming language

python-expat-2.6.7
expat module for Python

Expand Down
54 changes: 20 additions & 34 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -479,12 +479,19 @@ unset CDPATH
# set up the common build environment unless already existing
if [ "x$CFLAGS" = 'x' ]; then
export CFLAGS='-fPIC'
if [ `uname` = "Darwin" ] && [ -d /opt/local ]; then
# include MacPorts directories, which typically have additional
# and later libraries
export CFLAGS='-fPIC -I/opt/local/include'
if [ `uname` = "Darwin" ]; then
# try to undo Apple's attempt to prevent the use of their Python
# for open-source development
export CFLAGS='-fPIC -Qunused-arguments'
export CPPFLAGS=$CFLAGS
export LDFLAGS='-L/opt/local/lib'
export ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future
if [ -d /opt/local ]; then
# include MacPorts directories, which typically have additional
# and later libraries
export CFLAGS='-fPIC -Qunused-arguments -I/opt/local/include'
export CPPFLAGS=$CFLAGS
export LDFLAGS='-L/opt/local/lib'
fi
fi
fi

Expand Down Expand Up @@ -981,31 +988,6 @@ if [ ! -x "$PY" ]; then

. helper_scripts/build_python.sh

# # The virtualenv kit has copies of setuptools and pip
# echo "Installing setuptools..."
# cd "$PKG"
# untar $VIRTUALENV_TB
# cd $VIRTUALENV_DIR/virtualenv_support
# untar setuptools*.tar.gz
# cd setuptools*
# "$PY" setup.py install >> "$INSTALL_LOG" 2>&1
# if [ ! -x "$EI" ]; then
# echo "$EI missing. Aborting."
# seelog
# exit 1
# fi
# cd ..
# untar pip*.tar.gz
# cd pip*
# "$PY" setup.py install >> "$INSTALL_LOG" 2>&1
# cd "$PKG"
# rm -r $VIRTUALENV_DIR

# if [ ! -x "$EI" ]; then
# echo "$EI missing. Aborting."
# seelog
# exit 1
# fi
if "$PY" "$CWD/$HSCRIPTS_DIR"/checkPython.py --without-ssl=${WITHOUT_SSL}; then
echo "Python build looks OK."
else
Expand All @@ -1022,10 +1004,14 @@ fi


# From here on, we don't want any ad-hoc cflags or ldflags, as
# they will foul the modules built via distutils
unset CFLAGS
unset LDFLAGS

# they will foul the modules built via distutils.
# Latest OS X is the exception, since their Mavericks Python
# supplies bad flags. How did they build that Python? Probably
# not with the latest XCode.
if [ `uname` != "Darwin" ]; then
unset CFLAGS
unset LDFLAGS
fi

if [ -f "${PKG}/buildout-cache.tar.bz2" ]; then
if [ -x "$BUILDOUT_CACHE" ]; then
Expand Down

0 comments on commit f8ec9cc

Please sign in to comment.