]> 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:51:20 +0000 (01:51 +0000)
committerGary V. Vaughan <gary@gnu.org>
Wed, 7 Mar 2001 01:51:20 +0000 (01:51 +0000)
* ltcf-c.sh, ltcf-gcj.sh (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
ltcf-c.sh
ltcf-gcj.sh

index 66c9bfe530453809f600728a68f8744e328072de..68dd6bca010d35428537a0d1d6ced48958fa073b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
 2001-03-07  Gary V. Vaughan  <gvv@techie.com>
+       
+       From Tor Lillqvist <tml@iki.fi>
+       * ltcf-c.sh, ltcf-gcj.sh (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.
 
        From Tor Lillqvist <tml@iki.fi>
        * ltmain.in (library_names_spec): Use an appropriate filename
index 6235322edb8d00d19314ec0769b42cbe55dc3f7e..3d99a49cc1918c21c4b28a4959a79d776be5c2d0 100644 (file)
--- a/ltcf-c.sh
+++ b/ltcf-c.sh
@@ -148,17 +148,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~
index 2c7f7f4369fff83e72ab1183f90c695bbaa278a2..6471e3527ea45d395a183c075b65997acd22030a 100644 (file)
@@ -151,17 +151,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_gcj_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~