--- /usr/autotool/devel/share/aclocal/libtool.m4.orig 2002-07-16 05:05:58.000000000 +0100 +++ /usr/autotool/devel/share/aclocal/libtool.m4 2002-09-07 18:07:28.000000000 +0100 @@ -603,7 +603,7 @@ # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; - cygwin*) + cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, @@ -1113,10 +1113,19 @@ version_type=windows need_version=no need_lib_prefix=no + # This is a feature of Win32, not of Cygwin + shlibpath_overrides_runpath=yes + case $GCC,$host_os,$CC in + yes,cygwin*,* | yes,mingw*,gcc*-mno-cygwin*) + sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" + ;; + yes,mingw*,*) + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g"` + ;; + esac case $GCC,$host_os in yes,cygwin*) library_names_spec='$libname.dll.a' - sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib" soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' postinstall_cmds='base_file=`basename \${file}`~ dlpath=`bash 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ @@ -1126,11 +1135,9 @@ postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' - shlibpath_overrides_runpath=yes ;; yes,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"` + library_names_spec='$libname.dll.a' if echo "$sys_lib_search_path_spec" | [egrep ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search @@ -1142,6 +1149,15 @@ else sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | sed -e "s/$PATH_SEPARATOR/ /g"` fi + soname_spec='`echo ${libname} | sed -e 's/^lib//'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`bash 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + `echo \$install_prog | sed -e '\'':a;s/\(-m [[0-7]]*\)6/\17/;s/\(-m [[0-7]]*\)4/\15/;ta'\''` $dir/$dlname \$dldir/$dlname' + postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' ;; yes,pw32*) library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' @@ -2267,6 +2283,8 @@ _LT_AC_SYS_COMPILER +_LT_AC_TAGVAR(compiler, $1)=$CC + # # Check for any special shared library compilation flags. # @@ -4501,21 +4519,42 @@ fi ;; - cygwin*) + cygwin* | mingw*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # We will try this both ways. No first. Yes second. _LT_AC_TAGVAR(always_export_symbols, $1)=no if $LD --help 2>&1 | egrep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}-retain-symbols-file $wl$export_symbols ${wl}--out-implib,$lib' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib' + + # 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! + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`sed 1q $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;; + 4) echo " \[$]2 \[$]3 \[$]4 ; " >> $output_objdir/$soname.def; _lt_hint=`expr \$_lt_hint - 1`;; + *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname.def;; + esac; + _lt_hint=`expr 1 + \$_lt_hint`; + done; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--out-implib,$lib' else ld_shlibs=no fi ;; - mingw* | pw32*) + pw32*) # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, as there is # no search path for DLLs. _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' --- /usr/autotool/devel/share/libtool/ltmain.sh.orig 2002-09-05 22:58:28.000000000 +0100 +++ /usr/autotool/devel/share/libtool/ltmain.sh 2002-09-07 13:06:16.000000000 +0100 @@ -4475,7 +4475,7 @@ # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $echo > $output "\ # $outputname - a libtool library file