]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4 (AC_LIBTOOL_PROG_CC_C_O): Albert Chin's gcj fix.
authorAnthony Green <green@redhat.com>
Thu, 14 Mar 2002 17:40:20 +0000 (17:40 +0000)
committerRobert Boehne <rboehne@gnu.org>
Thu, 14 Mar 2002 17:40:20 +0000 (17:40 +0000)
(AC_LIBTOOL_PROG_COMPILER_PIC): Per Bothner's change for not
using -DPIC with gcj.

ChangeLog
libtool.m4

index f5a826627a18628548b9858b58790f67e87146fe..ed5f766e370cb4d37a5693f658d30c9a7a9c250f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-03-14  Anthony Green  <green@redhat.com>
+
+       * libtool.m4 (AC_LIBTOOL_PROG_CC_C_O): Albert Chin's gcj fix.
+       (AC_LIBTOOL_PROG_COMPILER_PIC): Per Bothner's change for not
+       using -DPIC with gcj.
+
 2002-03-11  Bruce Korb  <bkorb@gnu.org>
 
        * ltmain.in(compile): bring a touch of order to the option processing
index 0da7338363e6a66b6f7e57b506d32117392798c0..2ba05336bedf0163f9cb7bf02ac0bd391e750c26 100644 (file)
@@ -832,8 +832,8 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
                   CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"],
          [$1],[CXX],[save_CXXFLAGS="$CXXFLAGS"
                   CXXFLAGS="$CXXFLAGS -o out/conftest2.$ac_objext"],
-         [$1],[GCJ],[save_GCJFLAGS="$GCJFLAGS"
-                  GCJFLAGS="$GCJFLAGS -o out/conftest2.$ac_objext"])
+         [$1],[GCJ],[save_GCJFLAGS="$CFLAGS"
+                  CFLAGS="$GCJFLAGS -o out/conftest2.$ac_objext"])
    echo "$lt_simple_compile_test_code" > conftest.$ac_ext
 
    # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
@@ -856,7 +856,7 @@ AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
    fi
    ifelse([$1],[],[CFLAGS="$save_CFLAGS"],
          [$1],[CXX],[CXXFLAGS="$save_CXXFLAGS"],
-         [$1],[GCJ],[GCJFLAGS="$save_GCJFLAGS"])
+         [$1],[GCJ],[CFLAGS="$save_CFLAGS"])
    chmod u+w .
    $rm conftest* out/*
    rmdir out
@@ -984,7 +984,20 @@ shlibpath_overrides_runpath=unknown
 version_type=none
 dynamic_linker="$host_os ld.so"
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
-sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://"`
+  if echo "$sys_lib_search_path_spec" | egrep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
 need_lib_prefix=unknown
 hardcode_into_libs=no
 
@@ -3177,7 +3190,7 @@ objext=o
 _LT_AC_TAGVAR(objext, $1)=$objext
 
 # Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}"
+lt_simple_compile_test_code="class foo {};"
 
 # Code to be used in simple link tests
 lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }'
@@ -4316,7 +4329,7 @@ AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
 if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
   AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
     _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
-    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC], [],
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[GCJ],[],[ -DPIC])], [],
     [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
      "" | " "*) ;;
      *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
@@ -4330,7 +4343,7 @@ case "$host_os" in
     _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
     ;;
   *)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -DPIC"
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[GCJ],[],[ -DPIC])"
     ;;
 esac
 ])