[前][次][番号順一覧][スレッド一覧]

ruby-changes:37474

From: nobu <ko1@a...>
Date: Tue, 10 Feb 2015 17:30:16 +0900 (JST)
Subject: [ruby-changes:37474] nobu:r49555 (trunk): configure.in: use /usr/include

nobu	2015-02-10 17:30:02 +0900 (Tue, 10 Feb 2015)

  New Revision: 49555

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49555

  Log:
    configure.in: use /usr/include
    
    * configure.in (CPPFLAGS): override /usr/local/include by
      /usr/include, unless explicitly /usr/local is given.

  Modified files:
    trunk/configure.in
Index: configure.in
===================================================================
--- configure.in	(revision 49554)
+++ configure.in	(revision 49555)
@@ -1007,6 +1007,18 @@ 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 -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 https://github.com/ruby/ruby/blob/trunk/configure.in#L2964
 	[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"

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]