From: Gary V. Vaughan Date: Tue, 1 Dec 1998 18:45:30 +0000 (+0000) Subject: Update the dll generation shell code for cygwin32. X-Git-Tag: release-1-2d~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62eb32d68c8c10facc3b2cf84c4ad0be672a3f91;p=thirdparty%2Flibtool.git Update the dll generation shell code for cygwin32. --- diff --git a/ChangeLog b/ChangeLog index 784dd8171..a15f536c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 1998-12-01 Gary V. Vaughan + * ltconfig.in (ltdll.c): update the ltdll.c file for cygwinb20. + Based on code from Mumit Khan . + (archive_cmds): correct typo libtool.c->ltdll.c. Update shell + commands for cygwin32. + * libtool.m4 (AM_SYS_SYMBOL_UNDERSCORE): New macro; find out whether compiled symbols have an extra leading underscore. (AM_SYS_NM_PARSE): New macro (converted to m4 from ltconfig.in); diff --git a/ltconfig.in b/ltconfig.in index bdb356044..52029f227 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -1013,25 +1013,33 @@ if test "$with_gnu_ld" = yes; then allow_undefined_flag=unsupported # Very, very bogus. echo ' +#define WIN32_LEAN_AND_MEAN #include +#undef WIN32_LEAN_AND_MEAN +#include + +BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); + +#include +DECLARE_CYGWIN_DLL( DllMain ); +HINSTANCE __hDllInstance_base; -struct _reent *_impure_ptr; -extern struct _reent *__imp_reent_data; BOOL APIENTRY -__dll_entry (HINSTANCE hinst, DWORD reason, LPVOID reserved) +DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) { - _impure_ptr = __imp_reent_data; + __hDllInstance_base = hInst; + return TRUE; } ' > ltdll.c archive_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib.exp~ - if test -z "$export_symbols"; then $NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp; + if test -z "$export_symbols"; then $DLLTOOL --export-all --output-def $lib.exp; else cat "$export_symbols" > $lib.exp; fi~ - $LD -s --base-file $soname-base --dll -e ___dll_entry@12 -o $lib libtool.$objext$libobjs$deplibs~ - $DLLTOOL --as=$AS --dllname $soname --def $lib.exp --base-file $soname-base --output-exp $soname-exp~ - $LD -s --base-file $soname-base $soname-exp --dll -e ___dll_entry@12 -o $lib libtool.$objext$libobjs$deplibs~ - $DLLTOOL --as=$AS --dllname $soname --def $lib.exp --base-file $soname-base --output-exp $soname-exp~ - $LD $soname-exp --dll -e ___dll_entry@12 -o $lib libtool.$objext$libobjs$deplibs~ - $rm libtool.$objext $soname-base $soname-exp' + $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobs ltdll.$objext~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib.exp --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$deplibs~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib.exp --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$deplibs~ + $rm ltdll.$objext $soname-base $soname-exp' old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $lib.exp --output-lib $objdir/$libname.a~$rm $lib.exp' else # When not using gcc, we currently assume that we are using @@ -1107,25 +1115,33 @@ else allow_undefined_flag=unsupported # Very, very bogus. echo ' +#define WIN32_LEAN_AND_MEAN #include +#undef WIN32_LEAN_AND_MEAN +#include + +BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); + +#include +DECLARE_CYGWIN_DLL( DllMain ); +HINSTANCE __hDllInstance_base; -struct _reent *_impure_ptr; -extern struct _reent *__imp_reent_data; BOOL APIENTRY -__dll_entry (HINSTANCE hinst, DWORD reason, LPVOID reserved) +DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) { - _impure_ptr = __imp_reent_data; + __hDllInstance_base = hInst; + return TRUE; } ' > ltdll.c - archive_cmds='$CC -c '"`pwd`"'/ltdll.c~ echo EXPORTS > $lib.exp~ - if test -z "$export_symbols"; then $NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp; - else cat "$export_symbols" > $lib.exp; fi~ - $LD -s --base-file $soname-base --dll -e ___dll_entry@12 -o $lib libtool.$objext$libobjs$deplibs~ - $DLLTOOL --as=$AS --dllname $soname --def $lib.exp --base-file $soname-base --output-exp $soname-exp~ - $LD -s --base-file $soname-base $soname-exp --dll -e ___dll_entry@12 -o $lib libtool.$objext$libobjs$deplibs~ - $DLLTOOL --as=$AS --dllname $soname --def $lib.exp --base-file $soname-base --output-exp $soname-exp~ - $LD $soname-exp --dll -e ___dll_entry@12 -o $lib libtool.$objext$libobjs$deplibs~ - $rm libtool.$objext $soname-base $soname-exp' + archive_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib.exp~ + if test -z "$export_symbols"; then $DLLTOOL --export-all --output-def $lib.exp; + else cat "$export_symbols" >> $lib.exp; fi~ + $CC -Wl,--base-file,$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 $libobs ltdll.$objext~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib.exp --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$deplibs~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbol=_cygwin_dll_entry@12 --def $lib.exp --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$deplibs~ + $rm ltdll.$objext $soname-base $soname-exp' old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $lib.exp --output-lib $objdir/$libname.a~$rm $lib.exp' else # When not using gcc, we currently assume that we are using