]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - config-scripts/cups-common.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-common.m4
index 442cd5325fd5a17fbd880be20214cb26698f2810..03a348031ada76603bb3e3ba5df3de98ad95dedb 100644 (file)
@@ -1,9 +1,9 @@
 dnl
-dnl "$Id: cups-common.m4 5136 2006-02-19 18:46:46Z mike $"
+dnl "$Id: cups-common.m4 6304 2007-02-22 22:06:23Z 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 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
@@ -29,10 +29,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.3svn"
+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 +63,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 +79,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 +132,7 @@ 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(scsi/sg.h,AC_DEFINE(HAVE_SCSI_SG_H))
 
 dnl Checks for string functions.
 AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
@@ -183,6 +192,9 @@ dnl Extra platform-specific libraries...
 BACKLIBS=""
 CUPSDLIBS=""
 DBUSDIR=""
+CUPS_SYSTEM_AUTHKEY=""
+
+AC_ARG_ENABLE(dbus, [  --enable-dbus           enable DBUS support, default=auto])
 
 case $uname in
         Darwin*)
@@ -211,28 +223,40 @@ case $uname in
                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_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_SYSTEM_AUTHKEY)
+
 dnl See if we have POSIX ACL support...
 SAVELIBS="$LIBS"
 LIBS=""
@@ -253,5 +277,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 6304 2007-02-22 22:06:23Z mike $".
 dnl