summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-11 06:50:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-02-11 06:50:24 +0000
commit5e868b2bcad572904e33ae6ff0198c6b5822128a (patch)
treebe1a38efd5c33cf282f174338cd8d110fe915b3c
parent0b71264edbee2adaf8be4c20315fc4ae84a63627 (diff)
configure.in: add -L options
* configure.in (LDFLAGS): add -L options for library directories corresponding to default include directories, as gcc does not prepend duplicate directories. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--configure.in19
1 files changed, 7 insertions, 12 deletions
diff --git a/configure.in b/configure.in
index 27a0302a8ee..0089957aabb 100644
--- a/configure.in
+++ b/configure.in
@@ -1007,18 +1007,13 @@ 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 -iquote /usr/include -iquote /usr/local/include"])
+ incs=`$CC -v -E -xc - < /dev/null 2>&1 | sed -n '1,/^@%:@include </d;s/^ *//;s|/include$|/lib|p'`
+ for d in `$CC -print-search-dirs | sed -e '/^libraries: */!d;s///' | tr : '\012' | fgrep -v /../ | sed -n 's|^\(/.*/lib\)/$|\1|p'`; do
+ incs=`echo "$incs" | fgrep -v "$d"`
+ done
+ for d in $incs; do
+ test -d "$d" && LDFLAGS="${LDFLAGS:+$LDFLAGS }-L$d"
+ done
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()