From d56d56eafceedc384cfb6ee050ebd0e384ce7246 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Wed, 17 Feb 1999 13:02:41 +0000 Subject: [PATCH] * ltconfig.in: (freebsd2*, sunos4*, exclude_expsyms): exclude _GLOBAL_OFFSET_TABLE_ * ltmain.in: implement exclude_expsyms with egrep --- ChangeLog | 4 ++++ ltconfig.in | 11 +++++++++++ ltmain.in | 28 +++++++++++++++++----------- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index d7e2c7b31..53f6911d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 1999-02-17 Alexandre Oliva + * ltconfig.in: (freebsd2*, sunos4*, exclude_expsyms): exclude + _GLOBAL_OFFSET_TABLE_ + * ltmain.in: implement exclude_expsyms with egrep + * libltdl/ltdl.c (lt_dlmalloc, lt_dlfree): SunOS' cc can't cope with argument lists, we __P even in the definition diff --git a/ltconfig.in b/ltconfig.in index 5761c4401..02d677002 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -1023,7 +1023,13 @@ hardcode_shlibpath_var=unsupported runpath_var= always_export_symbols=no export_symbols_cmd="$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= +# exclude_expsyms can be an egrep regular expression of symbols to exclude +# it will be wrapped by `^(' and `) ', so one must not match beginning or +# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +# as well as any symbol that contains `d'. exclude_expsyms= case "$host_os" in @@ -1040,6 +1046,11 @@ cygwin* | mingw*) with_gnu_ld=no fi ;; + +freebsd2* | sunos4*) + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + ;; + esac ld_shlibs=yes diff --git a/ltmain.in b/ltmain.in index 30f4d5d2c..0956e12d4 100644 --- a/ltmain.in +++ b/ltmain.in @@ -2151,21 +2151,22 @@ extern \"C\" { $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done - if test -n "$exclude_expsyms"; then - : # TODO: remove symbols from $nlist - fi - if test -z "$run"; then # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" + $mv "$nlist"T "$nlist" else $rm "$nlist"T fi + if test -n "$exclude_expsyms"; then + egrep -v "^($exclude_expsyms) " "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + if test -f "$nlist"; then sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$output_objdir/$dlsyms" else @@ -2203,10 +2204,13 @@ lt_preloaded_symbols[] = for arg in $progfiles; do eval "$NM $arg | $global_symbol_pipe >> '$nlist'" done - if test -n "$exclude_expsyms"; then - : # TODO: remove symbols from $nlist - fi + if test -f "$nlist"; then + if test -n "$exclude_expsyms"; then + egrep -v "^($exclude_expsyms) " "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + sed 's/^\(.*\) \(.*\)$/ {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms" else echo '/* NONE */' >> "$output_objdir/$dlsyms" @@ -2220,10 +2224,12 @@ lt_preloaded_symbols[] = {\"$name\", (lt_ptr_t) 0}," eval "$NM $arg | $global_symbol_pipe > '$nlist'" - if test -n "$exclude_expsyms"; then - : # TODO: remove symbols from $nlist - fi if test -f "$nlist"; then + if test -n "$exclude_expsyms"; then + egrep -v "^($exclude_expsyms) " "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + sed 's/^\(.*\) \(.*\)$/ {"\1", (lt_ptr_t) \&\2},/' < "$nlist" >> "$output_objdir/$dlsyms" else echo '/* NONE */' >> "$output_objdir/$dlsyms" -- 2.47.3