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.
