diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-07-04 23:16:23 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-07-04 23:16:23 +0000 |
commit | d798f70a965e3564ff1d56f2c53cccc42489caf4 (patch) | |
tree | 5048a15efba17d3bb29a75287e3f25fcd007cec3 /macosx-setup.sh | |
parent | df952279cb5ff08048cd70cdccab5119990e7973 (diff) |
Use xcrun --show-sdk-path to find out where the system include files are
hidden, rather than a "compile a program" hack.
svn path=/trunk/; revision=50383
Diffstat (limited to 'macosx-setup.sh')
-rwxr-xr-x | macosx-setup.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/macosx-setup.sh b/macosx-setup.sh index 9c445863a2..96f19e86a5 100755 --- a/macosx-setup.sh +++ b/macosx-setup.sh @@ -333,13 +333,13 @@ if [ ! -f glib-$GLIB_VERSION-done ] ; then # https://bugzilla.gnome.org/show_bug.cgi?id=691608#c25 # # First, determine where the system include files are. (It's not - # necessarily /usr/include.) + # necessarily /usr/include.) There's a bit of a greasy hack here; + # pre-5.x versions of the developer tools don't support the + # --show-sdk-path option, and will produce no output, so includedir + # will be set to /usr/include (in those older versions of the + # developer tools, there is a /usr/include directory). # - testfile=/tmp/test$$.c - trap "rm -f $testfile" 0 - echo "#include <ffi/ffi.h>" > $testfile - includedir=`gcc -M $testfile | sed -n -e 's;[\\];;' -e 's/^ *//' -e 's/ *$//' -e 's;/ffi/ffi\.h;;p'` - rm -f $testfile + includedir=`xcrun --show-sdk-path 2>/dev/null`/usr/include if grep -qs '#define.*MACOSX' $includedir/ffi/fficonfig.h then # It's defined, nothing to do |