diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-10 08:30:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-10 08:30:02 +0000 |
commit | 6f2a41e9951d7e4cb25e33e675f0d424c98ea9a8 (patch) | |
tree | b9c52c0ce0d53764a4e0fa1b80eb36da4fccda02 /configure.in | |
parent | 53053bcac63f361c190280409ac99dab9bea41b3 (diff) | |
download | ruby-6f2a41e9951d7e4cb25e33e675f0d424c98ea9a8.tar.gz |
configure.in: use /usr/include
* configure.in (CPPFLAGS): override /usr/local/include by
/usr/include, unless explicitly /usr/local is given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/configure.in b/configure.in index 37bc31c4df..bf6b82d09f 100644 --- a/configure.in +++ b/configure.in @@ -1007,6 +1007,18 @@ AS_CASE(["$target_os"], AC_DEFINE(BROKEN_SETREUID, 1) AC_DEFINE(BROKEN_SETREGID, 1) fi + AC_CACHE_CHECK([if $CC includes /usr/local/include by default], [rb_cv_isystem_usr_include], [ + AS_CASE([" $CC "], [*' -isystem /usr/local/include '*], [rb_cv_isystem_usr_include=unknown], [ + rb_cv_isystem_usr_include=no + if $CC -E -v -xc - < /dev/null 2>&1 | grep -A1 '^@%:@include <' | grep -q /usr/local/include; then + $CC -print-search-dirs | grep -q '^libraries:.*:/usr/local/lib/*' || + rb_cv_isystem_usr_include=yes + fi + ]) + ]) + AS_CASE(["$rb_cv_isystem_usr_include: $CPPFLAGS $LDFLAGS "], + [no:* | *" -I/usr/local/include "* | *" -L/usr/local/lib "*], [], + [CPPFLAGS="$CPPFLAGS -isystem /usr/include"]) ac_cv_type_getgroups=gid_t # getgroups() on Rosetta fills garbage ac_cv_lib_crypt_crypt=no ac_cv_func_fdatasync=no # Mac OS X wrongly reports it has fdatasync() @@ -2952,14 +2964,6 @@ if test "$with_dln_a_out" != yes; then [darwin*], [ : ${LDSHARED='$(CC) -dynamic -bundle'} : ${LDFLAGS=""} : ${LIBPATHENV=DYLD_LIBRARY_PATH} - # /usr/local/include is always searched for - # some reason, but /usr/local/lib is not. - hdr=`find /usr/local/include -name \*.h -type f | sed 's:^/usr/local/include/::;q'` - if test -n "$hdr" && $CC -E -include "$hdr" -xc - </dev/null 2>/dev/null | fgrep -q "$hdr"; then - $CC -print-search-dirs | grep -q '^libraries:.*:/usr/local/lib/*' || - echo " $LDFLAGS " | grep -q ' -L */usr/local/lib/* ' || - LDFLAGS="${LDFLAGS:+$LDFLAGS }-L/usr/local/lib" - fi rb_cv_dlopen=yes], [aix*], [ : ${LDSHARED='$(CC)'} LDSHARED="$LDSHARED ${linker_flag}-G" |