aboutsummaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in20
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"