This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch: Don't name the internal preprocessor "cpp"
On Wed, Jul 26, 2000 at 02:54:00PM +0200, Toon Moene wrote:
> Zack Weinberg wrote:
>
> > This patch changes the specs and the Makefiles so that the internal
> > executable is named "cpp0" (or tradcpp0, for -traditional). The 0 is by
> > analogy with cc1. The two programs now cannot be confused.
>
> Note that f/lang-specs.h has *two* occurrences of `tradcpp' (even though
> you don't like it :-):
Bah. I did, actually, edit both occurrences - but then I cut out the
second chunk of the patch because it also removed the extra /dev/null
and that was an unrelated change.
Here is a corrected patch. I'm going to go ahead and check this in.
It also contains a fix for the .i bug reported last week.
zw
* Makefile.in: Rename cpp to cpp0, tradcpp to tradcpp0, and
xcpp to cpp throughout.
(native): Remove unnecessary dependency on cpp.
* gcc.c (trad_capable_cpp, C specs): Rename cpp to cpp,
tradcpp to tradcpp0.
(.i spec): Add missing output-file spec to cc1 command line.
* ch/lang-specs.h, cp/lang-specs.h, f/lang-specs.h,
objc/lang-specs.h: Rename cpp to cpp0 and/or tradcpp to tradcpp0.
===================================================================
Index: Makefile.in
--- Makefile.in 2000/07/31 17:33:26 1.491
+++ Makefile.in 2000/07/31 18:21:36
@@ -448,7 +448,7 @@ COMPILERS = cc1$(exeext) @all_compilers@
# List of things which should already be built whenever we try to use xgcc
# to compile anything (without linking).
-GCC_PASSES=xgcc$(exeext) cc1$(exeext) cpp$(exeext) $(EXTRA_PASSES)
+GCC_PASSES=xgcc$(exeext) cc1$(exeext) cpp0$(exeext) $(EXTRA_PASSES)
# List of things which should already be built whenever we try to use xgcc
# to link anything.
@@ -716,10 +716,10 @@ STAGESTUFF = *$(objext) insn-flags.h ins
genconfig$(build_exeext) genpeep$(build_exeext) genattrtab$(build_exeext) \
genattr$(build_exeext) genopinit$(build_exeext) gengenrtl$(build_exeext) \
gencheck$(build_exeext) genrtl.c genrtl.h \
- xgcc$(exeext) xcpp$(exeext) cc1$(exeext) cpp$(exeext) $(EXTRA_PASSES) \
+ xgcc$(exeext) cpp$(exeext) cc1$(exeext) cpp0$(exeext) $(EXTRA_PASSES) \
$(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) cc1obj$(exeext) \
enquire$(exeext) protoize$(exeext) unprotoize$(exeext) \
- specs collect2$(exeext) $(USE_COLLECT2) underscore.c tradcpp$(exeext) \
+ specs collect2$(exeext) $(USE_COLLECT2) underscore.c tradcpp0$(exeext) \
gcov$(exeext) *.[0-9][0-9].* *.[si] libcpp.a libgcc libgcc.mk \
$(LANG_STAGESTUFF)
@@ -858,22 +858,22 @@ all.internal: start.encap rest.encap doc
# This is what to compile if making a cross-compiler.
# Note that we can compile enquire using the cross-compiler just built,
# although we can't run it on this machine.
-all.cross: native gcc-cross xcpp$(exeext) specs \
+all.cross: native gcc-cross cpp$(exeext) specs \
$(LIBGCC) $(LIBGCC1_TEST) $(EXTRA_PARTS) lang.all.cross doc
# This is what to compile if making gcc with a cross-compiler.
-all.build: native xgcc$(exeext) xcpp$(exeext) $(EXTRA_PARTS) lang.all.build
+all.build: native xgcc$(exeext) cpp$(exeext) $(EXTRA_PARTS) lang.all.build
# This is what must be made before installing GCC and converting libraries.
-start.encap: native xgcc$(exeext) xcpp$(exeext) specs \
+start.encap: native xgcc$(exeext) cpp$(exeext) specs \
xlimits.h lang.start.encap
# These can't be made until after GCC can run.
rest.encap: $(STMP_FIXPROTO) $(LIBGCC) $(EXTRA_PARTS) lang.rest.encap
# This is what is made with the host's compiler
# whether making a cross compiler or not.
-native: config.status auto-host.h cpp$(exeext) intl.all $(LANGUAGES) \
+native: config.status auto-host.h intl.all $(LANGUAGES) \
$(EXTRA_PASSES) $(EXTRA_PROGRAMS) $(USE_COLLECT2)
# Define the names for selecting languages in LANGUAGES.
-C c: cc1$(exeext) tradcpp$(exeext)
+C c: cc1$(exeext) tradcpp0$(exeext)
PROTO: proto
# Tell GNU make these are phony targets.
@@ -909,12 +909,10 @@ xgcc$(exeext): gcc.o gccspec.o version.o
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o gccspec.o intl.o \
prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
-# We call this executable `xcpp' rather than `cpp'
-# since the real preprocessor is named `cpp'. It too is renamed
-# when it is installed.
+# cpp is to cpp0 as gcc is to cc1.
# The only difference from xgcc is that it's linked with cppspec.o
# instead of gccspec.o.
-xcpp$(exeext): gcc.o cppspec.o version.o intl.o prefix.o \
+cpp$(exeext): gcc.o cppspec.o version.o intl.o prefix.o \
version.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ gcc.o cppspec.o intl.o \
prefix.o version.o $(EXTRA_GCC_OBJS) $(LIBS)
@@ -1801,8 +1799,8 @@ libcpp.a: $(LIBCPP_OBJS)
$(AR) $(AR_FLAGS) libcpp.a $(LIBCPP_OBJS)
if $(RANLIB_TEST) ; then $(RANLIB) libcpp.a ; else true ; fi
-cpp$(exeext): cppmain.o intl.o libcpp.a $(LIBDEPS)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cpp$(exeext) cppmain.o \
+cpp0$(exeext): cppmain.o intl.o libcpp.a $(LIBDEPS)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cpp0$(exeext) cppmain.o \
intl.o libcpp.a $(LIBS)
cppmain.o: cppmain.c $(CONFIG_H) cpplib.h intl.h system.h
@@ -1827,8 +1825,8 @@ mkdeps.o: mkdeps.c $(CONFIG_H) system.h
# The traditional mode preprocessor, a separate program for ease of
# maintenance. Some code is shared with the ISO-C cpp.
-tradcpp$(exeext): tradcpp.o tradcif.o cppdefault.o version.o intl.o $(LIBDEPS)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o tradcpp$(exeext) \
+tradcpp0$(exeext): tradcpp.o tradcif.o cppdefault.o version.o intl.o $(LIBDEPS)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o tradcpp0$(exeext) \
tradcpp.o tradcif.o cppdefault.o version.o intl.o $(LIBS)
tradcpp.o: tradcpp.c $(CONFIG_H) system.h version.h cppdefault.h
@@ -2256,20 +2254,20 @@ install-build: force
install-cross-rest: install-float-h-cross
# Handle cpp installation.
-install-cpp: xcpp$(exeext)
+install-cpp: cpp$(exeext)
-if [ -f gcc-cross$(exeext) ] ; then \
rm -f $(bindir)/$(CPP_CROSS_NAME)$(exeext); \
- $(INSTALL_PROGRAM) -m 755 xcpp$(exeext) $(bindir)/$(CPP_CROSS_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(bindir)/$(CPP_CROSS_NAME)$(exeext); \
if [ x$(cpp_install_dir) != x ]; then \
rm -f $(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
- $(INSTALL_PROGRAM) -m 755 xcpp$(exeext) $(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
else true; fi; \
else \
rm -f $(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
- $(INSTALL_PROGRAM) -m 755 xcpp$(exeext) $(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
if [ x$(cpp_install_dir) != x ]; then \
rm -f $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
- $(INSTALL_PROGRAM) -m 755 xcpp$(exeext) $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
else true; fi; \
fi
@@ -2363,10 +2361,10 @@ install-common: native installdirs $(EXT
$(INSTALL_DATA) SYSCALLS.c.X $(libsubdir)/SYSCALLS.c.X; \
chmod a-x $(libsubdir)/SYSCALLS.c.X; \
fi
- -rm -f $(libsubdir)/cpp$(exeext)
- $(INSTALL_PROGRAM) cpp$(exeext) $(libsubdir)/cpp$(exeext)
- -rm -f $(libsubdir)/tradcpp$(exeext)
- $(INSTALL_PROGRAM) tradcpp$(exeext) $(libsubdir)/tradcpp$(exeext)
+ -rm -f $(libsubdir)/cpp0$(exeext)
+ $(INSTALL_PROGRAM) cpp0$(exeext) $(libsubdir)/cpp0$(exeext)
+ -rm -f $(libsubdir)/tradcpp0$(exeext)
+ $(INSTALL_PROGRAM) tradcpp0$(exeext) $(libsubdir)/tradcpp0$(exeext)
# Install gcov if it was compiled.
-if [ -f gcov$(exeext) ]; \
then \
===================================================================
Index: gcc.c
--- gcc.c 2000/07/28 01:46:11 1.155
+++ gcc.c 2000/07/31 18:21:37
@@ -548,7 +548,7 @@ static const char *link_libgcc_spec = LI
appropriate -B options. */
static const char *trad_capable_cpp =
-"%{traditional|ftraditional|traditional-cpp:trad}cpp";
+"%{traditional|ftraditional|traditional-cpp:trad}cpp0";
static const char *cpp_options =
"%{C:%{!E:%eGNU C does not support -C without using -E}}\
@@ -688,7 +688,7 @@ static struct compiler default_compilers
{".c", "@c"},
{"@c",
#if USE_CPPLIB
- "%{E|M|MM:cpp -lang-c %{ansi:-std=c89} %(cpp_options)}\
+ "%{E|M|MM:cpp0 -lang-c %{ansi:-std=c89} %(cpp_options)}\
%{!E:%{!M:%{!MM:cc1 -lang-c %{ansi:-std=c89} %(cpp_options)\
%(cc1_options) %{!S:-o %{|!pipe:%g.s} |\n\
as %(asm_options) %{!pipe:%g.s} %A }}}}"
@@ -709,7 +709,7 @@ static struct compiler default_compilers
{".i", "@cpp-output"},
{"@cpp-output",
"%{!M:%{!MM:%{!E:\
- cc1 %i %(cc1_options) %{!S:|\n\
+ cc1 %i %(cc1_options) %{!S:-o %{|!pipe:%g.s} |\n\
as %(asm_options) %{!pipe:%g.s} %A }}}}"},
{".s", "@assembler"},
{"@assembler",
===================================================================
Index: ch/lang-specs.h
--- ch/lang-specs.h 2000/07/13 07:14:11 1.13
+++ ch/lang-specs.h 2000/07/31 18:21:37
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
{".ch", "@chill"},
{".chi", "@chill"},
{"@chill",
- "tradcpp -lang-chill %{!no-gcc:-D__GNUCHILL__=%v1} %(cpp_options)\
+ "tradcpp0 -lang-chill %{!no-gcc:-D__GNUCHILL__=%v1} %(cpp_options)\
%{!M:%{!MM:%{!E:%{!pipe:%g.i} |\n\
cc1chill %{!pipe:%g.i} %(cc1_options) %{!S:-o %{|!pipe:%g.s} |\n\
as %(asm_options) %{!pipe:%g.s} %A }}}}\n"},
===================================================================
Index: cp/lang-specs.h
--- cp/lang-specs.h 2000/07/13 07:14:12 1.25
+++ cp/lang-specs.h 2000/07/31 18:21:37
@@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA. */
{".C", "@c++"},
{"@c++",
#if USE_CPPLIB
- "%{E|M|MM:cpp -lang-c++ %{!no-gcc:-D__GNUG__=%v1}\
+ "%{E|M|MM:cpp0 -lang-c++ %{!no-gcc:-D__GNUG__=%v1}\
%{fnew-abi:-D__GXX_ABI_VERSION=100}\
%{ansi:-trigraphs -$ -D__STRICT_ANSI__} %(cpp_options)}\
%{!E:%{!M:%{!MM:cc1plus -lang-c++ %{!no-gcc:-D__GNUG__=%v1}\
@@ -40,7 +40,7 @@ Boston, MA 02111-1307, USA. */
%{!S:-o %{|!pipe:%g.s} |\n\
as %(asm_options) %{!pipe:%g.s} %A }}}}"
#else /* ! USE_CPPLIB */
- "cpp -lang-c++ %{!no-gcc:-D__GNUG__=%v1}\
+ "cpp0 -lang-c++ %{!no-gcc:-D__GNUG__=%v1}\
%{fnew-abi:-D__GXX_ABI_VERSION=100}\
%{ansi:-trigraphs -$ -D__STRICT_ANSI__} %(cpp_options)\
%{!M:%{!MM:%{!E:%{!pipe:%g.ii} |\n\
===================================================================
Index: f/lang-specs.h
--- f/lang-specs.h 2000/07/26 12:37:12 1.23
+++ f/lang-specs.h 2000/07/31 18:21:37
@@ -28,7 +28,7 @@ the Free Software Foundation, 59 Temple
{".fpp", "@f77-cpp-input"},
{".FPP", "@f77-cpp-input"},
{"@f77-cpp-input",
- "tradcpp -lang-fortran %(cpp_options) %{!M:%{!MM:%{!E:%{!pipe:%g.f |\n\
+ "tradcpp0 -lang-fortran %(cpp_options) %{!M:%{!MM:%{!E:%{!pipe:%g.f |\n\
f771 %{!pipe:%g.f} %(cc1_options) %{!S:-o %{|!pipe:%g.s} |\n\
as %(asm_options) %{!pipe:%g.s} %A }}}}}\n"},
{".r", "@ratfor"},
@@ -45,7 +45,7 @@ the Free Software Foundation, 59 Temple
as %(asm_options) %{!pipe:%g.s} %A }}}}\n"},
/* XXX This is perverse and should not be necessary. */
{"@f77-version",
- "tradcpp -lang-fortran %(cpp_options) /dev/null \n\
+ "tradcpp0 -lang-fortran %(cpp_options) /dev/null \n\
f771 -fnull-version %1 \
%{!Q:-quiet} -dumpbase g77-version.f %{d*} %{m*} %{a*} \
%{g*} %{O*} %{W*} %{w} %{pedantic*} \
===================================================================
Index: objc/lang-specs.h
--- objc/lang-specs.h 2000/07/13 07:14:13 1.13
+++ objc/lang-specs.h 2000/07/31 18:21:37
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
{".m", "@objective-c"},
{"@objective-c",
#if USE_CPPLIB
- "%{E|M|MM:cpp -lang-objc %{ansi:-std=c89} %(cpp_options)}\
+ "%{E|M|MM:cpp0 -lang-objc %{ansi:-std=c89} %(cpp_options)}\
%{!E:%{!M:%{!MM:cc1obj -lang-objc %(cpp_options) %(cc1_options)\
%{gen-decls} %{!S:-o %{|!pipe:%g.s} |\n\
as %(asm_options) %{!pipe:%g.s} %A }}}}"