Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Small perl task for the interested
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Dan Sugalski  
View profile  
 More options Jun 26 2003, 2:48 pm
Newsgroups: perl.perl6.internals
From: d...@sidhe.org (Dan Sugalski)
Date: Thu, 26 Jun 2003 10:09:49 -0400
Local: Thurs, Jun 26 2003 10:09 am
Subject: Small perl task for the interested
Since folks are at times looking for something small and not mind
warping to dive into...

We could really use the capability of specifying per-C-file flags in
the make procedure, something that can be built into Configure. Right
now we build without optimizations on, which is fine, but I'd like to
turn them on in the future.

They can't be turned on unconditionally, since tsq.c *can't* have any
optimizations turned on for it. (That's the thread-safe queue module,
something that is annoyingly execution-order-dependent because it has
to operate safely as interrupt code potentially interrupting itself
as non-interrupt code) And, if Perl 5 is any guide (and I think it
is) there will be some platform/compiler combinations that won't be
able to compile one or more source modules with the highest
optimization level, but will be able to manage with a lower one.

So... Configure.pl needs to be able to build a makefile that has
per-C-file flags, and those flags need to be overridable per-file at
configure time by the platform configuration module.

Any takers? :)
--
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
d...@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Robins  
View profile  
 More options Jun 26 2003, 3:00 pm
Newsgroups: perl.perl6.internals
From: dbrob...@davidrobins.net (David Robins)
Date: Thu, 26 Jun 2003 12:57:57 -0400 (EDT)
Local: Thurs, Jun 26 2003 12:57 pm
Subject: Re: Small perl task for the interested

> So... Configure.pl needs to be able to build a makefile that has
> per-C-file flags, and those flags need to be overridable per-file at
> configure time by the platform configuration module.

Does the makefile need to be a typical 'make' makefile or is an all-perl
solution viable?

--
Dave
Isa. 40:31


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Sugalski  
View profile  
 More options Jun 29 2003, 1:00 pm
Newsgroups: perl.perl6.internals
From: d...@sidhe.org (Dan Sugalski)
Date: Sun, 29 Jun 2003 12:44:59 -0400
Local: Sun, Jun 29 2003 12:44 pm
Subject: Re: Small perl task for the interested
At 12:57 PM -0400 6/26/03, David Robins wrote:

>  > So... Configure.pl needs to be able to build a makefile that has
>>  per-C-file flags, and those flags need to be overridable per-file at
>>  configure time by the platform configuration module.

>Does the makefile need to be a typical 'make' makefile or is an all-perl
>solution viable?

After three or four false starts... I don't really care. Right now
we're generating makefiles because they're relatively easy, and at
some point we're going to want a two stage build (one platform-native
script, the other some combination of the languages parrot can
compile to bytecode from) but in the interim, well, if you're
interested in redoing it all from makefiles, go for it.

The only thing I ask, and I won't check in without it, is that either
the resulting build script or the config system that generates the
script be adequately understandable, so we can maintain the thing.
--
                                         Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
d...@sidhe.org                         have teddy bears and even
                                       teddy bears get drunk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lars Balker Rasmussen  
View profile  
 More options Jul 14 2003, 7:00 am
Newsgroups: perl.perl6.internals
From: l...@balker.org (Lars Balker Rasmussen)
Date: Mon, 14 Jul 2003 12:48:03 +0200
Local: Mon, Jul 14 2003 6:48 am
Subject: Re: Small perl task for the interested

I've taken this very simple approach to the problem.  A perl-wrapper
for the CC lines in makefiles/root.in

    .c$(O) :
        $(PERL) tools/dev/cc_flags.pl $(CC) $(CFLAGS) ${cc_o_out}$@ -c $<

that takes a rules-based approach to removing or adding options to the
command-line, based on the filename of the .c-file.  This gives some
overhead while building, but it keeps the complexity of the solution
down a lot.

Right now, the configure system has nothing to do with it, but it'd be
fairly simple to make it write a file like following example:

----------------------------------------------------------------------
# File: CFLAGS
# [ filename | {regex} ] -{removed option} +{added option} ...
spf_render.c -{-Wformat-nonliteral}
{^core} +{-O3}
----------------------------------------------------------------------

What're peoples opinion?

Script:
----------------------------------------------------------------------
#!/usr/bin/perl -w

use strict;

if (open F, "CFLAGS") {
    my @options;

    while (<F>) {
        chomp;
        s/#.*//;
        next unless /\S/;

        my $regex;
        if (s/^\{(.+?)\}\s*//) {
            $regex = qr/$1/;
        }
        elsif (s/^(\S+)\s*//) {
            $regex = qr/^\Q$1\E$/;
        }
        else {
            die "syntax error in CFLAGS: line $., $_\n";
        }

        while (s/^([-+])\{(.+?)\}\s*//) {
            push @options, [ $regex, $1, $2 ];
        }

        if (/\S/) {
            die "syntax error in CFLAGS: line $., $_\n";
        }
    }

    my ($cfile) = grep /\.c$/, @ARGV;

    foreach my $option (@options) {
        if ($cfile =~ $option->[0]) {
            if ($option->[1] eq '+') {
                splice @ARGV, 1, 0, $option->[2];
            }
            else {
                @ARGV = grep { $_ ne $option->[2] } @ARGV;
            }
        }
    }

}

print "@ARGV\n";
exec @ARGV;
__END__

Cheers,
--
Lars Balker Rasmussen                                      Consult::Perl


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "config/inter/progs.pl weirdness" by Lars Balker Rasmussen
Lars Balker Rasmussen  
View profile  
 More options Jul 16 2003, 3:48 pm
Newsgroups: perl.perl6.internals
From: l...@balker.org (Lars Balker Rasmussen)
Date: Wed, 16 Jul 2003 21:27:52 +0200
Local: Wed, Jul 16 2003 3:27 pm
Subject: config/inter/progs.pl weirdness
Found this pecularity in config/inter/progs.pl.  

The lines should probably just be removed (as well as lex/bison in
@args and elsewhere), since $yacc/$lex are specifically handled above,
but I wasn't sure what the intended purpose was.

Anyway, giving --lex or --yacc arguments to Configure.pl will break
the build-process with these.

  $cc_warn=$args{lex}     if defined $args{lex};
  $cc_warn=$args{yacc}    if defined $args{yacc};

Cheers,
--
Lars Balker Rasmussen                                      Consult::Perl


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Small perl task for the interested" by Josh Wilmes
Josh Wilmes  
View profile  
 More options Jul 18 2003, 10:00 pm
Newsgroups: perl.perl6.internals
From: j...@hitchhiker.org (Josh Wilmes)
Date: Fri, 18 Jul 2003 21:49:59 -0400
Local: Fri, Jul 18 2003 9:49 pm
Subject: Re: Small perl task for the interested

At 12:48 on 07/14/2003 +0200, Lars Balker Rasmussen <l...@balker.org> wrote:

> I've taken this very simple approach to the problem.  A perl-wrapper
> for the CC lines in makefiles/root.in

>     .c$(O) :
>    $(PERL) tools/dev/cc_flags.pl $(CC) $(CFLAGS) ${cc_o_out}$@ -c $<

I would go a bit further, and create a tools/build/compile, tools/build/
link_executable, tools/build/link_library, etc.

Take all the flags out of the makefile altogether.  Just a thought.

--Josh


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Benjamin Goldberg  
View profile  
 More options Jul 19 2003, 6:48 pm
Newsgroups: perl.perl6.internals
From: ben.goldb...@hotpop.com (Benjamin Goldberg)
Date: Sat, 19 Jul 2003 18:45:43 -0400
Local: Sat, Jul 19 2003 6:45 pm
Subject: Re: Small perl task for the interested

Josh Wilmes wrote:

> At 12:48 on 07/14/2003 +0200, Lars Balker Rasmussen <l...@balker.org> wrote:

> > I've taken this very simple approach to the problem.  A perl-wrapper
> > for the CC lines in makefiles/root.in

> >     .c$(O) :
> >       $(PERL) tools/dev/cc_flags.pl $(CC) $(CFLAGS) ${cc_o_out}$@ -c $<

> I would go a bit further, and create a tools/build/compile, tools/build/
> link_executable, tools/build/link_library, etc.

That would be silly.  Instead, specify the file to read the flags from
as the first argument to cc_flags.pl.  That is, change:

   if (open F, "CFLAGS") {

To:

   if (open F, shift @ARGV) {

Then:

c$(O) :
        $(PERL) tools/dev/flags.pl CFLAGS $(CC) $(CFLAGS) \
                ${cc_o_out}$@ -c $<

And for linking, flags.pl gets an argument of LINKFLAGS, and for making
a shared library, it gets an argument of SHAREFLAGS, etc..  In each of
those files are rules for the per-file flags for that type of step.

> Take all the flags out of the makefile altogether.  Just a thought.

> --Josh

--
$a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca
);{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "$@[$a%6
]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Josh Wilmes  
View profile  
 More options Jul 19 2003, 9:48 pm
Newsgroups: perl.perl6.internals
From: j...@hitchhiker.org (Josh Wilmes)
Date: Sat, 19 Jul 2003 21:38:26 -0400
Local: Sat, Jul 19 2003 9:38 pm
Subject: Re: Small perl task for the interested

I think you miss the point.   It's not just about flags.  It's about how
you do a particular task, which could involve one or more commands (or be
impossible).

See libtool for an idea of the size of the problem.

--Josh  

At 18:45 on 07/19/2003 EDT, Benjamin Goldberg <ben.goldb...@hotpop.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Lars Balker Rasmussen  
View profile  
 More options Jul 21 2003, 5:48 pm
Newsgroups: perl.perl6.internals
From: l...@balker.org (Lars Balker Rasmussen)
Date: Mon, 21 Jul 2003 23:21:00 +0200
Subject: Re: Small perl task for the interested

Josh Wilmes <j...@hitchhiker.org> wrote:
>>     .c$(O) :
>>        $(PERL) tools/dev/cc_flags.pl $(CC) $(CFLAGS) ${cc_o_out}$@ -c $<

> I would go a bit further, and create a tools/build/compile, tools/build/
> link_executable, tools/build/link_library, etc.

> Take all the flags out of the makefile altogether.  Just a thought.

It's a good idea, though the correct approach would be to return to
only using a modified version of make.pl - but it's a lot more work
than merely extending the current system.  For now, I've focused only
on the requirements Dan had.

The suggestion by Benjamin Goldberg was already in the patch already
committed.  Modifying the link-step the way Benjamin suggests is
trivial, although I suggest we wait until the need arises.

Cheers,
--
Lars Balker Rasmussen                                      Consult::Perl


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gordon Henriksen  
View profile  
 More options Jul 25 2003, 8:48 am
Newsgroups: perl.perl6.internals
From: malic...@mac.com (Gordon Henriksen)
Date: Fri, 25 Jul 2003 08:29:43 -0400
Local: Fri, Jul 25 2003 8:29 am
Subject: Re: Small perl task for the interested

On Friday, July 18, 2003, at 09:49 , Josh Wilmes wrote:
> At 12:48 on 07/14/2003 +0200, Lars Balker Rasmussen <l...@balker.org>
> wrote:

>> I've taken this very simple approach to the problem.  A
>> perl-wrapperfor the CC lines in makefiles/root.in

>>     .c$(O) :
>>        $(PERL) tools/dev/cc_flags.pl $(CC) $(CFLAGS) ${cc_o_out}$@ -c $<

> I would go a bit further, and create a tools/build/compile,
> tools/build/link_executable, tools/build/link_library, etc.

> Take all the flags out of the makefile altogether.  Just a thought.

qmail's build process does this. It's heart-breakingly beautiful;
Makefiles suddenly start to work like they should.


Gordon Henriksen
malic...@mac.com


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »