wmauda: Fix installation dir
[dockapps.git] / wmweather+-2.12 / m4 / libwraster.m4
blobcdf7277e1da33e588567fb67354e40e2206a462a
1 dnl @synopsis CHECK_LIBWRASTER([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
2 dnl
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.
8 dnl
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
11 dnl file.
12 dnl
13 dnl Sources files should then use something like
14 dnl
15 dnl #ifdef HAVE_LIBWRASTER
16 dnl #include <wraster.h>
17 dnl #endif /* HAVE_LIBWRASTER */
18 dnl
19 dnl @version 1.0
20 dnl based on CHECK_ZLIB by Loic Dachary <loic@senga.org>
21 dnl
23 AC_DEFUN([CHECK_LIBWRASTER],
25 # Handle user hints
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])
35                       else
36                           AC_MSG_RESULT(no)
37                       fi],
38                      [LIBWRASTER_HOME=/usr/local
39                       if test ! -f "${LIBWRASTER_HOME}/include/wraster.h"
40                       then
41                          LIBWRASTER_HOME=/usr
42                          if test ! -f "${LIBWRASTER_HOME}/include/wraster.h"
43                          then
44                              LIBWRASTER_HOME=/usr/X11R6
45                          fi
46                       fi
47                       AC_MSG_RESULT([yes: libraries ${LIBWRASTER_HOME}/lib  includes ${LIBWRASTER_HOME}/include])
48                      ])
51 # Locate libwraster, if wanted
53          if test -n "${LIBWRASTER_HOME}"
54          then
55              LDFLAGS="$LDFLAGS -L${LIBWRASTER_HOME}/lib"
56              CPPFLAGS="$CPPFLAGS -I${LIBWRASTER_HOME}/include"
57              AC_CHECK_LIB(wraster, RCreateContext, $1, $2)
58          else
59              $2
60          fi
61     ])