ruby-changes:37486
From: nobu <ko1@a...>
Date: Wed, 11 Feb 2015 15:50:38 +0900 (JST)
Subject: [ruby-changes:37486] nobu:r49567 (trunk): configure.in: add -L options
nobu 2015-02-11 15:50:24 +0900 (Wed, 11 Feb 2015) New Revision: 49567 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49567 Log: 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. Modified files: trunk/configure.in Index: configure.in =================================================================== --- configure.in (revision 49566) +++ configure.in (revision 49567) @@ -1007,18 +1007,13 @@ AS_CASE(["$target_os"], https://github.com/ruby/ruby/blob/trunk/configure.in#L1007 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() -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/