On Tue, 22 Jan 2008, jerry gay wrote:

> it's rather annoying that some variables in Parrot::Config::Generated
> contain make-related variable expansion values, and others contain
> literal values, and that it's impossible to tell by the variable name
> which type the value may be. however, changing that means changing
> configure and a bunch of makefiles and code generators, which is no
> small task, so it has remained undone.

Yes.  Having some expansions done by perl at Configure.pl time and others 
done by make at build time is just odd.

> i'm still not sure what the best short-term solution is. i suppose we
> need to add a new variable during configure time, with the expanded
> value of LIBPARROT in it. we could call it LIBPARROT_X (_X for
> expanded,) but i'd rather put a suffix on variables containing
> makefile variable expansions, because they're less-frequently used, in
> my opinion. i'm interested in what other folks think on this matter.

The immediate short-term culprit is this section in
config/inter/progs.pm:

    unless ( defined( $conf->data->get('libparrot_ldflags') ) ) {
        $conf->data->set(
            libparrot_ldflags => ($parrot_is_shared)
            ? '-L'
                . $conf->data->get('build_dir')
                . $conf->data->get('slash')
                . $conf->data->get('blib_dir')
                . ' -lparrot'
            : $conf->data->get('libparrot')
        );
    }

I'm not sure what this code ends up doing on Windows, but on traditional
Unix systems, at least, there's no reason for the two different code
paths here.  -L./blib/lib -lparrot works for either shared or static
libraries.  Changing it to the following simpler ought to improve things
for the moment.  Of course if the link order is still wrong, it still
might not actually work :-(.

--- parrot-current/config/inter/libparrot.pm    2008-01-12 03:15:10.000000000 
-0500
+++ parrot-andy/config/inter/libparrot.pm       2008-01-23 09:29:27.000000000 
-0500
@@ -72,14 +72,12 @@
     );
 
     unless ( defined( $conf->data->get('libparrot_ldflags') ) ) {
-        $conf->data->set(
-            libparrot_ldflags => ($parrot_is_shared)
-            ? '-L'
-                . $conf->data->get('build_dir')
-                . $conf->data->get('slash')
-                . $conf->data->get('blib_dir')
-                . ' -lparrot'
-            : $conf->data->get('libparrot')
+        $conf->data->set(libparrot_ldflags => 
+            '-L'
+            . $conf->data->get('build_dir')
+            . $conf->data->get('slash')
+            . $conf->data->get('blib_dir')
+            . ' -lparrot'
         );
     }
 
    

Slightly longer term, I'm not sure what this code is doing here at
all, nor why it is named 'ldflags' instead of 'linkflags'.  I'd have
thought this variable should be defined and initialized in the 'link'
section in config/init/defaults.pm.  (I tried hard there to carefully
distinguish $link from $ld, to avoid repeating a mistake I made with
perl5's Configure.)

-- 
    Andy Dougherty              [EMAIL PROTECTED]

Reply via email to