VirtualBox

source: kBuild/vendor/gnumake/2003-11-23/configure.in

Last change on this file was 54, checked in by (none), 21 years ago

This commit was manufactured by cvs2svn to create branch 'GNU'.

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