VirtualBox

source: kBuild/vendor/gnumake/3.82/configure.in

Last change on this file was 2579, checked in by bird, 12 years ago

Importing make-3.82.tar.bz2 (md5sum 1a11100f3c63fcf5753818e59d63088f) with --auto-props but no keywords.

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