Building libhw_module.a in daemons/Makefile with external libraries

View: New views
2 Messages — Rating Filter:   Alert me  

Building libhw_module.a in daemons/Makefile with external libraries

by Matthew Bodkin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A quick question/comment to the changing CVS building process...

It looks like an intermediary libhw_module.a is being built.  No problem, but it appears to fail when external external libraries are linked in (@alsa_lib@, @atilibusb_lib@, etc + my new @commandir_lib@) since the added -L and -l parameters are treated as file names by "ar cru ...".

After a couple experiments, I ended up getting a build but adding the external libraries to the lircd_LDADD & irrecord_LDADD vars in daemons/Makefile.am, like this:

lircd_LDADD = @daemon@ libhw_module.a @commandir_lib@

But the @commandir_lib@ won't be the only one, and it's updating 2 places now instead of 1 which I'm guessing was the objective in isolating/consolidating libhw_module.

The commandir driver isn't in CVS yet, but the steps to recreate are building any driver that depends on an external library: alsa_usb, atilibusb, portaudio, audio_alsa, caraca, iguanaIR, and irman.

Example output from building atilibusb (most similar to my new driver case):
Making all in daemons
make[2]: Entering directory `/home/matt/jul3/lirc/daemons'
gcc -DHAVE_CONFIG_H -I. -I.. -I..    -O2 -g -Wall  -MT hw-types.o -MD -MP -MF .deps/hw-types.Tpo -c -o hw-types.o hw-types.c
mv -f .deps/hw-types.Tpo .deps/hw-types.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I..    -O2 -g -Wall  -MT ir_remote.o -MD -MP -MF .deps/ir_remote.Tpo -c -o ir_remote.o ir_remote.c
mv -f .deps/ir_remote.Tpo .deps/ir_remote.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I..    -O2 -g -Wall  -MT release.o -MD -MP -MF .deps/release.Tpo -c -o release.o release.c
mv -f .deps/release.Tpo .deps/release.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I..    -O2 -g -Wall  -MT hw_atilibusb.o -MD -MP -MF .deps/hw_atilibusb.Tpo -c -o hw_atilibusb.o hw_atilibusb.c
mv -f .deps/hw_atilibusb.Tpo .deps/hw_atilibusb.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I..    -O2 -g -Wall  -MT receive.o -MD -MP -MF .deps/receive.Tpo -c -o receive.o receive.c
mv -f .deps/receive.Tpo .deps/receive.Po
rm -f libhw_module.a
ar cru libhw_module.a hw-types.o ir_remote.o release.o hw_atilibusb.o receive.o  -L/usr/lib -lusb
ar: -L/usr/lib: No such file or directory
make[2]: *** [libhw_module.a] Error 1

Did I miss another parameter that should be used to add external libraries to the build? 

Thanks,

Matthew
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08

Re: Building libhw_module.a in daemons/Makefile with external libraries

by Christoph Bartelmus :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

Matthew Bodkin "lists@..." wrote:

> A quick question/comment to the changing CVS building process...
[...]
> It looks like an intermediary libhw_module.a is being built.  No
> problem, but it appears to fail when external external libraries are
> linked in (@alsa_lib@, @atilibusb_lib@, etc + my new @commandir_lib@)
> since the added -L and -l parameters are treated as file names by "ar
> cru ...".
[...]
> Did I miss another parameter that should be used to add external
> libraries to the build?

No, yesterdays change simply has broken the build. Should be fixed now.
I need the intermediate library because I need to link all this stuff to  
mode2.

Christoph

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
LightInTheBox - Buy quality products at wholesale price