1 dnl @synopsis CHECK_LIBWRASTER([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
3 dnl This macro searches for an installed libwraster library. If nothing
4 dnl was specified when calling configure, it searches first in /usr/local
5 dnl and then in /usr. If the --with-libwraster=DIR is specified, it will try
6 dnl to find it in DIR/include/wraster.h and DIR/lib/libwraster.a. If --without-libwraster
7 dnl is specified, the library is not searched at all.
9 dnl It defines the symbol HAVE_LIBWRASTER if the library is found. You should
10 dnl use autoheader to include a definition for this symbol in a config.h
13 dnl Sources files should then use something like
15 dnl #ifdef HAVE_LIBWRASTER
16 dnl #include <wraster.h>
17 dnl #endif /* HAVE_LIBWRASTER */
20 dnl based on CHECK_ZLIB by Loic Dachary <loic@senga.org>
23 AC_DEFUN([CHECK_LIBWRASTER],
27 [AC_MSG_CHECKING(if libwraster is wanted)
28 AC_ARG_WITH(libwraster,
29 [ --with-libwraster=DIR root directory path of libwraster installation [defaults to
30 /usr/local or /usr if not found in /usr/local]
31 --without-libwraster to disable libwraster usage completely],
32 [if test "$withval" != no ; then
33 LIBWRASTER_HOME="$withval"
34 AC_MSG_RESULT([yes: libraries ${LIBWRASTER_HOME}/lib includes ${LIBWRASTER_HOME}/include])
38 [LIBWRASTER_HOME=/usr/local
39 if test ! -f "${LIBWRASTER_HOME}/include/wraster.h"
42 if test ! -f "${LIBWRASTER_HOME}/include/wraster.h"
44 LIBWRASTER_HOME=/usr/X11R6
47 AC_MSG_RESULT([yes: libraries ${LIBWRASTER_HOME}/lib includes ${LIBWRASTER_HOME}/include])
51 # Locate libwraster, if wanted
53 if test -n "${LIBWRASTER_HOME}"
55 LDFLAGS="$LDFLAGS -L${LIBWRASTER_HOME}/lib"
56 CPPFLAGS="$CPPFLAGS -I${LIBWRASTER_HOME}/include"
57 AC_CHECK_LIB(wraster, RCreateContext, $1, $2)