On Wed, 9 Jan 2002, Dan Sugalski wrote:
> At 10:56 AM 1/9/2002 -0500, Andy Dougherty wrote:

> >For perl5, the main makefile calls (essentially)
> >
> >         $(CC) -o perl
> >
> >while the parrot Makefile calls
> >
> >         $(LD) -o test_main
> >
> >I tend to think parrot's wrong here, but there might have been a good
> >reason for doing that way that I am unaware of.
> 
> It's a platform-independence issue. Non-Unix platforms need to call the 
> linker, unix ones don't. Which means we've either got the makefile wrong, 
> or have got the switches set in incorrect ways. Or both. Probably both--let 
> me think about this some.

I think we've got lots of things mixed up on all ends.  Perl5's
Unix-centric Configure is showing up again.

Specifically, Perl5's $Config{ld} is documented as follows:

ld:     This variable indicates the program to be used to link
        libraries for dynamic loading.  On some systems, it is 'ld'.
        On ELF systems, it should be $cc.  Mostly, we'll try to respect
        the hint file setting.

The problem is that we really need at least *three* variables, something
like the following:

Variable        description
cc              Compiler -- used to turn .c files into object files.
                (Usually cc or cl, or something like that.)
link            Linker, used to link object files (plus libraries) into
                an executable.  (Usually $cc on Unix-ish systems.  VMS and
                Win32 might use "Link". 
lib_ld          Tool used to build dynamically loadable libraries.  Often
                $cc on Unix-ish systems, but apparently sometimes it's ld.

For perl5, $Config{ld} is what I labeled lib_ld in the little table above.
Perl5's Configure/Makefile.SH build system incorrectly _assumes_ that 
linker=$cc.

One possible "fix" for now is to introduce these *three* variables into
parrot's Configure, and letting $c{linker} default to $c{cc} for now,
unless overridden by a hints file.  The parrot Makefile would then call
(essentially)
        $(LINK) -o test_main
and HP/UX would work again.

-- 
    Andy Dougherty              [EMAIL PROTECTED]
    Dept. of Physics
    Lafayette College, Easton PA 18042

Reply via email to