2004-09-22 Charles Wilson <cwilson@spam.protected>
+ * ltmain.in (func_generate_dlsyms) [cygwin, mingw]: when creating
+ a .exp file for an executable, also create a .def file, and add
+ that file to the link command via SYMFILES. This causes binutils
+ to generate an .edata section, and allows self dlopening to work.
+ * NEWS: Updated.
+
* m4/libtool.m4 (_LT_SYS_DYNAMIC_LINKER): better quoting for
postinstall_cmds and postuninstall_cmds to allow spaces in install
paths.
types have been exchanged. See libltdl/slist.c for documentation.
* libltdl is C89 compatible again. lt_dlsymbol type removed, and lt_dlsymlist
structure changed to avoid using C99 flexible arrays.
+* Support self dlopening for executables on cygwin and mingw.
* Improved support for linux-gnu/ia64.
* Fixed some memory leaks in libltdl.
\f
export_symbols="$output_objdir/$output.exp"
$run $RM $export_symbols
$run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ case $host in
+ *cygwin* | *mingw* )
+ $run eval "${SED} -e '1iEXPORTS'"' < "$export_symbols" > "$output_objdir/$output.def"'
+ ;;
+ esac
else
$run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ case $host in
+ *cygwin | *mingw* )
+ $run eval "${SED} -e '1iEXPORTS'"' < "$output_objdir/$output.exp" > "$output_objdir/$output.def"'
+ ;;
+ esac
$run eval '$GREP -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
$run eval '$MV "$nlist"T "$nlist"'
fi
# Transform the symbol file into the correct name.
symfileobj="$output_objdir/${my_outputname}S.$objext"
- compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
- finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ case $host in
+ *cygwin* | *mingw* )
+ if test -f "$output_objdir/$my_outputname.def"; then
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+ else
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ fi
+ ;;
+ *)
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"`
+ ;;
+ esac
;;
*)
func_fatal_error "unknown suffix for \`$my_dlsyms'"
esac
case $host in
*cygwin* | *mingw* )
- cwrappersource=`$echo ${objdir}/lt-${output}.c`
- cwrapper=`$echo ${output}.exe`
+ output_name=`basename $output`
+ output_path=`dirname $output`
+ cwrappersource=`$echo "$output_path/$objdir/lt-$output_name.c"`
+ cwrapper=`$echo "$output_path/$output_name.exe"`
$RM $cwrappersource $cwrapper
trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15