Re: APXS question
On 7/24/07, Graham Dumpleton [EMAIL PROTECTED] wrote: The problem is that I don't want apxs recompiling everything each time I make a change. I'm looking at something like 100 files in the total module. Still suggest doing the compilation of Apache specific files with apxs and link to others from library. or learn how to use libtool... Kind regards.
Re: APXS question
On 7/24/07, Tim Bray [EMAIL PROTECTED] wrote: or learn how to use libtool... How do you do that? I've been looking and having trouble finding TFM. Pointers appreciated. http://www.gnu.org/software/libtool/manual.html
APXS question
I'm trying to set up a makefile using apxs to compile and link a module and I'm running into a couple of problems. If I use the following command line: apxs -ic -S CC=g++ -n mod_fancy mod_fancy.cpp config.cpp everything works fine. In my makefile, I have the following (this is a partial): mod_fancy.so: mod_fancy.o config.o apxs -i -n mod_fancy mod_fancy.o config.o %.o : %.cpp apxs -S CC=g++ -c $ Now, when I try to run make, the compile works fine, but the final install doesn't work. Here's what I get: /usr/local/apache2/bin/apxs -i -n mod_fancy mod_fancy.o config.o /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' mod_fancy.o /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp mod_fancy.o /usr/local/apache2/modules/ cp mod_fancy.o /usr/local/apache2/modules/mod_fancy.o Warning! dlname not found in /usr/local/apache2/modules/mod_fancy.o. Assuming installing a .so rather than a libtool archive. chmod 755 /usr/local/apache2/modules/mod_fancy.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' config.o /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp config.o /usr/local/apache2/modules/ cp config.o /usr/local/apache2/modules/config.o Warning! dlname not found in /usr/local/apache2/modules/config.o. Assuming installing a .so rather than a libtool archive. chmod 755 /usr/local/apache2/modules/config.so chmod: /usr/local/apache2/modules/config.so: No such file or directory apxs:Error: Command failed with rc=65536 I've tried it by using different files (ie .slo and .lo files), but I get the same error. Any ideas? I'd really rather not have apxs recompiling every single file each time. Thanks. -- Farokh MCF Software...simply dependably engineered Developers of ListSTAR http://www.liststar.com/, MacRADIUS http://www.macradius.com/, Address List Sorter http://www.mcfsoftware.com/als/, SimpleText Filter for EIMS http://www.mcfsoftware.com/stf/ and Auto Reply plug-in for EIMS http://www.mcfsoftware.com/ar/.
Re: APXS question
On Sun, 2007-07-22 at 11:32 -0400, Farokh Irani wrote: I'm trying to set up a makefile using apxs to compile and link a module and I'm running into a couple of problems. If I use the following command line: apxs -ic -S CC=g++ -n mod_fancy mod_fancy.cpp config.cpp everything works fine. In my makefile, I have the following (this is a partial): mod_fancy.so: mod_fancy.o config.o apxs -i -n mod_fancy mod_fancy.o config.o Hmm - I see what you want to avoid, but the object files (as well as the shared object) are pretty much hidden from you (libtool the beast stuffs them into a '.lib' directory). There should be convenient '*.slo' file in your top level directory. %.o : %.cpp apxs -S CC=g++ -c $ Now, when I try to run make, the compile works fine, but the final install doesn't work. Here's what I get: /usr/local/apache2/bin/apxs -i -n mod_fancy mod_fancy.o config.o /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' mod_fancy.o /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp mod_fancy.o /usr/local/apache2/modules/ cp mod_fancy.o /usr/local/apache2/modules/mod_fancy.o Warning! dlname not found in /usr/local/apache2/modules/mod_fancy.o. Assuming installing a .so rather than a libtool archive. chmod 755 /usr/local/apache2/modules/mod_fancy.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' config.o /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp config.o /usr/local/apache2/modules/ cp config.o /usr/local/apache2/modules/config.o Warning! dlname not found in /usr/local/apache2/modules/config.o. Assuming installing a .so rather than a libtool archive. chmod 755 /usr/local/apache2/modules/config.so chmod: /usr/local/apache2/modules/config.so: No such file or directory apxs:Error: Command failed with rc=65536 I've tried it by using different files (ie .slo and .lo files), but I get the same error. You want to installthe '*.so' file from the '.libs' directory. But be careful: that name depends on the platform. Any ideas? I'd really rather not have apxs recompiling every single file each time. Does your compilation really take _that_ long. Looks like a severe case of premature Makefile optimization to me. Cheers, RalfD Thanks.
Re: APXS question
On 23/07/07, Farokh Irani [EMAIL PROTECTED] wrote: Farokh Irani wrote: apxs -i -n mod_fancy mod_fancy.o config.o You don't -i'nstall a .o file. It's not a loadable module. Loadable modules are the .so (.sl/.dll/.dylib) already-linked object files. I tried it with the .so files (apxs -i -n mod_fancy .libs/mod_fancy.so .libs/config.so) and got the same errors: /usr/local/apache2/bin/apxs -i -n mod_fancy .libs/mod_fancy.so .libs/config.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' .libs/mod_fancy.so /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp .libs/mod_fancy.so /usr/local/apache2/modules/ cp .libs/mod_fancy.so /usr/local/apache2/modules/mod_fancy.so Warning! dlname not found in /usr/local/apache2/modules/mod_fancy.so. Assuming installing a .so rather than a libtool archive. chmod 755 /usr/local/apache2/modules/mod_fancy.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' .libs/config.so /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp .libs/config.so /usr/local/apache2/modules/ cp .libs/config.so /usr/local/apache2/modules/config.so Warning! dlname not found in /usr/local/apache2/modules/config.so. Assuming installing a .so rather than a libtool archive. If using Apache 1.3, the magic you want is something like:: install : all $(APXS) -i -n 'mod_wsgi' mod_wsgi.so If using Apache 2.X, the magic you want is something like: install : all $(APXS) -i -n 'mod_wsgi' mod_wsgi.la That is presuming you are using your own Makefile for some reason. If using Makefile generated by apxs and which uses makefile rule system supplied by Apache, you wouldn't normally need to worry about it explicitly as it should do it the correct way. Graham
Re: APXS question
On 23/07/07, Graham Dumpleton [EMAIL PROTECTED] wrote: On 23/07/07, Farokh Irani [EMAIL PROTECTED] wrote: Farokh Irani wrote: apxs -i -n mod_fancy mod_fancy.o config.o You don't -i'nstall a .o file. It's not a loadable module. Loadable modules are the .so (.sl/.dll/.dylib) already-linked object files. I tried it with the .so files (apxs -i -n mod_fancy .libs/mod_fancy.so .libs/config.so) and got the same errors: /usr/local/apache2/bin/apxs -i -n mod_fancy .libs/mod_fancy.so .libs/config.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' .libs/mod_fancy.so /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp .libs/mod_fancy.so /usr/local/apache2/modules/ cp .libs/mod_fancy.so /usr/local/apache2/modules/mod_fancy.so Warning! dlname not found in /usr/local/apache2/modules/mod_fancy.so. Assuming installing a .so rather than a libtool archive. chmod 755 /usr/local/apache2/modules/mod_fancy.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' .libs/config.so /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp .libs/config.so /usr/local/apache2/modules/ cp .libs/config.so /usr/local/apache2/modules/config.so Warning! dlname not found in /usr/local/apache2/modules/config.so. Assuming installing a .so rather than a libtool archive. If using Apache 1.3, the magic you want is something like:: install : all $(APXS) -i -n 'mod_wsgi' mod_wsgi.so If using Apache 2.X, the magic you want is something like: install : all $(APXS) -i -n 'mod_wsgi' mod_wsgi.la That is presuming you are using your own Makefile for some reason. If using Makefile generated by apxs and which uses makefile rule system supplied by Apache, you wouldn't normally need to worry about it explicitly as it should do it the correct way. BTW, for the remainder of the configure/makefile system I use, see: http://modwsgi.googlecode.com/svn/trunk/mod_wsgi/ You'll possibly need to look at that to see what 'all' actually maps to on Apache 1.3 vs Apache 2.X as it needs to be different as well. Graham
Re: APXS question
One final comment, the 'apxs' manual page provides a number of examples of using -i separate to compilation. For example: $ apxs -i -a mod_foo.la /path/to/instdso.sh mod_foo.la /path/to/apache/modules /path/to/libtool --mode=install cp mod_foo.la /path/to/apache/modules ... chmod 755 /path/to/apache/modules/mod_foo.so [activating module `foo' in /path/to/apache/conf/httpd.conf] $ _ Thus, it does by way of example at least document that the dso-file in this case is the .la file. It could perhaps be more explicit in mentioning this perhaps. :-) Graham On 23/07/07, Graham Dumpleton [EMAIL PROTECTED] wrote: On 23/07/07, Graham Dumpleton [EMAIL PROTECTED] wrote: On 23/07/07, Farokh Irani [EMAIL PROTECTED] wrote: Farokh Irani wrote: apxs -i -n mod_fancy mod_fancy.o config.o You don't -i'nstall a .o file. It's not a loadable module. Loadable modules are the .so (.sl/.dll/.dylib) already-linked object files. I tried it with the .so files (apxs -i -n mod_fancy .libs/mod_fancy.so .libs/config.so) and got the same errors: /usr/local/apache2/bin/apxs -i -n mod_fancy .libs/mod_fancy.so .libs/config.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' .libs/mod_fancy.so /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp .libs/mod_fancy.so /usr/local/apache2/modules/ cp .libs/mod_fancy.so /usr/local/apache2/modules/mod_fancy.so Warning! dlname not found in /usr/local/apache2/modules/mod_fancy.so. Assuming installing a .so rather than a libtool archive. chmod 755 /usr/local/apache2/modules/mod_fancy.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' .libs/config.so /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp .libs/config.so /usr/local/apache2/modules/ cp .libs/config.so /usr/local/apache2/modules/config.so Warning! dlname not found in /usr/local/apache2/modules/config.so. Assuming installing a .so rather than a libtool archive. If using Apache 1.3, the magic you want is something like:: install : all $(APXS) -i -n 'mod_wsgi' mod_wsgi.so If using Apache 2.X, the magic you want is something like: install : all $(APXS) -i -n 'mod_wsgi' mod_wsgi.la That is presuming you are using your own Makefile for some reason. If using Makefile generated by apxs and which uses makefile rule system supplied by Apache, you wouldn't normally need to worry about it explicitly as it should do it the correct way. BTW, for the remainder of the configure/makefile system I use, see: http://modwsgi.googlecode.com/svn/trunk/mod_wsgi/ You'll possibly need to look at that to see what 'all' actually maps to on Apache 1.3 vs Apache 2.X as it needs to be different as well. Graham
Re: APXS question
On 7/22/07, Farokh Irani [EMAIL PROTECTED] wrote: /usr/local/apache2/bin/apxs -i -n mod_fancy .libs/mod_fancy.so .libs/config.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' .libs/mod_fancy.so /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp .libs/mod_fancy.so /usr/local/apache2/modules/ cp .libs/mod_fancy.so /usr/local/apache2/modules/mod_fancy.so Warning! dlname not found in /usr/local/apache2/modules/mod_fancy.so. Assuming installing a .so rather than a libtool archive. chmod 755 /usr/local/apache2/modules/mod_fancy.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' .libs/config.so /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp .libs/config.so /usr/local/apache2/modules/ cp .libs/config.so /usr/local/apache2/modules/config.so Warning! dlname not found in /usr/local/apache2/modules/config.so. Assuming installing a .so rather than a libtool archive. Was this msg truncated? I didn't see the same error as in the start of this thread. It does unfortunately look like you're invoking apxs in such a way as to install two DSO's, not to link two pieces of object code into a single DSO. -- Eric Covener [EMAIL PROTECTED]
Re: APXS question
On 7/22/07, Farokh Irani [EMAIL PROTECTED] wrote: /usr/local/apache2/bin/apxs -i -n mod_fancy .libs/mod_fancy.so .libs/config.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' .libs/mod_fancy.so /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp .libs/mod_fancy.so /usr/local/apache2/modules/ cp .libs/mod_fancy.so /usr/local/apache2/modules/mod_fancy.so Warning! dlname not found in /usr/local/apache2/modules/mod_fancy.so. Assuming installing a .so rather than a libtool archive. chmod 755 /usr/local/apache2/modules/mod_fancy.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' .libs/config.so /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp .libs/config.so /usr/local/apache2/modules/ cp .libs/config.so /usr/local/apache2/modules/config.so Warning! dlname not found in /usr/local/apache2/modules/config.so. Assuming installing a .so rather than a libtool archive. Was this msg truncated? I didn't see the same error as in the start of this thread. Hmm. Well, that's the most recent set of errors :) It does unfortunately look like you're invoking apxs in such a way as to install two DSO's, not to link two pieces of object code into a single DSO. I tried to use the .la files (as you mentioned in a different message) as in: apxs -i -n mod_fancy mod_fancy.la config.la Unfortunately, apxs generated two .so files, mod_fancy.so and config.so. It seems that apxs doesn't want to link multiple .la files into one .so as it does if I passed it .cpp files. I think that what I'm going to have to do is to create a single library out of everything and then use apxs to install that. Anyone have thoughts on that? Thanks. -- Farokh MCF Software...simply dependably engineered Developers of ListSTAR http://www.liststar.com/, MacRADIUS http://www.macradius.com/, Address List Sorter http://www.mcfsoftware.com/als/, SimpleText Filter for EIMS http://www.mcfsoftware.com/stf/ and Auto Reply plug-in for EIMS http://www.mcfsoftware.com/ar/.
Re: APXS question
On 23/07/07, Farokh Irani [EMAIL PROTECTED] wrote: On 7/22/07, Farokh Irani [EMAIL PROTECTED] wrote: /usr/local/apache2/bin/apxs -i -n mod_fancy .libs/mod_fancy.so .libs/config.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' .libs/mod_fancy.so /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp .libs/mod_fancy.so /usr/local/apache2/modules/ cp .libs/mod_fancy.so /usr/local/apache2/modules/mod_fancy.so Warning! dlname not found in /usr/local/apache2/modules/mod_fancy.so. Assuming installing a .so rather than a libtool archive. chmod 755 /usr/local/apache2/modules/mod_fancy.so /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' .libs/config.so /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp .libs/config.so /usr/local/apache2/modules/ cp .libs/config.so /usr/local/apache2/modules/config.so Warning! dlname not found in /usr/local/apache2/modules/config.so. Assuming installing a .so rather than a libtool archive. Was this msg truncated? I didn't see the same error as in the start of this thread. Hmm. Well, that's the most recent set of errors :) It does unfortunately look like you're invoking apxs in such a way as to install two DSO's, not to link two pieces of object code into a single DSO. I tried to use the .la files (as you mentioned in a different message) as in: apxs -i -n mod_fancy mod_fancy.la config.la Unfortunately, apxs generated two .so files, mod_fancy.so and config.so. It seems that apxs doesn't want to link multiple .la files into one .so as it does if I passed it .cpp files. I think that what I'm going to have to do is to create a single library out of everything and then use apxs to install that. Anyone have thoughts on that? Huh. If you use the -c option correctly, ie., list all source code, object files with one invocation of apxs then all the source file object files, plus other object files, should be combined into one loadable module at that point. I see the problem now. You have: %.o : %.cpp apxs -S CC=g++ -c $ which is just wrong. You shouldn't be calling apxs on each source file separately. Instead do something like: SRCS= mod_python.c _apachemodule.c requestobject.c tableobject.c util.c \ serverobject.c connobject.c filterobject.c hlist.c \ hlistobject.c finfoobject.c mod_python.la: $(SRCS) $(APXS) $(INCLUDES) -c $(SRCS) $(LDFLAGS) $(LIBS) The name of the output module will use the basename of the first code file listed in the list of source files in this case. Graham