]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - config-scripts/cups-common.m4
Merge changes from CUPS 1.4svn-r7696.
[thirdparty/cups.git] / config-scripts / cups-common.m4
index 57cdb5290d9f9949edcb8f9cffcce3960e973626..a88692f35ddcd4756c694271f91938c3cb116af1 100644 (file)
@@ -1,5 +1,5 @@
 dnl
-dnl "$Id: cups-common.m4 6964 2007-09-17 21:33:57Z mike $"
+dnl "$Id: cups-common.m4 7695 2008-06-26 00:46:24Z mike $"
 dnl
 dnl   Common configuration stuff for the Common UNIX Printing System (CUPS).
 dnl
@@ -42,11 +42,6 @@ AC_PROG_AWK
 AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_CXX
-AC_PROG_INSTALL
-if test "$INSTALL" = "$ac_install_sh"; then
-       # Use full path to install-sh script...
-       INSTALL="`pwd`/install-sh -c"
-fi
 AC_PROG_RANLIB
 AC_PATH_PROG(AR,ar)
 AC_PATH_PROG(HTMLDOC,htmldoc)
@@ -56,7 +51,11 @@ 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)
+
+AC_MSG_CHECKING(for install-sh script)
+INSTALL="`pwd`/install-sh -c"
+AC_SUBST(INSTALL)
+AC_MSG_RESULT(using $INSTALL)
 
 if test "x$AR" = x; then
        AC_MSG_ERROR([Unable to find required library archive command.])
@@ -84,14 +83,11 @@ LIBMALLOC=""
 AC_ARG_ENABLE(mallinfo, [  --enable-mallinfo       turn on malloc debug information, default=no])
 
 if test x$enable_mallinfo = xyes; then
-       AC_CHECK_LIB(c,mallinfo,LIBS="$LIBS"; AC_DEFINE(HAVE_MALLINFO),LIBS="$LIBS")
-       if test "$ac_cv_lib_c_mallinfo" = "no"; then
-               AC_CHECK_LIB(malloc,mallinfo,
-                            LIBS="$LIBS"
-                            LIBMALLOC="-lmalloc"
-                            AC_DEFINE(HAVE_MALLINFO),
-                            LIBS="$LIBS")
-       fi
+       SAVELIBS="$LIBS"
+       LIBS=""
+       AC_SEARCH_LIBS(mallinfo, malloc, AC_DEFINE(HAVE_MALLINFO))
+       LIBMALLOC="$LIBS"
+       LIBS="$SAVELIBS"
 fi
 
 AC_SUBST(LIBMALLOC)
@@ -171,6 +167,27 @@ AC_TRY_COMPILE([#include <time.h>],[struct tm t;
 dnl See if we have the removefile(3) function for securely removing files
 AC_CHECK_FUNCS(removefile)
 
+dnl See if we have libusb...
+AC_ARG_ENABLE(libusb, [  --enable-libusb         use libusb for USB printing, default=auto])
+
+LIBUSB=""
+AC_SUBST(LIBUSB)
+
+if test x$enable_libusb = xyes; then
+       check_libusb=yes
+elif test x$enable_libusb != xno -a $uname != Darwin; then
+       check_libusb=yes
+else
+       check_libusb=no
+fi
+
+if test $check_libusb = yes; then
+       AC_CHECK_LIB(usb, usb_init,[
+               AC_CHECK_HEADER(usb.h,
+                       AC_DEFINE(HAVE_USB_H)
+                       LIBUSB="-lusb")])
+fi
+
 dnl Flags for "ar" command...
 case $uname in
         Darwin* | *BSD*)
@@ -239,7 +256,7 @@ case $uname in
                FONTS=""
                LEGACY_BACKENDS=""
                 BACKLIBS="$BACKLIBS -framework IOKit"
-                CUPSDLIBS="$CUPSDLIBS -sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration -framework ApplicationServices"
+                CUPSDLIBS="$CUPSDLIBS -sectorder __TEXT __text cupsd.order -e start -framework IOKit -framework SystemConfiguration -weak_framework ApplicationServices"
                 LIBS="-framework SystemConfiguration -framework CoreFoundation $LIBS"
 
                dnl Check for framework headers...
@@ -262,8 +279,13 @@ case $uname in
                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"])
+                       if grep -q system.print.operator /etc/authorization; then
+                               CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
+                               CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"
+                       else
+                               CUPS_DEFAULT_PRINTADMIN_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
+                               CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.print.admin"
+                       fi])
                AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
 
                dnl Check for sandbox/Seatbelt support
@@ -278,5 +300,5 @@ AC_SUBST(FONTS)
 AC_SUBST(LEGACY_BACKENDS)
 
 dnl
-dnl End of "$Id: cups-common.m4 6964 2007-09-17 21:33:57Z mike $".
+dnl End of "$Id: cups-common.m4 7695 2008-06-26 00:46:24Z mike $".
 dnl