]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltconfig.in: (freebsd2*, sunos4*, exclude_expsyms): exclude
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Wed, 17 Feb 1999 13:02:41 +0000 (13:02 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Wed, 17 Feb 1999 13:02:41 +0000 (13:02 +0000)
_GLOBAL_OFFSET_TABLE_
* ltmain.in: implement exclude_expsyms with egrep

ChangeLog
ltconfig.in
ltmain.in

index d7e2c7b316e95ced03d434122f345f093b65bd0a..53f6911d627037b236d1854fa608c9b8b2f77a79 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 1999-02-17  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
+       * 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
 
index 5761c4401da6a023a0343e2d57f01e27f1236e02..02d6770029e0655d63efa243836c86219d53c211 100755 (executable)
@@ -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
index 30f4d5d2c8486a64a0759f6f687bec172f1d4a0f..0956e12d4b2709a97e6b4ee19c91576a162ae719 100644 (file)
--- 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"