+1999-02-19 Gary V. Vaughan <gvaughan@oranda.demon.co.uk>
+
+ * ltconfig.in (export_symbols_cmds): renamed from
+ export_symbols_cmd.
+ (cygwin, mingw): Be sure to compile the ltdll.c object before
+ extracting the exported symbol list. Extract only the names
+ of the exported symbols from the def file [otherwise we might
+ run into trouble with -export-symbols-regex].
+ (archive_expsym_cmds): Regenerate the def file from the symbol
+ export list.
+ (delay_variable_subst): New sed expression to allow us to delay
+ evaluation of $foo in a double_quote_subst evaluated variable by
+ using \$.
+ * ltmain.in (export_symbols_cmds): evaluate each ~ delimitted cmd
+ separately.
+ * doc/libtool.texi (libtool script contents): new paragraph to
+ explain the difference between _cmd and _cmds suffixes for
+ variable names.
+ (export_symbols_cmds): renamed from export_symbols_cmd.
+
1999-02-18 Alexandre Oliva <oliva@dcc.unicamp.br>
* ltconfig.in (ld_shlibs): move -soname and similar flags to the
inlines the contents of @code{ltmain.sh} into the generated
@code{libtool}, which improves performance on many systems.
+The convention used for naming variables which hold shell commands for
+delayed evaluation, is to use the suffix @code{_cmd} where a single
+line of valid shell script is needed, and the suffix @code{_cmds} where
+multiple lines of shell script @strong{may} be delayed for later
+evaluation. By convention, @code{_cmds} variables delimit the
+evaluation units with the @code{~} character where necessary.
+
Here is a listing of each of the configuration variables, and how they
are used within @code{ltmain.sh}:
@defvar always_export_symbols
Whether libtool should automatically generate a list of exported symbols
-using @var{export_symbols_cmd} before linking an archive.
+using @var{export_symbols_cmds} before linking an archive.
Set to @samp{yes} or @samp{no}. Default is @samp{no}
@end defvar
symbols that are defined in the program.
@end defvar
-@defvar export_symbols_cmd
-Command to extract exported symbols from @var{libobjs} to the
+@defvar export_symbols_cmds
+Commands to extract exported symbols from @var{libobjs} to the
file @var{export_symbols}.
@end defvar
# Same as above, but do not quote variable references.
double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
# The name of this program.
progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
hardcode_shlibpath_var=unsupported
runpath_var=
always_export_symbols=no
-export_symbols_cmd='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
+export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
# include_expsyms should be a list of space-separated symbols to be *always*
# included in the symbol list
include_expsyms=
hardcode_libdir_flag_spec='-L$libdir'
allow_undefined_flag=unsupported
always_export_symbols=yes
- export_symbols_cmd='$DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $export_symbols $objdir/$soname-ltdll.$objext $libobjs'
- archive_expsym_cmds='rm -f $objdir/$soname-ltdll.c~
+ # Extract the symbol export list from an `--export-all' def file,
+ # then regenerate the def file from the symbol export list, so that
+ # the compiled dll only exports the symbol export list.
+ export_symbols_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~
+ $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs~
+ sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
+
+ archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
+ _lt_hint=1;
+ for symbol in `cat $export_symbols`; do
+ echo " \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
+ _lt_hint=`expr 1 + \$_lt_hint`;
+ done~
$CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
$DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_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 $deplibs $linkopts~
library_names_spec soname_spec \
RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \
- file_magic_cmd export_symbols_cmd deplibs_check_method allow_undefined_flag no_undefined_flag \
+ file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \
finish_cmds finish_eval global_symbol_pipe hardcode_libdir_flag_spec \
hardcode_libdir_separator sys_lib_search_path_spec \
compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
case "$var" in
reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
old_postinstall_cmds | old_postuninstall_cmds | \
- archive_cmds | archive_expsym_cmds | \
+ export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
postinstall_cmds | postuninstall_cmds | \
finish_cmds | sys_lib_search_path_spec)
# Double-quote double-evaled strings.
- eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`\\\""
+ eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
;;
*)
eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
always_export_symbols=$always_export_symbols
# The command to extract exported symbols
-export_symbols_cmd=$export_symbols_cmd
+export_symbols_cmds=$export_symbols_cmds
# Symbols that should not be listed in the preloaded symbols
exclude_expsyms=$exclude_expsyms