Mark2117 has asked for the wisdom of the Perl Monks concerning the following question:

I am having trouble compiling Term::ReadKey on HP-UX 11.0. I am using a CC compiler and have change the CC=gcc line in the make file however I still get the following error:

make test cc -c -DUSE_REENTRANT_API -D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE -L/lib/pa1.1 -DUINT32_MAX_BROKEN -mpa-risc-1-1 -fPIC -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O -DVERSION=\"2.21\" -DXS_VERSION=\"2.21\" -fPIC -I/opt/perl/lib/5.6.1/PA-RISC1.1-thread-multi/CORE ReadKey.c
cc: warning 487: Possibly incorrect message catalog.
cc: warning 422: Unknown option "m" ignored.
cc: warning 422: Unknown option "a" ignored.
cc: warning 422: Unknown option "-" ignored.
cc: warning 422: Unknown option "i" ignored.
cc: warning 422: Unknown option "-" ignored.
cc: warning 422: Unknown option "1" ignored.
cc: warning 422: Unknown option "-" ignored.
cc: warning 422: Unknown option "1" ignored.
cc: warning 422: Unknown option "f" ignored.
cc: warning 422: Unknown option "f" ignored.
cc: warning 422: Unknown option "f" ignored.
cc: warning 401: "-s" defeats the purpose of "-p"; "-s" ignored.
Running Mkbootstrap for Term::ReadKey ()
chmod 644 ReadKey.bs
rm -f blib/arch/auto/Term/ReadKey/ReadKey.sl
LD_RUN_PATH="" ld -b -L/usr/local/lib ReadKey.o -o
blib/arch/auto/Term/ReadKey/ReadKey.sl
ld: Can't open ReadKey.o
ld: No such file or directory
*** Error exit code 1

Any suggestions??

Thanks,
Mark

Replies are listed 'Best First'.
Re: Trouble Compiling Term::ReadKey
by wirrwarr (Monk) on Sep 02, 2003 at 18:53 UTC
    it doesn't look like make is using gcc, cause the compiler line starts with cc. the error messages are about the option -mpa-risc-1-1 not recognized, so it might be useful to see which compiler supports that flag.
    Does supplying CC=gcc to MakeMaker work?
    CC=gcc perl Makefile.PL
    daniel.

      I thought that it was the Configure step of building Perl that knew how to select compiler command-line arguments for cc vs. gcc. I thought that MakeMaker just pulled out the one set of compiler options that Configure stuffed into Config.pm and so doesn't know how to adjust compiler command-line options based on cc vs. gcc.

      Therefore, I don't expect CC=gcc to work when building a module (unless you get very lucky), only when building Perl itself.

      The best rule is to build modules using the same environment that was used to build Perl. If I wanted to use gcc to build modules but Config.pm wanted to use cc, then I'd probably grab the source code to Perl and build it with gcc.

                      - tye
        Hmm, I'm no expert in building perl, so I didn't know about that, but it sounds reasonable.
        (looking into my configuration with "perl -V")
        Yes, the C-compiler is set there, and the flags etc. as well. So, OP, which compiler was used in building perl?

        daniel.