2 dnl "$Id: cups-common.m4 6092 2006-11-14 16:36:36Z mike $"
4 dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
6 dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
8 dnl These coded instructions, statements, and computer programs are the
9 dnl property of Easy Software Products and are protected by Federal
10 dnl copyright law. Distribution and use rights are outlined in the file
11 dnl "LICENSE.txt" which should have been included with this file. If this
12 dnl file is missing or damaged please contact Easy Software Products
15 dnl Attn: CUPS Licensing Information
16 dnl Easy Software Products
17 dnl 44141 Airport View Drive, Suite 204
18 dnl Hollywood, Maryland 20636 USA
20 dnl Voice: (301) 373-9600
21 dnl EMail: cups-info@cups.org
22 dnl WWW: http://www.cups.org
25 dnl We need at least autoconf 2.50...
28 dnl Set the name of the config header file...
29 AC_CONFIG_HEADER(config.h)
31 dnl Version number information...
35 AC_SUBST(CUPS_VERSION)
36 AC_SUBST(CUPS_REVISION)
37 AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION$CUPS_REVISION")
38 AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION$CUPS_REVISION")
40 dnl Default compiler flags...
42 CPPFLAGS="${CPPFLAGS:=}"
43 CXXFLAGS="${CXXFLAGS:=}"
44 LDFLAGS="${LDFLAGS:=}"
46 dnl Checks for programs...
52 if test "$INSTALL" = "$ac_install_sh"; then
53 # Use full path to install-sh script...
54 INSTALL="`pwd`/install-sh -c"
58 AC_PATH_PROG(HTMLDOC,htmldoc)
63 AC_PATH_PROG(RMDIR,rmdir)
65 AC_PATH_PROG(STRIP,strip)
67 if test "x$AR" = x; then
68 AC_MSG_ERROR([Unable to find required library archive command.])
70 if test "x$CC" = x; then
71 AC_MSG_ERROR([Unable to find required C compiler command.])
73 if test "x$CXX" = x; then
74 AC_MSG_ERROR([Unable to find required C++ compiler command.])
77 dnl Static library option...
79 AC_ARG_ENABLE(static, [ --enable-static install static libraries, default=no])
81 if test x$enable_static = xyes; then
82 echo Installing static libraries...
83 INSTALLSTATIC="installstatic"
86 AC_SUBST(INSTALLSTATIC)
88 dnl Check for libraries...
89 AC_SEARCH_LIBS(crypt, crypt)
90 AC_SEARCH_LIBS(getspent, sec gen)
93 AC_ARG_ENABLE(mallinfo, [ --enable-mallinfo turn on malloc debug information, default=no])
95 if test x$enable_mallinfo = xyes; then
96 AC_CHECK_LIB(c,mallinfo,LIBS="$LIBS"; AC_DEFINE(HAVE_MALLINFO),LIBS="$LIBS")
97 if test "$ac_cv_lib_c_mallinfo" = "no"; then
98 AC_CHECK_LIB(malloc,mallinfo,
101 AC_DEFINE(HAVE_MALLINFO),
108 dnl Check for libpaper support...
109 AC_ARG_ENABLE(libpaper, [ --enable-libpaper turn on libpaper support, default=no])
111 if test x$enable_libpaper = xyes; then
112 AC_CHECK_LIB(paper,systempapername,
113 AC_DEFINE(HAVE_LIBPAPER)
121 dnl Checks for header files.
123 AC_CHECK_HEADER(crypt.h,AC_DEFINE(HAVE_CRYPT_H))
124 AC_CHECK_HEADER(langinfo.h,AC_DEFINE(HAVE_LANGINFO_H))
125 AC_CHECK_HEADER(malloc.h,AC_DEFINE(HAVE_MALLOC_H))
126 AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H))
127 AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
128 AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
129 AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
130 AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
131 AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
132 AC_CHECK_HEADER(scsi/sg.h,AC_DEFINE(HAVE_SCSI_SG_H))
134 dnl Checks for string functions.
135 AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
136 if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
137 echo Forcing snprintf emulation for HP-UX.
139 AC_CHECK_FUNCS(snprintf vsnprintf)
142 dnl Checks for mkstemp and mkstemps functions.
143 AC_CHECK_FUNCS(mkstemp mkstemps)
145 dnl Check for geteuid function.
146 AC_CHECK_FUNCS(geteuid)
148 dnl Check for vsyslog function.
149 AC_CHECK_FUNCS(vsyslog)
151 dnl Checks for signal functions.
154 # Do not use sigset on Linux or GNU HURD
157 # Use sigset on other platforms, if available
158 AC_CHECK_FUNCS(sigset)
162 AC_CHECK_FUNCS(sigaction)
164 dnl Checks for wait functions.
165 AC_CHECK_FUNCS(waitpid)
166 AC_CHECK_FUNCS(wait3)
168 dnl See if the tm structure has the tm_gmtoff member...
169 AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
170 AC_TRY_COMPILE([#include <time.h>],[struct tm t;
171 int o = t.tm_gmtoff;],
173 AC_DEFINE(HAVE_TM_GMTOFF),
176 dnl Flags for "ar" command...
188 dnl Extra platform-specific libraries...
193 AC_ARG_ENABLE(dbus, [ --enable-dbus enable DBUS support, default=auto])
197 BACKLIBS="-framework IOKit"
198 CUPSDLIBS="-framework IOKit -framework SystemConfiguration"
199 LIBS="-framework CoreFoundation $LIBS"
201 dnl Check for CFLocaleCreateCanonicalLocaleIdentifierFromString...
202 AC_MSG_CHECKING(for CFLocaleCreateCanonicalLocaleIdentifierFromString)
203 if test "$uname" = "Darwin" -a $uversion -ge 70; then
204 AC_DEFINE(HAVE_CF_LOCALE_ID)
210 dnl Check for framework headers...
211 AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H))
212 AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
213 AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H))
215 dnl Check for the new membership functions in MacOSX 10.4 (Tiger)...
216 AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
217 AC_CHECK_FUNCS(mbr_uid_to_uuid)
219 dnl Check for notify_post support
220 AC_CHECK_HEADER(notify.h,AC_DEFINE(HAVE_NOTIFY_H))
221 AC_CHECK_FUNCS(notify_post)
225 dnl Check for DBUS support
226 if test "x$enable_dbus" != xno; then
227 AC_PATH_PROG(PKGCONFIG, pkg-config)
228 if test "x$PKGCONFIG" != x; then
229 AC_MSG_CHECKING(for DBUS)
230 if $PKGCONFIG --exists dbus-1; then
233 CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
234 CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
235 DBUSDIR="/etc/dbus-1/system.d"
237 dbus_message_iter_init_append,
238 AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND))
247 dnl See if we have POSIX ACL support...
250 AC_SEARCH_LIBS(acl_init, acl, AC_DEFINE(HAVE_ACL_INIT))
251 CUPSDLIBS="$CUPSDLIBS $LIBS"
258 dnl New default port definition for IPP...
259 AC_ARG_WITH(ipp-port, [ --with-ipp-port set default port number for IPP ],
260 DEFAULT_IPP_PORT="$withval",
261 DEFAULT_IPP_PORT="631")
263 AC_SUBST(DEFAULT_IPP_PORT)
264 AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
267 dnl End of "$Id: cups-common.m4 6092 2006-11-14 16:36:36Z mike $".