]> 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
fa73b229 2dnl "$Id: cups-common.m4 4979 2006-01-25 17:47:43Z 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
72dnl Architecture checks...
73AC_C_BIGENDIAN
74
75dnl Check for libraries...
76AC_SEARCH_LIBS(crypt, crypt)
77AC_SEARCH_LIBS(getspent, sec gen)
78
79LIBMALLOC=""
80AC_ARG_ENABLE(mallinfo, [ --enable-mallinfo turn on malloc debug information, default=no])
81
82if test x$enable_mallinfo = xyes; then
83 AC_CHECK_LIB(c,mallinfo,LIBS="$LIBS"; AC_DEFINE(HAVE_MALLINFO),LIBS="$LIBS")
84 if test "$ac_cv_lib_c_mallinfo" = "no"; then
85 AC_CHECK_LIB(malloc,mallinfo,
86 LIBS="$LIBS"
87 LIBMALLOC="-lmalloc"
88 AC_DEFINE(HAVE_MALLINFO),
89 LIBS="$LIBS")
90 fi
91fi
92
93AC_SUBST(LIBMALLOC)
94
95dnl Check for libpaper support...
96AC_ARG_ENABLE(libpaper, [ --enable-libpaper turn on libpaper support, default=no])
97
98if test x$enable_libpaper = xyes; then
99 AC_CHECK_LIB(paper,systempapername,
100 AC_DEFINE(HAVE_LIBPAPER)
101 LIBPAPER="-lpaper",
102 LIBPAPER="")
103else
104 LIBPAPER=""
105fi
106AC_SUBST(LIBPAPER)
107
108dnl Checks for header files.
109AC_HEADER_STDC
110AC_CHECK_HEADER(crypt.h,AC_DEFINE(HAVE_CRYPT_H))
111AC_CHECK_HEADER(langinfo.h,AC_DEFINE(HAVE_LANGINFO_H))
112AC_CHECK_HEADER(malloc.h,AC_DEFINE(HAVE_MALLOC_H))
113AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H))
114AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H))
115AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H))
116AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H))
117AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H))
118AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H))
119
120dnl Checks for string functions.
121AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy)
122if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
123 echo Forcing snprintf emulation for HP-UX.
124else
125 AC_CHECK_FUNCS(snprintf vsnprintf)
126fi
127
128dnl Checks for mkstemp and mkstemps functions.
129AC_CHECK_FUNCS(mkstemp mkstemps)
130
131dnl Check for geteuid function.
132AC_CHECK_FUNCS(geteuid)
133
134dnl Check for vsyslog function.
135AC_CHECK_FUNCS(vsyslog)
136
137dnl Checks for signal functions.
138case "$uname" in
139 Linux | GNU)
140 # Do not use sigset on Linux or GNU HURD
141 ;;
142 *)
143 # Use sigset on other platforms, if available
144 AC_CHECK_FUNCS(sigset)
145 ;;
146esac
147
148AC_CHECK_FUNCS(sigaction)
149
150dnl Checks for wait functions.
151AC_CHECK_FUNCS(waitpid)
152AC_CHECK_FUNCS(wait3)
153
154dnl See if the tm structure has the tm_gmtoff member...
155AC_MSG_CHECKING(for tm_gmtoff member in tm structure)
156AC_TRY_COMPILE([#include <time.h>],[struct tm t;
157 int o = t.tm_gmtoff;],
158 AC_MSG_RESULT(yes)
159 AC_DEFINE(HAVE_TM_GMTOFF),
160 AC_MSG_RESULT(no))
161
fa73b229 162dnl See if we have POSIX ACL support...
163dnl TODO: Linux/Solaris/IRIX/etc. version
164
165AC_CHECK_FUNCS(acl_init)
166
ef416fc2 167dnl Flags for "ar" command...
168case $uname in
169 Darwin* | *BSD*)
170 ARFLAGS="-rcv"
171 ;;
172 *)
173 ARFLAGS="crvs"
174 ;;
175esac
176
177AC_SUBST(ARFLAGS)
178
179dnl Extra platform-specific libraries...
180case $uname in
181 Darwin*)
182 BACKLIBS="-framework IOKit"
183 LIBS="-framework CoreFoundation $LIBS"
fa73b229 184
185 dnl Check for CFLocaleCreateCanonicalLocaleIdentifierFromString...
186 AC_MSG_CHECKING(for CFLocaleCreateCanonicalLocaleIdentifierFromString)
187 if test "$uname" = "Darwin" -a $uversion -ge 70; then
188 AC_DEFINE(HAVE_CF_LOCALE_ID)
189 AC_MSG_RESULT(yes)
190 else
191 AC_MSG_RESULT(no)
192 fi
193
194 dnl Check for framework headers...
195 AC_CHECK_HEADER(CoreFoundation/CoreFoundation.h,AC_DEFINE(HAVE_COREFOUNDATION_H))
196 AC_CHECK_HEADER(CoreFoundation/CFPriv.h,AC_DEFINE(HAVE_CFPRIV_H))
197 AC_CHECK_HEADER(CoreFoundation/CFBundlePriv.h,AC_DEFINE(HAVE_CFBUNDLEPRIV_H))
198
199 dnl Check for the new membership functions in MacOSX 10.4 (Tiger)...
200 AC_CHECK_HEADER(membership.h,AC_DEFINE(HAVE_MEMBERSHIP_H))
201 AC_CHECK_HEADER(membershipPriv.h,AC_DEFINE(HAVE_MEMBERSHIPPRIV_H))
202 AC_CHECK_FUNCS(mbr_uid_to_uuid)
203
204 dnl Check for notify_post support
205 AC_CHECK_HEADER(notify.h,AC_DEFINE(HAVE_NOTIFY_H))
206 AC_CHECK_FUNCS(notify_post)
ef416fc2 207 ;;
208 *)
209 BACKLIBS=""
210 ;;
211esac
212
213AC_SUBST(BACKLIBS)
214
215dnl New default port definition for IPP...
216AC_ARG_WITH(ipp-port, [ --with-ipp-port set default port number for IPP ],
217 DEFAULT_IPP_PORT="$withval",
218 DEFAULT_IPP_PORT="631")
219
220AC_SUBST(DEFAULT_IPP_PORT)
221AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT)
222
223dnl
fa73b229 224dnl End of "$Id: cups-common.m4 4979 2006-01-25 17:47:43Z mike $".
ef416fc2 225dnl