From: Zack Weinberg Date: Wed, 3 Mar 1999 22:57:20 +0000 (+0000) Subject: cpp.in: New. X-Git-Tag: prereleases/egcs-1.1.2-prerelease-3~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f462aa49ae81c3ce54ce0922e1da3c61176b2ae;p=thirdparty%2Fgcc.git cpp.in: New. * cpp.in: New. Better cpp shell script. * cpp.sh: Delete. * Makefile.in (cpp.sh): Build from cpp.in From-SVN: r25569 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d47199ac659e..5827e794cdbc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +Wed Mar 3 23:55:14 1999 Zack Weinberg + + * 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 724906239eb9..ecc4dec59bce 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 000000000000..5e85c0b54de5 --- /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 b9b6b4317119..000000000000 --- a/gcc/cpp.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh -exec `gcc -print-prog-name=cpp` ${1+"$@"}