]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* ltmain.in: extract symbols from program objects to nlist first,
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Mon, 8 Mar 1999 21:55:25 +0000 (21:55 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Mon, 8 Mar 1999 21:55:25 +0000 (21:55 +0000)
then translate them to the export_symbols format.  Now it works,
but it appears to be needlessly extracting the symbol list from
dlpreopened libraries twice

ChangeLog
ltmain.in

index c6f9bf42383a4178f57aa85bc5d0998b3f467afc..5570ff99984ab0796835a62e60349b7e83c77252 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,14 @@
 1999-03-08  Alexandre Oliva  <oliva@dcc.unicamp.br>
 
+       * ltmain.in: extract symbols from program objects to nlist first,
+       then translate them to the export_symbols format.  Now it works,
+       but it appears to be needlessly extracting the symbol list from
+       dlpreopened libraries twice
+       
        * ltmain.in: temporarily disable dlopen_self when linking with
        -static or -all-static, until we figure out how to test whether it
        works at configure time
+
        * TODO: remember to fix this later
 
        * tests/build-relink.test: when hell is expected to fail, run it
index b6382e6f480bdef12f7baa62070270be230a4ba9..b067ff0b89f8e69f603ece1163993e3297b3b523 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -2328,8 +2328,7 @@ extern \"C\" {
 /* External symbol declarations for the compiler. */\
 "
 
-         # Prepare the list of exported symbols
-         if test "$dlself" = yes && test -z "$export_symbols"; then
+         if test "$dlself" = yes; then
            $show "generating symbol list for \`$output'"
            export_symbols="$objdir/$output.exp"
            $run $rm $export_symbols
@@ -2338,24 +2337,28 @@ extern \"C\" {
            progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
            for arg in $progfiles; do
              $show "extracting global C symbols from \`$arg'"
-             $run eval "$NM $arg | $global_symbol_pipe >> '$export_symbols'"
+             $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
            done
-             
-           if test -n "$exclude_expsyms"; then
-             $run eval 'egrep -v "^($exclude_expsyms)" "$export_symbols" > "${export_symbols}T"'
-             $run eval '$mv ${export_symbols}T $export_symbols'
-           fi
+
+           # Prepare the list of exported symbols
+           if test -z "$export_symbols"; then
+             export_symbols="$objdir/$output.exp"
+             $run $rm $export_symbols
+
+             if test -n "$exclude_expsyms"; then
+               $run eval 'egrep -v "^($exclude_expsyms)" "$nlist" > "$nlist"T'
+               $run eval '$mv "$nlist"T "$nlist"'
+             fi
            
-           if test -n "$export_symbols_regex"; then
-             $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
-             $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
-             $show "$mv \"${export_symbols}T\" \"$export_symbols\""
-             $run eval '$mv "${export_symbols}T" "$export_symbols"'
-           fi
-         fi
+             if test -n "$export_symbols_regex"; then
+               $show "egrep -e \"$export_symbols_regex\" \"$nlist\" > \"$nlist\"T"
+               $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+               $show "$mv \"$nlist\"T \"$nlist\""
+               $run eval '$mv "$nlist"T "$nlist"'
+             fi
 
-         if test "$dlself" = yes; then
-           $run eval 'sed -e "s/^\(.*\)/\1 \1/" < "$export_symbols" > "$nlist"'
+             sed -e 's/^.* \(.*\)$/\1/' < "$nlist" > "$export_symbols"
+           fi
          fi
 
          for arg in $dlprefiles; do