List Info

Thread: Broken APXS




Broken APXS
country flaguser name
Poland
2007-07-22 02:53:00
Greetings.

apxs accepts only *.c files as its input. For other
extensions it
doesn't invoke libtool in compile mode and several different
issues
leading to empty Apache module creation. The most probably
reason is
poor regex design.
We've been having a nice discussion on modules-dev about
fixing apxs and
finally I decided to write a note here.

Here's what we found we think is poor and needs a fix:

//---------------------------------------------------------
around line 350
>     foreach $f (args) {
>         if ($f =~ m|.c$|) {  <----------------
Here, bad
>         coder! BAD!
>             push(srcs, $f);
>         }
>         else {
>             push(objs, $f);
>         }
>     }
//---------------------------------------------------------

around line 400
> foreach $s (srcs) {
>	my $slo = $s;
>	$slo =~ s|.c$|.slo|;
>	my $lo = $s;
>	$lo =~ s|.c$|.lo|;
>	my $la = $s;
>	$la =~ s|.c$|.la|;
>	my $o = $s;
>	$o =~ s|.c$|.o|; 
//---------------------------------------------------------

Where could I find current apxs maintainter?

Kind regards.

Re: Broken APXS
country flaguser name
United States
2007-07-22 02:59:02
Mike wrote:
> 
> Where could I find current apxs maintainter?

Apache projects don't have component-maintainers the way you
might
find in bsd and similar hierarchical organizations.

The good news is, you found the right place to bring this
up.

Bill

Re: Broken APXS
user name
2007-07-22 08:18:49
On 7/22/07, Mike <dykciarzgmail.com> wrote:
> Greetings.
>
> apxs accepts only *.c files as its input. For other
extensions it
> doesn't invoke libtool in compile mode and several
different issues
> leading to empty Apache module creation. The most
probably reason is
> poor regex design.

This kind of invocation: $ apxs -cia mod_cpp.cpp other.C

Seems to behave better w/ the patch below:

http:
//people.apache.org/~covener/apxs-cpp.diff

| libtool --silent --mode=compile -c -o mod_cpp.lo
mod_cpp.cpp
| libtool --silent --mode=compile -c -o other.lo other.C
| libtool --silent --mode=link gcc -o mod_cpp.la ... 
other.lo mod_cpp.lo


-- 
Eric Covener
covenergmail.com

Re: Broken APXS
user name
2007-07-22 08:32:21
On Sun, 22 Jul 2007 09:18:49 -0400
"Eric Covener" <covenergmail.com> wrote:


> Seems to behave better w/ the patch below:
> 
> http:
//people.apache.org/~covener/apxs-cpp.diff

.cxx?  Modules in other languages?
How about adding an environment variable?  Something like:

-    my $srcs_regex = '.(' . join('|', srcs_extensions) . ')$';
+    my $srcs_regex = $ENV{'APXS_SRC_EXT'}
+                     ? "." .
$ENV{'APXS_SRC_EXT'} . "$"
+                     : '.(' . join('|', srcs_extensions) . ')$';

-- 
Nick Kew

Application Development with Apache - the Apache Modules
Book
http://www.apachetutor.or
g/

Re: Broken APXS
country flaguser name
Poland
2007-07-22 08:37:48
On Sun, Jul 22, 2007 at 09:18:49AM -0400, Eric Covener
wrote:
>> apxs accepts only *.c files as its input. For other
extensions it
>> doesn't invoke libtool in compile mode and several
different issues
>> leading to empty Apache module creation. The most
probably reason is
>> poor regex design.
> 
>  This kind of invocation: $ apxs -cia mod_cpp.cpp
other.C
> 
>  Seems to behave better w/ the patch below:
> 
>  http:
//people.apache.org/~covener/apxs-cpp.diff
> 
>  | libtool --silent --mode=compile -c -o mod_cpp.lo
mod_cpp.cpp
>  | libtool --silent --mode=compile -c -o other.lo
other.C
>  | libtool --silent --mode=link gcc -o mod_cpp.la ... 
other.lo mod_cpp.lo
Good. Also including this in next Apache release would be
good idea.
Kind regards.

Re: Broken APXS
country flaguser name
Poland
2007-07-22 08:37:48
On Sun, Jul 22, 2007 at 09:18:49AM -0400, Eric Covener
wrote:
>> apxs accepts only *.c files as its input. For other
extensions it
>> doesn't invoke libtool in compile mode and several
different issues
>> leading to empty Apache module creation. The most
probably reason is
>> poor regex design.
> 
>  This kind of invocation: $ apxs -cia mod_cpp.cpp
other.C
> 
>  Seems to behave better w/ the patch below:
> 
>  http:
//people.apache.org/~covener/apxs-cpp.diff
> 
>  | libtool --silent --mode=compile -c -o mod_cpp.lo
mod_cpp.cpp
>  | libtool --silent --mode=compile -c -o other.lo
other.C
>  | libtool --silent --mode=link gcc -o mod_cpp.la ... 
other.lo mod_cpp.lo
Good. Also including this in next Apache release would be
good idea.
Kind regards.

Re: Broken APXS
country flaguser name
Poland
2007-07-22 08:40:18
On Sun, Jul 22, 2007 at 02:32:21PM +0100, Nick Kew wrote:
> .cxx?  Modules in other languages?
Every shared-lib-compilable language (e. g. C++).

> How about adding an environment variable?  Something
like:
> 
> -    my $srcs_regex = '.(' . join('|', srcs_extensions) . ')$';
> +    my $srcs_regex = $ENV{'APXS_SRC_EXT'}
> +                     ? "." .
$ENV{'APXS_SRC_EXT'} . "$"
> +                     : '.(' . join('|', srcs_extensions) . ')$';
Fixed extension is a bad idea. Sometimes ppl might have *.c
and
*.cxx/*.cpp files together.
Kind regards.

Re: Broken APXS
country flaguser name
Poland
2007-07-22 08:40:18
On Sun, Jul 22, 2007 at 02:32:21PM +0100, Nick Kew wrote:
> .cxx?  Modules in other languages?
Every shared-lib-compilable language (e. g. C++).

> How about adding an environment variable?  Something
like:
> 
> -    my $srcs_regex = '.(' . join('|', srcs_extensions) . ')$';
> +    my $srcs_regex = $ENV{'APXS_SRC_EXT'}
> +                     ? "." .
$ENV{'APXS_SRC_EXT'} . "$"
> +                     : '.(' . join('|', srcs_extensions) . ')$';
Fixed extension is a bad idea. Sometimes ppl might have *.c
and
*.cxx/*.cpp files together.
Kind regards.

Re: Broken APXS
user name
2007-07-22 09:02:14
On 7/22/07, Nick Kew <nickwebthing.com> wrote:
> On Sun, 22 Jul 2007 09:18:49 -0400
> "Eric Covener" <covenergmail.com> wrote:
>
>
> > Seems to behave better w/ the patch below:
> >
> > http:
//people.apache.org/~covener/apxs-cpp.diff
>
> .cxx?  Modules in other languages?
> How about adding an environment variable?  Something
like:
>
> -    my $srcs_regex = '.(' . join('|', srcs_extensions) . ')$';
> +    my $srcs_regex = $ENV{'APXS_SRC_EXT'}
> +                     ? "." .
$ENV{'APXS_SRC_EXT'} . "$"
> +                     : '.(' . join('|', srcs_extensions) . ')$';
>

How about opt_E to prepend (unshift) additional source
extensions?

(will add cxx too)

-- 
Eric Covener
covenergmail.com

Re: Broken APXS
country flaguser name
United States
2007-07-22 09:33:39
Eric Covener wrote:
> On 7/22/07, Nick Kew <nickwebthing.com> wrote:
>> On Sun, 22 Jul 2007 09:18:49 -0400
>> "Eric Covener" <covenergmail.com> wrote:
>>
>> > Seems to behave better w/ the patch below:
>> >
>> > http:
//people.apache.org/~covener/apxs-cpp.diff
>>
>> .cxx?  Modules in other languages?
>> How about adding an environment variable?
> 
> How about opt_E to prepend (unshift) additional
source extensions?

My suggestion on modules-dev was to focus on the object and
lib extensions,
a very short list that are usually acceptable to ld/libtool,
and then having
the assumption that others are source files.  Right now, we
pick up all known
source extensions, and assume any others are objects or
libs.

In conjunction with Eric's patch above, it seems like a more
comprehensive
fix.

Bill

[1-10] [11-12]

about | contact  Other archives ( Real Estate discussion Medical topics )