?RCS: $Id$ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic Licence, ?RCS: as specified in the README file that comes with the distribution. ?RCS: You may reuse parts of this distribution only within the terms of ?RCS: that same Artistic Licence; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: usenm.U,v $ ?RCS: Revision 3.0.1.1 1997/02/28 16:26:40 ram ?RCS: patch61: don't use nm with the GNU C library ?RCS: patch61: added support for Linux shared libs ?RCS: ?RCS: Revision 3.0 1993/08/18 12:09:57 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?MAKE:usenm runnm nm_opt nm_so_opt: cat test Myread Oldconfig grep \ d_gnulibc nm egrep rsrc osname Guess ?MAKE: -pick add $@ %< ?S:usenm: ?S: This variable contains 'true' or 'false' depending whether the ?S: nm extraction is wanted or not. ?S:. ?S:runnm: ?S: This variable contains 'true' or 'false' depending whether the ?S: nm extraction should be performed or not, according to the value ?S: of usenm and the flags on the Configure command line. ?S:. ?S:nm_opt: ?S: This variable holds the options that may be necessary for nm. ?S:. ?S:nm_so_opt: ?S: This variable holds the options that may be necessary for nm ?S: to work on a shared library but that can not be used on an ?S: archive library. Currently, this is only used by Linux, where ?S: nm --dynamic is *required* to get symbols from an ELF library which ?S: has been stripped, but nm --dynamic is *fatal* on an archive library. ?S: Maybe Linux should just always set usenm=false. ?S:. : see if nm is to be used to determine whether a symbol is defined or not ?X: If there is enough enquiries, it might be worth to wait for the nm ?X: extraction. Otherwise, the C compilations might be a better deal. ?X: ?X: Don't bother if we're using GNU libc -- skimo case "$usenm" in '') dflt='' case "$d_gnulibc" in "$define") echo " " echo "$nm probably won't work on the GNU C Library." >&4 dflt=n ;; esac case "$dflt" in '') if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then echo " " echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4 echo "'nm' won't be sufficient on this system." >&4 dflt=n fi ;; esac case "$dflt" in '') if ./gnu; then echo " " echo "Hmm... A GNU system without a GNU C Library? Weird..." >&4 dflt=n else dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null` if $test $dflt -gt 20; then dflt=y else dflt=n fi fi ;; esac ;; *) case "$usenm" in true|$define) dflt=y;; *) dflt=n;; esac ;; esac $cat < /dev/null 2>&1; then nm_so_opt='--dynamic' fi ;; esac ;; esac