VirtualBox

source: kBuild/trunk/src/kmk/configure.ac@ 3262

Last change on this file since 3262 was 3262, checked in by bird, 6 years ago

kmk: rhel4 bootstrap hacking.

  • Property svn:eol-style set to LF
File size: 18.0 KB
Line 
1# Process this file with autoconf to produce a configure script.
2#
3# Copyright (C) 1993-2016 Free Software Foundation, Inc.
4# This file is part of GNU Make.
5#
6# GNU Make is free software; you can redistribute it and/or modify it under
7# the terms of the GNU General Public License as published by the Free Software
8# Foundation; either version 3 of the License, or (at your option) any later
9# 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
13# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14# details.
15#
16# You should have received a copy of the GNU General Public License along with
17# this program. If not, see <http://www.gnu.org/licenses/>.
18
19AC_INIT([GNU make],[4.2.1],[[email protected]])
20
21AC_PREREQ([2.69])
22
23# Autoconf setup
24AC_CONFIG_AUX_DIR([config])
25AC_CONFIG_SRCDIR([vpath.c])
26AC_CONFIG_HEADERS([config.h])
27
28# Automake setup
29# We have to enable "foreign" because ChangeLog is auto-generated
30# We cannot enable -Werror because gettext 0.18.1 has invalid content
31# When we update gettext to 0.18.3 or better we can add it again.
32# bird: Added subdir-objects
33AM_INIT_AUTOMAKE([1.15 foreign -Werror -Wall subdir-objects])
34
35# Checks for programs.
36AC_USE_SYSTEM_EXTENSIONS
37AC_PROG_CC
38AC_PROG_INSTALL
39AC_PROG_RANLIB
40AC_PROG_CPP
41AC_CHECK_PROG([AR], [ar], [ar], [ar])
42# Perl is needed for the test suite (only)
43AC_CHECK_PROG([PERL], [perl], [perl], [perl])
44
45# Needed for w32/Makefile.am
46AM_PROG_AR
47
48# Specialized system macros
49AC_CANONICAL_HOST
50AC_AIX
51AC_ISC_POSIX
52AC_MINIX
53
54# Enable gettext, in "external" mode.
55# bird: causes trouble when it doesn't find 'po' in SUBDIRS, so skip it.
56#AM_GNU_GETTEXT_VERSION([0.19.4])
57#AM_GNU_GETTEXT([external])
58
59# This test must come as early as possible after the compiler configuration
60# tests, because the choice of the file model can (in principle) affect
61# whether functions and headers are available, whether they work, etc.
62AC_SYS_LARGEFILE
63
64# Checks for libraries.
65AC_SEARCH_LIBS([getpwnam], [sun])
66
67# Checks for header files.
68AC_HEADER_STDC
69AC_HEADER_DIRENT
70AC_HEADER_STAT
71AC_HEADER_TIME
72AC_CHECK_HEADERS([stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
73 memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h \
74 sys/select.h])
75
76AM_PROG_CC_C_O
77AC_C_CONST
78AC_TYPE_SIGNAL
79AC_TYPE_UID_T
80AC_TYPE_PID_T
81AC_TYPE_OFF_T
82AC_TYPE_SIZE_T
83AC_TYPE_SSIZE_T
84AC_TYPE_UINTMAX_T
85
86# Find out whether our struct stat returns nanosecond resolution timestamps.
87
88AC_STRUCT_ST_MTIM_NSEC
89AC_CACHE_CHECK([whether to use high resolution file timestamps],
90 [make_cv_file_timestamp_hi_res],
91[ make_cv_file_timestamp_hi_res=no
92 AS_IF([test "$ac_cv_struct_st_mtim_nsec" != no],
93 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
94#if HAVE_INTTYPES_H
95# include <inttypes.h>
96#endif]],
97 [[char a[0x7fffffff < (uintmax_t)-1 >> 30 ? 1 : -1];]])],
98 [make_cv_file_timestamp_hi_res=yes])
99 ])])
100AS_IF([test "$make_cv_file_timestamp_hi_res" = yes], [val=1], [val=0])
101AC_DEFINE_UNQUOTED([FILE_TIMESTAMP_HI_RES], [$val],
102 [Use high resolution file timestamps if nonzero.])
103
104AS_IF([test "$make_cv_file_timestamp_hi_res" = yes],
105[ # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
106 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
107 AC_SEARCH_LIBS([clock_gettime], [rt posix4])
108 AS_IF([test "$ac_cv_search_clock_gettime" != no],
109 [ AC_DEFINE([HAVE_CLOCK_GETTIME], [1],
110 [Define to 1 if you have the clock_gettime function.])
111 ])
112])
113
114# Check for DOS-style pathnames.
115pds_AC_DOS_PATHS
116
117# See if we have a standard version of gettimeofday(). Since actual
118# implementations can differ, just make sure we have the most common
119# one.
120AC_CACHE_CHECK([for standard gettimeofday], [ac_cv_func_gettimeofday],
121 [ac_cv_func_gettimeofday=no
122 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/time.h>
123 int main ()
124 {
125 struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
126 exit (gettimeofday (&t, 0) != 0
127 || t.tv_sec < 0 || t.tv_usec < 0);
128 }]])],
129 [ac_cv_func_gettimeofday=yes],
130 [ac_cv_func_gettimeofday=no],
131 [ac_cv_func_gettimeofday="no (cross-compiling)"])])
132AS_IF([test "$ac_cv_func_gettimeofday" = yes],
133[ AC_DEFINE([HAVE_GETTIMEOFDAY], [1],
134 [Define to 1 if you have a standard gettimeofday function])
135])
136
137AC_CHECK_FUNCS([strdup strndup mkstemp mktemp fdopen fileno \
138 dup dup2 getcwd realpath sigsetmask sigaction \
139 getgroups seteuid setegid setlinebuf setreuid setregid \
140 getrlimit setrlimit setvbuf pipe strerror strsignal \
141 lstat readlink atexit isatty ttyname pselect])
142
143# We need to check declarations, not just existence, because on Tru64 this
144# function is not declared without special flags, which themselves cause
145# other problems. We'll just use our own.
146AC_CHECK_DECLS([bsd_signal], [], [], [[#define _GNU_SOURCE 1
147#include <signal.h>]])
148
149AC_FUNC_FORK
150
151AC_FUNC_SETVBUF_REVERSED
152
153# Rumor has it that strcasecmp lives in -lresolv on some odd systems.
154# It doesn't hurt much to use our own if we can't find it so I don't
155# make the effort here.
156AC_CHECK_FUNCS([strcasecmp strncasecmp strcmpi strncmpi stricmp strnicmp])
157
158# strcoll() is used by the GNU glob library
159AC_FUNC_STRCOLL
160
161AC_FUNC_ALLOCA
162AC_FUNC_CLOSEDIR_VOID
163
164# bird: This guile detection does not work on rhel4. Disabled it all since we doesn't care about guile.
165## See if the user wants to add (or not) GNU Guile support
166#PKG_PROG_PKG_CONFIG
167#AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
168# [Support GNU Guile for embedded scripting])])
169#
170## For some strange reason, at least on Ubuntu, each version of Guile
171## comes with it's own PC file so we have to specify them as individual
172## packages. Ugh.
173#AS_IF([test "x$with_guile" != xno],
174#[ PKG_CHECK_MODULES([GUILE], [guile-2.0], [have_guile=yes],
175# [PKG_CHECK_MODULES([GUILE], [guile-1.8], [have_guile=yes],
176# [have_guile=no])])
177#])
178#
179#AS_IF([test "$have_guile" = yes],
180# [AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])])
181#
182#AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = yes])
183
184AC_FUNC_GETLOADAVG
185
186# AC_FUNC_GETLOADAVG is documented to set the NLIST_STRUCT value, but it
187# doesn't. So, we will.
188
189AS_IF([test "$ac_cv_header_nlist_h" = yes],
190[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
191 [[struct nlist nl;
192 nl.n_name = "string";
193 return 0;]])],
194 [make_cv_nlist_struct=yes],
195 [make_cv_nlist_struct=no])
196 AS_IF([test "$make_cv_nlist_struct" = yes],
197 [ AC_DEFINE([NLIST_STRUCT], [1],
198 [Define to 1 if struct nlist.n_name is a pointer rather than an array.])
199 ])
200])
201
202AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
203 [AC_INCLUDES_DEFAULT
204#include <signal.h>
205/* NetBSD declares sys_siglist in unistd.h. */
206#if HAVE_UNISTD_H
207# include <unistd.h>
208#endif
209])
210
211
212# Check out the wait reality.
213AC_CHECK_HEADERS([sys/wait.h],[],[],[[#include <sys/types.h>]])
214AC_CHECK_FUNCS([waitpid wait3])
215AC_CACHE_CHECK([for union wait], [make_cv_union_wait],
216[ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
217#include <sys/wait.h>]],
218 [[union wait status; int pid; pid = wait (&status);
219#ifdef WEXITSTATUS
220/* Some POSIXoid systems have both the new-style macros and the old
221 union wait type, and they do not work together. If union wait
222 conflicts with WEXITSTATUS et al, we don't want to use it at all. */
223 if (WEXITSTATUS (status) != 0) pid = -1;
224#ifdef WTERMSIG
225 /* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
226 -- blow chunks here --
227#endif
228#endif
229#ifdef HAVE_WAITPID
230 /* Make sure union wait works with waitpid. */
231 pid = waitpid (-1, &status, 0);
232#endif
233 ]])],
234 [make_cv_union_wait=yes],
235 [make_cv_union_wait=no])
236])
237AS_IF([test "$make_cv_union_wait" = yes],
238[ AC_DEFINE([HAVE_UNION_WAIT], [1],
239 [Define to 1 if you have the 'union wait' type in <sys/wait.h>.])
240])
241
242
243# If we're building on Windows/DOS/OS/2, add some support for DOS drive specs.
244AS_IF([test "$PATH_SEPARATOR" = ';'],
245[ AC_DEFINE([HAVE_DOS_PATHS], [1],
246 [Define to 1 if your system requires backslashes or drive specs in pathnames.])
247])
248
249# See if the user wants to use pmake's "customs" distributed build capability
250AC_SUBST([REMOTE]) REMOTE=stub
251use_customs=false
252AC_ARG_WITH([customs],
253[AC_HELP_STRING([--with-customs=DIR],
254 [enable remote jobs via Customs--see README.customs])],
255[ AS_CASE([$withval], [n|no], [:],
256 [make_cppflags="$CPPFLAGS"
257 AS_CASE([$withval],
258 [y|ye|yes], [:],
259 [CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
260 make_ldflags="$LDFLAGS -L$with_customs/lib"])
261 CF_NETLIBS
262 AC_CHECK_HEADER([customs.h],
263 [use_customs=true
264 REMOTE=cstms
265 LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags"],
266 [with_customs=no
267 CPPFLAGS="$make_cppflags" make_badcust=yes])
268 ])
269])
270
271# Tell automake about this, so it can include the right .c files.
272AM_CONDITIONAL([USE_CUSTOMS], [test "$use_customs" = true])
273
274# See if the user asked to handle case insensitive file systems.
275AH_TEMPLATE([HAVE_CASE_INSENSITIVE_FS], [Use case insensitive file names])
276AC_ARG_ENABLE([case-insensitive-file-system],
277 AC_HELP_STRING([--enable-case-insensitive-file-system],
278 [assume file systems are case insensitive]),
279 [AS_IF([test "$enableval" = yes], [AC_DEFINE([HAVE_CASE_INSENSITIVE_FS])])])
280
281# See if we can handle the job server feature, and if the user wants it.
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
288AS_IF([test "$ac_cv_func_waitpid" = no && test "$ac_cv_func_wait3" = no],
289 [has_wait_nohang=no],
290 [has_wait_nohang=yes])
291
292AC_CACHE_CHECK([for SA_RESTART], [make_cv_sa_restart], [
293 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]],
294 [[return SA_RESTART;]])],
295 [make_cv_sa_restart=yes],
296 [make_cv_sa_restart=no])])
297
298AS_IF([test "$make_cv_sa_restart" != no],
299[ AC_DEFINE([HAVE_SA_RESTART], [1],
300 [Define to 1 if <signal.h> defines the SA_RESTART constant.])
301])
302
303# Only allow jobserver on systems that support it
304AS_CASE([/$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/],
305 [*/no/*], [make_cv_job_server=no])
306
307# Also supported on OS2 and MinGW
308AS_CASE([$host_os], [os2*|mingw*], [make_cv_job_server=yes])
309
310# If we support it and the user didn't disable it, build with jobserver
311AS_CASE([/$make_cv_job_server/$user_job_server/],
312 [*/no/*], [: no jobserver],
313 [AC_DEFINE(MAKE_JOBSERVER, 1,
314 [Define to 1 to enable job server support in GNU make.])
315 ])
316
317# If dl*() functions are supported we can enable the load operation
318AC_CHECK_DECLS([dlopen, dlsym, dlerror], [], [],
319 [[#include <dlfcn.h>]])
320
321AC_ARG_ENABLE([load],
322 AC_HELP_STRING([--disable-load],
323 [disable support for the 'load' operation]),
324 [make_cv_load="$enableval" user_load="$enableval"],
325 [make_cv_load="yes"])
326
327AS_CASE([/$ac_cv_have_decl_dlopen/$ac_cv_have_decl_dlsym/$ac_cv_have_decl_dlerror/],
328 [*/no/*], [make_cv_load=no])
329
330# We might need -ldl
331AS_IF([test "$make_cv_load" = yes], [
332 AC_SEARCH_LIBS([dlopen], [dl], [], [make_cv_load=])
333 ])
334
335AS_CASE([/$make_cv_load/$user_load/],
336 [*/no/*], [make_cv_load=no],
337 [AC_DEFINE(MAKE_LOAD, 1,
338 [Define to 1 to enable 'load' support in GNU make.])
339 ])
340
341# If we want load support, we might need to link with export-dynamic.
342# See if we can figure it out. Unfortunately this is very difficult.
343# For example passing -rdynamic to the SunPRO linker gives a warning
344# but succeeds and creates a shared object, not an executable!
345AS_IF([test "$make_cv_load" = yes], [
346 AC_MSG_CHECKING([If the linker accepts -Wl,--export-dynamic])
347 old_LDFLAGS="$LDFLAGS"
348 LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
349 AC_LINK_IFELSE([AC_LANG_SOURCE([int main(){}])],
350 [AC_MSG_RESULT([yes])
351 AC_SUBST([AM_LDFLAGS], [-Wl,--export-dynamic])],
352 [AC_MSG_RESULT([no])
353 AC_MSG_CHECKING([If the linker accepts -rdynamic])
354 LDFLAGS="$old_LDFLAGS -rdynamic"
355 AC_LINK_IFELSE([AC_LANG_SOURCE([int main(){}])],
356 [AC_MSG_RESULT([yes])
357 AC_SUBST([AM_LDFLAGS], [-rdynamic])],
358 [AC_MSG_RESULT([no])])
359 ])
360 LDFLAGS="$old_LDFLAGS"
361])
362
363# if we have both lstat() and readlink() then we can support symlink
364# timechecks.
365AS_IF([test "$ac_cv_func_lstat" = yes && test "$ac_cv_func_readlink" = yes],
366 [ AC_DEFINE([MAKE_SYMLINKS], [1],
367 [Define to 1 to enable symbolic link timestamp checking.])
368])
369
370# Find the SCCS commands, so we can include them in our default rules.
371
372AC_CACHE_CHECK([for location of SCCS get command], [make_cv_path_sccs_get], [
373 AS_IF([test -f /usr/sccs/get],
374 [make_cv_path_sccs_get=/usr/sccs/get],
375 [make_cv_path_sccs_get=get])
376])
377AC_DEFINE_UNQUOTED([SCCS_GET], ["$make_cv_path_sccs_get"],
378 [Define to the name of the SCCS 'get' command.])
379
380ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
381AS_IF([(/usr/sccs/admin -n s.conftest || admin -n s.conftest) >/dev/null 2>&1 &&
382 test -f s.conftest],
383[ # We successfully created an SCCS file.
384 AC_CACHE_CHECK([if SCCS get command understands -G], [make_cv_sys_get_minus_G],
385 [AS_IF([$make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
386 test -f conftoast],
387 [make_cv_sys_get_minus_G=yes],
388 [make_cv_sys_get_minus_G=no])
389 ])
390 AS_IF([test "$make_cv_sys_get_minus_G" = yes],
391 [AC_DEFINE([SCCS_GET_MINUS_G], [1],
392 [Define to 1 if the SCCS 'get' command understands the '-G<file>' option.])
393 ])
394])
395rm -f s.conftest conftoast
396
397## bird: always use our glob impl. Avoids trouble with newish glibc.
398# Check the system to see if it provides GNU glob. If not, use our
399# local version.
400#x# AC_CACHE_CHECK([if system libc has GNU glob], [make_cv_sys_gnu_glob],
401#x# [ AC_EGREP_CPP([gnu glob],[
402#x# #include <features.h>
403#x# #include <glob.h>
404#x# #include <fnmatch.h>
405#x#
406#x# #define GLOB_INTERFACE_VERSION 1
407#x# #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
408#x# # include <gnu-versions.h>
409#x# # if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
410#x# gnu glob
411#x# # endif
412#x# #endif],
413#x# [make_cv_sys_gnu_glob=yes],
414#x# [make_cv_sys_gnu_glob=no])])
415#x# AS_IF([test "$make_cv_sys_gnu_glob" = no],
416AS_IF([test yes = yes],
417[ GLOBINC='-I$(srcdir)/glob'
418 GLOBLIB=glob/libglob.a
419 make_cv_sys_gnu_glob=no
420])
421AC_SUBST([GLOBINC])
422AC_SUBST([GLOBLIB])
423
424# Tell automake about this, so it can build the right .c files.
425AM_CONDITIONAL([USE_LOCAL_GLOB], [test "$make_cv_sys_gnu_glob" = no])
426
427# Let the makefile know what our build host is
428
429AC_DEFINE_UNQUOTED([MAKE_HOST],["$host"],[Build host information.])
430MAKE_HOST="$host"
431AC_SUBST([MAKE_HOST])
432
433w32_target_env=no
434AM_CONDITIONAL([WINDOWSENV], [false])
435
436AS_CASE([$host],
437 [*-*-mingw32],
438 [AM_CONDITIONAL([WINDOWSENV], [true])
439 w32_target_env=yes
440 AC_DEFINE([WINDOWS32], [1], [Use platform specific coding])
441 AC_DEFINE([HAVE_DOS_PATHS], [1], [Use platform specific coding])
442 ])
443
444AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
445 [Define to the character that separates directories in PATH.])
446
447# Include the Maintainer's Makefile section, if it's here.
448
449MAINT_MAKEFILE=/dev/null
450AS_IF([test -r "$srcdir/maintMakefile"],
451[ MAINT_MAKEFILE="$srcdir/maintMakefile"
452])
453AC_SUBST_FILE([MAINT_MAKEFILE])
454
455# Allow building with dmalloc
456AM_WITH_DMALLOC
457
458# Forcibly disable SET_MAKE. If it's set it breaks things like the test
459# scripts, etc.
460SET_MAKE=
461
462# Sanity check and inform the user of what we found
463
464AS_IF([test "x$make_badcust" = xyes], [
465echo
466echo "WARNING: --with-customs specified but no customs.h could be found;"
467echo " disabling Customs support."
468echo
469])
470
471AS_CASE([$with_customs],
472[""|n|no|y|ye|yes], [:],
473[AS_IF([test -f "$with_customs/lib/libcustoms.a"], [:],
474[ echo
475 echo "WARNING: '$with_customs/lib' does not appear to contain the"
476 echo " Customs library. You must build and install Customs"
477 echo " before compiling GNU make."
478 echo
479])])
480
481AS_IF([test "x$has_wait_nohang" = xno],
482[ echo
483 echo "WARNING: Your system has neither waitpid() nor wait3()."
484 echo " Without one of these, signal handling is unreliable."
485 echo " You should be aware that running GNU make with -j"
486 echo " could result in erratic behavior."
487 echo
488])
489
490AS_IF([test "x$make_cv_job_server" = xno && test "x$user_job_server" = xyes],
491[ echo
492 echo "WARNING: Make job server requires a POSIX-ish system that"
493 echo " supports the pipe(), sigaction(), and either"
494 echo " waitpid() or wait3() functions. Your system doesn't"
495 echo " appear to provide one or more of those."
496 echo " Disabling job server support."
497 echo
498])
499
500AS_IF([test "x$make_cv_load" = xno && test "x$user_load" = xyes],
501[ echo
502 echo "WARNING: 'load' support requires a POSIX-ish system that"
503 echo " supports the dlopen(), dlsym(), and dlerror() functions."
504 echo " Your system doesn't appear to provide one or more of these."
505 echo " Disabling 'load' support."
506 echo
507])
508
509# Specify what files are to be created.
510# bird: Removed po/Makefile.in.
511#AC_CONFIG_FILES([Makefile glob/Makefile po/Makefile.in config/Makefile \
512# doc/Makefile w32/Makefile tests/config-flags.pm])
513AC_CONFIG_FILES([Makefile glob/Makefile config/Makefile \
514 doc/Makefile w32/Makefile tests/config-flags.pm])
515
516# OK, do it!
517
518AC_OUTPUT
519
520# We only generate the build.sh if we have a build.sh.in; we won't have
521# one before we've created a distribution.
522AS_IF([test -f "$srcdir/build.sh.in"],
523[ ./config.status --file build.sh
524 chmod +x build.sh
525])
526
527dnl Local Variables:
528dnl comment-start: "dnl "
529dnl comment-end: ""
530dnl comment-start-skip: "\\bdnl\\b\\s *"
531dnl compile-command: "make configure config.h.in"
532dnl End:
Note: See TracBrowser for help on using the repository browser.

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