1 dnl $Id: cups.m4,v 1.2 2005-04-28 20:50:05 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***])
35 elif test x"$enable_cups" = "xyes"; then
36 AC_MSG_ERROR([*** CUPS not found. You might need to specify the path to cups-config ***])
40 AC_MSG_CHECKING([whether CUPS support can be enabled])
41 AC_MSG_RESULT([$netatalk_cv_use_cups])
45 [ --with-spooldir=PATH path for spooldir used for CUPS support (LOCALSTATEDIR/spool/netatalk)],[
47 if test "$withval" = "no"; then
48 if test x"$spool_required" == x"yes"; then
49 AC_MSG_ERROR([*** CUPS support requires a spooldir ***])
51 AC_DEFINE(DISABLE_SPOOL, 1, [Define to enable spooldir support])
52 AC_MSG_RESULT([spool disabled])
54 elif test "$withval" != "yes"; then
56 AC_MSG_RESULT([spooldir set to $withval])
58 SPOOLDIR="${localstatedir}/spool/netatalk"
59 AC_MSG_RESULT([spool set to default])
62 SPOOLDIR="${localstatedir}/spool/netatalk"
65 AM_CONDITIONAL(USE_SPOOLDIR, test x"$spool_required" = x"yes")