VirtualBox

source: kBuild/vendor/gnumake/current/configure.in@ 900

Last change on this file since 900 was 900, checked in by bird, 18 years ago

Load /home/bird/src/Gnu/make/2007-05-23 into vendor/gnumake/current.

  • Property svn:eol-style set to native
File size: 14.5 KB
Line 
1# Process this file with autoconf to produce a configure script.
2#
3# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
5# This file is part of GNU Make.
6#
7# GNU Make is free software; you can redistribute it and/or modify it under the
8# terms of the GNU General Public License as published by the Free Software
9# Foundation; either version 2, or (at your option) any later version.
10#
11# GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
12# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License along with
16# GNU Make; see the file COPYING. If not, write to the Free Software
17# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
19AC_INIT([GNU make],[3.81.90],[bug-make@gnu.org])
20
21AC_PREREQ(2.59)
22AC_REVISION([[$Id: configure.in,v 1.147 2007/05/09 02:01:53 psmith Exp $]])
23
24# Autoconf setup
25AC_CONFIG_AUX_DIR(config)
26AC_CONFIG_SRCDIR(vpath.c)
27AC_CONFIG_HEADERS(config.h)
28
29# Automake setup
30AM_INIT_AUTOMAKE([1.9])
31
32# Checks for programs.
33AC_PROG_CC
34AC_PROG_INSTALL
35AC_PROG_RANLIB
36AC_PROG_CPP
37AC_CHECK_PROG(AR, ar, ar, ar)
38# Perl is needed for the test suite (only)
39AC_CHECK_PROG(PERL, perl, perl, perl)
40
41# Specialized system macros
42AC_CANONICAL_HOST
43AC_AIX
44AC_ISC_POSIX
45AC_MINIX
46
47# Enable gettext, in "external" mode.
48
49AM_GNU_GETTEXT_VERSION(0.14.1)
50AM_GNU_GETTEXT([external])
51
52# This test must come as early as possible after the compiler configuration
53# tests, because the choice of the file model can (in principle) affect
54# whether functions and headers are available, whether they work, etc.
55AC_SYS_LARGEFILE
56
57# Checks for libraries.
58AC_SEARCH_LIBS(getpwnam, [sun])
59
60# Checks for header files.
61AC_HEADER_STDC
62AC_HEADER_DIRENT
63AC_HEADER_STAT
64AC_HEADER_TIME
65AC_CHECK_HEADERS(stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
66 memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h)
67
68# Set a flag if we have an ANSI C compiler
69if test "$ac_cv_prog_cc_stdc" != no; then
70 AC_DEFINE(HAVE_ANSI_COMPILER, 1,
71 [Define to 1 if your compiler conforms to the ANSI C standard.])
72fi
73
74
75# Determine what kind of variadic function calls we support
76AC_CHECK_HEADERS(stdarg.h varargs.h, break)
77
78AM_PROG_CC_C_O
79AC_C_CONST
80AC_TYPE_SIGNAL
81AC_TYPE_UID_T
82AC_TYPE_PID_T
83
84# Find some definition for uintmax_t
85
86AC_CHECK_TYPE(uintmax_t,,[
87 uintmax_t="unsigned long"
88 AC_CHECK_TYPE(unsigned long long,[uintmax_t="unsigned long long"])
89 AC_DEFINE_UNQUOTED(uintmax_t,$uintmax_t,
90 [Define uintmax_t if not defined in <stdint.h> or <inttypes.h>.])])
91
92# Find out whether our struct stat returns nanosecond resolution timestamps.
93
94AC_STRUCT_ST_MTIM_NSEC
95AC_MSG_CHECKING([whether to use high resolution file timestamps])
96AC_CACHE_VAL(make_cv_file_timestamp_hi_res, [
97 make_cv_file_timestamp_hi_res=no
98 if test "$ac_cv_struct_st_mtim_nsec" != no; then
99 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
100# if HAVE_INTTYPES_H
101# include <inttypes.h>
102# endif]],
103 [[char a[0x7fffffff < (uintmax_t)-1 >> 30 ? 1 : -1];]])],
104 [make_cv_file_timestamp_hi_res=yes],
105 [])
106 fi])
107AC_MSG_RESULT($make_cv_file_timestamp_hi_res)
108if test "$make_cv_file_timestamp_hi_res" = yes; then
109 val=1
110else
111 val=0
112fi
113AC_DEFINE_UNQUOTED(FILE_TIMESTAMP_HI_RES, $val,
114 [Use high resolution file timestamps if nonzero.])
115
116if test "$make_cv_file_timestamp_hi_res" = yes; then
117 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
118 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
119 AC_SEARCH_LIBS(clock_gettime, [rt posix4])
120 if test "$ac_cv_search_clock_gettime" != no; then
121 AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
122 [Define to 1 if you have the clock_gettime function.])
123 fi
124fi
125
126# Check for DOS-style pathnames.
127pds_AC_DOS_PATHS
128
129# See if we have a standard version of gettimeofday(). Since actual
130# implementations can differ, just make sure we have the most common
131# one.
132AC_CACHE_CHECK([for standard gettimeofday], ac_cv_func_gettimeofday,
133 [ac_cv_func_gettimeofday=no
134 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/time.h>
135 int main ()
136 {
137 struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
138 exit (gettimeofday (&t, 0) != 0
139 || t.tv_sec < 0 || t.tv_usec < 0);
140 }]])],
141 [ac_cv_func_gettimeofday=yes],
142 [ac_cv_func_gettimeofday=no],
143 [ac_cv_func_gettimeofday="no (cross-compiling)"])])
144if test "$ac_cv_func_gettimeofday" = yes; then
145 AC_DEFINE(HAVE_GETTIMEOFDAY, 1,
146 [Define to 1 if you have a standard gettimeofday function])
147fi
148
149AC_CHECK_FUNCS( strdup mkstemp mktemp fdopen \
150 bsd_signal dup2 getcwd realpath sigsetmask sigaction \
151 getgroups seteuid setegid setlinebuf setreuid setregid \
152 getrlimit setrlimit setvbuf pipe strerror strsignal \
153 lstat readlink atexit)
154
155AC_FUNC_SETVBUF_REVERSED
156
157# Rumor has it that strcasecmp lives in -lresolv on some odd systems.
158# It doesn't hurt much to use our own if we can't find it so I don't
159# make the effort here.
160AC_CHECK_FUNCS(strcasecmp strcmpi stricmp)
161
162# strcoll() is used by the GNU glob library
163AC_FUNC_STRCOLL
164
165AC_FUNC_ALLOCA
166AC_FUNC_FORK([])
167AC_FUNC_VPRINTF
168AC_FUNC_CLOSEDIR_VOID
169
170AC_FUNC_GETLOADAVG
171
172# AC_FUNC_GETLOADAVG is documented to set the NLIST_STRUCT value, but it
173# doesn't. So, we will.
174
175if test "$ac_cv_header_nlist_h" = yes; then
176 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
177 [[struct nlist nl;
178 nl.n_name = "string";
179 return 0;]])],
180 [make_cv_nlist_struct=yes],
181 [make_cv_nlist_struct=no])
182 if test "$make_cv_nlist_struct" = yes; then
183 AC_DEFINE(NLIST_STRUCT, 1,
184 [Define to 1 if struct nlist.n_name is a pointer rather than an array.])
185 fi
186fi
187
188AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
189 [AC_INCLUDES_DEFAULT
190#include <signal.h>
191/* NetBSD declares sys_siglist in unistd.h. */
192#if HAVE_UNISTD_H
193# include <unistd.h>
194#endif
195])
196
197
198# Check out the wait reality.
199AC_CHECK_HEADERS(sys/wait.h,,,[[#include <sys/types.h>]])
200AC_CHECK_FUNCS(waitpid wait3)
201AC_MSG_CHECKING(for union wait)
202AC_CACHE_VAL(make_cv_union_wait, [dnl
203 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
204#include <sys/wait.h>]],
205 [[union wait status; int pid; pid = wait (&status);
206#ifdef WEXITSTATUS
207/* Some POSIXoid systems have both the new-style macros and the old
208 union wait type, and they do not work together. If union wait
209 conflicts with WEXITSTATUS et al, we don't want to use it at all. */
210 if (WEXITSTATUS (status) != 0) pid = -1;
211#ifdef WTERMSIG
212 /* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
213 -- blow chunks here --
214#endif
215#endif
216#ifdef HAVE_WAITPID
217 /* Make sure union wait works with waitpid. */
218 pid = waitpid (-1, &status, 0);
219#endif
220 ]])],
221 [make_cv_union_wait=yes],
222 [make_cv_union_wait=no])])
223if test "$make_cv_union_wait" = yes; then
224 AC_DEFINE(HAVE_UNION_WAIT, 1,
225 [Define to 1 if you have the \`union wait' type in <sys/wait.h>.])
226fi
227AC_MSG_RESULT($make_cv_union_wait)
228
229
230# If we're building on Windows/DOS/OS/2, add some support for DOS drive specs.
231if test "$PATH_SEPARATOR" = ';'; then
232 AC_DEFINE(HAVE_DOS_PATHS, 1,
233 [Define to 1 if your system requires backslashes or drive specs in pathnames.])
234fi
235
236
237# See if the user wants to use pmake's "customs" distributed build capability
238
239AC_SUBST(REMOTE) REMOTE=stub
240use_customs=false
241AC_ARG_WITH(customs,
242 AC_HELP_STRING([--with-customs=DIR],
243 [enable remote jobs via Customs--see README.customs]),
244 [case $withval in
245 n|no) : ;;
246 *) make_cppflags="$CPPFLAGS"
247 case $withval in
248 y|ye|yes) : ;;
249 *) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
250 make_ldflags="$LDFLAGS -L$with_customs/lib" ;;
251 esac
252 CF_NETLIBS
253 AC_CHECK_HEADER(customs.h,
254 [use_customs=true
255 REMOTE=cstms
256 LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags"],
257 [with_customs=no
258 CPPFLAGS="$make_cppflags" make_badcust=yes])
259 ;;
260 esac])
261# Tell automake about this, so it can include the right .c files.
262AM_CONDITIONAL(USE_CUSTOMS, test "$use_customs" = true)
263
264# See if the user asked to handle case insensitive file systems.
265
266AH_TEMPLATE(HAVE_CASE_INSENSITIVE_FS, [Use case insensitive file names])
267AC_ARG_ENABLE(case-insensitive-file-system,
268 AC_HELP_STRING([--enable-case-insensitive-file-system],
269 [assume file systems are case insensitive]),
270 [case $enableval in
271 yes) AC_DEFINE(HAVE_CASE_INSENSITIVE_FS) ;;
272 esac])
273
274# See if we can handle the job server feature, and if the user wants it.
275
276AC_ARG_ENABLE(job-server,
277 AC_HELP_STRING([--disable-job-server],
278 [disallow recursive make communication during -jN]),
279 [make_cv_job_server="$enableval" user_job_server="$enableval"],
280 [make_cv_job_server="yes"])
281
282has_wait_nohang=yes
283case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
284 no/no) has_wait_nohang=no ;;
285esac
286
287AC_CACHE_CHECK(for SA_RESTART, make_cv_sa_restart, [
288 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]],
289 [[return SA_RESTART;]])],
290 [make_cv_sa_restart=yes],
291 [make_cv_sa_restart=no])])
292
293if test "$make_cv_sa_restart" != no; then
294 AC_DEFINE(HAVE_SA_RESTART, 1,
295 [Define to 1 if <signal.h> defines the SA_RESTART constant.])
296fi
297
298# enable make_cv_sa_restart for OS/2 so that the jobserver will be enabled,
299# but do it after HAVE_SA_RESTART has been defined.
300case "$host_os" in
301 os2*) make_cv_sa_restart=yes ;;
302esac
303
304case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/$make_cv_job_server" in
305 yes/yes/yes/yes/yes)
306 AC_DEFINE(MAKE_JOBSERVER, 1,
307 [Define to 1 to enable job server support in GNU make.]);;
308esac
309
310# if we have both lstat() and readlink() then we can support symlink
311# timechecks.
312case "$ac_cv_func_lstat/$ac_cv_func_readlink" in
313 yes/yes)
314 AC_DEFINE(MAKE_SYMLINKS, 1,
315 [Define to 1 to enable symbolic link timestamp checking.]);;
316esac
317
318# Find the SCCS commands, so we can include them in our default rules.
319
320AC_CACHE_CHECK(for location of SCCS get command, make_cv_path_sccs_get, [
321if test -f /usr/sccs/get; then
322 make_cv_path_sccs_get=/usr/sccs/get
323else
324 make_cv_path_sccs_get=get
325fi])
326AC_DEFINE_UNQUOTED(SCCS_GET, ["$make_cv_path_sccs_get"],
327 [Define to the name of the SCCS 'get' command.])
328
329ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
330if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
331 test -f s.conftest; then
332 # We successfully created an SCCS file.
333 AC_CACHE_CHECK(if SCCS get command understands -G, make_cv_sys_get_minus_G, [
334 if $make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
335 test -f conftoast; then
336 make_cv_sys_get_minus_G=yes
337 else
338 make_cv_sys_get_minus_G=no
339 fi])
340 case "$make_cv_sys_get_minus_G" in
341 yes) AC_DEFINE(SCCS_GET_MINUS_G, 1,
342 [Define to 1 if the SCCS 'get' command understands the '-G<file>' option.]);;
343 esac
344fi
345rm -f s.conftest conftoast
346
347# Check the system to see if it provides GNU glob. If not, use our
348# local version.
349
350AC_MSG_CHECKING(if system libc has GNU glob)
351AC_CACHE_VAL(make_cv_sys_gnu_glob, [
352 AC_EGREP_CPP(gnu glob,[
353#include <features.h>
354#include <glob.h>
355#include <fnmatch.h>
356
357#define GLOB_INTERFACE_VERSION 1
358#if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
359# include <gnu-versions.h>
360# if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
361 gnu glob
362# endif
363#endif
364 ], [AC_MSG_RESULT(yes)
365make_cv_sys_gnu_glob=yes], [AC_MSG_RESULT([no; using local copy])
366AC_SUBST(GLOBINC) GLOBINC='-I$(srcdir)/glob'
367AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a
368make_cv_sys_gnu_glob=no])])
369# Tell automake about this, so it can build the right .c files.
370AM_CONDITIONAL(USE_LOCAL_GLOB, test "$make_cv_sys_gnu_glob" = no)
371
372# Let the makefile know what our build host is
373
374AC_DEFINE_UNQUOTED(MAKE_HOST,"$host",[Build host information.])
375MAKE_HOST="$host"
376AC_SUBST(MAKE_HOST)
377
378w32_target_env=no
379AM_CONDITIONAL([WINDOWSENV], false)
380
381case "$host" in
382 *-*-mingw32)
383 AM_CONDITIONAL(WINDOWSENV, true)
384 w32_target_env=yes
385 AC_DEFINE([WINDOWS32], [1], [Use platform specific coding])
386 AC_DEFINE([HAVE_DOS_PATHS], [1], [Use platform specific coding])
387 ;;
388esac
389
390AC_DEFINE_UNQUOTED(PATH_SEPARATOR_CHAR,'$PATH_SEPARATOR',[Define to the character that separates directories in PATH.])
391
392# Include the Maintainer's Makefile section, if it's here.
393
394MAINT_MAKEFILE=/dev/null
395if test -r "$srcdir/maintMakefile"; then
396 MAINT_MAKEFILE="$srcdir/maintMakefile"
397fi
398AC_SUBST_FILE(MAINT_MAKEFILE)
399
400# Allow building with dmalloc
401AM_WITH_DMALLOC
402
403# Forcibly disable SET_MAKE. If it's set it breaks things like the test
404# scripts, etc.
405SET_MAKE=
406
407# Sanity check and inform the user of what we found
408
409case "$make_badcust" in
410 yes) echo
411 echo "WARNING: --with-customs specified but no customs.h could be found;"
412 echo " disabling Customs support."
413 echo ;;
414esac
415
416case "$with_customs" in
417 ""|n|no|y|ye|yes) ;;
418 *) if test -f "$with_customs/lib/libcustoms.a"; then
419 :
420 else
421 echo
422 echo "WARNING: '$with_customs/lib' does not appear to contain the"
423 echo " Customs library. You must build and install Customs"
424 echo " before compiling GNU make."
425 echo
426 fi ;;
427esac
428
429case "$has_wait_nohang" in
430 no) echo
431 echo "WARNING: Your system has neither waitpid() nor wait3()."
432 echo " Without one of these, signal handling is unreliable."
433 echo " You should be aware that running GNU make with -j"
434 echo " could result in erratic behavior."
435 echo ;;
436esac
437
438case "$make_cv_job_server/$user_job_server" in
439 no/yes) echo
440 echo "WARNING: Make job server requires a POSIX-ish system that"
441 echo " supports the pipe(), sigaction(), and either"
442 echo " waitpid() or wait3() functions. Your system doesn't"
443 echo " appear to provide one or more of those."
444 echo " Disabling job server support."
445 echo ;;
446esac
447
448
449# Specify what files are to be created.
450AC_CONFIG_FILES(Makefile glob/Makefile po/Makefile.in config/Makefile doc/Makefile w32/Makefile)
451
452# OK, do it!
453
454AC_OUTPUT
455
456# We only generate the build.sh if we have a build.sh.in; we won't have
457# one before we've created a distribution.
458if test -f "$srcdir/build.sh.in"; then
459 ./config.status --file build.sh
460 chmod +x build.sh
461fi
462
463dnl Local Variables:
464dnl comment-start: "dnl "
465dnl comment-end: ""
466dnl comment-start-skip: "\\bdnl\\b\\s *"
467dnl compile-command: "make configure config.h.in"
468dnl End:
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette