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
4 AC_DEFUN([NETATALK_AC_CUPS], [
6 dnl Don't use spool unless it's needed
8 netatalk_cv_use_cups=no
11 [ --enable-cups Turn on CUPS support (default=auto)])
13 if test x$enable_cups != xno; then
14 AC_PATH_PROG(CUPS_CONFIG, cups-config)
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])
24 AC_SUBST(CUPS_LDFLAGS)
27 AC_MSG_CHECKING([CUPS version])
28 AC_MSG_RESULT([$CUPS_VERSION])
29 netatalk_cv_use_cups=yes
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***])
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 ***])
41 AC_MSG_CHECKING([whether CUPS support can be enabled])
42 AC_MSG_RESULT([$netatalk_cv_use_cups])
46 [ --with-spooldir=PATH path for spooldir used for CUPS support (LOCALSTATEDIR/spool/netatalk)],[
48 if test "$withval" = "no"; then
49 if test x"$spool_required" == x"yes"; then
50 AC_MSG_ERROR([*** CUPS support requires a spooldir ***])
52 AC_DEFINE(DISABLE_SPOOL, 1, [Define to enable spooldir support])
53 AC_MSG_RESULT([spool disabled])
55 elif test "$withval" != "yes"; then
57 AC_MSG_RESULT([spooldir set to $withval])
59 SPOOLDIR="${localstatedir}/spool/netatalk"
60 AC_MSG_RESULT([spool set to default])
63 SPOOLDIR="${localstatedir}/spool/netatalk"
66 AM_CONDITIONAL(USE_SPOOLDIR, test x"$spool_required" = x"yes")