On Tue, 26 Feb 2002, Geoffrey Furnish wrote:
> Hi Alan,
> Thanks for the prompt usage report.
> Alan W. Irwin writes:
> > gcc -c -O -I. -I/home/software/java/jdk1.2.2//include -I/home/software/java/jdk1.2.2//include/linux -I/usr/include/tcl8.3 -I/usr/include/tcl8.3/itcl-private/generic -I/usr/include/gtk-1.2 -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/X11R6/include -I/usr/include/gnome-1.0 -I/usr/lib/gnome-libs/include -I/usr/include/orbit-1.0 -MD -MF .d.pdfutils -MP -c pdfutils.c -o pdfutils.o
> > gcc: cannot specify -o with -c or -S and multiple compilations
> > make: *** [pdfutils.o] Error 1
> > make: Leaving directory `/home/software/plplot_cvs/HEAD/plplot/tmp'
> > make: *** [all] Error 2
> > For your convenience here is a wrapped version of that gcc line
> > gcc -c -O
> > -I. -I/home/software/java/jdk1.2.2//include
> > -I/home/software/java/jdk1.2.2//include/linux
> > -I/usr/include/tcl8.3
> > -I/usr/include/tcl8.3/itcl-private/generic
> > -I/usr/include/gtk-1.2
> > -I/usr/include/glib-1.2
> > -I/usr/lib/glib/include
> > -I/usr/X11R6/include
> > -I/usr/include/gnome-1.0
> > -I/usr/lib/gnome-libs/include
> > -I/usr/include/orbit-1.0
> > -MD -MF .d.pdfutils -MP -c pdfutils.c -o pdfutils.o
> > On my system the gcc version is as follows:
> > gcc -dumpversion
> > 2.95.4
> ?!?! What the heck is 2.95.4? Never heard of it. And the release
> page at gcc.gnu.org makes no mention of it. Must be another Linux
> dist vendor inventing gcc releases again like Red Hat did when they
> christened a daily gcc snapshot "2.96" and started the whole debacle.
I believe the .4 is just part of the Debian numbering scheme.
From their changelog, they are just following gcc CVS for 2.9.5 for
> Could you do me a favor and paste that line into your system, and try
> editing it to find out what makes the error message go away? Is the
> problem the -M* options, or is it the multiple -c options, or is it
> just the use of the -o (which would totally floor me).
If the "-MF .d.pdfutils -MP" part of the option string is dropped all is
well. Another way of saying this is you can add -MD and (the redundant) -c
to the normal compile command from yesterday, and it compiles without
complaint, but -MF and -MP options cause problems.
> > The working compile I did yesterday with the old plplot didn't have the
> > "-MD -MF .d.pdfutils -MP -c" part of the command so I assume it is
> > some aspect of that string of parameters that is causing the
> > problem for my gcc version 2.95.4.
> > As you alluded to in your message the configuration seems to be adding these
> > gcc-3.0 parameters to the gcc command line when my system only has 2.95.4.
> Mmm. Sorry. Could you look in lib_sh_linux.in near the top, where
> the with_gcc3 business is, and telll me if you see how the shell code
> is coming up with the wrong answer there? When I try to duplicate the
> stuff that's in $(shell ...) on my own xterm, it comes up with the
> right answer, so I can't see how it would be getting it wrong inside make.
The lines in question from the Makefile are the following:
with_gcc := yes
# Need to figure out if this is GCC version 3 or not.
gcc_major := $(shell gcc -v 2>&1 | grep version | \
cut '-d ' -f 3 | cut -d. -f 1 )
gcc_v3 := $(shell expr $gcc_major \>= 3)
$(CC) $(1) -MD -MF $(3:$(2).o=.d.$(2)) -MP -c $(2).c -o $(3)
automatic_deps := yes
$(CC) $(1) -c $(2).c -o $(3)
automatic_deps := not_yet
# Define the simple forms.
Under bash on my system:
gcc -v 2>&1 | grep version | cut '-d ' -f 3 | cut -d. -f 1
So that works okay. Furthermore,
expr $gcc_major \>= 3
So that works as well.
I then echoed gcc_major right from the Makefile and it
was 2 as expected. I then tried the same thing with gcc_v3 and
it was 1 which *was not expected* and which causes the problem.
I have no idea why gcc_v3 is being set to 1 rather than the expected zero.
> Shell drives me bonkers.
The shell command within Makefiles drives me crazy....;-)
To verify my problem set gcc_major to 2, and go from there. Good luck in
finding why gcc_v3 is being set to 1 rather than the expected 0 under these
circumstances (gcc_major == 2). I wondered if the backwards slash in expr
$gcc_major \>= 3 had to be escaped when it is in a Makefile but replacing by
\\ just caused a syntax error.