(@pxref{Dlopened modules}).
@item -export-symbols @var{symfile}
-Same as @samp{-export-dynamic}, except that it only exports symbols
-that are listed in @var{symfile}. The symbol file should end in @samp{.sym}
-and must contain the name of one symbol per line.
+Tells the linker to export only the symbols listed in @var{symfile}.
+The symbol file should end in @samp{.sym} and must contain the name of one
+symbol per line. This option does not work for modules.
+By default all symbols are exported.
@item -L@var{libdir}
Search @var{libdir} for required libraries that have already been
in order to be dynamically resolved with the @code{dlsym} (or
equivalent) function.
-Libtool provides the @samp{-export-dynamic} and @samp{-export-symbols} link
+Libtool provides the @samp{-export-dynamic} link
flags (@pxref{Link mode}), which does this declaration.
You need to use this flag if you are linking an application program that
dlopens other modules or a libtool library that will also be dlopened.
without crashing.
@end enumerate
-Libtool emulates @samp{-export-dynamic} and @samp{-export-symbols}
+Libtool emulates @samp{-export-dynamic}
on static platforms by linking objects into the program at compile time,
and creating data structures that represent the program's symbol table.
@cindex names of dynamic modules
@cindex dynamic modules, names
-After a library has been linked with @samp{-export-dynamic} or
-@samp{-export-symbols}, it can be dlopened.
+After a library has been linked with @samp{-export-dynamic}, it can be dlopened.
Unfortunately, because of the variation in library names,
your package needs to determine the correct file to dlopen.
allow_undefined_flag=
no_undefined_flag=
archive_cmds=
+archive_sym_cmds=
old_archive_from_new_cmds=
export_dynamic_flag_spec=
whole_archive_flag_spec=
}
' > ltdll.c
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~
+ $DLLTOOL --export-all --output-def $lib.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'
+ archive_sym_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib.exp~
+ cat "$export_symbols" > $lib.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~
*)
if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs$deplibs'
+ archive_sym_cmds='$CC -shared ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib$libobjs$deplibs'
else
ld_shlibs=no
fi
case "$host_os" in
aix3*)
allow_undefined_flag=unsupported
- archive_cmds='if test -z "$export_symbols"; then $NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp;
- else cat "$export_symbols" > $lib.exp; fi~$LD -o $objdir/$soname$libobjs$deplibs -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
+ archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp~
+ $LD -o $objdir/$soname$libobjs$deplibs -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
+ archive_sym_cmds='cat $export_symbols > $lib.exp~
+ $LD -o $objdir/$soname$libobjs$deplibs -bE:$lib.exp -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname~$rm $lib.exp'
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
aix4*)
allow_undefined_flag=unsupported
- archive_cmds='if test -z "$export_symbols"; then $NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp;
- else cat "$export_symbols" > $lib.exp; fi~ $CC -o $objdir/$soname$libobjs$deplibs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry~$AR cru $lib $objdir/$soname'
+ archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\' | sort | uniq' > $lib.exp else cat $export_symbols > $lib.exp~
+ $CC -o $objdir/$soname$libobjs$deplibs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry~$AR cru $lib $objdir/$soname'
+ archive_sym_cmds='cat $export_symbols > $lib.exp~
+ $CC -o $objdir/$soname$libobjs$deplibs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry~$AR cru $lib $objdir/$soname~$rm $lib.exp'
hardcode_direct=yes
hardcode_minus_L=yes
;;
}
' > ltdll.c
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~
+ $DLLTOOL --export-all --output-def $lib.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'
+ archive_sym_cmds='$CC -c '"`pwd`"'/ltdll.c~echo EXPORTS > $lib.exp~
+ cat "$export_symbols" > $lib.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~
archive_cmds='$CC -shared ${wl}-h $wl$soname -o $lib$libobjs$deplibs'
else
archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib$libobjs$deplibs'
+ archive_sym_cmds='$echo "{ global:" > $lib.exp~sed $export_symbols -e "s/.*/\1;/" >> $lib.exp~$echo "local: * }" > $lib.exp~
+ $LD -G${allow_undefined_flag} -M $export_symbols -h $soname -o $lib$libobjs$deplibs~$rm $lib.exp'
fi
hardcode_libdir_flag_spec='-R$libdir'
hardcode_shlibpath_var=no
$echo "$modename: symbol file \`$arg' does not exist"
exit 1
fi
- if test -n "$export_dynamic_flag_spec"; then
- eval arg=\"$export_dynamic_flag_spec\"
- else
- arg=
- fi
-
- # Add the symbol object into the linking commands.
- compile_command="$compile_command @SYMFILE@"
- finalize_command="$finalize_command @SYMFILE@"
prev=
;;
release)
;;
-export-symbols)
- if test "$export_dynamic" != no; then
- $echo "$modename: cannot have both -export-dynamic and -export-symbols"
- exit 1
- fi
if test -n "$export_symbols"; then
$echo "$modename: cannot have more than one -exported-symbols"
exit 1
exit 1
fi
+ if test -n "$export_symbols" && test "$module" = yes; then
+ $echo "$modename: \`-export-symbols' is not supported for modules"
+ exit 1
+ fi
+
oldlibs=
# calculate the name of the file, without its directory
outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
fi
+ if test -n "$export_symbols"; then
+ $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+ fi
+
# Now set the variables for building old libraries.
build_libtool_libs=no
oldlibs="$output"
fi
# Do each of the archive commands.
- eval cmds=\"$archive_cmds\"
+ if test -n "$export_symbols" && test -n "$archive_sym_cmds"; then
+ eval cmds=\"$archive_sym_cmds\"
+ else
+ eval cmds=\"$archive_cmds\"
+ fi
IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
for cmd in $cmds; do
IFS="$save_ifs"
fi
done
- # If -export-dynamic/symbols was specified, set the dlname.
- if test "$export_dynamic" = yes || test -n "$export_symbols"; then
+ # If -export-dynamic was specified, set the dlname.
+ if test "$export_dynamic" = yes; then
# On all known operating systems, these are identical.
dlname="$soname"
fi
finalize_command=`$echo "X$finalize_command " | $Xsed -e "$los2o" -e 's/ $//'`
fi
- if { test "$export_dynamic" = yes || test "$export_dynamic" = yes; } &&
- test -n "$NM" && test -n "$global_symbol_pipe"; then
+ if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
dlsyms="${outputname}S.c"
else
dlsyms=
exit 1
;;
esac
- elif test "$export_dynamic" != yes && test -z "$export_symbols"; then
+ elif test "$export_dynamic" != yes; then
test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
else
# We keep going just in case the user didn't refer to