]> 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
e00b005a 2dnl "$Id: cups-common.m4 5025 2006-01-30 03:49:12Z mike $"
ef416fc2 3dnl
4dnl Common configuration stuff for the Common UNIX Printing System (CUPS).
5dnl
6dnl Copyright 1997-2005 by Easy Software Products, all rights reserved.
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"
33AC_SUBST(CUPS_VERSION)
34AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION")
35AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION")
36
37dnl Default compiler flags...
38CFLAGS="${CFLAGS:=}"
39CPPFLAGS="${CPPFLAGS:=}"
40CXXFLAGS="${CXXFLAGS:=}"
41LDFLAGS="${LDFLAGS:=}"
42
43dnl Checks for programs...
44AC_PROG_AWK
45AC_PROG_CC
46AC_PROG_CXX
47AC_PROG_CPP
48AC_PROG_INSTALL
49if test "$INSTALL" = "$ac_install_sh"; then
50 # Use full path to install-sh script...
51 INSTALL="`pwd`/install-sh -c"
52fi
53AC_PROG_RANLIB
54AC_PATH_PROG(AR,ar)
55AC_PATH_PROG(HTMLDOC,htmldoc)
56AC_PATH_PROG(LN,ln)
57AC_PATH_PROG(MV,mv)
58AC_PATH_PROG(RM,rm)
59AC_PATH_PROG(SED,sed)
60AC_PATH_PROG(STRIP,strip)
61
62if test "x$AR" = x; then
63 AC_MSG_ERROR([Unable to find required library archive command.])
64fi
65if test "x$CC" = x; then
66 AC_MSG_ERROR([Unable to find required C compiler command.])
67fi
68if test "x$CXX" = x; then
69 AC_MSG_ERROR([Unable to find required C++ compiler command.])
70fi
71
923edb68 72dnl Static library option...
73INSTALLSTATIC=""
74AC_ARG_ENABLE(install_static, [ --enable-static install static libraries, default=no])
75
76if test x$enable_install_static = xyes; then
77 INSTALLSTATIC="installstatic"
78fi
79
80AC_SUBST(INSTALLSTATIC)
ef416fc2 81
82dnl Check for libraries...
83AC_SEARCH_LIBS(crypt, crypt)
84AC_SEARCH_LIBS(getspent, sec gen)
85
86LIBMALLOC=""
87AC_ARG_ENABLE(mallinfo, [ --enable-mallinfo turn on malloc debug information, default=no])
88
89if test x$enable_mallinfo = xyes; then
90 AC_CHECK_LIB(c,mallinfo,LIBS="$LIBS"; AC_DEFINE(HAVE_MALLINFO),LIBS="$LIBS")
91 if test "$ac_cv_lib_c_mallinfo" = "no"; then
92 AC_CHECK_LIB(malloc,mallinfo,
93 LIBS="$LIBS"
94 LIBMALLOC="-lmalloc"
95 AC_DEFINE(HAVE_MALLINFO),
96 LIBS="$LIBS")
97 fi
98fi
99
100AC_SUBST(LIBMALLOC)
101
102dnl Check for libpaper support...
103AC_ARG_ENABLE(libpaper, [ --enable-libpaper turn on libpaper support, default=no])
104
105if test x$enable_libpaper = xyes; then
106 AC_CHECK_LIB(paper,systempapername,
107 AC_DEFINE(HAVE_LIBPAPER)
108 LIBPAPER="-lpaper",
109 LIBPAPER="")
110else
111 LIBPAPER=""
112fi
113AC_SUBST(LIBPAPER)
114
115dnl Checks for header files.
116AC_HEADER_STDC
117AC_CHECK_HEADER(crypt.h,AC_DEFINE(HAVE_CRYPT_H))
118AC_CHECK_HEADER(langinfo.h,AC_DEFINE(HAVE_LANGINFO_H))
119AC_CHECK_HEADER(malloc.h,AC_DEFINE(HAVE_MALLOC_H))
120AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H))
121AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
122AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
123AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
124AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
125AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
126
127dnl Checks for string functions.
128AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
129if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
130 echo Forcing snprintf emulation for HP-UX.
131else
132 AC_CHECK_FUNCS(snprintf vsnprintf)
133fi
134
135dnl Checks for mkstemp and mkstemps functions.
136AC_CHECK_FUNCS(mkstemp mkstemps)
137
138dnl Check for geteuid function.
139AC_CHECK_FUNCS(geteuid)
140
141dnl Check for vsyslog function.
142AC_CHECK_FUNCS(vsyslog)
143
144dnl Checks for signal functions.
145case "$uname" in
146 Linux | GNU)
147 # Do not use sigset on Linux or GNU HURD
148 ;;
149 *)
150 # Use sigset on other platforms, if available
151 AC_CHECK_FUNCS(sigset)
152 ;;
153esac
154
155AC_CHECK_FUNCS(sigaction)
156
157dnl Checks for wait functions.
158AC_CHECK_FUNCS(waitpid)
159AC_CHECK_FUNCS(wait3)
160
161dnl See if the tm structure has the tm_gmtoff member...
162AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
163AC_TRY_COMPILE([#include <time.h>],[struct tm t;
164 int o = t.tm_gmtoff;],
165 AC_MSG_RESULT(yes)
166 AC_DEFINE(HAVE_TM_GMTOFF),
167 AC_MSG_RESULT(no))
168
fa73b229 169dnl See if we have POSIX ACL support...
170dnl TODO: Linux/Solaris/IRIX/etc. version
171
172AC_CHECK_FUNCS(acl_init)
173
ef416fc2 174dnl Flags for "ar" command...
175case $uname in
176 Darwin* | *BSD*)
177 ARFLAGS="-rcv"
178 ;;
179 *)
180 ARFLAGS="crvs"
181 ;;
182esac
183
184AC_SUBST(ARFLAGS)
185
186dnl Extra platform-specific libraries...
187case $uname in
188 Darwin*)
189 BACKLIBS="-framework IOKit"
09ec0018 190 CUPSDLIBS="-framework IOKit -framework SystemConfiguration"
ef416fc2 191 LIBS="-framework CoreFoundation $LIBS"
fa73b229 192
193 dnl Check for CFLocaleCreateCanonicalLocaleIdentifierFromString...
194 AC_MSG_CHECKING(for CFLocaleCreateCanonicalLocaleIdentifierFromString)
195 if test "$uname" = "Darwin" -a $uversion -ge 70; then
196 AC_DEFINE(HAVE_CF_LOCALE_ID)
197 AC_MSG_RESULT(yes)
198 else
199 AC_MSG_RESULT(no)
200 fi
201
202 dnl Check for framework headers...
203 AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H))
204 AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
205 AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H))
206
207 dnl Check for the new membership functions in MacOSX 10.4 (Tiger)...
208 AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
209 AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H))
210 AC_CHECK_FUNCS(mbr_uid_to_uuid)
211
212 dnl Check for notify_post support
213 AC_CHECK_HEADER(notify.h,AC_DEFINE(HAVE_NOTIFY_H))
214 AC_CHECK_FUNCS(notify_post)
ef416fc2 215 ;;
e00b005a 216
217 Linux*)
218 dnl Check for DBUS support
219 BACKLIBS=""
220 CUPSDLIBS=""
221
222 AC_PATH_PROG(PKGCONFIG, pkg-config)
223 if test "x$PKGCONFIG" != x; then
224 AC_MSG_CHECKING(for DBUS)
225 if $PKGCONFIG --exists dbus-1; then
226 AC_MSG_RESULT(yes)
227 AC_DEFINE(HAVE_DBUS)
228 CFLAGS="$CFLAGS `$PKGCONFIG --cflags dbus-1` -DDBUS_API_SUBJECT_TO_CHANGE"
229 CUPSDLIBS="`$PKGCONFIG --libs dbus-1`"
230 else
231 AC_MSG_RESULT(no)
232 fi
233 fi
234 ;;
235
ef416fc2 236 *)
237 BACKLIBS=""
09ec0018 238 CUPSDLIBS=""
ef416fc2 239 ;;
240esac
241
242AC_SUBST(BACKLIBS)
09ec0018 243AC_SUBST(CUPSDLIBS)
ef416fc2 244
245dnl New default port definition for IPP...
246AC_ARG_WITH(ipp-port, [ --with-ipp-port set default port number for IPP ],
247 DEFAULT_IPP_PORT="$withval",
248 DEFAULT_IPP_PORT="631")
249
250AC_SUBST(DEFAULT_IPP_PORT)
251AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
252
253dnl
e00b005a 254dnl End of "$Id: cups-common.m4 5025 2006-01-30 03:49:12Z mike $".
ef416fc2 255dnl