1 ?RCS: $Id: usenm.U,v 3.0.1.1 1997/02/28 16:26:40 ram Exp $
3 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
5 ?RCS: You may redistribute only under the terms of the Artistic Licence,
6 ?RCS: as specified in the README file that comes with the distribution.
7 ?RCS: You may reuse parts of this distribution only within the terms of
8 ?RCS: that same Artistic Licence; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 3.0.
11 ?RCS: $Log: usenm.U,v $
12 ?RCS: Revision 3.0.1.1 1997/02/28 16:26:40 ram
13 ?RCS: patch61: don't use nm with the GNU C library
14 ?RCS: patch61: added support for Linux shared libs
16 ?RCS: Revision 3.0 1993/08/18 12:09:57 ram
17 ?RCS: Baseline for dist 3.0 netwide release.
19 ?MAKE:usenm runnm nm_opt nm_so_opt: cat test Myread Oldconfig myuname grep \
20 nm d_gnulibc osname egrep rsrc
21 ?MAKE: -pick add $@ %<
23 ?S: This variable contains 'true' or 'false' depending whether the
24 ?S: nm extraction is wanted or not.
27 ?S: This variable contains 'true' or 'false' depending whether the
28 ?S: nm extraction should be performed or not, according to the value
29 ?S: of usenm and the flags on the Configure command line.
32 ?S: This variable holds the options that may be necessary for nm.
35 ?S: This variable holds the options that may be necessary for nm
36 ?S: to work on a shared library but that can not be used on an
37 ?S: archive library. Currently, this is only used by Linux, where
38 ?S: nm --dynamic is *required* to get symbols from an ELF library which
39 ?S: has been stripped, but nm --dynamic is *fatal* on an archive library.
40 ?S: Maybe Linux should just always set usenm=false.
42 : see if nm is to be used to determine whether a symbol is defined or not
43 ?X: If there is enough enquiries, it might be worth to wait for the nm
44 ?X: extraction. Otherwise, the C compilations might be a better deal.
46 ?X: Don't bother if we're using GNU libc -- skimo
53 echo "nm probably won't work on the GNU C Library." >&4
59 if $test "$osname" = aix -a "X$PASE" != "$Xdefine" -a ! -f /lib/syscalls.exp; then
61 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
62 echo "'nm' won't be sufficient on this sytem." >&4
68 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
69 if $test $dflt -gt 20; then
79 true|$define) dflt=y;;
86 I can use $nm to extract the symbols from your C libraries. This
87 is a time consuming task which may generate huge output on the disk (up
88 to 3 megabytes) but that should make the symbols extraction faster. The
89 alternative is to skip the 'nm' extraction part and to compile a small
90 test program instead to determine whether each symbol is present. If
91 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
92 this may be the best solution.
94 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
97 rp="Shall I use $nm to extract C symbols from the libraries?"
104 ?X: Name extraction is to be run if 'nm' usage is wanted and if no -r flag
105 ?X: was provided to configure (in which case we simply re-use the previous
112 : nm options which may be necessary
114 '') if $test -f /mach_boot; then
116 elif $test -d /usr/ccs/lib; then
117 nm_opt='-p' # Solaris (and SunOS?)
118 elif $test -f /dgux; then
120 elif $test -f /lib64/rld; then
121 nm_opt='-p' # 64-bit Irix
127 : nm options which may be necessary for shared libraries but illegal
128 : for archive libraries. Thank you, Linux.
130 '') case "$myuname" in
132 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
133 nm_so_opt='--dynamic'