You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modules-dev@httpd.apache.org by Mike Meyer <mw...@mired.org> on 2010/09/23 04:08:17 UTC

Maintaining modules.mk for modules with multiple sources...

I'm working on a module whose source is spread across multiple
files. About the time I was adding the seventh file's .lo & .slo, I
decided "The computer should be doing this", and did what I thought
was a standard make hack:

C_FILES=merchant_mod.c ...
LO_FILES=${C_FILES:%.c=%.lo}
SLO_FILES=${C_FILES:%.c=%.slo}

in my Makefile, and

mod_merchant.1a: ${SLO_FILES}
	$(SH_LINK) -rpath $(libexecdir) -modules -avoid-version ${LO_FILES}

in the modules.mk.

Trouble is, it doesn't run the compile step for the files, but goes
straight to trying to link the .lo's together, which doesn't work all
that well.

I'm building against apache httpd 2.2 on Freebsd 8.1-RELEASE and
OpenSolaris snv_134, as I need to run on both.

Searching google doesn't turn up much on this, and the modules in the
apache source tree all seem to just list all the files, rather than
trying to generate them automatically.

Anyone got a hint as to why this doesn't work, and what I should do to
fix it? Or maybe another way to deal with modules with multiple source
files that doesn't involve having to add each file suffix in three
different places?

      Thanks,
      <mike
-- 
Mike Meyer <mw...@mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Re: Maintaining modules.mk for modules with multiple sources... (solved)

Posted by Mike Meyer <mw...@mired.org>.
On Wed, 22 Sep 2010 22:08:17 -0400
Mike Meyer <mw...@mired.org> wrote:

> I'm working on a module whose source is spread across multiple
> files. About the time I was adding the seventh file's .lo & .slo, I
> decided "The computer should be doing this", and did what I thought
> was a standard make hack:
> 
> C_FILES=merchant_mod.c ...
> LO_FILES=${C_FILES:%.c=%.lo}
> SLO_FILES=${C_FILES:%.c=%.slo}
> 
> in my Makefile, and
> 
> mod_merchant.1a: ${SLO_FILES}
> 	$(SH_LINK) -rpath $(libexecdir) -modules -avoid-version ${LO_FILES}
> 
> in the modules.mk.
> 
> Trouble is, it doesn't run the compile step for the files, but goes
> straight to trying to link the .lo's together, which doesn't work all
> that well.
> 
> I'm building against apache httpd 2.2 on Freebsd 8.1-RELEASE and
> OpenSolaris snv_134, as I need to run on both.

For the search engines:

The problem was that the variables have to be set when the include
files are processed. So the lines setting all my file names has to
occur before the lines:

builddir=.
top_srcdir=...
top_builddir=...
include .../build/special.mk

Otherwise, they aren't set, so the .la files don't have an
dependencies, so nothing gets compiled, and so on.

     <mike
-- 
Mike Meyer <mw...@mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Re: Maintaining modules.mk for modules with multiple sources...

Posted by Mike Meyer <mw...@mired.org>.
On Thu, 23 Sep 2010 13:23:12 +1000
Andrew Punch <an...@247realmedia.com> wrote:

> Hi,
> 
> I recently had a similar problem. What rules do you have for
> compiling .c into .lo/.slo (or into .lo/.slo via .o)?

Whatever is dragged in

> Does the makefile work correctly if you manually enter the filenames. 
> i.e:
> C_FILES=merchant_mod.c ...
> LO_FILES=merchange_mod.lo ...
> SLO_FILES=merchant_mod.slo ...

No, it doesn't, which is even odder. Then again, given that I verified
that the variables had the correct values, it's expected.

     Thanks,
     <mike
-- 
Mike Meyer <mw...@mired.org>		http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

Re: Maintaining modules.mk for modules with multiple sources...

Posted by Andrew Punch <an...@247realmedia.com>.
Hi,

I recently had a similar problem. What rules do you have for
compiling .c into .lo/.slo (or into .lo/.slo via .o)?

Does the makefile work correctly if you manually enter the filenames. 
i.e:
C_FILES=merchant_mod.c ...
LO_FILES=merchange_mod.lo ...
SLO_FILES=merchant_mod.slo ...

-Andrew

On Thu, 2010-09-23 at 02:08 +0000, Mike Meyer wrote:
> I'm working on a module whose source is spread across multiple
> files. About the time I was adding the seventh file's .lo & .slo, I
> decided "The computer should be doing this", and did what I thought
> was a standard make hack:
> 
> C_FILES=merchant_mod.c ...
> LO_FILES=${C_FILES:%.c=%.lo}
> SLO_FILES=${C_FILES:%.c=%.slo}
> 
> in my Makefile, and
> 
> mod_merchant.1a: ${SLO_FILES}
> 	$(SH_LINK) -rpath $(libexecdir) -modules -avoid-version ${LO_FILES}
> 
> in the modules.mk.
> 
> Trouble is, it doesn't run the compile step for the files, but goes
> straight to trying to link the .lo's together, which doesn't work all
> that well.
> 
> I'm building against apache httpd 2.2 on Freebsd 8.1-RELEASE and
> OpenSolaris snv_134, as I need to run on both.
> 
> Searching google doesn't turn up much on this, and the modules in the
> apache source tree all seem to just list all the files, rather than
> trying to generate them automatically.
> 
> Anyone got a hint as to why this doesn't work, and what I should do to
> fix it? Or maybe another way to deal with modules with multiple source
> files that doesn't involve having to add each file suffix in three
> different places?
> 
>       Thanks,
>       <mike