[alsa-devel] [Alsa-devel] Static build of alsa-lib

Takashi Iwai tiwai at suse.de
Thu Mar 22 00:45:23 CET 2007

At Wed, 21 Mar 2007 12:00:23 -0700 (PDT),
Ciaccia wrote:
> Hi Takashi,
> I have just tried the patch you provided me. I applied
> the patch and then I configured alsa-lib as following:
> ./configure --enable-static --disable-shared
> --disable-mixer --disable-hwdep --disable-rawmidi
> --disable-seq --disable-instr --disable-alisp
> --with-pcm-plugins=no --with-libdl=no
> --with-pthread=no 
> The compilation works fine, ant the static library is
> created. When I try to link my application to it, I
> get the following warning:
> ~/alsa $ gcc -Wall -O2 -o test test.c
> -L/tmp/alsa-lib-hg20070317/src/.libs/ -lasound -static
> /tmp/alsa-lib-hg20070317/src/.libs/libasound.a(control_shm.o):
> In function `_snd_ctl_shm_open':
> /tmp/alsa-lib-hg20070317/src/control/control_shm.c:664:
> warning: Using 'gethostbyname' in statically linked
> applications requires at runtime the shared libraries
> from the glibc version used for linking

This is actually a glibc issue.  You don't care about it at all.
(control_shm is very unlikely used, so it can be trimmed down in the
 future version.)

> I think we are getting closer, but I could not figure
> out how to exclude this from the compilation. The file
> control_shm.c contains only few macro #IFDEFS, and
> none for it.
> Takashi, could you tell me why/when the pthread lib is
> needed? Do I need it for PCM, or is it used just for

Usually the places where any race may happen.  The library itself
doesn't use mutli-threading at all.

> Last but not least, the ./configure --help does not
> give information about the the new switches
> (--with-libdl=no --with-pthread=no), shouldn't they be
> visible in the "help" page?

They should.  At least, it's shown on my ststem correctly.


More information about the Alsa-devel mailing list