aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZack Weinberg <zack@rabi.columbia.edu>1999-03-03 22:57:20 +0000
committerJeffrey A Law <law@cygnus.com>1999-03-03 22:57:20 +0000
commit2a56df66ee16cf6d7f9b11b9dec1c2dbaa0c1e0c (patch)
tree99a5cd8b82fd0e4bdfcd50a58216c06a60342137
parent6ceea30cb19fd0a46f5765502680c3fafc75d051 (diff)
* cpp.in: New. Better cpp shell script.
* cpp.sh: Delete. * Makefile.in (cpp.sh): Build from cpp.in git-svn-id: https://gcc.gnu.org/svn/gcc/branches/egcs_1_1_branch@25569 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/Makefile.in4
-rw-r--r--gcc/cpp.in41
-rwxr-xr-xgcc/cpp.sh2
4 files changed, 51 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d47199ac659..5827e794cdb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+Wed Mar 3 23:55:14 1999 Zack Weinberg <zack@rabi.columbia.edu>
+
+ * cpp.in: New. Better cpp shell script.
+ * cpp.sh: Delete.
+ * Makefile.in (cpp.sh): Build from cpp.in
+
Tue Mar 2 01:27:52 1999 H.J. Lu (hjl@gnu.org)
* Makefile.in (cpp_install_dir, INSTALL_CPP, UNINSTALL_CPP): New
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 724906239eb..ecc4dec59bc 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -2287,6 +2287,10 @@ install-cpp: cpp.sh
$(INSTALL_PROGRAM) -m 755 cpp.sh $(prefix)/$(cpp_install_dir)/cpp; \
else true; fi
+cpp.sh: $(srcdir)/cpp.in Makefile
+ sed -e 's%@GCC@%'$(GCC_INSTALL_NAME)'%' $(srcdir)/cpp.in > xcpp.T
+ mv -f xcpp.T cpp.sh
+
uninstall-cpp:
-rm -f $(bindir)/cpp
-if [ x$(cpp_install_dir) != x ]; then \
diff --git a/gcc/cpp.in b/gcc/cpp.in
new file mode 100644
index 00000000000..5e85c0b54de
--- /dev/null
+++ b/gcc/cpp.in
@@ -0,0 +1,41 @@
+#! /bin/sh
+
+# Copyright (C) 1999 Free Software Foundation, Inc.
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation; either version 2, or (at your option) any
+# later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# cpp: wrapper script for `gcc -E'
+
+# Check whether an input file was specified.
+# This has some limited awareness of which switches take arguments.
+
+stdin="-"
+next_is_arg=
+for arg
+do
+ if [ -n "$next_is_arg" ]
+ then next_is_arg=
+ else
+ case "$arg" in
+ -i* | -o | -x) next_is_arg=t;;
+ -) stdin= ;;
+ -*) ;;
+ *) stdin= ;;
+ esac
+ fi
+done
+
+# Hand off to the gcc driver, with -E (preprocess only)
+# and -xc (treat unknown files as source, not linker scripts)
+exec @GCC@ -E -xc ${1+"$@"} $stdin
diff --git a/gcc/cpp.sh b/gcc/cpp.sh
deleted file mode 100755
index b9b6b431711..00000000000
--- a/gcc/cpp.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#! /bin/sh
-exec `gcc -print-prog-name=cpp` ${1+"$@"}