Andy Dougherty wrote:
On Tue, 23 Jun 2009, Jeff Horwitz wrote:

On Mon, 22 Jun 2009, James E Keenan wrote:

Since jhorwitz asked me about this just now at YAPC|10 Parrot BOF, a data
point:

./parrot_config --dump | grep '$('
[snip]
libparrot => '$(LIBPARROT_SHARED)'
libparrot_shared => 'libparrot$(SHARE_EXT).$(SOVERSION)'
libparrot_shared_alias => 'libparrot$(SHARE_EXT)'
libparrot_soname => '-Wl,-soname=libparrot$(SHARE_EXT).$(SOVERSION)'
[snip]

The remaining ones (libparrot, libparrot_shared, libparrot_shared_alias,
and libparrot_soname) look to me as if they can (and should) simply be
expanded by Configure.pl in the first place.


Let me see if I understand what expansion by Configure.pl would entail.

Let's look at just one of these Make variables:  $(SHARE_EXT)

grepping the config/ directory, I get:

$ fns config | xargs grep -n share_ext
config/init/hints/darwin.pm:49:        share_ext           => '.dylib',
config/init/hints/darwin.pm:71:            . $conf->data->get('share_ext')
config/init/hints/mswin32.pm:75:            share_ext  => '.dll',
config/init/hints/mswin32.pm:129:            share_ext  => '.dll',
config/init/hints/mswin32.pm:171:            share_ext => '.dll',
config/init/defaults.pm:139: share_ext => ".$Config{so}", # shared library extension
config/gen/makefiles/root.in:125:SHARE_EXT        := @share_ext@
config/gen/config_pm/myconfig.in:16: share_ext='@share_ext@', ld_share_flags='@ld_share_flags@', config/gen/config_h/config_h.in:26:#define PARROT_SHARE_EXT "@share_ext@"

I interpret this to mean:
1. Our old nemesis, the %Config associated with the Perl 5 used to invoke Configure.pl, is consulted by init::defaults to define 'share_ext'. 2. On 2 OSes, darwin and mswin32, this is overridden by their respective init::hints files. 3. The content of 'share_ext' in the Parrot::Configure object is then assigned or used, in configuration step order:
a.  as the value of PARROT_SHARE_EXT in the gen::config_h template;
b.  as the value of SHARE_EXT in the gen::makefiles root template;
c.  as the value of share_ext in the gen::config_pm myconfig template.

To further partialize the problem, let's consider only (3a) above. It seems to me that instead of having a line in the template file config_h.in which, in effect, hands the interpolation of 'share_ext' over to 'make', what we need to do is to somehow have gen::config_h write that one particular line in config.h.

Am I on the right track? Messing with those makefile templates doesn't seem very elegant or maintainable to me, at first glance.

kid51


_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to