]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
From Tor Lillqvist <tml@iki.fi>
authorGary V. Vaughan <gary@gnu.org>
Wed, 7 Mar 2001 01:43:27 +0000 (01:43 +0000)
committerGary V. Vaughan <gary@gnu.org>
Wed, 7 Mar 2001 01:43:27 +0000 (01:43 +0000)
* libtool.m4 (export_symbols): On Windows, if the export_symbols
file (which has been passed to libtool with the -export-symbols
command line switch) already is a .def file, use it as is.

ChangeLog
libtool.m4

index 5bee81bfdee9fc95b3b8efc476b42a8b48746e56..f2dba20629baebb93ae882baf0db7cfa82ce4100 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2001-03-07  Gary V. Vaughan  <gvv@techie.com>
 
+       From Tor Lillqvist <tml@iki.fi>
+       * libtool.m4 (export_symbols): On Windows, if the export_symbols
+       file (which has been passed to libtool with the -export-symbols
+       command line switch) already is a .def file, use it as is. 
+
        * libtool.m4 (library_names_spec): Using m4 quotes correctly this
        time around!
        
index 3f76d4b12f8f927458f074ccbf68af7e993466d9..558b79d48b917ddf54227ee73d49e764b7b1f5a7 100644 (file)
@@ -1272,17 +1272,23 @@ EOF
       $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~
       [sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//"] < $output_objdir/$soname-def > $export_symbols'
 
+    # If the export-symbols file already is a .def file (1st line
+    # is EXPORTS), use it as is.
     # If DATA tags from a recent dlltool are present, honour them!
-    archive_expsym_cmds='echo EXPORTS > $output_objdir/$soname-def~
-      _lt_hint=1;
-      cat $export_symbols | while read symbol; do
-       set dummy \$symbol;
-       case \[$]# in
-         2) echo "     \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
-         *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
-       esac;
-       _lt_hint=`expr 1 + \$_lt_hint`;
-      done~
+    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+        cp $export_symbols $output_objdir/$soname-def;
+      else
+        echo EXPORTS > $output_objdir/$soname-def;
+        _lt_hint=1;
+        cat $export_symbols | while read symbol; do
+         set dummy \$symbol;
+         case \[$]# in
+           2) echo "   \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;;
+           *) echo "     \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;;
+         esac;
+         _lt_hint=`expr 1 + \$_lt_hint`;
+        done;
+      fi~
       '"$ltdll_cmds"'
       $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $lib '$ltdll_obj'$libobjs $deplibs $compiler_flags~
       $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~