]> 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
b86bc4cf 2dnl "$Id: cups-common.m4 6145 2006-12-06 20:10:16Z 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
411affcf 31dnl Version number information...
b86bc4cf 32CUPS_VERSION="1.2.8"
ecdc0628 33CUPS_REVISION=""
ecdc0628 34
ef416fc2 35AC_SUBST(CUPS_VERSION)
ecdc0628 36AC_SUBST(CUPS_REVISION)
37AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION$CUPS_REVISION")
38AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION$CUPS_REVISION")
ef416fc2 39
40dnl Default compiler flags...
41CFLAGS="${CFLAGS:=}"
42CPPFLAGS="${CPPFLAGS:=}"
43CXXFLAGS="${CXXFLAGS:=}"
44LDFLAGS="${LDFLAGS:=}"
45
46dnl Checks for programs...
47AC_PROG_AWK
48AC_PROG_CC
49AC_PROG_CXX
50AC_PROG_CPP
51AC_PROG_INSTALL
52if test "$INSTALL" = "$ac_install_sh"; then
53 # Use full path to install-sh script...
54 INSTALL="`pwd`/install-sh -c"
55fi
56AC_PROG_RANLIB
57AC_PATH_PROG(AR,ar)
58AC_PATH_PROG(HTMLDOC,htmldoc)
bd7854cb 59AC_PATH_PROG(LD,ld)
ef416fc2 60AC_PATH_PROG(LN,ln)
61AC_PATH_PROG(MV,mv)
62AC_PATH_PROG(RM,rm)
e1d6a774 63AC_PATH_PROG(RMDIR,rmdir)
ef416fc2 64AC_PATH_PROG(SED,sed)
65AC_PATH_PROG(STRIP,strip)
66
67if test "x$AR" = x; then
68 AC_MSG_ERROR([Unable to find required library archive command.])
69fi
70if test "x$CC" = x; then
71 AC_MSG_ERROR([Unable to find required C compiler command.])
72fi
73if test "x$CXX" = x; then
74 AC_MSG_ERROR([Unable to find required C++ compiler command.])
75fi
76
923edb68 77dnl Static library option...
78INSTALLSTATIC=""
d6ae789d 79AC_ARG_ENABLE(static, [ --enable-static install static libraries, default=no])
923edb68 80
d6ae789d 81if test x$enable_static = xyes; then
82 echo Installing static libraries...
923edb68 83 INSTALLSTATIC="installstatic"
84fi
85
86AC_SUBST(INSTALLSTATIC)
ef416fc2 87
88dnl Check for libraries...
89AC_SEARCH_LIBS(crypt, crypt)
90AC_SEARCH_LIBS(getspent, sec gen)
91
92LIBMALLOC=""
93AC_ARG_ENABLE(mallinfo, [ --enable-mallinfo turn on malloc debug information, default=no])
94
95if 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,
99 LIBS="$LIBS"
100 LIBMALLOC="-lmalloc"
101 AC_DEFINE(HAVE_MALLINFO),
102 LIBS="$LIBS")
103 fi
104fi
105
106AC_SUBST(LIBMALLOC)
107
108dnl Check for libpaper support...
109AC_ARG_ENABLE(libpaper, [ --enable-libpaper turn on libpaper support, default=no])
110
111if test x$enable_libpaper = xyes; then
112 AC_CHECK_LIB(paper,systempapername,
113 AC_DEFINE(HAVE_LIBPAPER)
114 LIBPAPER="-lpaper",
115 LIBPAPER="")
116else
117 LIBPAPER=""
118fi
119AC_SUBST(LIBPAPER)
120
121dnl Checks for header files.
122AC_HEADER_STDC
123AC_CHECK_HEADER(crypt.h,AC_DEFINE(HAVE_CRYPT_H))
124AC_CHECK_HEADER(langinfo.h,AC_DEFINE(HAVE_LANGINFO_H))
125AC_CHECK_HEADER(malloc.h,AC_DEFINE(HAVE_MALLOC_H))
126AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H))
127AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
128AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
129AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
130AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
131AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
2abf387c 132AC_CHECK_HEADER(scsi/sg.h,AC_DEFINE(HAVE_SCSI_SG_H))
ef416fc2 133
134dnl Checks for string functions.
135AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
136if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
137 echo Forcing snprintf emulation for HP-UX.
138else
139 AC_CHECK_FUNCS(snprintf vsnprintf)
140fi
141
142dnl Checks for mkstemp and mkstemps functions.
143AC_CHECK_FUNCS(mkstemp mkstemps)
144
145dnl Check for geteuid function.
146AC_CHECK_FUNCS(geteuid)
147
148dnl Check for vsyslog function.
149AC_CHECK_FUNCS(vsyslog)
150
151dnl Checks for signal functions.
152case "$uname" in
153 Linux | GNU)
154 # Do not use sigset on Linux or GNU HURD
155 ;;
156 *)
157 # Use sigset on other platforms, if available
158 AC_CHECK_FUNCS(sigset)
159 ;;
160esac
161
162AC_CHECK_FUNCS(sigaction)
163
164dnl Checks for wait functions.
165AC_CHECK_FUNCS(waitpid)
166AC_CHECK_FUNCS(wait3)
167
168dnl See if the tm structure has the tm_gmtoff member...
169AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
170AC_TRY_COMPILE([#include <time.h>],[struct tm t;
171 int o = t.tm_gmtoff;],
172 AC_MSG_RESULT(yes)
173 AC_DEFINE(HAVE_TM_GMTOFF),
174 AC_MSG_RESULT(no))
175
176dnl Flags for "ar" command...
177case $uname in
178 Darwin* | *BSD*)
179 ARFLAGS="-rcv"
180 ;;
181 *)
182 ARFLAGS="crvs"
183 ;;
184esac
185
186AC_SUBST(ARFLAGS)
187
188dnl Extra platform-specific libraries...
bd7854cb 189BACKLIBS=""
190CUPSDLIBS=""
191DBUSDIR=""
192
ecdc0628 193AC_ARG_ENABLE(dbus, [ --enable-dbus enable DBUS support, default=auto])
194
ef416fc2 195case $uname in
196 Darwin*)
197 BACKLIBS="-framework IOKit"
09ec0018 198 CUPSDLIBS="-framework IOKit -framework SystemConfiguration"
ef416fc2 199 LIBS="-framework CoreFoundation $LIBS"
fa73b229 200
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)
205 AC_MSG_RESULT(yes)
206 else
207 AC_MSG_RESULT(no)
208 fi
209
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))
214
215 dnl Check for the new membership functions in MacOSX 10.4 (Tiger)...
216 AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
fa73b229 217 AC_CHECK_FUNCS(mbr_uid_to_uuid)
218
219 dnl Check for notify_post support
220 AC_CHECK_HEADER(notify.h,AC_DEFINE(HAVE_NOTIFY_H))
221 AC_CHECK_FUNCS(notify_post)
ef416fc2 222 ;;
e00b005a 223
224 Linux*)
225 dnl Check for DBUS support
ecdc0628 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
231 AC_MSG_RESULT(yes)
2abf387c 232 AC_DEFINE(HAVE_DBUS)
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"
ecdc0628 236 AC_CHECK_LIB(dbus-1,
237 dbus_message_iter_init_append,
2abf387c 238 AC_DEFINE(HAVE_DBUS_MESSAGE_ITER_INIT_APPEND))
ecdc0628 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
b86bc4cf 267dnl End of "$Id: cups-common.m4 6145 2006-12-06 20:10:16Z mike $".
ef416fc2 268dnl