VirtualBox

source: kBuild/branches/GNU/src/gmake/configure.in@ 280

Last change on this file since 280 was 280, checked in by bird, 20 years ago

Current make snaphot, 2005-05-16.

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