🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.programmer
Article #3683

GNU cpp combined with HP C++ compiler ?

#3683
From: Linde, Jon Olav
Date: Wed, 19 Jun 1996 00:00
82 lines
3518 bytes

I would like to utilize GNU cpp's -MD option. I.e. making it generate
dependency files in parallell with normal pre-processing.

But I didn't succeed with my little test-program, so therefore, I will
appreciate any help from those of you with experience with this.

I use an HP 715/50, HP-UX 9.03, HP C++ 3.05 and cpp from the gcc 2.7.2
distribution.

This is my test-program:

----------------------------------------------------------------------
#include <stream.h>

main()
{
  cout << "Hello world !!" << endl;
}
----------------------------------------------------------------------


My makefile looks like this:

----------------------------------------------------------------------

CCC.comp = CC -v -tp,/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.03/2.7.2/cpp -Wp,-lang-c++,"-MD $*.d"
CCC.link = CC -v

helloWorld: helloWorld.o
	$(CCC.link) -o helloWorld helloWorld.o

.C.o:
	$(CCC.comp) -c -o $@ $<

----------------------------------------------------------------------


... and the output when running make:

----------------------------------------------------------------------
~/CC/testDir > make helloWorld.o
        CC -v -tp,/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.03/2.7.2/cpp -Wp,-lang-c++,"-MD helloWorld.d" -c -o helloWorld.o helloWorld.C
 /local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9.03/2.7.2/cpp -lang-c++ -MD helloWorld.d -D__hp9000s700 -D_PA_RISC1_1 -$ -Dc_plusplus -D__cplusplus -D__hp9000s800 -D__hppa -D__hpux -D__unix -Dhp9000s800 -Dhppa -Dhpux -Dunix -I/usr/include/CC -I/usr/include helloWorld.C /usr/tmp/AAAa27020.i
 /usr/lib/cfront +T/usr/tmp/BAAa27020 +s +t/usr/tmp/CAAa27020 +fhelloWorld.C +XChelloWorld.o </usr/tmp/AAAa27020.i
 removing /usr/tmp/AAAa27020.i
 removing /usr/tmp/BAAa27020
 removing /usr/tmp/CAAa27020
~/CC/testDir > 
~/CC/testDir > ls -l
total 112
-rw-r--r--   1 etojol     68 Jun 19 17:51 helloWorld.C
-rw-r--r--   1 etojol    624 Jun 19 18:07 helloWorld.o
-rw-r--r--   1 etojol    241 Jun 19 17:50 makefile

----------------------------------------------------------------------

cpp seems to get the right argument (-MD helloWorld.d) but the dependency
file is simply not generated,  and the object file (helloWorld.o) is
obviously to small. But, it is an object-file:

~/CC/testDir > file *.o
helloWorld.o:   PA-RISC1.1 relocatable object


The really strange thing is, when I use "copy and paste" from the above
output, and executes the cpp-command isolated (not invoked by CC) it works
exactly like expected, and generates the .d-file.

Any suggestions are welcome !

regards,
Jon Olav Linde

----------------------------------------------------------------------

  Ericsson AS                   phone:   +47 66 84 12 13
  Olav Brunborgs vei 6          fax:     +47 66 84 26 06
  postboks 34                   e-mail:  etojol@etn.ericsson.se
  1361 Billingstad
  Norway
Technical Details
Message-ID: <ETOJOL.96Jun19182015@eto-sharon.eto.ericsson.se>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,5c1219276b9a3d60,start
X-Google-Attributes: gid11318c,public
X-Google-Thread: fcda7,5c1219276b9a3d60,start
X-Google-Attributes: gidfcda7,public
X-Google-Thread: fc89c,5c1219276b9a3d60,start
X-Google-Attributes: gidfc89c,public
From: etojol@eto.ericsson.se (Linde, Jon Olav)
Subject: GNU cpp combined with HP C++ compiler ?
Date: 1996/06/19
Message-ID: <ETOJOL.96Jun19182015@eto-sharon.eto.ericsson.se>
X-Deja-AN: 161039366
distribution: world
organization: Ericsson AS
newsgroups: comp.unix.programmer,comp.sys.hp.hpux,gnu.gcc.help