[gcompris-devel] how to add a lib

Christof Petig christof at petig-baender.de
Tue Sep 17 02:08:03 UTC 2002


pgeorges schrieb:
> I would like to link gcompris with libpthread.
> What do I have to do in configure.in or makefile.am ?
> 

Basically you have to do the following:
- add a check for the name and or path of the library and put the 
LDFLAGS (-L/path) and LIBS (-lpthread) into a reasonable variable (e.g. 
PTHREAD_LDFLAGS=-L... and PTHREAD_LIBS=-lpthread via export) then 
AC_SUBST it.

- add your variables to LIBS and program_LDFLAGS in the Makefile.am.

------
examples for configure.in :

ALSA.m4 uses something like (which assumes the name but does not check 
for it)
   export PTHREAD_LIBS=-lpthread
   AC_SUBST(PTHREAD_LIBS)

Tcl.m4 even checks for the existance of pthread like
   AC_CHECK_LIB(pthread,pthread_mutex_init,PTHREAD_LIBS=-lpthread,
			PTHREAD_LIBS=false)
and then under the name "pthreads" and "c" (if then else cascade)

Yours
    Christof Petig





More information about the Gcompris-devel mailing list