6 ## This script is invoked by Xcode external targets.
8 ## We must guarantee no jobserver is passed through since the file-descriptors
9 ## have been clobbered by Xcode. If this is not done then make behaves as if
10 ## it is allowed to run an infinite number of jobs.
15 ## sanity check - the build system only supports 1 arch at a time
16 archcount=`echo $ARCHS | awk '{ print NF }'`
17 if [ "$archcount" -ne 1 ]; then
18 echo "*********************************************************************"
20 echo "*** ERROR: invalid number of architectures: $ARCHS"
21 echo "*** This build system builds one (1) archtecture at a time."
23 echo "*********************************************************************"
27 ## compute if re/configure necessary
28 if [ $EXTERNAL_METHOD != 'xcode' ]; then
29 reconfigure="terminal -> Xcode"
30 elif [ ! -f $EXTERNAL_BUILD/GNUmakefile ]; then
31 reconfigure="no configuration present"
32 elif [ $EXTERNAL_SRC/make/configure.py -nt $EXTERNAL_BUILD/GNUmakefile ]; then
33 reconfigure="configure script was updated"
38 ## perform re/configure
39 if [ -n "$reconfigure" ]; then
40 echo "reconfiguring ($reconfigure)"
42 case "$CONFIGURATION" in
44 debug="--debug=max --optimize=none"
51 ## invoke configure with (hidden) option which indicates conf performed by xcode
52 (set -x; $EXTERNAL_SRC/configure --force --build=$EXTERNAL_BUILD \
54 --arch=$ARCHS $debug --conf-method=xcode PATH=$PATH )
57 ## compute goals; these correlate with TARGET_NAME and ACTION from Xcode
58 spec="$TARGET_NAME:$ACTION"
59 echo "env specification: $spec"
71 if [ -z "$EXTERNAL_GOALS" ]; then
74 goals="$EXTERNAL_GOALS"
84 echo "ERROR: invalid env specification: $spec"
89 ## safeguard against passing blank value which would result in unlimited jobs
90 if [ -z "$EXTERNAL_JOBS" ]; then
93 jobs=--jobs=$EXTERNAL_JOBS
98 exec make -C $EXTERNAL_BUILD BUILD.method=xcode $jobs $goals $EXTERNAL_VARS