* configure.in: Set UNDERSCORE in Makefile based on result of

invoking config.bfd with a second argument of ``_''.
	* Makefile.in (underscore.c): Depend upon Makefile.  Don't try to
	run $(CC) and $(NM), just use $(UNDERSCORE).  Create via temporary
	file.
	(demangle.o): Remove target.
	($(NM_PROG)): Don't depend upon demangle.o, and	don't link against
	demangle.o.  It's in libiberty anyhow.
	(cplus-dem.o): Don't depend upon demangle.o.
	* binutils.texi: Mention -n and --no-strip-underscores arguments
	to c++filt.
This commit is contained in:
Ian Lance Taylor 1994-06-16 21:59:41 +00:00
parent e3400040fa
commit 6f88f03122
4 changed files with 38 additions and 19 deletions

View File

@ -1,3 +1,17 @@
Thu Jun 16 17:25:20 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* configure.in: Set UNDERSCORE in Makefile based on result of
invoking config.bfd with a second argument of ``_''.
* Makefile.in (underscore.c): Depend upon Makefile. Don't try to
run $(CC) and $(NM), just use $(UNDERSCORE). Create via temporary
file.
(demangle.o): Remove target.
($(NM_PROG)): Don't depend upon demangle.o, and don't link against
demangle.o. It's in libiberty anyhow.
(cplus-dem.o): Don't depend upon demangle.o.
* binutils.texi: Mention -n and --no-strip-underscores arguments
to c++filt.
Wed Jun 15 12:10:31 1994 Ian Lance Taylor (ian@tweedledumb.cygnus.com)
* nm.c (long_options): Add --no-demangle to turn off --demangle,
@ -1964,5 +1978,8 @@ Fri May 3 22:21:44 1991 John Gilmore (gnu at cygint.cygnus.com)
Local Variables:
mode: indented-text
left-margin: 8
fill-column: 74
version-control: never
End:

View File

@ -198,33 +198,22 @@ $(STRINGS_PROG): $(ADDL_LIBS) strings.o $(BFD)
$(STRIP_PROG): $(ADDL_LIBS) objcopy.o is-strip.o $(BFD)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(STRIP_PROG) objcopy.o is-strip.o $(ADDL_LIBS) $(EXTRALIBS)
$(NM_PROG): $(ADDL_LIBS) nm.o demangle.o $(BFD)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(NM_PROG) nm.o demangle.o $(ADDL_LIBS) $(EXTRALIBS)
$(NM_PROG): $(ADDL_LIBS) nm.o $(BFD)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(EXTRALIBS)
$(OBJDUMP_PROG): $(ADDL_LIBS) objdump.o $(BFD) $(OPCODES)
$(CC) $(CFLAGS) $(LDFLAGS) -o $(OBJDUMP_PROG) objdump.o $(OPCODES) $(ADDL_LIBS) $(EXTRALIBS)
underscore.c:
echo "int xxy_us_dummy;" >dummy.c
$(CC) -c dummy.c
underscore.c: Makefile
rm -f underscore.c
echo '/*WARNING: This file is automatically generated!*/' >underscore.c
if [ "`$(NM) dummy.o | grep _xxy_us_dummy ; true`" != "" ]; then \
echo "int prepends_underscore = 1;" >>underscore.c; \
else \
echo "int prepends_underscore = 0;" >>underscore.c; \
fi
-rm -f dummy.c dummy.o
echo '/*WARNING: This file is automatically generated!*/' >underscore.t
echo "int prepends_underscore = $(UNDERSCORE);" >>underscore.t
mv -f underscore.t underscore.c
version.o: version.c
$(CC) $(INCLUDES) $(HDEFINES) $(TDEFINES) -DVERSION='"$(VERSION)"' $(CFLAGS) -c $(srcdir)/version.c
demangle.o: $(BASEDIR)/libiberty/cplus-dem.c
$(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS) $(BASEDIR)/libiberty/cplus-dem.c
mv cplus-dem.o demangle.o
# For parallel compiling, depend on demangle.o so that one gets done first.
cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h demangle.o
cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h
$(CC) -c -DMAIN $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CFLAGS) $(BASEDIR)/libiberty/cplus-dem.c
$(DEMANGLER_PROG): cplus-dem.o $(LIBIBERTY) underscore.o version.o

View File

@ -1276,6 +1276,7 @@ archives, @samp{strip -v} lists all members of the archive.
@smallexample
c++filt [ -_ | --strip-underscores ]
[ -n | --no-strip-underscores ]
[ -s @var{format} | --format=@var{format} ]
[ --help ] [ --version ] [ @var{symbol}@dots{} ]
@end smallexample
@ -1308,7 +1309,12 @@ standard output. All results are printed on the standard output.
@itemx --strip-underscores
On some systems, both the C and C++ compilers put an underscore in front
of every name. For example, the C name @code{foo} gets the low-level
name @code{_foo}. This option removes the initial underscore.
name @code{_foo}. This option removes the initial underscore. Whether
@code{c++filt} removes the underscore by default is target dependent.
@item -n
@itemx --no-strip-underscores
Do not remove the initial underscore.
@item -s @var{format}
@itemx --format=@var{format}

View File

@ -76,6 +76,13 @@ if [ "x${build_srconv}" = "xtrue" ]; then
echo 'BUILD_SRCONV = $(SRCONV_PROG)' >> Makefile.2
fi
if [ "x`$srcdir/../bfd/config.bfd $target _`" = "xyes" ]; then
underscore=1
else
underscore=0
fi
echo "UNDERSCORE = ${underscore}" >> Makefile.2
cat Makefile.tmp >> Makefile.2
rm -f Makefile.tmp
mv Makefile.2 Makefile