]> git.ipfire.org Git - thirdparty/cups.git/blame - config-scripts/cups-common.m4
Load cups into easysw/current.
[thirdparty/cups.git] / config-scripts / cups-common.m4
CommitLineData
ef416fc2 1dnl
757d2cad 2dnl "$Id: cups-common.m4 5229 2006-03-05 16:48:12Z mike $"
ef416fc2 3dnl
4dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
5dnl
bd7854cb 6dnl Copyright 1997-2006 by Easy Software Products, all rights reserved.
ef416fc2 7dnl
8dnl These coded instructions, statements, and computer programs are the
9dnl property of Easy Software Products and are protected by Federal
10dnl copyright law. Distribution and use rights are outlined in the file
11dnl "LICENSE.txt" which should have been included with this file. If this
12dnl file is missing or damaged please contact Easy Software Products
13dnl at:
14dnl
15dnl Attn: CUPS Licensing Information
16dnl Easy Software Products
17dnl 44141 Airport View Drive, Suite 204
18dnl Hollywood, Maryland 20636 USA
19dnl
20dnl Voice: (301) 373-9600
21dnl EMail: cups-info@cups.org
22dnl WWW: http://www.cups.org
23dnl
24
25dnl We need at least autoconf 2.50...
26AC_PREREQ(2.50)
27
28dnl Set the name of the config header file...
29AC_CONFIG_HEADER(config.h)
30
31dnl Versio number information...
32CUPS_VERSION="1.2svn"
ecdc0628 33CUPS_REVISION=""
34if test -z "$CUPS_REVISION" -a -d .svn; then
35 CUPS_REVISION="-r`svnversion . | awk -F: '{print $NF}' | sed -e '1,$s/[[a-zA-Z]]*//g'`"
36fi
37
ef416fc2 38AC_SUBST(CUPS_VERSION)
ecdc0628 39AC_SUBST(CUPS_REVISION)
40AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION$CUPS_REVISION")
41AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION$CUPS_REVISION")
ef416fc2 42
43dnl Default compiler flags...
44CFLAGS="${CFLAGS:=}"
45CPPFLAGS="${CPPFLAGS:=}"
46CXXFLAGS="${CXXFLAGS:=}"
47LDFLAGS="${LDFLAGS:=}"
48
49dnl Checks for programs...
50AC_PROG_AWK
51AC_PROG_CC
52AC_PROG_CXX
53AC_PROG_CPP
54AC_PROG_INSTALL
55if test "$INSTALL" = "$ac_install_sh"; then
56 # Use full path to install-sh script...
57 INSTALL="`pwd`/install-sh -c"
58fi
59AC_PROG_RANLIB
60AC_PATH_PROG(AR,ar)
61AC_PATH_PROG(HTMLDOC,htmldoc)
bd7854cb 62AC_PATH_PROG(LD,ld)
ef416fc2 63AC_PATH_PROG(LN,ln)
64AC_PATH_PROG(MV,mv)
65AC_PATH_PROG(RM,rm)
757d2cad 66AC_PATH_PROG(RM,rmdir)
ef416fc2 67AC_PATH_PROG(SED,sed)
68AC_PATH_PROG(STRIP,strip)
69
70if test "x$AR" = x; then
71 AC_MSG_ERROR([Unable to find required library archive command.])
72fi
73if test "x$CC" = x; then
74 AC_MSG_ERROR([Unable to find required C compiler command.])
75fi
76if test "x$CXX" = x; then
77 AC_MSG_ERROR([Unable to find required C++ compiler command.])
78fi
79
923edb68 80dnl Static library option...
81INSTALLSTATIC=""
82AC_ARG_ENABLE(install_static, [ --enable-static install static libraries, default=no])
83
84if test x$enable_install_static = xyes; then
85 INSTALLSTATIC="installstatic"
86fi
87
88AC_SUBST(INSTALLSTATIC)
ef416fc2 89
90dnl Check for libraries...
91AC_SEARCH_LIBS(crypt, crypt)
92AC_SEARCH_LIBS(getspent, sec gen)
93
94LIBMALLOC=""
95AC_ARG_ENABLE(mallinfo, [ --enable-mallinfo turn on malloc debug information, default=no])
96
97if test x$enable_mallinfo = xyes; then
98 AC_CHECK_LIB(c,mallinfo,LIBS="$LIBS"; AC_DEFINE(HAVE_MALLINFO),LIBS="$LIBS")
99 if test "$ac_cv_lib_c_mallinfo" = "no"; then
100 AC_CHECK_LIB(malloc,mallinfo,
101 LIBS="$LIBS"
102 LIBMALLOC="-lmalloc"
103 AC_DEFINE(HAVE_MALLINFO),
104 LIBS="$LIBS")
105 fi
106fi
107
108AC_SUBST(LIBMALLOC)
109
110dnl Check for libpaper support...
111AC_ARG_ENABLE(libpaper, [ --enable-libpaper turn on libpaper support, default=no])
112
113if test x$enable_libpaper = xyes; then
114 AC_CHECK_LIB(paper,systempapername,
115 AC_DEFINE(HAVE_LIBPAPER)
116 LIBPAPER="-lpaper",
117 LIBPAPER="")
118else
119 LIBPAPER=""
120fi
121AC_SUBST(LIBPAPER)
122
123dnl Checks for header files.
124AC_HEADER_STDC
125AC_CHECK_HEADER(crypt.h,AC_DEFINE(HAVE_CRYPT_H))
126AC_CHECK_HEADER(langinfo.h,AC_DEFINE(HAVE_LANGINFO_H))
127AC_CHECK_HEADER(malloc.h,AC_DEFINE(HAVE_MALLOC_H))
128AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H))
129AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
130AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
131AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
132AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
133AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
134
135dnl Checks for string functions.
136AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
137if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
138 echo Forcing snprintf emulation for HP-UX.
139else
140 AC_CHECK_FUNCS(snprintf vsnprintf)
141fi
142
143dnl Checks for mkstemp and mkstemps functions.
144AC_CHECK_FUNCS(mkstemp mkstemps)
145
146dnl Check for geteuid function.
147AC_CHECK_FUNCS(geteuid)
148
149dnl Check for vsyslog function.
150AC_CHECK_FUNCS(vsyslog)
151
152dnl Checks for signal functions.
153case "$uname" in
154 Linux | GNU)
155 # Do not use sigset on Linux or GNU HURD
156 ;;
157 *)
158 # Use sigset on other platforms, if available
159 AC_CHECK_FUNCS(sigset)
160 ;;
161esac
162
163AC_CHECK_FUNCS(sigaction)
164
165dnl Checks for wait functions.
166AC_CHECK_FUNCS(waitpid)
167AC_CHECK_FUNCS(wait3)
168
169dnl See if the tm structure has the tm_gmtoff member...
170AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
171AC_TRY_COMPILE([#include <time.h>],[struct tm t;
172 int o = t.tm_gmtoff;],
173 AC_MSG_RESULT(yes)
174 AC_DEFINE(HAVE_TM_GMTOFF),
175 AC_MSG_RESULT(no))
176
177dnl Flags for "ar" command...
178case $uname in
179 Darwin* | *BSD*)
180 ARFLAGS="-rcv"
181 ;;
182 *)
183 ARFLAGS="crvs"
184 ;;
185esac
186
187AC_SUBST(ARFLAGS)
188
189dnl Extra platform-specific libraries...
bd7854cb 190BACKLIBS=""
191CUPSDLIBS=""
192DBUSDIR=""
193
ecdc0628 194AC_ARG_ENABLE(dbus, [ --enable-dbus enable DBUS support, default=auto])
195
ef416fc2 196case $uname in
197 Darwin*)
198 BACKLIBS="-framework IOKit"
09ec0018 199 CUPSDLIBS="-framework IOKit -framework SystemConfiguration"
ef416fc2 200 LIBS="-framework CoreFoundation $LIBS"
fa73b229 201
202 dnl Check for CFLocaleCreateCanonicalLocaleIdentifierFromString...
203 AC_MSG_CHECKING(for CFLocaleCreateCanonicalLocaleIdentifierFromString)
204 if test "$uname" = "Darwin" -a $uversion -ge 70; then
205 AC_DEFINE(HAVE_CF_LOCALE_ID)
206 AC_MSG_RESULT(yes)
207 else
208 AC_MSG_RESULT(no)
209 fi
210
211 dnl Check for framework headers...
212 AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H))
213 AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
214 AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H))
215
216 dnl Check for the new membership functions in MacOSX 10.4 (Tiger)...
217 AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
fa73b229 218 AC_CHECK_FUNCS(mbr_uid_to_uuid)
219
220 dnl Check for notify_post support
221 AC_CHECK_HEADER(notify.h,AC_DEFINE(HAVE_NOTIFY_H))
222 AC_CHECK_FUNCS(notify_post)
ef416fc2 223 ;;
e00b005a 224
225 Linux*)
226 dnl Check for DBUS support
ecdc0628 227 if test "x$enable_dbus" != xno; then
228 AC_PATH_PROG(PKGCONFIG, pkg-config)
229 if test "x$PKGCONFIG" != x; then
230 AC_MSG_CHECKING(for DBUS)
231 if $PKGCONFIG --exists dbus-1; then
232 AC_MSG_RESULT(yes)
233 AC_CHECK_LIB(dbus-1,
234 dbus_message_iter_init_append,
235 AC_DEFINE(HAVE_DBUS)
236 CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
237 CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
238 DBUSDIR="/etc/dbus-1/system.d")
239 else
240 AC_MSG_RESULT(no)
241 fi
e00b005a 242 fi
243 fi
244 ;;
ef416fc2 245esac
246
bd7854cb 247dnl See if we have POSIX ACL support...
248SAVELIBS="$LIBS"
249LIBS=""
250AC_SEARCH_LIBS(acl_init, acl, AC_DEFINE(HAVE_ACL_INIT))
251CUPSDLIBS="$CUPSDLIBS $LIBS"
252LIBS="$SAVELIBS"
253
ef416fc2 254AC_SUBST(BACKLIBS)
09ec0018 255AC_SUBST(CUPSDLIBS)
bd7854cb 256AC_SUBST(DBUSDIR)
ef416fc2 257
258dnl New default port definition for IPP...
259AC_ARG_WITH(ipp-port, [ --with-ipp-port set default port number for IPP ],
260 DEFAULT_IPP_PORT="$withval",
261 DEFAULT_IPP_PORT="631")
262
263AC_SUBST(DEFAULT_IPP_PORT)
264AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
265
266dnl
757d2cad 267dnl End of "$Id: cups-common.m4 5229 2006-03-05 16:48:12Z mike $".
ef416fc2 268dnl