Specifying a different target directory for APXS

2007-12-13 Thread Subra A Narayanan
Hello folks,

I use the following command to compile my apache module:

*/usr/sbin/apxs -c mod_my.c*


this creates a *.libs/* folder and my mod_my.so file is generated in that
folder.

My question is, is it possible to specify a different target folder for my
.so file?

I have gone through the man page for apxs and wasn't able to find anything.


thanks in advance,
Subra


Re: Specifying a different target directory for APXS

2007-12-14 Thread Subra A Narayanan
Hello folks,

Has anyone come across a similar situation before? Can a target folder be
specified or is that not possible?

Any help is greatly appreciated.

Subra

On Dec 13, 2007 12:05 PM, Subra A Narayanan <[EMAIL PROTECTED]> wrote:

> Hello folks,
>
> I use the following command to compile my apache module:
>
> */usr/sbin/apxs -c mod_my.c*
>
>
> this creates a *.libs/* folder and my mod_my.so file is generated in that
> folder.
>
> My question is, is it possible to specify a different target folder for my
> .so file?
>
> I have gone through the man page for apxs and wasn't able to find
> anything.
>
>
> thanks in advance,
> Subra
>


Re: Specifying a different target directory for APXS

2007-12-14 Thread Subra A Narayanan
Joe,

Thanks for ur response.

The reason I wanted to change the target directory was because my apache
module is being compiled as one of the components of a much larger makefile.
All the other shared libraries generated by this make file, are copied in a
particular directory and hence I wanted my apache module to go in to that
directory as well. As you suggested, I could copy the .so file to whatever
directory I want later on, but I am not sure if such copying ig generally
done in a makefile.

I did try to directly use gcc to compile my apache module so that I could
specify any target directory but ran in to another issue which is detailed
here =>
http://mail-archives.apache.org/mod_mbox/httpd-modules-dev/200711.mbox/[EMAIL 
PROTECTED]

I didnt receive any helpful responses to that posting thats why I am trying
to use apxs.

Would you care to take a look at this issue =>
http://mail-archives.apache.org/mod_mbox/httpd-modules-dev/200711.mbox/[EMAIL 
PROTECTED]


Thanks so much!

Subra

On Dec 14, 2007 9:27 AM, Joe Lewis <[EMAIL PROTECTED]> wrote:

> Subra A Narayanan wrote:
> > Hello folks,
> >
> > Has anyone come across a similar situation before? Can a target folder
> be
> > specified or is that not possible?
> >
> > Any help is greatly appreciated.
> >
> > Subra
> >
>
> The .libs directory is specified by the libtool command, not by the apxs
> tool.  However, this is probably not what you really want.  Perhaps
> running an apxs -i command to INSTALL the module.
>
> Your apxs -c command is merely compiling the module.  The apxs -i
> command installs the module into the appropriate apache directory
> (configured when you compiled apache the first time [if RPM, when the
> RPM was built]).
>
> If you really must change the directory, then you can manually edit the
> file specified by the `apr-config --apr-libtool` command, and change the
> objdir parameter.  But, don't ask us for any help if this causes your
> system to no longer compile apache or apache modules (or even run apache
> or compile other processes that require the libtool command, or things
> to blow up).  No one in their right mind is going to touch that.
>
> It is easy enough to copy the .so file to where you need it once (unless
> you are installing it, then it's easy enough to just use a -i parameter
> to apxs to install the module).
>
> Good luck,
> Joe
> --
> Joseph Lewis 
> "Divide the fire, and you will sooner put it out." - Publius Syrus
>


Re: Specifying a different target directory for APXS

2007-12-14 Thread Joe Lewis
Subra A Narayanan wrote:
> I didnt receive any helpful responses to that posting thats why I am trying
> to use apxs.
>   

You DID get helpful responses - I was one of those responders who said
to use apxs.  (We pointed you to the tool because there are too many
changes across systems, platforms, etc, that it is faster, more
efficient, and better quality to use a tool that also makes the end
result more portable - go figure).

> Would you care to take a look at this issue =>
> http://mail-archives.apache.org/mod_mbox/httpd-modules-dev/200711.mbox/[EMAIL 
> PROTECTED]
>   

We need no more discussion on that - use apxs.  If you need a Makefile,
use the apxs tool in your Makefile.  (It IS possible, after all.)  For
example, Makefile rules might look like :

mod_test.so:
apxs -c mod_test.so
cp .libs/mod_test.so path/to/mod_test.so

install:
apxs -n mod_test -i mod_test.la

That is how I have done all of my modules.  It's easier to type "make
install" rather than "apxs -i -a -c mod_test.c".  If you think you need
help in your makefile, go to google, and type in "makefile".  Just
copying a makefile from another package seriously limits your capabilities.

Joe
-- 
Joseph Lewis 
"Divide the fire, and you will sooner put it out." - Publius Syrus


Re: Specifying a different target directory for APXS

2007-12-14 Thread Subra A Narayanan
Joe,

Thanks for ur reply.

Let me clarify somethingWhen I said I didnt get any helpful responses, I
meant I didn't get any answers as to what is wrong with gcc and why the
module was behaving the way it was.

Anywayspoint taken.will use apxs for compiling the module.

Subra

On Dec 14, 2007 12:12 PM, Joe Lewis <[EMAIL PROTECTED]> wrote:

> Subra A Narayanan wrote:
> > I didnt receive any helpful responses to that posting thats why I am
> trying
> > to use apxs.
> >
>
> You DID get helpful responses - I was one of those responders who said
> to use apxs.  (We pointed you to the tool because there are too many
> changes across systems, platforms, etc, that it is faster, more
> efficient, and better quality to use a tool that also makes the end
> result more portable - go figure).
>
> > Would you care to take a look at this issue =>
> >
> http://mail-archives.apache.org/mod_mbox/httpd-modules-dev/200711.mbox/[EMAIL 
> PROTECTED]
> >
>
> We need no more discussion on that - use apxs.  If you need a Makefile,
> use the apxs tool in your Makefile.  (It IS possible, after all.)  For
> example, Makefile rules might look like :
>
> mod_test.so:
>apxs -c mod_test.so
>cp .libs/mod_test.so path/to/mod_test.so
>
> install:
>apxs -n mod_test -i mod_test.la
>
> That is how I have done all of my modules.  It's easier to type "make
> install" rather than "apxs -i -a -c mod_test.c".  If you think you need
> help in your makefile, go to google, and type in "makefile".  Just
> copying a makefile from another package seriously limits your
> capabilities.
>
> Joe
> --
> Joseph Lewis 
> "Divide the fire, and you will sooner put it out." - Publius Syrus
>


Re: Specifying a different target directory for APXS

2007-12-14 Thread Ralf Mattes
On Fri, 2007-12-14 at 08:07 -0500, Subra A Narayanan wrote:
> Hello folks,

Hello folk,

your "problem" has nothing to do with apxs. The .libs directory is
created by libtool. You might want to contact the helpful dwellers on
the libtool mailing list.

> Has anyone come across a similar situation before? Can a target folder be
> specified or is that not possible?

Never needed to change that part of the build process. 

HTT Ralf Mattes

> Any help is greatly appreciated.
> 
> Subra
> 
> On Dec 13, 2007 12:05 PM, Subra A Narayanan <[EMAIL PROTECTED]> wrote:
> 
> > Hello folks,
> >
> > I use the following command to compile my apache module:
> >
> > */usr/sbin/apxs -c mod_my.c*
> >
> >
> > this creates a *.libs/* folder and my mod_my.so file is generated in that
> > folder.
> >
> > My question is, is it possible to specify a different target folder for my
> > .so file?
> >
> > I have gone through the man page for apxs and wasn't able to find
> > anything.
> >
> >
> > thanks in advance,
> > Subra
> >



Re: Specifying a different target directory for APXS

2007-12-14 Thread Ralf Mattes
On Fri, 2007-12-14 at 11:05 -0500, Subra A Narayanan wrote:
> Joe,
> 
> Thanks for ur response.
> 
> The reason I wanted to change the target directory was because my apache
> module is being compiled as one of the components of a much larger makefile.
> All the other shared libraries generated by this make file, are copied in a
> particular directory and hence I wanted my apache module to go in to that
> directory as well. As you suggested, I could copy the .so file to whatever
> directory I want later on, but I am not sure if such copying ig generally
> done in a makefile.

That's the approach I would choose (I do for packaging my modules into
Debian packages). Why wouldn't you copy in a Makefile? Just add another
dependency:

your_very_Special_path/your_module.so: your_module.slo
cp .libs/your_module.so 
your_very_Special_path/your_module.so


> I did try to directly use gcc to compile my apache module so that I could
> specify any target directory but ran in to another issue which is detailed
> here =>
> http://mail-archives.apache.org/mod_mbox/httpd-modules-dev/200711.mbox/[EMAIL 
> PROTECTED]
> 
> I didnt receive any helpful responses to that posting thats why I am trying
> to use apxs.

I got the impression that everyone considered this a no-so-good
idea 

 HTH Ralf Mattes



Re: Specifying a different target directory for APXS

2007-12-14 Thread Joe Lewis
Subra A Narayanan wrote:
> Joe,
>
> Thanks for ur reply.
>
> Let me clarify somethingWhen I said I didnt get any helpful responses, I
> meant I didn't get any answers as to what is wrong with gcc and why the
> module was behaving the way it was.
>
> Anywayspoint taken.will use apxs for compiling the module.
>
> Subra
>   

Your -z initfirst, -fPIC and other flags may have been causing that. 
apxs is easier and faster.

Hopefully, that will work.

Joe
-- 
Joseph Lewis 
"Divide the fire, and you will sooner put it out." - Publius Syrus


Re: Specifying a different target directory for APXS

2007-12-14 Thread Subra A Narayanan
Ralf/Joe,

Now I am trying to (just) compile my module using apxs and I see this
warning

 *$ /usr/sbin/apxs -c -L /myprj/deps/axis2c/lib -L /myprj/lib/ -l
axutil -l axis2_engine -l dl -l pthread -l client -l operations -c
/myprj/obj/webservices/mod_my.o /myprj/obj/webservices/dispatcher.o
/myprj/obj/webservices/parserequest.o
/myprj/obj/webservices/response.o
/usr/lib/apr/build/libtool --silent --mode=link gcc -o
/myprj/obj/webservices/mod_my.la  -L /myprj/deps/axis2c/lib
-L/myprj/lib/ -laxutil -laxis2_engine -ldl -lpthread -lclient
-loperations -rpath /usr/lib/httpd/modules -module -avoid-version
/myprj/obj/webservices/mod_my.o /myprj/obj/webservices/dispatcher.o
/myprj/obj/webservices/parserequest.o
/myprj/obj/webservices/response.o

*** Warning: Linking the shared library
/myprj/obj/webservices/mod_my.la against the non-libtool
*** objects  /myprj/obj/webservices/mod_my.o
/myprj/obj/webservices/dispatcher.o
/myprj/obj/webservices/parserequest.o
/myprj/obj/webservices/response.o is not portable!*


Do you know what is causing this problem?

Thanks for all the responses!
Subra


On Dec 14, 2007 1:30 PM, Ralf Mattes <[EMAIL PROTECTED]> wrote:

> On Fri, 2007-12-14 at 11:05 -0500, Subra A Narayanan wrote:
> > Joe,
> >
> > Thanks for ur response.
> >
> > The reason I wanted to change the target directory was because my apache
> > module is being compiled as one of the components of a much larger
> makefile.
> > All the other shared libraries generated by this make file, are copied
> in a
> > particular directory and hence I wanted my apache module to go in to
> that
> > directory as well. As you suggested, I could copy the .so file to
> whatever
> > directory I want later on, but I am not sure if such copying ig
> generally
> > done in a makefile.
>
> That's the approach I would choose (I do for packaging my modules into
> Debian packages). Why wouldn't you copy in a Makefile? Just add another
> dependency:
>
> your_very_Special_path/your_module.so: your_module.slo
>cp .libs/your_module.so
> your_very_Special_path/your_module.so
>
>
> > I did try to directly use gcc to compile my apache module so that I
> could
> > specify any target directory but ran in to another issue which is
> detailed
> > here =>
> >
> http://mail-archives.apache.org/mod_mbox/httpd-modules-dev/200711.mbox/[EMAIL 
> PROTECTED]
> >
> > I didnt receive any helpful responses to that posting thats why I am
> trying
> > to use apxs.
>
> I got the impression that everyone considered this a no-so-good
> idea 
>
>  HTH Ralf Mattes
>
>


Re: Specifying a different target directory for APXS

2007-12-14 Thread Nick Kew
On Fri, 14 Dec 2007 16:57:28 -0500
"Subra A Narayanan" <[EMAIL PROTECTED]> wrote:

PLEASE LEARN TO POST!  In particular, don't append
someone else's post to yours.

> Now I am trying to (just) compile my module using apxs and I see this
> warning
> 
>  *$ /usr/sbin/apxs -c -L /myprj/deps/axis2c/lib -L /myprj/lib/ -l

Don't link that stuff in.  You're compiling a module, not the
kitchen sink.  Use LoadFile if you need extra libs.

> axutil -l axis2_engine -l dl -l pthread -l client -l operations -c

Some of those, like dl and pthread, should be accessed through APR.
Using them directly loses portability.

> /myprj/obj/webservices/mod_my.o /myprj/obj/webservices/dispatcher.o

Why have you called your source files [name].o?

-- 
Nick Kew

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