Bruce Peltzer wrote:
I've been trying to get past a little problem when building gpc from version 20050331. I'm running hp-ux 11i v1 and normally use gcc 4.0.2, but for building, I'm using gcc 3.4.3. When I try to build gpc, make balks at this point.
`echo /opt/hp-gcc-src/gcc-3.4.3/gcc/xgcc -B/opt/hp-gcc-src/gcc-3.4.3/gcc/ -B/usr/local/hppa2.0w-hp-hpux11.11/bin/ -B/usr/local/hppa2.0w-hp-hpux11.11/lib/ -isystem /usr/local/hppa2.0w-hp-hpux11.11/include -isystem /usr/local/hppa2.0w-hp-hpux11.11/sys-include | sed 's,^([^ ]*[/][^/]*)gcc,\1gpc,;s/^gcc$/gpc/' ` -I. -W -Wall -Wmissing-prototypes -Wmissing-declarations -O2 --unit-path=/opt/hp-gcc-src/gcc-3.4.3/gcc/p/rts --automake --print-needed-options "endian.pas" 2> "needed-options" || true if grep '^[^-]' "needed-options" > /dev/null; then echo "needed-options: `cat "needed-options"`" >&2; rm -f "needed-options"; false; else true; fi needed-options: endian.pas:37: error: module/unit interface `error' could not be imported make: *** [needed-options] Error 1
At first glance it looks that gpc tries to compile `endian.pas'. However, when `--print-needed-options' is given on the command line gpc should ignore the input file and print options that should be given in the following compilations, like `-DHPUX' ... (This may sound strange, but this is the easiest way to pass information from compiler proper to the preprocessor.)
So, somethning is broken when the command line is processed. Quick test could be: cd to the proper directory touch /tmp/foo /opt/hp-gcc-src/gcc-3.4.3/gcc/gpc1 -fprint-needed-options \ -famtmpfile=/tmp/foo endian.pas
If that give you the same error then command line handling in gpc is broken and one has to do some real debugging at C level (the problem may be due to bug in gcc, you may try to use different gcc version for build compiler and use plain `make' (_no_ bootstrap)). If the above test just prints info, then to isolate the culprit one should execute (by hand) the sed command to see shell command line. It should be:
/opt/hp-gcc-src/gcc-3.4.3/gcc/xgpc -B/opt/hp-gcc-src/gcc-3.4.3/gcc/ -B/usr/local/hppa2.0w-hp-hpux11.11/bin/ -B/usr/local/hppa2.0w-hp-hpux11.11/lib/ -isystem /usr/local/hppa2.0w-hp-hpux11.11/include -isystem /usr/local/hppa2.0w-hp-hpux11.11/sys-include -I. -W -Wall -Wmissing-prototypes -Wmissing-declarations -O2 --unit-path=/opt/hp-gcc-src/gcc-3.4.3/gcc/p/rts --automake --print-needed-options "endian.pas"
Then one should add '-v' to the command above and execute it by hand in the proper directory. The output will tell you which commands got run (the `gpc1' is the crucial command).