]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cpp.in: New.
authorZack Weinberg <zack@rabi.columbia.edu>
Wed, 3 Mar 1999 22:57:20 +0000 (22:57 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 3 Mar 1999 22:57:20 +0000 (15:57 -0700)
        * cpp.in: New.  Better cpp shell script.
        * cpp.sh: Delete.
        * Makefile.in (cpp.sh): Build from cpp.in

From-SVN: r25569

gcc/ChangeLog
gcc/Makefile.in
gcc/cpp.in [new file with mode: 0644]
gcc/cpp.sh [deleted file]

index d47199ac659e77fc1d763e52f55a3b4394f78ff3..5827e794cdbc0e149b3e6c07f050a1fce0691048 100644 (file)
@@ -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
index 724906239eb97262ab513a3d90ac8db406cf4f40..ecc4dec59bce15eb89086c9da7ede98c17121737 100644 (file)
@@ -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 (file)
index 0000000..5e85c0b
--- /dev/null
@@ -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 (executable)
index b9b6b43..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-#! /bin/sh
-exec `gcc -print-prog-name=cpp` ${1+"$@"}