]> arthur.barton.de Git - netatalk.git/blob - macros/cups.m4
Add a patch folder for stuff not included in CVS.
[netatalk.git] / macros / cups.m4
1 dnl $Id: cups.m4,v 1.1.2.1 2004-06-09 02:18:32 bfernhomberg Exp $
2 dnl Autoconf macros to check for CUPS
3
4 AC_DEFUN([NETATALK_AC_CUPS], [
5
6         dnl Don't use spool unless it's needed
7         spool_required=no
8         netatalk_cv_use_cups=no
9
10         AC_ARG_ENABLE(cups,
11         [  --enable-cups           Turn on CUPS support (default=auto)])
12
13         if test x$enable_cups != xno; then
14                 AC_PATH_PROG(CUPS_CONFIG, cups-config)
15
16                 if test "x$CUPS_CONFIG" != x; then
17                         AC_DEFINE(HAVE_CUPS, 1, [Define to enable CUPS Support])
18                         CUPS_CFLAGS="`$CUPS_CONFIG --cflags`"
19                         CUPS_LDFLAGS="`$CUPS_CONFIG --ldflags`"
20                         CUPS_LIBS="`$CUPS_CONFIG --libs`"
21                         CUPS_VERSION="`$CUPS_CONFIG --version`"
22                         AC_DEFINE_UNQUOTED(CUPS_API_VERSION, "`$CUPS_CONFIG --api-version`", [CUPS API Version])
23                         AC_SUBST(CUPS_CFLAGS)
24                         AC_SUBST(CUPS_LDFLAGS)
25                         AC_SUBST(CUPS_LIBS)
26         
27                         AC_MSG_CHECKING([CUPS version])
28                         AC_MSG_RESULT([$CUPS_VERSION])
29                         netatalk_cv_use_cups=yes
30         
31                         if test x"$netatalk_cv_HAVE_USABLE_ICONV" = x"no" ; then
32                                 AC_WARN([*** Warning: iconv not found on your system, using simple ascii mapping***])
33                         fi
34                         spool_required="yes"
35
36                 elif test x"$enable_cups" == "xyes"; then
37                         AC_MSG_ERROR([*** CUPS not found. You might need to specify the path to cups-config ***])
38                 fi
39         fi
40
41         AC_MSG_CHECKING([whether CUPS support can be enabled])
42         AC_MSG_RESULT([$netatalk_cv_use_cups])
43
44
45         AC_ARG_WITH(spooldir,
46         [  --with-spooldir=PATH     path for spooldir used for CUPS support (LOCALSTATEDIR/spool/netatalk)],[
47
48                 if test "$withval" = "no"; then
49                        if test x"$spool_required" == x"yes"; then
50                                AC_MSG_ERROR([*** CUPS support requires a spooldir ***])
51                        else
52                                AC_DEFINE(DISABLE_SPOOL, 1, [Define to enable spooldir support])
53                                AC_MSG_RESULT([spool disabled])
54                         fi
55                 elif test "$withval" != "yes"; then
56                         SPOOLDIR="$withval"
57                         AC_MSG_RESULT([spooldir set to $withval])
58                 else
59                         SPOOLDIR="${localstatedir}/spool/netatalk"
60                         AC_MSG_RESULT([spool set to default])
61                 fi
62         ],[
63                 SPOOLDIR="${localstatedir}/spool/netatalk"
64         ])
65
66         AM_CONDITIONAL(USE_SPOOLDIR, test x"$spool_required" = x"yes")
67         AC_SUBST(SPOOLDIR)
68 ])