--- rl/build.sh.orig 2015-10-13 01:59:32.000000000 +1100
+++ rl/build.sh 2017-09-08 09:58:13.000000000 +1000
echo "Using compiler $osx_compiler on OS X"
# Parse output of cc -v to guess real compiler (works with clang and gcc, at least)
echo "Guessing actual compiler:" `$osx_compiler -v 2>&1 | grep ' version '`
- detected_arches="Compiler supports architectures:"
- echo $'#include <stdio.h>\nint main() {\n printf("Hello world\\n");\n}' > test.c
- # Find out which architectures are supported by doing a test compile AND link per arch
- for arch in i386 x86_64 ppc ppc64; do
- arch_flag=' -arch '$arch
- if ${CC-cc} $arch_flag test.c 2> /dev/null; then
- detected_arches+=' '$arch
- # Verify the final arch flags (typically containing multiple architectures).
- # If it doesn't work, we probably have GNU gcc which cannot handle
- # i386 + x86_64 (in that order) - go for x86_64 only instead.
- if ! ${CC-cc} $arch_flags test.c 2> /dev/null; then
- if test "$arch_flags" == ' -arch i386 -arch x86_64'; then
- echo "Compiler (gcc?) fails with both i386 and x86_64 arches - do x86_64 only"
- arch_flags=' -arch x86_64'
- echo "Compiler fails with multiple arches - go back to default architecture"
- rm -f test.c test.o a.out
- # Don't set sysroot anymore (should be fine for OS X 10.6+)
patch -p0 < ../readline63-007
patch -p0 < ../readline63-008
# Force compiler to CC/cc in the case of Darwin
-./configure CPPFLAGS='-DNEED_EXTERN_PC -fPIC' $cc_override
+export CFLAGS="$CFLAGS -fPIC"
+export CPPFLAGS="$CPPFLAGS -DNEED_EXTERN_PC"
+./configure $cc_override
# Only the static libraries are required