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
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)
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.])
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)
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*)
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...
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
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