1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | AC_REVISION([$Id: configure.in,v 1.4 2001-04-04 00:04:41 ghudson Exp $]) |
---|
3 | AC_PREREQ(2.13)dnl dnl Minimum Autoconf version required. |
---|
4 | AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir. |
---|
5 | |
---|
6 | AM_INIT_AUTOMAKE(make, 3.79.1) |
---|
7 | AM_CONFIG_HEADER(config.h) |
---|
8 | |
---|
9 | dnl Regular configure stuff |
---|
10 | |
---|
11 | AC_CANONICAL_HOST |
---|
12 | AC_PROG_MAKE_SET |
---|
13 | AC_PROG_CC |
---|
14 | AC_PROG_INSTALL |
---|
15 | AC_CHECK_PROG(AR, ar, ar, ar) |
---|
16 | AC_PROG_RANLIB |
---|
17 | AC_PROG_CPP dnl Later checks need this. |
---|
18 | AC_AIX |
---|
19 | AC_ISC_POSIX |
---|
20 | AC_MINIX |
---|
21 | |
---|
22 | AC_CHECK_PROG(PERL, perl, perl, perl) dnl Needed for the test suite (only) |
---|
23 | |
---|
24 | dnl This test must come as early as possible after the compiler configuration |
---|
25 | dnl tests, because the choice of the file model can (in principle) affect |
---|
26 | dnl whether functions and headers are available, whether they work, etc. |
---|
27 | AC_SYS_LARGEFILE |
---|
28 | |
---|
29 | AC_HEADER_STDC |
---|
30 | AC_HEADER_DIRENT |
---|
31 | AC_TYPE_UID_T dnl Also does gid_t. |
---|
32 | AC_TYPE_PID_T |
---|
33 | AC_TYPE_SIGNAL |
---|
34 | AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/param.h fcntl.h string.h \ |
---|
35 | memory.h sys/time.h sys/timeb.h) |
---|
36 | AC_PROG_CC_C_O |
---|
37 | AM_PROG_CC_STDC |
---|
38 | AC_C_CONST dnl getopt needs this. |
---|
39 | AC_C_INLINE dnl gettext needs this. |
---|
40 | AC_HEADER_STAT |
---|
41 | AC_HEADER_TIME |
---|
42 | |
---|
43 | dnl Handle internationalization |
---|
44 | |
---|
45 | ALL_LINGUAS="de es fr ja ko nl pl pt_BR ru" |
---|
46 | pds_WITH_GETTEXT |
---|
47 | |
---|
48 | |
---|
49 | dnl See if the user wants nsec timestamps |
---|
50 | |
---|
51 | AC_ARG_ENABLE(nsec-timestamps, |
---|
52 | [ --disable-nsec-timestamps disable use of sub-second timestamps], |
---|
53 | [make_cv_nsec_timestamps="$enableval"], |
---|
54 | [make_cv_nsec_timestamps="yes"]) |
---|
55 | |
---|
56 | if test "x$make_cv_nsec_timestamps" != xno; then |
---|
57 | AC_STRUCT_ST_MTIM_NSEC |
---|
58 | fi |
---|
59 | jm_AC_TYPE_UINTMAX_T |
---|
60 | |
---|
61 | AC_SUBST(LIBOBJS) |
---|
62 | |
---|
63 | AC_DEFUN(AC_CHECK_SYMBOL, [dnl |
---|
64 | AC_MSG_CHECKING(for $1) |
---|
65 | AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl |
---|
66 | AC_TRY_LINK(, [extern char *sys_siglist[]; puts(*sys_siglist);], |
---|
67 | ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)]) |
---|
68 | if test "$ac_cv_check_symbol_$1" = yes; then |
---|
69 | changequote(,)dnl |
---|
70 | ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'` |
---|
71 | changequote([,])dnl |
---|
72 | AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol}) |
---|
73 | fi |
---|
74 | AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl |
---|
75 | |
---|
76 | # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function. |
---|
77 | # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. |
---|
78 | AC_SEARCH_LIBS(clock_gettime, [rt posix4]) |
---|
79 | if test "$ac_cv_search_clock_gettime" != no; then |
---|
80 | AC_DEFINE(HAVE_CLOCK_GETTIME, 1, |
---|
81 | [Define if you have the clock_gettime function.]) |
---|
82 | fi |
---|
83 | |
---|
84 | # See if we have a standard version of gettimeofday(). Since actual |
---|
85 | # implementations can differ, just make sure we have the most common |
---|
86 | # one. |
---|
87 | AC_CACHE_CHECK([for standard gettimeofday], ac_cv_func_gettimeofday, |
---|
88 | [ac_cv_func_gettimeofday=no |
---|
89 | AC_TRY_RUN([#include <sys/time.h> |
---|
90 | int main () |
---|
91 | { |
---|
92 | struct timeval t; t.tv_sec = -1; t.tv_usec = -1; |
---|
93 | exit (gettimeofday (&t, 0) != 0 |
---|
94 | || t.tv_sec < 0 || t.tv_usec < 0); |
---|
95 | }], |
---|
96 | ac_cv_func_gettimeofday=yes, |
---|
97 | ac_cv_func_gettimeofday=no, |
---|
98 | ac_cv_func_gettimeofday="no (cross-compiling)")]) |
---|
99 | if test $ac_cv_func_gettimeofday = yes; then |
---|
100 | AC_DEFINE(HAVE_GETTIMEOFDAY, 1, |
---|
101 | [Define if you have a standard gettimeofday function]) |
---|
102 | fi |
---|
103 | |
---|
104 | AC_CHECK_FUNCS( memmove memcpy strchr strdup psignal mkstemp mktemp fdopen \ |
---|
105 | dup2 getcwd sigsetmask sigaction getgroups setlinebuf \ |
---|
106 | seteuid setegid setreuid setregid pipe strerror strsignal) |
---|
107 | |
---|
108 | AC_CHECK_SYMBOL(sys_siglist) |
---|
109 | AC_FUNC_ALLOCA |
---|
110 | AC_FUNC_VFORK |
---|
111 | AC_FUNC_VPRINTF |
---|
112 | AC_FUNC_STRCOLL |
---|
113 | AC_FUNC_CLOSEDIR_VOID |
---|
114 | AC_FUNC_SETVBUF_REVERSED |
---|
115 | |
---|
116 | AC_CHECK_LIB(kstat, kstat_open) dnl _Must_ come before AC_FUNC_GETLOADAVG. |
---|
117 | AC_CHECK_FUNCS(pstat_getdynamic) dnl Supposedly in AC_FUNC_GETLOADAVG, but...? |
---|
118 | AC_FUNC_GETLOADAVG |
---|
119 | |
---|
120 | # Check out the wait reality. |
---|
121 | AC_CHECK_HEADERS(sys/wait.h) |
---|
122 | AC_CHECK_FUNCS(waitpid wait3) |
---|
123 | AC_MSG_CHECKING(for union wait) |
---|
124 | AC_CACHE_VAL(make_cv_union_wait, [dnl |
---|
125 | AC_TRY_LINK([#include <sys/types.h> |
---|
126 | #include <sys/wait.h>], |
---|
127 | [union wait status; int pid; pid = wait (&status); |
---|
128 | #ifdef WEXITSTATUS |
---|
129 | /* Some POSIXoid systems have both the new-style macros and the old |
---|
130 | union wait type, and they do not work together. If union wait |
---|
131 | conflicts with WEXITSTATUS et al, we don't want to use it at all. */ |
---|
132 | if (WEXITSTATUS (status) != 0) pid = -1; |
---|
133 | #ifdef WTERMSIG |
---|
134 | /* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */ |
---|
135 | -- blow chunks here -- |
---|
136 | #endif |
---|
137 | #endif |
---|
138 | #ifdef HAVE_WAITPID |
---|
139 | /* Make sure union wait works with waitpid. */ |
---|
140 | pid = waitpid (-1, &status, 0); |
---|
141 | #endif |
---|
142 | ], |
---|
143 | [make_cv_union_wait=yes], [make_cv_union_wait=no])]) |
---|
144 | if test "$make_cv_union_wait" = yes; then |
---|
145 | AC_DEFINE(HAVE_UNION_WAIT, 1, [Define this if you have the \`union wait' type in <sys/wait.h>.]) |
---|
146 | fi |
---|
147 | AC_MSG_RESULT($make_cv_union_wait) |
---|
148 | |
---|
149 | AC_DECL_SYS_SIGLIST |
---|
150 | |
---|
151 | # The presence of the following is not meant to imply |
---|
152 | # that make necessarily works on those systems. |
---|
153 | AC_SEARCH_LIBS(getpwnam, sun) |
---|
154 | |
---|
155 | AC_SUBST(REMOTE) REMOTE=stub |
---|
156 | make_try_customs=no |
---|
157 | AC_ARG_WITH(customs, |
---|
158 | [ --with-customs=DIR Enable remote jobs via Customs--see README.customs], |
---|
159 | [case "$withval" in |
---|
160 | n|no) ;; |
---|
161 | *) make_cppflags="$CPPFLAGS" |
---|
162 | case "$withval" in |
---|
163 | y|ye|yes) ;; |
---|
164 | *) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs" |
---|
165 | make_ldflags="$LDFLAGS -L$with_customs/lib" ;; |
---|
166 | esac |
---|
167 | CF_NETLIBS |
---|
168 | AC_CHECK_HEADER(customs.h, |
---|
169 | REMOTE=cstms |
---|
170 | LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags", |
---|
171 | with_customs=no |
---|
172 | CPPFLAGS="$make_cppflags" make_badcust=yes) |
---|
173 | ;; |
---|
174 | esac]) |
---|
175 | |
---|
176 | dnl See if we can handle the job server feature, and if the user wants it. |
---|
177 | |
---|
178 | AC_ARG_ENABLE(job-server, |
---|
179 | [ --disable-job-server Disallow recursive make communication during -jN], |
---|
180 | [make_cv_job_server="$enableval" user_job_server="$enableval"], |
---|
181 | [make_cv_job_server="yes"]) |
---|
182 | |
---|
183 | has_wait_nohang=yes |
---|
184 | case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in |
---|
185 | no/no) has_wait_nohang=no ;; |
---|
186 | esac |
---|
187 | |
---|
188 | case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$has_wait_nohang/$make_cv_job_server" in |
---|
189 | yes/yes/yes/yes) AC_DEFINE(MAKE_JOBSERVER, 1, |
---|
190 | [Define this to enable job server support in GNU make.]);; |
---|
191 | esac |
---|
192 | |
---|
193 | dnl Allow building with dmalloc |
---|
194 | |
---|
195 | AC_ARG_ENABLE(dmalloc, |
---|
196 | [ --enable-dmalloc Enable support for the dmalloc debugging library], |
---|
197 | [make_cv_dmalloc="$enableval"], |
---|
198 | [make_cv_dmalloc="no"]) |
---|
199 | |
---|
200 | case "$make_cv_dmalloc" in |
---|
201 | yes) AC_CHECK_HEADERS(dmalloc.h) |
---|
202 | AC_CHECK_LIB(dmalloc, dmalloc_shutdown) |
---|
203 | CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" ;; |
---|
204 | esac |
---|
205 | |
---|
206 | AC_CACHE_CHECK(for location of SCCS get command, make_cv_path_sccs_get, [ |
---|
207 | if test -f /usr/sccs/get; then |
---|
208 | make_cv_path_sccs_get=/usr/sccs/get |
---|
209 | else |
---|
210 | make_cv_path_sccs_get=get |
---|
211 | fi]) |
---|
212 | AC_DEFINE_UNQUOTED(SCCS_GET,["$make_cv_path_sccs_get"]) |
---|
213 | |
---|
214 | ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later. |
---|
215 | if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 && |
---|
216 | test -f s.conftest; then |
---|
217 | # We successfully created an SCCS file. |
---|
218 | AC_CACHE_CHECK(if SCCS get command understands -G, make_cv_sys_get_minus_G, [ |
---|
219 | if $make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 && |
---|
220 | test -f conftoast; then |
---|
221 | make_cv_sys_get_minus_G=yes |
---|
222 | else |
---|
223 | make_cv_sys_get_minus_G=no |
---|
224 | fi]) |
---|
225 | case "$make_cv_sys_get_minus_G" in |
---|
226 | yes) AC_DEFINE(SCCS_GET_MINUS_G, 1, |
---|
227 | [Define this if the SCCS \`get' command understands the \`-G<file>' option.]);; |
---|
228 | esac |
---|
229 | fi |
---|
230 | rm -f s.conftest conftoast |
---|
231 | |
---|
232 | AC_MSG_CHECKING(if system libc has GNU glob) |
---|
233 | AC_CACHE_VAL(make_cv_sys_gnu_glob, [ |
---|
234 | AC_TRY_CPP([ |
---|
235 | #include <features.h> |
---|
236 | #include <glob.h> |
---|
237 | #include <fnmatch.h> |
---|
238 | |
---|
239 | #define GLOB_INTERFACE_VERSION 1 |
---|
240 | #if defined _LIBC || !defined __GNU_LIBRARY__ || __GNU_LIBRARY__ <= 1 |
---|
241 | # error no gnu glob |
---|
242 | #else |
---|
243 | # include <gnu-versions.h> |
---|
244 | # if _GNU_GLOB_INTERFACE_VERSION != GLOB_INTERFACE_VERSION |
---|
245 | # error no gnu glob |
---|
246 | # endif |
---|
247 | #endif |
---|
248 | ], make_cv_sys_gnu_glob=yes, make_cv_sys_gnu_glob=no)]) |
---|
249 | case "$make_cv_sys_gnu_glob" in |
---|
250 | yes) AC_MSG_RESULT(yes; using local copy anyway) |
---|
251 | AC_SUBST(GLOBDIR) GLOBDIR=glob |
---|
252 | AC_SUBST(GLOBINC) GLOBINC='-I$(srcdir)/glob' |
---|
253 | AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a |
---|
254 | ;; |
---|
255 | no) AC_MSG_RESULT([no; using local copy]) |
---|
256 | AC_SUBST(GLOBDIR) GLOBDIR=glob |
---|
257 | AC_SUBST(GLOBINC) GLOBINC='-I$(srcdir)/glob' |
---|
258 | AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a |
---|
259 | ;; |
---|
260 | esac |
---|
261 | |
---|
262 | AC_DEFINE_UNQUOTED(MAKE_HOST,"$host",[Build host information.]) |
---|
263 | MAKE_HOST="$host" |
---|
264 | AC_SUBST(MAKE_HOST) |
---|
265 | |
---|
266 | MAINT_MAKEFILE=/dev/null |
---|
267 | if test -r "$srcdir/maintMakefile"; then |
---|
268 | MAINT_MAKEFILE="$srcdir/maintMakefile" |
---|
269 | fi |
---|
270 | AC_SUBST_FILE(MAINT_MAKEFILE) |
---|
271 | |
---|
272 | AC_OUTPUT(build.sh Makefile glob/Makefile i18n/Makefile) |
---|
273 | |
---|
274 | dnl If we don't yet have build.sh.in, build.sh is a bogus 0-length file |
---|
275 | dnl so remove it. |
---|
276 | dnl Can't do this because then remote builds with build.sh don't work. |
---|
277 | dnl test -f build.sh.in || rm -f build.sh |
---|
278 | |
---|
279 | |
---|
280 | case "$make_badcust" in |
---|
281 | yes) echo |
---|
282 | echo "WARNING: --with-customs specified but no customs.h could be found;" |
---|
283 | echo " disabling Customs support." |
---|
284 | echo ;; |
---|
285 | esac |
---|
286 | |
---|
287 | case "$with_customs" in |
---|
288 | ""|n|no|y|ye|yes) ;; |
---|
289 | *) if test -f "$with_customs/lib/libcustoms.a"; then |
---|
290 | : |
---|
291 | else |
---|
292 | echo |
---|
293 | echo "WARNING: \`$with_customs/lib' does not appear to contain the" |
---|
294 | echo " Customs library. You must build and install Customs" |
---|
295 | echo " before compiling GNU make." |
---|
296 | echo |
---|
297 | fi ;; |
---|
298 | esac |
---|
299 | |
---|
300 | case "$has_wait_nohang" in |
---|
301 | no) echo |
---|
302 | echo "WARNING: Your system has neither waitpid() nor wait3()." |
---|
303 | echo " Without one of these, signal handling is unreliable." |
---|
304 | echo " You should be aware that running GNU make with -j" |
---|
305 | echo " could result in erratic behavior." |
---|
306 | echo ;; |
---|
307 | esac |
---|
308 | |
---|
309 | case "$make_cv_job_server/$user_job_server" in |
---|
310 | no/yes) echo |
---|
311 | echo "WARNING: Make job server requires a POSIX-ish system that" |
---|
312 | echo " supports the pipe(), sigaction(), and either" |
---|
313 | echo " waitpid() or wait3() functions. Your system doesn't" |
---|
314 | echo " appear to provide one or more of those." |
---|
315 | echo " Disabling job server support." |
---|
316 | echo ;; |
---|
317 | esac |
---|
318 | |
---|
319 | dnl Local Variables: |
---|
320 | dnl comment-start: "dnl " |
---|
321 | dnl comment-end: "" |
---|
322 | dnl comment-start-skip: "\\bdnl\\b\\s *" |
---|
323 | dnl compile-command: "make configure config.h.in" |
---|
324 | dnl End: |
---|