libtool
[Top][All Lists]
Advanced

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

new libtool.m4 patch for cygwin & mingw


From: Tor Lillqvist
Subject: new libtool.m4 patch for cygwin & mingw
Date: Wed, 21 Feb 2001 18:36:35 +0200 (FLE Standard Time)

New try... I changed "lib" to "cyg" in the wrong place. Sorry. Now it
should affect only the name of the dll (and related files), I hope.

--tml

Index: libtool.m4
===================================================================
RCS file: /cvs/libtool/libtool.m4,v
retrieving revision 1.142
diff -u -2 -r1.142 libtool.m4
--- libtool.m4  2001/01/27 19:19:05     1.142
+++ libtool.m4  2001/02/21 16:29:46
@@ -1272,15 +1272,21 @@
       [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~
@@ -1803,5 +1809,13 @@
   need_lib_prefix=no
   if test "$GCC" = yes; then
-    library_names_spec='${libname}`echo ${release} | [sed -e 
's/[.]/-/g']`${versuffix}.dll'
+    case "$host_os" in
+      cygwin*)
+        library_names_spec='`echo ${libname} | [sed -e 's/^lib/cyg/']``echo 
${release} | [sed -e 's/[.]/-/g']`${versuffix}.dll'
+       ;;
+      mingw*)
+        library_names_spec='${libname}`echo ${release} | [sed -e 
's/[.]/-/g']`${versuffix}.dll'
+       sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | 
sed -e "s/^libraries://" -e "s/;/ /g"`
+       ;;
+    esac
   else
     library_names_spec='${libname}`echo ${release} | [sed -e 
's/[.]/-/g']`${versuffix}.dll $libname.lib'




reply via email to

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