]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - config-scripts/cups-common.m4
Merge changes from CUPS 1.3.1.
[thirdparty/cups.git] / config-scripts / cups-common.m4
index 442cd5325fd5a17fbd880be20214cb26698f2810..7bfe47c615c0c825374534910e1677de0b1d16f9 100644 (file)
@@ -1,25 +1,16 @@
 dnl
-dnl "$Id: cups-common.m4 5136 2006-02-19 18:46:46Z mike $"
+dnl "$Id: cups-common.m4 6946 2007-09-12 18:28:16Z mike $"
 dnl
 dnl   Common configuration stuff for the Common UNIX Printing System (CUPS).
 dnl
-dnl   Copyright 1997-2006 by Easy Software Products, all rights reserved.
+dnl   Copyright 2007 by Apple Inc.
+dnl   Copyright 1997-2007 by Easy Software Products, all rights reserved.
 dnl
 dnl   These coded instructions, statements, and computer programs are the
-dnl   property of Easy Software Products and are protected by Federal
-dnl   copyright law.  Distribution and use rights are outlined in the file
-dnl   "LICENSE.txt" which should have been included with this file.  If this
-dnl   file is missing or damaged please contact Easy Software Products
-dnl   at:
-dnl
-dnl       Attn: CUPS Licensing Information
-dnl       Easy Software Products
-dnl       44141 Airport View Drive, Suite 204
-dnl       Hollywood, Maryland 20636 USA
-dnl
-dnl       Voice: (301) 373-9600
-dnl       EMail: cups-info@cups.org
-dnl         WWW: http://www.cups.org
+dnl   property of Apple Inc. and are protected by Federal copyright
+dnl   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+dnl   which should have been included with this file.  If this file is
+dnl   file is missing or damaged, see the license at "http://www.cups.org/".
 dnl
 
 dnl We need at least autoconf 2.50...
@@ -29,10 +20,16 @@ dnl Set the name of the config header file...
 AC_CONFIG_HEADER(config.h)
 
 dnl Versio number information...
-CUPS_VERSION="1.2svn"
+CUPS_VERSION="1.3.1"
+CUPS_REVISION=""
+#if test -z "$CUPS_REVISION" -a -d .svn; then
+#      CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
+#fi
+
 AC_SUBST(CUPS_VERSION)
-AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION")
-AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION")
+AC_SUBST(CUPS_REVISION)
+AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION$CUPS_REVISION")
+AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION$CUPS_REVISION")
 
 dnl Default compiler flags...
 CFLAGS="${CFLAGS:=}"
@@ -57,6 +54,7 @@ AC_PATH_PROG(LD,ld)
 AC_PATH_PROG(LN,ln)
 AC_PATH_PROG(MV,mv)
 AC_PATH_PROG(RM,rm)
+AC_PATH_PROG(RMDIR,rmdir)
 AC_PATH_PROG(SED,sed)
 AC_PATH_PROG(STRIP,strip)
 
@@ -72,9 +70,10 @@ fi
 
 dnl Static library option...
 INSTALLSTATIC=""
-AC_ARG_ENABLE(install_static, [  --enable-static         install static libraries, default=no])
+AC_ARG_ENABLE(static, [  --enable-static         install static libraries, default=no])
 
-if test x$enable_install_static = xyes; then
+if test x$enable_static = xyes; then
+       echo Installing static libraries...
        INSTALLSTATIC="installstatic"
 fi
 
@@ -124,6 +123,9 @@ AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
 AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
 AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
 AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
+AC_CHECK_HEADER(sys/param.h,AC_DEFINE(HAVE_SYS_PARAM_H))
+AC_CHECK_HEADER(sys/ucred.h,AC_DEFINE(HAVE_SYS_UCRED_H))
+AC_CHECK_HEADER(scsi/sg.h,AC_DEFINE(HAVE_SCSI_SG_H))
 
 dnl Checks for string functions.
 AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
@@ -156,8 +158,7 @@ esac
 AC_CHECK_FUNCS(sigaction)
 
 dnl Checks for wait functions.
-AC_CHECK_FUNCS(waitpid)
-AC_CHECK_FUNCS(wait3)
+AC_CHECK_FUNCS(waitpid wait3)
 
 dnl See if the tm structure has the tm_gmtoff member...
 AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
@@ -167,6 +168,9 @@ AC_TRY_COMPILE([#include <time.h>],[struct tm t;
        AC_DEFINE(HAVE_TM_GMTOFF),
        AC_MSG_RESULT(no))
 
+dnl See if we have the removefile(3) function for securely removing files
+AC_CHECK_FUNCS(removefile)
+
 dnl Flags for "ar" command...
 case $uname in
         Darwin* | *BSD*)
@@ -183,11 +187,22 @@ dnl Extra platform-specific libraries...
 BACKLIBS=""
 CUPSDLIBS=""
 DBUSDIR=""
+CUPS_DEFAULT_PRINTADMIN_AUTH="@SYSTEM"
+CUPS_SYSTEM_AUTHKEY=""
+
+AC_ARG_ENABLE(dbus, [  --enable-dbus           enable DBUS support, default=auto])
+
+FONTS="fonts"
+AC_SUBST(FONTS)
+LEGACY_BACKENDS="parallel scsi"
+AC_SUBST(LEGACY_BACKENDS)
 
 case $uname in
         Darwin*)
+               FONTS=""
+               LEGACY_BACKENDS=""
                 BACKLIBS="-framework IOKit"
-                CUPSDLIBS="-framework IOKit -framework SystemConfiguration"
+                CUPSDLIBS="-sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration"
                 LIBS="-framework CoreFoundation $LIBS"
 
                dnl Check for CFLocaleCreateCanonicalLocaleIdentifierFromString...
@@ -204,35 +219,54 @@ case $uname in
                AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
                AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H))
 
-               dnl Check for the new membership functions in MacOSX 10.4 (Tiger)...
+               dnl Check for the new membership functions in MacOSX 10.4...
                AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
+               AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H))
                AC_CHECK_FUNCS(mbr_uid_to_uuid)
 
+               dnl Need <dlfcn.h> header...
+               AC_CHECK_HEADER(dlfcn.h,AC_DEFINE(HAVE_DLFCN_H))
+
                dnl Check for notify_post support
                AC_CHECK_HEADER(notify.h,AC_DEFINE(HAVE_NOTIFY_H))
                AC_CHECK_FUNCS(notify_post)
+
+               dnl Check for Authorization Services support
+               AC_CHECK_HEADER(Security/Authorization.h, [
+                       AC_DEFINE(HAVE_AUTHORIZATION_H)
+                       CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
+                       CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"])
+               AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
                 ;;
 
        Linux*)
                dnl Check for DBUS support
-               AC_PATH_PROG(PKGCONFIG, pkg-config)
-               if test "x$PKGCONFIG" != x; then
-                       AC_MSG_CHECKING(for DBUS)
-                       if $PKGCONFIG --exists dbus-1; then
-                               AC_MSG_RESULT(yes)
-                               AC_CHECK_LIB(dbus-1,
-                                   dbus_message_iter_init_append,
-                                   AC_DEFINE(HAVE_DBUS)
-                                   CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
-                                   CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
-                                   DBUSDIR="/etc/dbus-1/system.d")
-                       else
-                               AC_MSG_RESULT(no)
+               if test "x$enable_dbus" != xno; then
+                       AC_PATH_PROG(PKGCONFIG, pkg-config)
+                       if test "x$PKGCONFIG" != x; then
+                               AC_MSG_CHECKING(for DBUS)
+                               if $PKGCONFIG --exists dbus-1; then
+                                       AC_MSG_RESULT(yes)
+                                       AC_DEFINE(HAVE_DBUS)
+                                       CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
+                                       CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
+                                       AC_ARG_WITH(dbusdir, [  --with-dbusdir          set DBUS configuration directory ], dbusdir="$withval", dbusdir="/etc/dbus-1")
+                                       DBUSDIR="$dbusdir"
+                                       AC_CHECK_LIB(dbus-1,
+                                           dbus_message_iter_init_append,
+                                           AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND))
+                               else
+                                       AC_MSG_RESULT(no)
+                               fi
                        fi
                fi
                ;;
 esac
 
+AC_SUBST(CUPS_DEFAULT_PRINTADMIN_AUTH)
+AC_DEFINE_UNQUOTED(CUPS_DEFAULT_PRINTADMIN_AUTH, "$CUPS_DEFAULT_PRINTADMIN_AUTH")
+AC_SUBST(CUPS_SYSTEM_AUTHKEY)
+
 dnl See if we have POSIX ACL support...
 SAVELIBS="$LIBS"
 LIBS=""
@@ -253,5 +287,5 @@ AC_SUBST(DEFAULT_IPP_PORT)
 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
 
 dnl
-dnl End of "$Id: cups-common.m4 5136 2006-02-19 18:46:46Z mike $".
+dnl End of "$Id: cups-common.m4 6946 2007-09-12 18:28:16Z mike $".
 dnl