]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4 (AM_SYS_NM_PARSE): need for underscore prefix is now
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Mon, 11 Jan 1999 04:20:25 +0000 (04:20 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Mon, 11 Jan 1999 04:20:25 +0000 (04:20 +0000)
  auto-detected, by trying first without, then with it
* ltconfig.in: ditto

ChangeLog
libtool.m4
ltconfig.in

index fec13b3ee6db86da763bb3a3ba10b31eed15d060..3bf5e9a652ba885898cf8f0fda9f7153873059d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1999-01-11  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * libtool.m4 (AM_SYS_NM_PARSE): need for underscore prefix is now
+       auto-detected, by trying first without, then with it
+       * ltconfig.in: ditto
+
 1999-01-10  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
        * configure.in (AC_CONFIG_SUBDIRS): add libltdl, demo, mdemo and
index 331247865662f970ad366ff9368f7a4939c99d81..c735e996772eefe72d1d2ce7fd8fd16f9125f50d 100644 (file)
@@ -21,7 +21,7 @@
 ## configuration script generated by Autoconf, you may include it under
 ## the same distribution terms that you use for the rest of that program.
 
-# serial 29 AM_PROG_LIBTOOL
+# serial 30 AM_PROG_LIBTOOL
 AC_DEFUN(AM_PROG_LIBTOOL,
 [AC_PREREQ(2.12.2)dnl
 AC_REQUIRE([AM_ENABLE_SHARED])dnl
@@ -353,10 +353,6 @@ case "$host_os" in
 aix*)
   ac_symcode='[BCDTU]'
   ;;
-sunos* | cygwin32* | mingw32*)
-  ac_sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
-  ac_symxfrm='_\1 \1'
-  ;;
 irix*)
   # Cannot use undefined symbols on IRIX because inlined functions mess us up.
   ac_symcode='[BCDEGRST]'
@@ -380,12 +376,15 @@ cygwin32* | mingw32*)
 esac
 changequote([,])dnl
 
-# Write the raw and C identifiers.
-ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* $ac_symcode $ac_sympat$/$ac_symxfrm/p'"
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
 
-# Check to see that the pipe works correctly.
-ac_pipe_works=no
-cat > conftest.$ac_ext <<EOF
+  # Write the raw and C identifiers.
+  ac_cv_sys_global_symbol_pipe="sed -n -e 's/^.* $ac_symcode $ac_symprfx$ac_sympat$/$ac_symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  ac_pipe_works=no
+  cat > conftest.$ac_ext <<EOF
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -396,37 +395,38 @@ void nm_test_func(){}
 #endif
 int main(){nm_test_var='a';nm_test_func;return 0;}
 EOF
-if AC_TRY_EVAL(ac_compile); then
-  # Now try to grab the symbols.
-  ac_nlist=conftest.nm
-  if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
-
-    # Try sorting and uniquifying the output.
-    if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
-      mv -f "$ac_nlist"T "$ac_nlist"
-      ac_wcout=`wc "$ac_nlist" 2>/dev/null`
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    ac_nlist=conftest.nm
+  
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| $ac_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+
+      # Try sorting and uniquifying the output.
+      if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
+        mv -f "$ac_nlist"T "$ac_nlist"
+        ac_wcout=`wc "$ac_nlist" 2>/dev/null`
 changequote(,)dnl
-      ac_count=`echo "X$ac_wcout" | sed -e 's,^X,,' -e 's/^[   ]*\([0-9][0-9]*\).*$/\1/'`
+        ac_count=`echo "X$ac_wcout" | sed -e 's,^X,,' -e 's/^[         ]*\([0-9][0-9]*\).*$/\1/'`
 changequote([,])dnl
-      (test "$ac_count" -ge 0) 2>/dev/null || ac_count=-1
-    else
-      rm -f "$ac_nlist"T
-      ac_count=-1
-    fi
+        (test "$ac_count" -ge 0) 2>/dev/null || ac_count=-1
+      else
+        rm -f "$ac_nlist"T
+        ac_count=-1
+      fi
 
-    # Make sure that we snagged all the symbols we need.
-    if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
-      if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
-       cat <<EOF > conftest.c
+      # Make sure that we snagged all the symbols we need.
+      if egrep ' nm_test_var$' "$ac_nlist" >/dev/null; then
+        if egrep ' nm_test_func$' "$ac_nlist" >/dev/null; then
+         cat <<EOF > conftest.c
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 EOF
-        # Now generate the symbol file.
-        sed 's/^.* \(.*\)$/extern char \1;/' < "$ac_nlist" >> conftest.c
+          # Now generate the symbol file.
+          sed 's/^.* \(.*\)$/extern char \1;/' < "$ac_nlist" >> conftest.c
 
-       cat <<EOF >> conftest.c
+         cat <<EOF >> conftest.c
 #if defined (__STDC__) && __STDC__
 # define lt_ptr_t void *
 #else
@@ -455,37 +455,42 @@ EOF
 }
 #endif
 EOF
-        # Now try linking the two files.
-        mv conftest.$ac_objext conftestm.$ac_objext
-       ac_save_LIBS="$LIBS"
-       ac_save_CFLAGS="$CFLAGS"
-        LIBS="conftestm.$ac_objext"
-       CFLAGS="$CFLAGS$no_builtin_flag"
-        if AC_TRY_EVAL(ac_link) && test -s conftest; then
-          ac_pipe_works=yes
+          # Now try linking the two files.
+          mv conftest.$ac_objext conftestm.$ac_objext
+         ac_save_LIBS="$LIBS"
+         ac_save_CFLAGS="$CFLAGS"
+          LIBS="conftestm.$ac_objext"
+         CFLAGS="$CFLAGS$no_builtin_flag"
+          if AC_TRY_EVAL(ac_link) && test -s conftest; then
+            ac_pipe_works=yes
+          else
+            echo "configure: failed program was:" >&AC_FD_CC
+            cat conftest.c >&AC_FD_CC
+          fi
+          LIBS="$ac_save_LIBS"
+         CFLAGS="$ac_save_CFLAGS"
         else
-          echo "configure: failed program was:" >&AC_FD_CC
-          cat conftest.c >&AC_FD_CC
+          echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
         fi
-        LIBS="$ac_save_LIBS"
-       CFLAGS="$ac_save_CFLAGS"
       else
-        echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+        echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
       fi
     else
-      echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
+      echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
     fi
   else
-    echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+    echo "$progname: failed program was:" >&AC_FD_CC
+    cat conftest.c >&AC_FD_CC
   fi
-else
-  echo "$progname: failed program was:" >&AC_FD_CC
-  cat conftest.c >&AC_FD_CC
-fi
-rm -rf conftest*
+  rm -rf conftest*
 
-# Do not use the global_symbol_pipe unless it works.
-test "$ac_pipe_works" = yes || ac_cv_sys_global_symbol_pipe=
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$ac_pipe_works" = yes; then
+    break
+  else
+    ac_cv_sys_global_symbol_pipe=
+  fi
+done
 ])
 
 ac_result=yes
index 57b6e1855285983aa3e0257bef466c7e78cec115..2a1f0f9a9888ed63954c7240aff31947d7db7786 100755 (executable)
@@ -1367,9 +1367,6 @@ case "$host_os" in
 aix*)
   symcode='[BCDTU]'
   ;;
-sunos* | cygwin32* | mingw32*)
-  sympat='_\([_A-Za-z][_A-Za-z0-9]*\)'
-  ;;
 irix*)
   # Cannot use undefined symbols on IRIX because inlined functions mess us up.
   symcode='[BCDEGRST]'
@@ -1392,13 +1389,16 @@ cygwin32* | mingw32*)
   ;;
 esac
 
-# Write the raw and C identifiers.
-global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
 
-# Check to see that the pipe works correctly.
-pipe_works=no
-$rm conftest*
-cat > conftest.c <<EOF
+  # Write the raw and C identifiers.
+  global_symbol_pipe="sed -n -e 's/^.* $symcode $ac_symprfx$sympat$/$symxfrm/p'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+  $rm conftest*
+  cat > conftest.c <<EOF
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -1410,36 +1410,36 @@ void nm_test_func(){}
 main(){nm_test_var='a';nm_test_func();return(0);}
 EOF
 
-echo "$progname:@LINENO@: checking if global_symbol_pipe works" >&5
-if { (eval echo $progname:@LINENO@: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
-  # Now try to grab the symbols.
-  nlist=conftest.nm
-  if { echo "$progname:@LINENO@: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
-
-    # Try sorting and uniquifying the output.
-    if sort "$nlist" | uniq > "$nlist"T; then
-      mv -f "$nlist"T "$nlist"
-      wcout=`wc "$nlist" 2>/dev/null`
-      count=`$echo "X$wcout" | $Xsed -e 's/^[  ]*\([0-9][0-9]*\).*$/\1/'`
-      (test "$count" -ge 0) 2>/dev/null || count=-1
-    else
-      rm -f "$nlist"T
-      count=-1
-    fi
+  echo "$progname:@LINENO@: checking if global_symbol_pipe works" >&5
+  if { (eval echo $progname:@LINENO@: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { echo "$progname:@LINENO@: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
+
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+        mv -f "$nlist"T "$nlist"
+        wcout=`wc "$nlist" 2>/dev/null`
+        count=`$echo "X$wcout" | $Xsed -e 's/^[        ]*\([0-9][0-9]*\).*$/\1/'`
+        (test "$count" -ge 0) 2>/dev/null || count=-1
+      else
+        rm -f "$nlist"T
+        count=-1
+      fi
 
-    # Make sure that we snagged all the symbols we need.
-    if egrep ' nm_test_var$' "$nlist" >/dev/null; then
-      if egrep ' nm_test_func$' "$nlist" >/dev/null; then
-       cat <<EOF > conftest.c
+      # Make sure that we snagged all the symbols we need.
+      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
+        if egrep ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<EOF > conftest.c
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 EOF
-       # Now generate the symbol file.
-       sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
+         # Now generate the symbol file.
+         sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
 
-       cat <<EOF >> conftest.c
+         cat <<EOF >> conftest.c
 #if defined (__STDC__) && __STDC__
 # define lt_ptr_t void *
 #else
@@ -1457,8 +1457,8 @@ struct {
 dld_preloaded_symbols[] =
 {
 EOF
-       sed 's/^\(.*\) \(.*\)$/  {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
-       cat <<\EOF >> conftest.c
+         sed 's/^\(.*\) \(.*\)$/  {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
+         cat <<\EOF >> conftest.c
   {0, (lt_ptr_t) 0}
 };
 
@@ -1466,37 +1466,42 @@ EOF
 }
 #endif
 EOF
-       # Now try linking the two files.
-       mv conftest.$objext conftestm.$objext
-       save_LIBS="$LIBS"
-       save_CFLAGS="$CFLAGS"
-       LIBS="conftestm.$objext"
-       CFLAGS="$CFLAGS$no_builtin_flag"
-       if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-         pipe_works=yes
-       else
-         echo "$progname: failed program was:" >&5
-         cat conftest.c >&5
-       fi
-       LIBS="$save_LIBS"
+         # Now try linking the two files.
+         mv conftest.$objext conftestm.$objext
+         save_LIBS="$LIBS"
+         save_CFLAGS="$CFLAGS"
+         LIBS="conftestm.$objext"
+         CFLAGS="$CFLAGS$no_builtin_flag"
+         if { (eval echo $progname:@LINENO@: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+           pipe_works=yes
+         else
+           echo "$progname: failed program was:" >&5
+           cat conftest.c >&5
+         fi
+         LIBS="$save_LIBS"
+        else
+         echo "cannot find nm_test_func in $nlist" >&5
+        fi
       else
-       echo "cannot find nm_test_func in $nlist" >&5
+        echo "cannot find nm_test_var in $nlist" >&5
       fi
     else
-      echo "cannot find nm_test_var in $nlist" >&5
+      echo "cannot run $global_symbol_pipe" >&5
     fi
   else
-    echo "cannot run $global_symbol_pipe" >&5
+    echo "$progname: failed program was:" >&5
+    cat conftest.c >&5
   fi
-else
-  echo "$progname: failed program was:" >&5
-  cat conftest.c >&5
-fi
-$rm conftest*
+  $rm conftest*
 
-# Do not use the global_symbol_pipe unless it works.
-echo "$ac_t$pipe_works" 1>&6
-test "$pipe_works" = yes || global_symbol_pipe=
+  # Do not use the global_symbol_pipe unless it works.
+  echo "$ac_t$pipe_works" 1>&6
+  if test "$pipe_works" = yes; then
+    break
+  else
+    global_symbol_pipe=
+  fi
+done
 
 # Check hardcoding attributes.
 echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6