]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | dnl |
2 | dnl "$Id: cups-common.m4 4833 2005-11-12 21:46:52Z mike $" | |
3 | dnl | |
4 | dnl Common configuration stuff for the Common UNIX Printing System (CUPS). | |
5 | dnl | |
6 | dnl Copyright 1997-2005 by Easy Software Products, all rights reserved. | |
7 | dnl | |
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 | |
13 | dnl at: | |
14 | dnl | |
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 | |
19 | dnl | |
20 | dnl Voice: (301) 373-9600 | |
21 | dnl EMail: cups-info@cups.org | |
22 | dnl WWW: http://www.cups.org | |
23 | dnl | |
24 | ||
25 | dnl We need at least autoconf 2.50... | |
26 | AC_PREREQ(2.50) | |
27 | ||
28 | dnl Set the name of the config header file... | |
29 | AC_CONFIG_HEADER(config.h) | |
30 | ||
31 | dnl Versio number information... | |
32 | CUPS_VERSION="1.2svn" | |
33 | AC_SUBST(CUPS_VERSION) | |
34 | AC_DEFINE_UNQUOTED(CUPS_SVERSION, "CUPS v$CUPS_VERSION") | |
35 | AC_DEFINE_UNQUOTED(CUPS_MINIMAL, "CUPS/$CUPS_VERSION") | |
36 | ||
37 | dnl Default compiler flags... | |
38 | CFLAGS="${CFLAGS:=}" | |
39 | CPPFLAGS="${CPPFLAGS:=}" | |
40 | CXXFLAGS="${CXXFLAGS:=}" | |
41 | LDFLAGS="${LDFLAGS:=}" | |
42 | ||
43 | dnl Checks for programs... | |
44 | AC_PROG_AWK | |
45 | AC_PROG_CC | |
46 | AC_PROG_CXX | |
47 | AC_PROG_CPP | |
48 | AC_PROG_INSTALL | |
49 | if test "$INSTALL" = "$ac_install_sh"; then | |
50 | # Use full path to install-sh script... | |
51 | INSTALL="`pwd`/install-sh -c" | |
52 | fi | |
53 | AC_PROG_RANLIB | |
54 | AC_PATH_PROG(AR,ar) | |
55 | AC_PATH_PROG(HTMLDOC,htmldoc) | |
56 | AC_PATH_PROG(LN,ln) | |
57 | AC_PATH_PROG(MV,mv) | |
58 | AC_PATH_PROG(RM,rm) | |
59 | AC_PATH_PROG(SED,sed) | |
60 | AC_PATH_PROG(STRIP,strip) | |
61 | ||
62 | if test "x$AR" = x; then | |
63 | AC_MSG_ERROR([Unable to find required library archive command.]) | |
64 | fi | |
65 | if test "x$CC" = x; then | |
66 | AC_MSG_ERROR([Unable to find required C compiler command.]) | |
67 | fi | |
68 | if test "x$CXX" = x; then | |
69 | AC_MSG_ERROR([Unable to find required C++ compiler command.]) | |
70 | fi | |
71 | ||
72 | dnl Architecture checks... | |
73 | AC_C_BIGENDIAN | |
74 | ||
75 | dnl Check for libraries... | |
76 | AC_SEARCH_LIBS(crypt, crypt) | |
77 | AC_SEARCH_LIBS(getspent, sec gen) | |
78 | ||
79 | LIBMALLOC="" | |
80 | AC_ARG_ENABLE(mallinfo, [ --enable-mallinfo turn on malloc debug information, default=no]) | |
81 | ||
82 | if 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 | |
91 | fi | |
92 | ||
93 | AC_SUBST(LIBMALLOC) | |
94 | ||
95 | dnl Check for libpaper support... | |
96 | AC_ARG_ENABLE(libpaper, [ --enable-libpaper turn on libpaper support, default=no]) | |
97 | ||
98 | if test x$enable_libpaper = xyes; then | |
99 | AC_CHECK_LIB(paper,systempapername, | |
100 | AC_DEFINE(HAVE_LIBPAPER) | |
101 | LIBPAPER="-lpaper", | |
102 | LIBPAPER="") | |
103 | else | |
104 | LIBPAPER="" | |
105 | fi | |
106 | AC_SUBST(LIBPAPER) | |
107 | ||
108 | dnl Checks for header files. | |
109 | AC_HEADER_STDC | |
110 | AC_CHECK_HEADER(crypt.h,AC_DEFINE(HAVE_CRYPT_H)) | |
111 | AC_CHECK_HEADER(langinfo.h,AC_DEFINE(HAVE_LANGINFO_H)) | |
112 | AC_CHECK_HEADER(malloc.h,AC_DEFINE(HAVE_MALLOC_H)) | |
113 | AC_CHECK_HEADER(shadow.h,AC_DEFINE(HAVE_SHADOW_H)) | |
114 | AC_CHECK_HEADER(string.h,AC_DEFINE(HAVE_STRING_H)) | |
115 | AC_CHECK_HEADER(strings.h,AC_DEFINE(HAVE_STRINGS_H)) | |
116 | AC_CHECK_HEADER(bstring.h,AC_DEFINE(HAVE_BSTRING_H)) | |
117 | AC_CHECK_HEADER(usersec.h,AC_DEFINE(HAVE_USERSEC_H)) | |
118 | AC_CHECK_HEADER(sys/ioctl.h,AC_DEFINE(HAVE_SYS_IOCTL_H)) | |
119 | ||
120 | dnl Checks for string functions. | |
121 | AC_CHECK_FUNCS(strdup strcasecmp strncasecmp strlcat strlcpy) | |
122 | if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then | |
123 | echo Forcing snprintf emulation for HP-UX. | |
124 | else | |
125 | AC_CHECK_FUNCS(snprintf vsnprintf) | |
126 | fi | |
127 | ||
128 | dnl Checks for mkstemp and mkstemps functions. | |
129 | AC_CHECK_FUNCS(mkstemp mkstemps) | |
130 | ||
131 | dnl Check for geteuid function. | |
132 | AC_CHECK_FUNCS(geteuid) | |
133 | ||
134 | dnl Check for vsyslog function. | |
135 | AC_CHECK_FUNCS(vsyslog) | |
136 | ||
137 | dnl Checks for signal functions. | |
138 | case "$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 | ;; | |
146 | esac | |
147 | ||
148 | AC_CHECK_FUNCS(sigaction) | |
149 | ||
150 | dnl Checks for wait functions. | |
151 | AC_CHECK_FUNCS(waitpid) | |
152 | AC_CHECK_FUNCS(wait3) | |
153 | ||
154 | dnl See if the tm structure has the tm_gmtoff member... | |
155 | AC_MSG_CHECKING(for tm_gmtoff member in tm structure) | |
156 | AC_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 | ||
162 | dnl Flags for "ar" command... | |
163 | case $uname in | |
164 | Darwin* | *BSD*) | |
165 | ARFLAGS="-rcv" | |
166 | ;; | |
167 | *) | |
168 | ARFLAGS="crvs" | |
169 | ;; | |
170 | esac | |
171 | ||
172 | AC_SUBST(ARFLAGS) | |
173 | ||
174 | dnl Extra platform-specific libraries... | |
175 | case $uname in | |
176 | Darwin*) | |
177 | BACKLIBS="-framework IOKit" | |
178 | LIBS="-framework CoreFoundation $LIBS" | |
179 | ;; | |
180 | *) | |
181 | BACKLIBS="" | |
182 | ;; | |
183 | esac | |
184 | ||
185 | AC_SUBST(BACKLIBS) | |
186 | ||
187 | dnl New default port definition for IPP... | |
188 | AC_ARG_WITH(ipp-port, [ --with-ipp-port set default port number for IPP ], | |
189 | DEFAULT_IPP_PORT="$withval", | |
190 | DEFAULT_IPP_PORT="631") | |
191 | ||
192 | AC_SUBST(DEFAULT_IPP_PORT) | |
193 | AC_DEFINE_UNQUOTED(CUPS_DEFAULT_IPP_PORT,$DEFAULT_IPP_PORT) | |
194 | ||
195 | dnl | |
196 | dnl End of "$Id: cups-common.m4 4833 2005-11-12 21:46:52Z mike $". | |
197 | dnl |