1 # Process this file with autoconf to produce a configure script.
3 # Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
4 # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software
6 # This file is part of GNU Make.
8 # GNU Make is free software; you can redistribute it and/or modify it under
9 # the terms of the GNU General Public License as published by the Free Software
10 # Foundation; either version 3 of the License, or (at your option) any later
13 # GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
14 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
18 # You should have received a copy of the GNU General Public License along with
19 # this program. If not, see <http://www.gnu.org/licenses/>.
21 AC_INIT([GNU make],[3.82.90],[bug-make@gnu.org])
24 AC_REVISION([$Id: configure.in,v 1.161 2012/01/16 02:29:22 psmith Exp $])
27 AC_CONFIG_AUX_DIR([config])
28 AC_CONFIG_SRCDIR([vpath.c])
29 AC_CONFIG_HEADERS([config.h])
32 AM_INIT_AUTOMAKE([1.9])
34 # Checks for programs.
39 AC_CHECK_PROG([AR], [ar], [ar], [ar])
40 # Perl is needed for the test suite (only)
41 AC_CHECK_PROG([PERL], [perl], [perl], [perl])
43 # Specialized system macros
49 # Enable gettext, in "external" mode.
51 AM_GNU_GETTEXT_VERSION([0.14.1])
52 AM_GNU_GETTEXT([external])
54 # This test must come as early as possible after the compiler configuration
55 # tests, because the choice of the file model can (in principle) affect
56 # whether functions and headers are available, whether they work, etc.
59 # Checks for libraries.
60 AC_SEARCH_LIBS([getpwnam], [sun])
62 # Checks for header files.
67 AC_CHECK_HEADERS([stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
68 memory.h sys/param.h sys/resource.h sys/time.h sys/timeb.h])
70 # Set a flag if we have an ANSI C compiler
71 AS_IF([test "$ac_cv_prog_cc_stdc" != no],
72 [ AC_DEFINE([HAVE_ANSI_COMPILER], [1],
73 [Define to 1 if your compiler conforms to the ANSI C standard.])
77 # Determine what kind of variadic function calls we support
78 AC_CHECK_HEADERS([stdarg.h varargs.h], [break])
86 # Find some definition for uintmax_t
88 AC_CHECK_TYPE([uintmax_t],[],
89 [ uintmax_t="unsigned long"
90 AC_CHECK_TYPE([unsigned long long],[uintmax_t="unsigned long long"])
91 AC_DEFINE_UNQUOTED([uintmax_t], [$uintmax_t],
92 [Define uintmax_t if not defined in <stdint.h> or <inttypes.h>.])
95 # Find out whether our struct stat returns nanosecond resolution timestamps.
97 AC_STRUCT_ST_MTIM_NSEC
98 AC_CACHE_CHECK([whether to use high resolution file timestamps],
99 [make_cv_file_timestamp_hi_res],
100 [ make_cv_file_timestamp_hi_res=no
101 AS_IF([test "$ac_cv_struct_st_mtim_nsec" != no],
102 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
104 # include <inttypes.h>
106 [[char a[0x7fffffff < (uintmax_t)-1 >> 30 ? 1 : -1];]])],
107 [make_cv_file_timestamp_hi_res=yes])
109 AS_IF([test "$make_cv_file_timestamp_hi_res" = yes], [val=1], [val=0])
110 AC_DEFINE_UNQUOTED([FILE_TIMESTAMP_HI_RES], [$val],
111 [Use high resolution file timestamps if nonzero.])
113 AS_IF([test "$make_cv_file_timestamp_hi_res" = yes],
114 [ # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
115 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
116 AC_SEARCH_LIBS([clock_gettime], [rt posix4])
117 AS_IF([test "$ac_cv_search_clock_gettime" != no],
118 [ AC_DEFINE([HAVE_CLOCK_GETTIME], [1],
119 [Define to 1 if you have the clock_gettime function.])
123 # Check for DOS-style pathnames.
126 # See if we have a standard version of gettimeofday(). Since actual
127 # implementations can differ, just make sure we have the most common
129 AC_CACHE_CHECK([for standard gettimeofday], [ac_cv_func_gettimeofday],
130 [ac_cv_func_gettimeofday=no
131 AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/time.h>
134 struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
135 exit (gettimeofday (&t, 0) != 0
136 || t.tv_sec < 0 || t.tv_usec < 0);
138 [ac_cv_func_gettimeofday=yes],
139 [ac_cv_func_gettimeofday=no],
140 [ac_cv_func_gettimeofday="no (cross-compiling)"])])
141 AS_IF([test "$ac_cv_func_gettimeofday" = yes],
142 [ AC_DEFINE([HAVE_GETTIMEOFDAY], [1],
143 [Define to 1 if you have a standard gettimeofday function])
146 AC_CHECK_FUNCS([strdup strndup mkstemp mktemp fdopen fileno \
147 dup2 getcwd realpath sigsetmask sigaction \
148 getgroups seteuid setegid setlinebuf setreuid setregid \
149 getrlimit setrlimit setvbuf pipe strerror strsignal \
150 lstat readlink atexit])
152 # We need to check declarations, not just existence, because on Tru64 this
153 # function is not declared without special flags, which themselves cause
154 # other problems. We'll just use our own.
155 AC_CHECK_DECLS([bsd_signal], [], [], [[#include <signal.h>]])
157 AC_FUNC_SETVBUF_REVERSED
159 # Rumor has it that strcasecmp lives in -lresolv on some odd systems.
160 # It doesn't hurt much to use our own if we can't find it so I don't
161 # make the effort here.
162 AC_CHECK_FUNCS([strcasecmp strncasecmp strcmpi strncmpi stricmp strnicmp])
164 # strcoll() is used by the GNU glob library
170 AC_FUNC_CLOSEDIR_VOID
172 # See if the user wants to add (or not) GNU Guile support
174 AC_ARG_WITH([guile], [AS_HELP_STRING([--with-guile],
175 [Support GNU Guile for embedded scripting])])
177 # For some strange reason, at least on Ubuntu, each version of Guile
178 # comes with it's own PC file so we have to specify them as individual
180 AS_IF([test "x$with_guile" != xno],
181 [ PKG_CHECK_MODULES([GUILE], [guile-2.0], [have_guile=yes],
182 [PKG_CHECK_MODULES([GUILE], [guile-1.8], [have_guile=yes],
183 [PKG_CHECK_MODULES([GUILE], [guile-1.6], [have_guile=yes],
187 AS_IF([test "$have_guile" = yes],
188 [AC_DEFINE([HAVE_GUILE], [1], [Embed GNU Guile support])])
190 AM_CONDITIONAL([HAVE_GUILE], [test "$have_guile" = yes])
194 # AC_FUNC_GETLOADAVG is documented to set the NLIST_STRUCT value, but it
195 # doesn't. So, we will.
197 AS_IF([test "$ac_cv_header_nlist_h" = yes],
198 [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <nlist.h>]],
200 nl.n_name = "string";
202 [make_cv_nlist_struct=yes],
203 [make_cv_nlist_struct=no])
204 AS_IF([test "$make_cv_nlist_struct" = yes],
205 [ AC_DEFINE([NLIST_STRUCT], [1],
206 [Define to 1 if struct nlist.n_name is a pointer rather than an array.])
210 AC_CHECK_DECLS([sys_siglist, _sys_siglist, __sys_siglist], , ,
213 /* NetBSD declares sys_siglist in unistd.h. */
220 # Check out the wait reality.
221 AC_CHECK_HEADERS([sys/wait.h],[],[],[[#include <sys/types.h>]])
222 AC_CHECK_FUNCS([waitpid wait3])
223 AC_CACHE_CHECK([for union wait], [make_cv_union_wait],
224 [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
225 #include <sys/wait.h>]],
226 [[union wait status; int pid; pid = wait (&status);
228 /* Some POSIXoid systems have both the new-style macros and the old
229 union wait type, and they do not work together. If union wait
230 conflicts with WEXITSTATUS et al, we don't want to use it at all. */
231 if (WEXITSTATUS (status) != 0) pid = -1;
233 /* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
234 -- blow chunks here --
238 /* Make sure union wait works with waitpid. */
239 pid = waitpid (-1, &status, 0);
242 [make_cv_union_wait=yes],
243 [make_cv_union_wait=no])
245 AS_IF([test "$make_cv_union_wait" = yes],
246 [ AC_DEFINE([HAVE_UNION_WAIT], [1],
247 [Define to 1 if you have the \`union wait' type in <sys/wait.h>.])
251 # If we're building on Windows/DOS/OS/2, add some support for DOS drive specs.
252 AS_IF([test "$PATH_SEPARATOR" = ';'],
253 [ AC_DEFINE([HAVE_DOS_PATHS], [1],
254 [Define to 1 if your system requires backslashes or drive specs in pathnames.])
258 # See if the user wants to use pmake's "customs" distributed build capability
260 AC_SUBST([REMOTE]) REMOTE=stub
262 AC_ARG_WITH([customs],
263 [ AC_HELP_STRING([--with-customs=DIR],
264 [enable remote jobs via Customs--see README.customs])],
265 [ AS_CASE([$withval], [n|no], [:],
266 [make_cppflags="$CPPFLAGS"
269 [CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
270 make_ldflags="$LDFLAGS -L$with_customs/lib"])
272 AC_CHECK_HEADER([customs.h],
275 LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags"],
277 CPPFLAGS="$make_cppflags" make_badcust=yes])
281 # Tell automake about this, so it can include the right .c files.
282 AM_CONDITIONAL([USE_CUSTOMS], [test "$use_customs" = true])
284 # See if the user asked to handle case insensitive file systems.
286 AH_TEMPLATE([HAVE_CASE_INSENSITIVE_FS], [Use case insensitive file names])
287 AC_ARG_ENABLE([case-insensitive-file-system],
288 AC_HELP_STRING([--enable-case-insensitive-file-system],
289 [assume file systems are case insensitive]),
290 [AS_IF([test "$enableval" = yes], [AC_DEFINE([HAVE_CASE_INSENSITIVE_FS])])])
292 # See if we can handle the job server feature, and if the user wants it.
294 AC_ARG_ENABLE([job-server],
295 AC_HELP_STRING([--disable-job-server],
296 [disallow recursive make communication during -jN]),
297 [make_cv_job_server="$enableval" user_job_server="$enableval"],
298 [make_cv_job_server="yes"])
300 AS_IF([test "$ac_cv_func_waitpid" = no && test "$ac_cv_func_wait3" = no],
301 [has_wait_nohang=no],
302 [has_wait_nohang=yes])
304 AC_CACHE_CHECK([for SA_RESTART], [make_cv_sa_restart], [
305 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <signal.h>]],
306 [[return SA_RESTART;]])],
307 [make_cv_sa_restart=yes],
308 [make_cv_sa_restart=no])])
310 AS_IF([test "$make_cv_sa_restart" != no],
311 [ AC_DEFINE([HAVE_SA_RESTART], [1],
312 [Define to 1 if <signal.h> defines the SA_RESTART constant.])
315 # Only allow jobserver on systems that support it
316 AS_CASE([/$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/],
317 [*/no/*], [make_cv_job_server=no])
319 # Also supported on OS2 and MinGW
320 AS_CASE([$host_os], [os2*|mingw*], [make_cv_job_server=yes])
322 # If we support it and the user didn't disable it, build with jobserver
323 AS_CASE([/$make_cv_job_server/$user_job_server/],
324 [*/no/*], [: no jobserver],
325 [AC_DEFINE(MAKE_JOBSERVER, 1,
326 [Define to 1 to enable job server support in GNU make.])
329 # if we have both lstat() and readlink() then we can support symlink
331 AS_IF([test "$ac_cv_func_lstat" = yes && test "$ac_cv_func_readlink" = yes],
332 [ AC_DEFINE([MAKE_SYMLINKS], [1],
333 [Define to 1 to enable symbolic link timestamp checking.])
336 # Find the SCCS commands, so we can include them in our default rules.
338 AC_CACHE_CHECK([for location of SCCS get command], [make_cv_path_sccs_get], [
339 AS_IF([test -f /usr/sccs/get],
340 [make_cv_path_sccs_get=/usr/sccs/get],
341 [make_cv_path_sccs_get=get])
343 AC_DEFINE_UNQUOTED([SCCS_GET], ["$make_cv_path_sccs_get"],
344 [Define to the name of the SCCS 'get' command.])
346 ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
347 AS_IF([(/usr/sccs/admin -n s.conftest || admin -n s.conftest) >/dev/null 2>&1 &&
349 [ # We successfully created an SCCS file.
350 AC_CACHE_CHECK([if SCCS get command understands -G], [make_cv_sys_get_minus_G],
351 [AS_IF([$make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
353 [make_cv_sys_get_minus_G=yes],
354 [make_cv_sys_get_minus_G=no])
356 AS_IF([test "$make_cv_sys_get_minus_G" = yes],
357 [AC_DEFINE([SCCS_GET_MINUS_G], [1],
358 [Define to 1 if the SCCS 'get' command understands the '-G<file>' option.])
361 rm -f s.conftest conftoast
363 # Check the system to see if it provides GNU glob. If not, use our
365 AC_CACHE_CHECK([if system libc has GNU glob], [make_cv_sys_gnu_glob],
366 [ AC_EGREP_CPP([gnu glob],[
367 #include <features.h>
371 #define GLOB_INTERFACE_VERSION 1
372 #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
373 # include <gnu-versions.h>
374 # if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
378 [make_cv_sys_gnu_glob=yes],
379 [make_cv_sys_gnu_glob=no])])
380 AS_IF([test "$make_cv_sys_gnu_glob" = no],
381 [ GLOBINC='-I$(srcdir)/glob'
382 GLOBLIB=glob/libglob.a
387 # Tell automake about this, so it can build the right .c files.
388 AM_CONDITIONAL([USE_LOCAL_GLOB], [test "$make_cv_sys_gnu_glob" = no])
390 # Let the makefile know what our build host is
392 AC_DEFINE_UNQUOTED([MAKE_HOST],["$host"],[Build host information.])
394 AC_SUBST([MAKE_HOST])
397 AM_CONDITIONAL([WINDOWSENV], [false])
401 [AM_CONDITIONAL([WINDOWSENV], [true])
403 AC_DEFINE([WINDOWS32], [1], [Use platform specific coding])
404 AC_DEFINE([HAVE_DOS_PATHS], [1], [Use platform specific coding])
407 AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
408 [Define to the character that separates directories in PATH.])
410 # Include the Maintainer's Makefile section, if it's here.
412 MAINT_MAKEFILE=/dev/null
413 AS_IF([test -r "$srcdir/maintMakefile"],
414 [ MAINT_MAKEFILE="$srcdir/maintMakefile"
416 AC_SUBST_FILE([MAINT_MAKEFILE])
418 # Allow building with dmalloc
421 # Forcibly disable SET_MAKE. If it's set it breaks things like the test
425 # Sanity check and inform the user of what we found
427 AS_IF([test "x$make_badcust" = xyes], [
429 echo "WARNING: --with-customs specified but no customs.h could be found;"
430 echo " disabling Customs support."
434 AS_CASE([$with_customs],
435 [""|n|no|y|ye|yes], [:],
436 [AS_IF([test -f "$with_customs/lib/libcustoms.a"], [:],
438 echo "WARNING: '$with_customs/lib' does not appear to contain the"
439 echo " Customs library. You must build and install Customs"
440 echo " before compiling GNU make."
444 AS_IF([test "x$has_wait_nohang" = xno],
446 echo "WARNING: Your system has neither waitpid() nor wait3()."
447 echo " Without one of these, signal handling is unreliable."
448 echo " You should be aware that running GNU make with -j"
449 echo " could result in erratic behavior."
453 AS_IF([test "x$make_cv_job_server" = xno && test "x$user_job_server" = xyes],
455 echo "WARNING: Make job server requires a POSIX-ish system that"
456 echo " supports the pipe(), sigaction(), and either"
457 echo " waitpid() or wait3() functions. Your system doesn't"
458 echo " appear to provide one or more of those."
459 echo " Disabling job server support."
463 # Specify what files are to be created.
464 AC_CONFIG_FILES([Makefile glob/Makefile po/Makefile.in config/Makefile \
465 doc/Makefile w32/Makefile])
471 # We only generate the build.sh if we have a build.sh.in; we won't have
472 # one before we've created a distribution.
473 AS_IF([test -f "$srcdir/build.sh.in"],
474 [ ./config.status --file build.sh
479 dnl comment-start: "dnl "
481 dnl comment-start-skip: "\\bdnl\\b\\s *"
482 dnl compile-command: "make configure config.h.in"