🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Noah Friedman Tue, 14 Apr 1992 15:29
preventing -lang-c from being passed to cpp
#391
Author: Noah Friedman
Date: Tue, 14 Apr 1992 15:29
14 lines
1173 bytes
   I would like to install older versions of gcc (e.g. 1.40) in the same
directory hierarchy that the 2.0+ programs are arranged in so that we can
run them by doing "gcc -V 1.40 foo.c".  This seems to work just fine
(provided I rename some of the binaries) except that older versions of cpp
don't understand the -lang-c (and similar) arguments.  I tried writing a
specs file to turn this off but I clearly don't understand what I'm doing
or it doesn't work at all, because I haven't figured out a way to do this.

   Does anyone have any advice?  I tried simply subsituting cpp 2.1 in
place of 1.40, but I got complaints like

        foo.c:30: #-lines for entering and leaving files don't match

from cc1 (1.41)
Re: preventing -lang-c from being passed to cpp
#413
Author: Andreas Stolcke
Date: Wed, 15 Apr 1992 07:34
69 lines
2527 bytes
In article <9204141529.AA27455@nutrimat.gnu.ai.mit.edu> friedman@gnu.ai.mit.edu writes:
>   I would like to install older versions of gcc (e.g. 1.40) in the same
>directory hierarchy that the 2.0+ programs are arranged in so that we can
>run them by doing "gcc -V 1.40 foo.c".  This seems to work just fine
>(provided I rename some of the binaries) except that older versions of cpp
>don't understand the -lang-c (and similar) arguments.  I tried writing a
>specs file to turn this off but I clearly don't understand what I'm doing
>or it doesn't work at all, because I haven't figured out a way to do this.

To achieve this we wrote a little wrapper script for cpp to massage
the options.  All other programs invoked by gcc seem to be compatible.
The problem with specs is that they don't allow you to modify the
arguments that are compiled into gcc (look at the string constants
containing all those % thingies in gcc.c ...).  But then maybe
I am missing something, too.

Anyway the cpp wrapper is included below.

--Andreas 

#!/bin/sh

# do some options massaging to let the gcc 2.0 driver call gcc 1.4

cpp=/usr/local/lib/gcc-cpp

newargs=
echo=

for arg
do
	case "$arg" in
	-v)	echo=true
		newargs="$newargs $arg"
		;;
	-g)		# ignore
		;;
	-lang-c)	# suppress
		;;
	-lang-objc)
		echo "No Objective-C support available for this version." >&2
		exit 1
		;;
	-lang-c++)	# use old c++ preprocessor flag
		newargs="$newargs -+"
		;;
	-D__GNUC__=2)
		newargs="$newargs -D__GNUC__"
		;;
	-D__GNUG__=2)
		newargs="$newargs -D__GNUG__"
		;;
	*)	# make sure funny args are preserved 
		newargs="$newargs '$arg'"
		;;
	esac
done

cmd="$cpp $newargs"

if [ "$echo" ]; then
	echo $cmd >&2
fi

eval "exec $cmd"
-- 
Andreas Stolcke					stolcke@icsi.berkeley.edu
International Computer Science Institute	stolcke@ucbicsi.bitnet
1947 Center St., Suite 600, Berkeley, CA 94704	(510) 642-4274 ext. 126
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads