libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AC_LIBTOOL_SYS_DYNAMIC_LINKER needs to test the current compiler for gcc


From: Peter O'Gorman
Subject: AC_LIBTOOL_SYS_DYNAMIC_LINKER needs to test the current compiler for gcc, not the cc compiler
Date: Fri, 16 Apr 2004 10:12:22 +0900
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4

Hi,
I'm not at all sure of the correctness of this patch, hopefully someone smarter than me will see what I am trying to fix and tell me the proper way to do it.

Some systems/people have gcc as the c compiler, but use a different compiler for c++ and/or f77. Currently AC_LIBTOOL_SYS_DYNAMIC_LINKER will do "$CC -print-search-dirs" if the c compiler is gcc, even if the current tag is something else and the compiler for that tag is not gcc.

This patch works for me, but as I said, it may be the wrong way to fix it.

Peter
--
Peter O'Gorman - http://www.pogma.com

Index: ChangeLog
2004-04-16  Peter O'Gorman  <address@hidden>

        * m4/libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER): Make this an m4_defun,
        test the tags compiler to see if it is GCC, not the CC compiler.

from  Scott James Remnant  <address@hidden>
Index: m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/libtool.m4,v
retrieving revision 1.62
diff -u -3 -p -u -r1.62 libtool.m4
--- m4/libtool.m4 15 Apr 2004 17:05:26 -0000 1.62
+++ m4/libtool.m4 16 Apr 2004 01:05:35 -0000
@@ -1537,9 +1537,14 @@ _LT_DECL([], [striplib], [1])
 # AC_LIBTOOL_SYS_DYNAMIC_LINKER
 # -----------------------------
 # PORTME Fill in your ld.so characteristics
-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+m4_defun([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
 [AC_REQUIRE([LT_AC_PROG_EGREP])
 AC_MSG_CHECKING([dynamic linker characteristics])
+m4_case([$1],
+       [C], [withGCC=$GCC],
+       [CXX], [withGCC=$GXX],
+       [F77], [withGCC=$G77],
+       [withGCC=$GCC])
 library_names_spec=
 libname_spec='lib$name'
 soname_spec=
@@ -1553,7 +1558,7 @@ shlibpath_overrides_runpath=unknown
 version_type=none
 dynamic_linker="$host_os ld.so"
 sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
+if test "$withGCC" = yes; then
   sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | 
$SED -e "s/^libraries://" -e "s,=/,/,g"`
   if echo "$sys_lib_search_path_spec" | $GREP ';' >/dev/null ; then
     # if the path contains ";" then we assume it to be the separator
@@ -1664,7 +1669,7 @@ cygwin* | mingw* | pw32*)
   need_version=no
   need_lib_prefix=no
 
-  case $GCC,$host_os in
+  case $withGCC,$host_os in
   yes,cygwin* | yes,mingw* | yes,pw32*)
     library_names_spec='$libname.dll.a'
     # DLL is installed to $(libdir)/../bin by postinstall_cmds
@@ -1727,7 +1732,7 @@ darwin* | rhapsody*)
   shlibpath_var=DYLD_LIBRARY_PATH
   shrext_cmds='$(test .$module = .yes && echo .so || echo .dylib)'
   # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
+  if test "$withGCC" = yes; then
     sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" 
"$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | $GREP 
"^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, 
,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
   else
     sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'

reply via email to

[Prev in Thread] Current Thread [Next in Thread]