dnl
-dnl "$Id$"
-dnl
dnl Common configuration stuff for CUPS.
dnl
-dnl Copyright 2007-2014 by Apple Inc.
-dnl Copyright 1997-2007 by Easy Software Products, all rights reserved.
+dnl Copyright © 2007-2019 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 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 Licensed under Apache License v2.0. See the file "LICENSE" for more
+dnl information.
dnl
-dnl We need at least autoconf 2.60...
-AC_PREREQ(2.60)
-
dnl Set the name of the config header file...
AC_CONFIG_HEADER(config.h)
dnl Version number information...
-CUPS_VERSION="2.0rc1"
+CUPS_VERSION="AC_PACKAGE_VERSION"
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
CUPS_BUILD="cups-$CUPS_VERSION"
AC_ARG_WITH(cups_build, [ --with-cups-build set "cups-config --build" string ],
AC_SUBST(CUPS_VERSION)
AC_SUBST(CUPS_REVISION)
AC_SUBST(CUPS_BUILD)
-AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION$CUPS_REVISION")
-AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION$CUPS_REVISION")
+AC_DEFINE_UNQUOTED(CUPS_SVERSION, "AC_PACKAGE_NAME v$CUPS_VERSION$CUPS_REVISION")
+AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "AC_PACKAGE_NAME/$CUPS_VERSION$CUPS_REVISION")
dnl Default compiler flags...
CFLAGS="${CFLAGS:=}"
AC_PROG_RANLIB
AC_PATH_PROG(AR,ar)
AC_PATH_PROG(CHMOD,chmod)
-AC_PATH_PROG(GZIP,gzip)
+AC_PATH_PROG(GZIPPROG,gzip)
+AC_MSG_CHECKING(for install-sh script)
+INSTALL="`pwd`/install-sh"
+AC_SUBST(INSTALL)
+AC_MSG_RESULT(using $INSTALL)
AC_PATH_PROG(LD,ld)
AC_PATH_PROG(LN,ln)
+AC_PATH_PROG(MKDIR,mkdir)
AC_PATH_PROG(MV,mv)
AC_PATH_PROG(RM,rm)
AC_PATH_PROG(RMDIR,rmdir)
AC_PATH_PROG(SED,sed)
AC_PATH_PROG(XDGOPEN,xdg-open)
+
if test "x$XDGOPEN" = x; then
CUPS_HTMLVIEW="htmlview"
else
fi
AC_SUBST(CUPS_HTMLVIEW)
-AC_MSG_CHECKING(for install-sh script)
-INSTALL="`pwd`/install-sh"
-AC_SUBST(INSTALL)
-AC_MSG_RESULT(using $INSTALL)
-
if test "x$AR" = x; then
AC_MSG_ERROR([Unable to find required library archive command.])
fi
AC_SEARCH_LIBS(iconv_open,iconv,
AC_DEFINE(HAVE_ICONV_H)
SAVELIBS="$SAVELIBS $LIBS")
+ AC_SEARCH_LIBS(libiconv_open,iconv,
+ AC_DEFINE(HAVE_ICONV_H)
+ SAVELIBS="$SAVELIBS $LIBS")
LIBS="$SAVELIBS")
-dnl Checks for Mini-XML (www.minixml.org)...
-LIBMXML=""
-AC_CHECK_HEADER(mxml.h,
- SAVELIBS="$LIBS"
- AC_SEARCH_LIBS(mmxlNewElement,mxml,
- AC_DEFINE(HAVE_MXML_H)
- LIBMXML="-lmxml")
- LIBS="$SAVELIBS")
-AC_SUBST(LIBMXML)
-
dnl Checks for statfs and its many headers...
AC_CHECK_HEADER(sys/mount.h,AC_DEFINE(HAVE_SYS_MOUNT_H))
AC_CHECK_HEADER(sys/statfs.h,AC_DEFINE(HAVE_SYS_STATFS_H))
dnl Checks for string functions.
AC_CHECK_FUNCS(strdup strlcat strlcpy)
-if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
+if test "$host_os_name" = "hp-ux" -a "$host_os_version" = "1020"; then
echo Forcing snprintf emulation for HP-UX.
else
AC_CHECK_FUNCS(snprintf vsnprintf)
AC_CHECK_FUNCS(vsyslog)
dnl Checks for signal functions.
-case "$uname" in
- Linux | GNU)
+case "$host_os_name" in
+ linux* | gnu*)
# Do not use sigset on Linux or GNU HURD
;;
*)
dnl Check for posix_spawn
AC_CHECK_FUNCS(posix_spawn)
+dnl Check for getgrouplist
+AC_CHECK_FUNCS(getgrouplist)
+
dnl See if the tm structure has the tm_gmtoff member...
AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
AC_TRY_COMPILE([#include <time.h>],[struct tm t;
AC_SUBST(USBQUIRKS)
if test "x$PKGCONFIG" != x; then
- if test x$enable_libusb != xno -a $uname != Darwin; then
+ if test x$enable_libusb != xno -a $host_os_name != darwin; then
AC_MSG_CHECKING(for libusb-1.0)
if $PKGCONFIG --exists libusb-1.0; then
AC_MSG_RESULT(yes)
INSTALL_GZIP=""
LIBZ=""
AC_CHECK_HEADER(zlib.h,
- AC_CHECK_LIB(z, gzgets,
+ AC_CHECK_LIB(z, gzgets,[
AC_DEFINE(HAVE_LIBZ)
LIBZ="-lz"
LIBS="$LIBS -lz"
AC_CHECK_LIB(z, inflateCopy, AC_DEFINE(HAVE_INFLATECOPY))
- if test "x$GZIP" != z; then
+ if test "x$GZIPPROG" != x; then
INSTALL_GZIP="-z"
- fi))
+ fi]))
AC_SUBST(INSTALL_GZIP)
AC_SUBST(LIBZ)
dnl Flags for "ar" command...
-case $uname in
- Darwin* | *BSD*)
+case $host_os_name in
+ darwin* | *bsd*)
ARFLAGS="-rcv"
;;
*)
LIBS="$SAVELIBS"
dnl Check for DBUS support
-AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
-AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
- DBUSDIR="$withval")
-
DBUSDIR=""
DBUS_NOTIFIER=""
DBUS_NOTIFIERLIBS=""
-if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x; then
+AC_ARG_ENABLE(dbus, [ --disable-dbus build without DBUS support])
+AC_ARG_WITH(dbusdir, [ --with-dbusdir set DBUS configuration directory ],
+ DBUSDIR="$withval")
+
+if test "x$enable_dbus" != xno -a "x$PKGCONFIG" != x -a "x$host_os_name" != xdarwin; then
AC_MSG_CHECKING(for DBUS)
if $PKGCONFIG --exists dbus-1; then
AC_MSG_RESULT(yes)
CUPS_SYSTEM_AUTHKEY=""
INSTALLXPC=""
-case $uname in
- Darwin*)
+case $host_os_name in
+ darwin*)
BACKLIBS="$BACKLIBS -framework IOKit"
SERVERLIBS="$SERVERLIBS -framework IOKit -weak_framework ApplicationServices"
- LIBS="-framework SystemConfiguration -framework CoreFoundation -framework Security $LIBS"
+ LIBS="-framework CoreFoundation -framework Security $LIBS"
dnl Check for framework headers...
AC_CHECK_HEADER(ApplicationServices/ApplicationServices.h,AC_DEFINE(HAVE_APPLICATIONSERVICES_H))
AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H))
- 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 dynamic store function...
- AC_CHECK_FUNCS(SCDynamicStoreCopyComputerName)
+ SAVELIBS="$LIBS"
+ LIBS="-framework SystemConfiguration $LIBS"
+ AC_CHECK_FUNCS(SCDynamicStoreCopyComputerName,[
+ AC_DEFINE(HAVE_SCDYNAMICSTORECOPYCOMPUTERNAME)],[
+ LIBS="$SAVELIBS"])
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 Check for the vproc_transaction_begin/end stuff...
- AC_CHECK_FUNCS(vproc_transaction_begin)
-
dnl Need <dlfcn.h> header...
AC_CHECK_HEADER(dlfcn.h,AC_DEFINE(HAVE_DLFCN_H))
if test "x$default_adminkey" != xdefault; then
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey $default_adminkey"
CUPS_DEFAULT_SYSTEM_AUTHKEY="$default_adminkey"
- elif grep -q system.print.operator /etc/authorization; then
+ else
CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.print.admin"
CUPS_DEFAULT_SYSTEM_AUTHKEY="system.print.admin"
- else
- CUPS_SYSTEM_AUTHKEY="SystemGroupAuthKey system.preferences"
- CUPS_DEFAULT_SYSTEM_AUTHKEY="system.preferences"
fi
if test "x$default_operkey" != xdefault; then
CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY($default_operkey) @admin @lpadmin"
- elif grep -q system.print.operator /etc/authorization; then
- CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
else
- CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY(system.print.admin) @admin @lpadmin"
+ CUPS_DEFAULT_PRINTOPERATOR_AUTH="@AUTHKEY(system.print.operator) @admin @lpadmin"
fi])
- AC_CHECK_HEADER(Security/SecBasePriv.h,AC_DEFINE(HAVE_SECBASEPRIV_H))
dnl Check for sandbox/Seatbelt support
- if test $uversion -ge 100; then
+ if test $host_os_version -ge 100; then
AC_CHECK_HEADER(sandbox.h,AC_DEFINE(HAVE_SANDBOX_H))
fi
- if test $uversion -ge 110 -a $uversion -lt 120; then
+ if test $host_os_version -ge 110 -a $host_os_version -lt 120; then
# Broken public headers in 10.7.x...
AC_MSG_CHECKING(for sandbox/private.h presence)
if test -f /usr/local/include/sandbox/private.h; then
AC_CHECK_HEADER(xpc/xpc.h,
AC_DEFINE(HAVE_XPC)
INSTALLXPC="install-xpc")
- AC_CHECK_HEADER(xpc/private.h,
- AC_DEFINE(HAVE_XPC_PRIVATE_H))
;;
esac
AC_ARG_WITH(components, [ --with-components set components to build:
- "all" (default) builds everything
- - "core" builds libcups and ipptool],
+ - "core" builds libcups and ipptool
+ - "libcups" builds just libcups
+ - "libcupslite" builds just libcups without driver support],
COMPONENTS="$withval")
+cupsimagebase="cupsimage"
+IPPEVECOMMANDS="ippevepcl ippeveps"
+LIBCUPSOBJS="\$(COREOBJS) \$(DRIVEROBJS)"
+LIBHEADERS="\$(COREHEADERS) \$(DRIVERHEADERS)"
+LIBHEADERSPRIV="\$(COREHEADERSPRIV) \$(DRIVERHEADERSPRIV)"
+
case "$COMPONENTS" in
all)
- BUILDDIRS="filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
+ BUILDDIRS="tools filter backend berkeley cgi-bin monitor notifier ppdc scheduler systemv conf data desktop locale man doc examples templates"
;;
core)
- BUILDDIRS="data locale"
+ BUILDDIRS="tools examples locale"
+ ;;
+
+ corelite)
+ AC_DEFINE(CUPS_LITE)
+ BUILDDIRS="tools examples locale"
+ cupsimagebase=""
+ LIBCUPSOBJS="\$(COREOBJS)"
+ LIBHEADERS="\$(COREHEADERS)"
+ LIBHEADERSPRIV="\$(COREHEADERSPRIV)"
+ ;;
+
+ libcups)
+ BUILDDIRS="locale"
+ cupsimagebase=""
+ ;;
+
+ libcupslite)
+ AC_DEFINE(CUPS_LITE)
+ BUILDDIRS="locale"
+ cupsimagebase=""
+ LIBCUPSOBJS="\$(COREOBJS)"
+ LIBHEADERS="\$(COREHEADERS)"
+ LIBHEADERSPRIV="\$(COREHEADERSPRIV)"
;;
*)
esac
AC_SUBST(BUILDDIRS)
-
-dnl
-dnl End of "$Id$".
-dnl
+AC_SUBST(IPPEVECOMMANDS)
+AC_SUBST(LIBCUPSOBJS)
+AC_SUBST(LIBHEADERS)
+AC_SUBST(LIBHEADERSPRIV)