1 # Process this file with autoconf to produce a configure script.
3 AC_INIT([GNU make],[3.81rc1],[bug-make@gnu.org])
6 AC_REVISION([[$Id: configure.in,v 1.121 2004/01/21 06:33:00 psmith Exp $]])
9 AC_CONFIG_AUX_DIR(config)
10 AC_CONFIG_SRCDIR(vpath.c)
11 AC_CONFIG_HEADERS(config.h)
14 AM_INIT_AUTOMAKE([1.7.6])
16 # Checks for programs.
21 AC_CHECK_PROG(AR, ar, ar, ar)
22 # Perl is needed for the test suite (only)
23 AC_CHECK_PROG(PERL, perl, perl, perl)
25 # Specialized system macros
34 # Enable gettext, in "external" mode.
36 AM_GNU_GETTEXT_VERSION(0.12.1)
37 AM_GNU_GETTEXT([external])
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.
44 # Checks for libraries.
45 AC_SEARCH_LIBS(getpwnam, [sun])
47 # Checks for header files.
52 AC_CHECK_HEADERS(stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
53 memory.h sys/param.h sys/time.h sys/timeb.h)
62 # Find some definition for uintmax_t
64 AC_CHECK_TYPE(uintmax_t,,[
65 uintmax_t="unsigned long"
66 AC_CHECK_TYPE(unsigned long long,[uintmax_t="unsigned long long"])
67 AC_DEFINE_UNQUOTED(uintmax_t,$uintmax_t,
68 [Define uintmax_t if not defined in <stdint.h> or <inttypes.h>.])])
70 # Find out whether our struct stat returns nanosecond resolution timestamps.
72 AC_STRUCT_ST_MTIM_NSEC
73 AC_MSG_CHECKING([whether to use high resolution file timestamps])
74 AC_CACHE_VAL(make_cv_file_timestamp_hi_res, [
75 make_cv_file_timestamp_hi_res=no
76 if test "$ac_cv_struct_st_mtim_nsec" != no; then
77 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
79 # include <inttypes.h>
81 [[char a[0x7fffffff < (uintmax_t)-1 >> 30 ? 1 : -1];]])],
82 [make_cv_file_timestamp_hi_res=yes],
85 AC_MSG_RESULT($make_cv_file_timestamp_hi_res)
86 if test "$make_cv_file_timestamp_hi_res" = yes; then
91 AC_DEFINE_UNQUOTED(FILE_TIMESTAMP_HI_RES, $val,
92 [Use high resolution file timestamps if nonzero.])
94 if test "$make_cv_file_timestamp_hi_res" = yes; then
95 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
96 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
97 AC_SEARCH_LIBS(clock_gettime, [rt posix4])
98 if test "$ac_cv_search_clock_gettime" != no; then
99 AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
100 [Define if you have the clock_gettime function.])
104 # Check for DOS-style pathnames.
107 # See if we have a standard version of gettimeofday(). Since actual
108 # implementations can differ, just make sure we have the most common
110 AC_CACHE_CHECK([for standard gettimeofday], ac_cv_func_gettimeofday,
111 [ac_cv_func_gettimeofday=no
112 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/time.h>
115 struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
116 exit (gettimeofday (&t, 0) != 0
117 || t.tv_sec < 0 || t.tv_usec < 0);
119 [ac_cv_func_gettimeofday=yes],
120 [ac_cv_func_gettimeofday=no],
121 [ac_cv_func_gettimeofday="no (cross-compiling)"])])
122 if test "$ac_cv_func_gettimeofday" = yes; then
123 AC_DEFINE(HAVE_GETTIMEOFDAY, 1,
124 [Define if you have a standard gettimeofday function])
127 AC_CHECK_FUNCS( memcpy memmove strchr strdup mkstemp mktemp fdopen \
128 bsd_signal dup2 getcwd sigsetmask sigaction getgroups \
129 seteuid setegid setlinebuf setreuid setregid setvbuf pipe \
132 AC_FUNC_SETVBUF_REVERSED
134 # strcoll() is used by the GNU glob library
140 AC_FUNC_CLOSEDIR_VOID
144 # AC_FUNC_GETLOADAVG is documented to set the NLIST_STRUCT value, but it
145 # doesn't. So, we will.
147 if test "$ac_cv_header_nlist_h" = yes; then
148 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
150 nl.n_name = "string";
152 [make_cv_nlist_struct=yes],
153 [make_cv_nlist_struct=no])
154 if test "$make_cv_nlist_struct" = yes; then
155 AC_DEFINE(NLIST_STRUCT, 1,
156 [Define if struct nlist.n_name is a pointer rather than an array.])
160 AC_CHECK_DECLS([sys_siglist])
163 # Check out the wait reality.
164 AC_CHECK_HEADERS(sys/wait.h)
165 AC_CHECK_FUNCS(waitpid wait3)
166 AC_MSG_CHECKING(for union wait)
167 AC_CACHE_VAL(make_cv_union_wait, [dnl
168 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
169 #include <sys/wait.h>]],
170 [[union wait status; int pid; pid = wait (&status);
172 /* Some POSIXoid systems have both the new-style macros and the old
173 union wait type, and they do not work together. If union wait
174 conflicts with WEXITSTATUS et al, we don't want to use it at all. */
175 if (WEXITSTATUS (status) != 0) pid = -1;
177 /* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
178 -- blow chunks here --
182 /* Make sure union wait works with waitpid. */
183 pid = waitpid (-1, &status, 0);
186 [make_cv_union_wait=yes],
187 [make_cv_union_wait=no])])
188 if test "$make_cv_union_wait" = yes; then
189 AC_DEFINE(HAVE_UNION_WAIT, 1,
190 [Define this if you have the \`union wait' type in <sys/wait.h>.])
192 AC_MSG_RESULT($make_cv_union_wait)
195 # If we're building on Windows/DOS/OS/2, add some support for DOS drive specs.
196 if test "$PATH_SEPARATOR" = ';'; then
197 AC_DEFINE(HAVE_DOS_PATHS, 1,
198 [Define this if your system requires backslashes or drive specs in pathnames.])
202 # See if the user wants to use pmake's "customs" distributed build capability
204 AC_SUBST(REMOTE) REMOTE=stub
207 AC_HELP_STRING([--with-customs=DIR],
208 [enable remote jobs via Customs--see README.customs]),
211 *) make_cppflags="$CPPFLAGS"
214 *) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
215 make_ldflags="$LDFLAGS -L$with_customs/lib" ;;
218 AC_CHECK_HEADER(customs.h,
221 LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags"],
223 CPPFLAGS="$make_cppflags" make_badcust=yes])
226 # Tell automake about this, so it can include the right .c files.
227 AM_CONDITIONAL(USE_CUSTOMS, test "$use_customs" = true)
229 # See if we can handle the job server feature, and if the user wants it.
231 AC_ARG_ENABLE(job-server,
232 AC_HELP_STRING([--disable-job-server],
233 [disallow recursive make communication during -jN]),
234 [make_cv_job_server="$enableval" user_job_server="$enableval"],
235 [make_cv_job_server="yes"])
238 case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
239 no/no) has_wait_nohang=no ;;
242 AC_CACHE_CHECK(for SA_RESTART, make_cv_sa_restart, [
243 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]],
244 [[return SA_RESTART;]])],
245 [make_cv_sa_restart=yes],
246 [make_cv_sa_restart=no])])
247 if test "$make_cv_sa_restart" != no; then
248 AC_DEFINE(HAVE_SA_RESTART, 1,
249 [Define if <signal.h> defines the SA_RESTART constant.])
252 case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/$make_cv_job_server" in
254 AC_DEFINE(MAKE_JOBSERVER, 1,
255 [Define this to enable job server support in GNU make.]);;
258 # Find the SCCS commands, so we can include them in our default rules.
260 AC_CACHE_CHECK(for location of SCCS get command, make_cv_path_sccs_get, [
261 if test -f /usr/sccs/get; then
262 make_cv_path_sccs_get=/usr/sccs/get
264 make_cv_path_sccs_get=get
266 AC_DEFINE_UNQUOTED(SCCS_GET, ["$make_cv_path_sccs_get"],
267 [Define to the name of the SCCS 'get' command.])
269 ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
270 if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
271 test -f s.conftest; then
272 # We successfully created an SCCS file.
273 AC_CACHE_CHECK(if SCCS get command understands -G, make_cv_sys_get_minus_G, [
274 if $make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
275 test -f conftoast; then
276 make_cv_sys_get_minus_G=yes
278 make_cv_sys_get_minus_G=no
280 case "$make_cv_sys_get_minus_G" in
281 yes) AC_DEFINE(SCCS_GET_MINUS_G, 1,
282 [Define this if the SCCS 'get' command understands the '-G<file>' option.]);;
285 rm -f s.conftest conftoast
287 # Check the system to see if it provides GNU glob. If not, use our
290 AC_MSG_CHECKING(if system libc has GNU glob)
291 AC_CACHE_VAL(make_cv_sys_gnu_glob, [
292 AC_EGREP_CPP(gnu glob,[
293 #include <features.h>
297 #define GLOB_INTERFACE_VERSION 1
298 #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
299 # include <gnu-versions.h>
300 # if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
304 ], [AC_MSG_RESULT(yes)
305 make_cv_sys_gnu_glob=yes], [AC_MSG_RESULT([no; using local copy])
306 AC_SUBST(GLOBINC) GLOBINC='-I$(srcdir)/glob'
307 AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a
308 make_cv_sys_gnu_glob=no])])
309 # Tell automake about this, so it can build the right .c files.
310 AM_CONDITIONAL(USE_LOCAL_GLOB, test "$make_cv_sys_gnu_glob" = no)
312 # Let the makefile know what our build host is
314 AC_DEFINE_UNQUOTED(MAKE_HOST,"$host",[Build host information.])
318 # Include the Maintainer's Makefile section, if it's here.
320 MAINT_MAKEFILE=/dev/null
321 if test -r "$srcdir/maintMakefile"; then
322 MAINT_MAKEFILE="$srcdir/maintMakefile"
324 AC_SUBST_FILE(MAINT_MAKEFILE)
326 # Allow building with dmalloc
330 # Sanity check and inform the user of what we found
332 case "$make_badcust" in
334 echo "WARNING: --with-customs specified but no customs.h could be found;"
335 echo " disabling Customs support."
339 case "$with_customs" in
341 *) if test -f "$with_customs/lib/libcustoms.a"; then
345 echo "WARNING: '$with_customs/lib' does not appear to contain the"
346 echo " Customs library. You must build and install Customs"
347 echo " before compiling GNU make."
352 case "$has_wait_nohang" in
354 echo "WARNING: Your system has neither waitpid() nor wait3()."
355 echo " Without one of these, signal handling is unreliable."
356 echo " You should be aware that running GNU make with -j"
357 echo " could result in erratic behavior."
361 case "$make_cv_job_server/$user_job_server" in
363 echo "WARNING: Make job server requires a POSIX-ish system that"
364 echo " supports the pipe(), sigaction(), and either"
365 echo " waitpid() or wait3() functions. Your system doesn't"
366 echo " appear to provide one or more of those."
367 echo " Disabling job server support."
372 # Specify what files are to be created.
373 # We only generate the build.sh if we have a build.sh.in; we won't have
374 # one before we've created a distribution.
376 AC_CONFIG_FILES(Makefile glob/Makefile po/Makefile.in config/Makefile doc/Makefile)
378 if test -f $srcdir/build.sh.in; then
379 AC_CONFIG_FILES(build.sh)
389 dnl comment-start: "dnl "
391 dnl comment-start-skip: "\\bdnl\\b\\s *"
392 dnl compile-command: "make configure config.h.in"