]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltconfig.in (cygwin, archive_cmds, archive_sym_cmds): Moved
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Tue, 5 Jan 1999 08:51:02 +0000 (08:51 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Tue, 5 Jan 1999 08:51:02 +0000 (08:51 +0000)
  ltdll.c into ltmain.in, to avoid its duplication, and added a sed
  script to extract it.  Also, create def and base files in $objdir,
  and don't remove them after the compilation.
(cygwin, library_names_spec): Create static part of the dll with
  suffix -dll.a, to avoid conflicts with actual static libraries.
* ltmain.in: Added ltdll.c, as commented out text

ChangeLog
ltconfig.in
ltmain.in

index 8d25d25d07395b32ee036febaac8bded96c24da4..136aba7f06d8dd2b8c11992edf0259a52a7e2065 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+1999-01-05  Alexandre Oliva  <oliva@dcc.unicamp.br>
+
+       * ltconfig.in (cygwin, archive_cmds, archive_sym_cmds): Moved
+       ltdll.c into ltmain.in, to avoid its duplication, and added a sed
+       script to extract it.  Also, create def and base files in $objdir,
+       and don't remove them after the compilation.
+       (cygwin, library_names_spec): Create static part of the dll with
+       suffix -dll.a, to avoid conflicts with actual static libraries.
+       * ltmain.in: Added ltdll.c, as commented out text
+
 1999-01-01  Thomas Tanner  <tanner@gmx.de>
 
        * NEWS: new BeOS support
index 063e247e14ce00c398c889248482ce57d2006c78..467048bfe6c3561d34a7aaf7d9de670fe76006c6 100755 (executable)
@@ -1023,42 +1023,30 @@ if test "$with_gnu_ld" = yes; then
       hardcode_libdir_flag_spec='-L$libdir'
       allow_undefined_flag=unsupported
       # Very, very bogus.
-      echo '
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#include <stdio.h>
 
-BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-
-#include <cygwin/cygwin_dll.h>
-DECLARE_CYGWIN_DLL( DllMain );
-HINSTANCE __hDllInstance_base;
-
-BOOL APIENTRY
-DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-{
-  __hDllInstance_base = hInst;
-  return TRUE;
-}
-' > ltdll.c
-      archive_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $soname-def~
-      $DLLTOOL --export-all --output-def $soname-def $libobjs ltdll.$objext~
-      $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext $compile_dependencylibs~
-      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $soname-def --base-file $soname-base --output-exp $soname-exp~
-      $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext $compile_dependencylibs~
-      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $soname-def --base-file $soname-base --output-exp $soname-exp~
-      $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext $compile_dependencylibs~
-      $rm ltdll.$objext $soname-base $soname-exp'
-      archive_sym_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $soname-def~
-      cat "$export_symbols" >> $soname-def~
-      $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext $compile_dependencylibs~
-      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $soname-def --base-file $soname-base --output-exp $soname-exp~
-      $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext $compile_dependencylibs~
-      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $soname-def --base-file $soname-base --output-exp $soname-exp~
-      $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext $compile_dependencylibs~
-      $rm ltdll.$objext $soname-base $soname-exp'
-      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $soname-def --output-lib $objdir/$libname.a~$rm $soname-def'
+      archive_cmds='rm -f $objdir/$soname-ltdll.c~
+      sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
+      (cd $objdir && $CC -c $soname-ltdll.c)~
+      echo EXPORTS > $objdir/$soname-def~
+      $DLLTOOL --export-all --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
+      $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $compile_dependencylibs~
+      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
+      $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $compile_dependencylibs~
+      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
+      $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $compile_dependencylibs'
+
+      archive_sym_cmds='rm -f $objdir/$soname-ltdll.c~
+      sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
+      (cd $objdir && $CC -c $soname-ltdll.c)~
+      echo EXPORTS > $objdir/$soname-def~
+      cat "$export_symbols" >> $objdir/$soname-def~
+      $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $compile_dependencylibs~
+      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
+      $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $compile_dependencylibs~
+      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
+      $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $compile_dependencylibs'
+
+      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
    else
       # When not using gcc, we currently assume that we are using
       # Microsoft Visual C++.
@@ -1135,42 +1123,30 @@ else
       hardcode_libdir_flag_spec='-L$libdir'
       allow_undefined_flag=unsupported
       # Very, very bogus.
-      echo '
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#undef WIN32_LEAN_AND_MEAN
-#include <stdio.h>
 
-BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-
-#include <cygwin/cygwin_dll.h>
-DECLARE_CYGWIN_DLL( DllMain );
-HINSTANCE __hDllInstance_base;
-
-BOOL APIENTRY
-DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-{
-  __hDllInstance_base = hInst;
-  return TRUE;
-}
-' > ltdll.c
-      archive_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $soname-def~
-      $DLLTOOL --export-all --output-def $soname-def $libobjs ltdll.$objext~
-      $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext $compile_dependencylibs~
-      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $soname-def --base-file $soname-base --output-exp $soname-exp~
-      $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext $compile_dependencylibs~
-      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $soname-def --base-file $soname-base --output-exp $soname-exp~
-      $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext $compile_dependencylibs~
-      $rm ltdll.$objext $soname-base $soname-exp $soname-def'
-      archive_sym_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $soname-def~
-      cat "$export_symbols" >> $soname-def~
-      $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext $compile_dependencylibs~
-      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $soname-def --base-file $soname-base --output-exp $soname-exp~
-      $CC -Wl,--base-file,$soname-base $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext $compile_dependencylibs~
-      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $soname-def --base-file $soname-base --output-exp $soname-exp~
-      $CC $soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $libobjs ltdll.$objext $compile_dependencylibs~
-      $rm ltdll.$objext $soname-base $soname-exp $soname-def'
-      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $soname-def --output-lib $objdir/$libname.a~$rm $soname-def'
+      archive_cmds='rm -f $objdir/$soname-ltdll.c~
+      sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
+      (cd $objdir && $CC -c $soname-ltdll.c)~
+      echo EXPORTS > $objdir/$soname-def~
+      $DLLTOOL --export-all --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
+      $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $compile_dependencylibs~
+      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
+      $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $compile_dependencylibs~
+      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
+      $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $compile_dependencylibs'
+
+      archive_sym_cmds='rm -f $objdir/$soname-ltdll.c~
+      sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
+      (cd $objdir && $CC -c $soname-ltdll.c)~
+      echo EXPORTS > $objdir/$soname-def~
+      cat "$export_symbols" >> $objdir/$soname-def~
+      $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $compile_dependencylibs~
+      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
+      $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $compile_dependencylibs~
+      $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
+      $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $compile_dependencylibs'
+
+      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
     else
       # When not using gcc, we currently assume that we are using
       # Microsoft Visual C++.
@@ -1615,7 +1591,7 @@ bsdi4*)
 cygwin32* | mingw32*)
   version_type=windows
   if test "$with_gcc" = yes; then
-    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
+    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname-dll.a'
   else
     library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
   fi
index 513756409e3c91aea0780a40fefb343934617c80..9358cd03a509caed95ef4a37fd7d0981799e3b06 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -569,6 +569,28 @@ compiler."
       # which system we are compiling for in order to pass an extra
       # flag for every libtool invokation.
       allow_undefined=no
+
+      # This is a source program that is used to create dlls on Windows
+      # Don't remove nor modify the starting and closing comments
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+# 
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# 
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# HINSTANCE __hDllInstance_base;
+# 
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+#   __hDllInstance_base = hInst;
+#   return TRUE;
+# }
+# /* ltdll.c ends here */
       ;;
     *)
       allow_undefined=yes