Next: , Previous: Building sources, Up: Preparation


4.3 Building sources using Automake

It is much easier if you use GNU Automake instead of writing your own Makefiles. If you do that you do not have to worry about finding and invoking the libassuan-config script at all. libassuan provides an Automake macro that does all the work for you.

— Macro: AM_PATH_LIBASSUAN ([minimum-version], [action-if-found], [action-if-not-found])

Check whether libassuan (at least version minimum-version, if given) exists on the host system. If it is found, execute action-if-found, otherwise do action-if-not-found, if given.

Additionally, the function defines LIBASSUAN_CFLAGS to the flags needed for compilation of the program to find the assuan.h header file, and LIBASSUAN_LIBS to the linker flags needed to link the program to the libassuan library.

You can use the defined Autoconf variables like this in your Makefile.am:

     AM_CPPFLAGS = $(LIBASSUAN_CFLAGS)
     LDADD = $(LIBASSUAN_LIBS)
— Macro: AM_PATH_LIBASSUAN_PTH ([minimum-version], [action-if-found], [action-if-not-found])

Same as AM_PATH_LIBASSUAN but checks for the GNU Pth enabled version of the library and defines LIBASSUAN_PTH_CFLAGS LIBASSUAN_PTH_LIBS instead. Use this is you are using GNU Pth. Note that you also need to pass the appropriate options for Pth to the compiler and linker.

— Macro: AM_PATH_LIBASSUAN_PTHREAD ([minimum-version], [action-if-found], [action-if-not-found])

Same as AM_PATH_LIBASSUAN but checks for the pthreads enabled version of the library and defines LIBASSUAN_PTHREAD_CFLAGS LIBASSUAN_PTHREAD_LIBS instead. Use this is you are using GNU Pth. Note that you also need to pass the appropriate options for Pth to the compiler and linker.