1 # Process this file with autoconf to produce a configure script.
3 AC_INIT(GNU make,3.79.2a1,bug-make@gnu.org)
7 AC_REVISION([[$Id: configure.in,v 1.108 2002/05/10 03:15:08 psmith Exp $]])
10 AC_CONFIG_AUX_DIR(config)
11 AC_CONFIG_SRCDIR(vpath.c)
12 AM_CONFIG_HEADER(config.h)
18 # Checks for programs.
23 AC_CHECK_PROG(AR, ar, ar, ar)
24 # Perl is needed for the test suite (only)
25 AC_CHECK_PROG(PERL, perl, perl, perl)
27 # Specialized system macros
33 # Enable gettext, in "external" mode.
34 # Maintainers: this requires gettext 0.11 or better!
35 AM_GNU_GETTEXT([external])
37 # This test must come as early as possible after the compiler configuration
38 # tests, because the choice of the file model can (in principle) affect
39 # whether functions and headers are available, whether they work, etc.
42 # Checks for libraries.
43 AC_SEARCH_LIBS(getpwnam, [sun])
45 # Checks for header files.
50 AC_CHECK_HEADERS(stdlib.h locale.h unistd.h limits.h fcntl.h string.h \
51 memory.h sys/param.h sys/time.h sys/timeb.h)
60 # Find some definition for uintmax_t
62 AC_CHECK_TYPE(uintmax_t,,[
63 uintmax_t="unsigned long"
64 AC_CHECK_TYPE(unsigned long long,[uintmax_t="unsigned long long"])
65 AC_DEFINE_UNQUOTED(uintmax_t,$uintmax_t,[Define uintmax_t if not defined in <stdint.h> or <inttypes.h>.])])
67 # Find out whether our struct stat returns nanosecond resolution timestamps.
69 AC_STRUCT_ST_MTIM_NSEC
70 AC_MSG_CHECKING([whether to use high resolution file timestamps])
71 AC_CACHE_VAL(make_cv_file_timestamp_hi_res, [
72 make_cv_file_timestamp_hi_res=no
73 if test "$ac_cv_struct_st_mtim_nsec" != no; then
76 # include <inttypes.h>
78 [char a[0x7fffffff < (uintmax_t) -1 >> 30 ? 1 : -1];],
79 make_cv_file_timestamp_hi_res=yes)
81 AC_MSG_RESULT($make_cv_file_timestamp_hi_res)
82 if test "$make_cv_file_timestamp_hi_res" = yes; then
87 AC_DEFINE_UNQUOTED(FILE_TIMESTAMP_HI_RES, $val,
88 [Use high resolution file timestamps if nonzero.])
90 if test "$make_cv_file_timestamp_hi_res" = yes; then
91 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
92 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
93 AC_SEARCH_LIBS(clock_gettime, [rt posix4])
94 if test "$ac_cv_search_clock_gettime" != no; then
95 AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
96 [Define if you have the clock_gettime function.])
101 # See if we have a standard version of gettimeofday(). Since actual
102 # implementations can differ, just make sure we have the most common
104 AC_CACHE_CHECK([for standard gettimeofday], ac_cv_func_gettimeofday,
105 [ac_cv_func_gettimeofday=no
106 AC_TRY_RUN([#include <sys/time.h>
109 struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
110 exit (gettimeofday (&t, 0) != 0
111 || t.tv_sec < 0 || t.tv_usec < 0);
113 ac_cv_func_gettimeofday=yes,
114 ac_cv_func_gettimeofday=no,
115 ac_cv_func_gettimeofday="no (cross-compiling)")])
116 if test "$ac_cv_func_gettimeofday" = yes; then
117 AC_DEFINE(HAVE_GETTIMEOFDAY, 1,
118 [Define if you have a standard gettimeofday function])
121 AC_CHECK_FUNCS( memcpy strchr strdup mkstemp mktemp fdopen \
122 bsd_signal dup2 getcwd sigsetmask sigaction getgroups \
123 seteuid setegid setlinebuf setreuid setregid setvbuf pipe \
126 make_FUNC_SETVBUF_REVERSED
128 # strcoll() is used by the GNU glob library
134 AC_FUNC_CLOSEDIR_VOID
138 # AC_FUNC_GETLOADAVG is documented to set the NLIST_STRUCT value, but it
139 # doesn't. So, we will.
141 if test "$ac_cv_header_nlist_h" = yes; then
142 AC_TRY_COMPILE([#include <nlist.h>],
144 nl.n_name = "string";
146 make_cv_nlist_struct=yes,
147 make_cv_nlist_struct=no)
148 if test "$make_cv_nlist_struct" = yes; then
149 AC_DEFINE(NLIST_STRUCT, 1,
150 [Define if struct nlist.n_name is a pointer rather than an array.])
156 # Check out the wait reality.
157 AC_CHECK_HEADERS(sys/wait.h)
158 AC_CHECK_FUNCS(waitpid wait3)
159 AC_MSG_CHECKING(for union wait)
160 AC_CACHE_VAL(make_cv_union_wait, [dnl
161 AC_TRY_LINK([#include <sys/types.h>
162 #include <sys/wait.h>],
163 [union wait status; int pid; pid = wait (&status);
165 /* Some POSIXoid systems have both the new-style macros and the old
166 union wait type, and they do not work together. If union wait
167 conflicts with WEXITSTATUS et al, we don't want to use it at all. */
168 if (WEXITSTATUS (status) != 0) pid = -1;
170 /* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
171 -- blow chunks here --
175 /* Make sure union wait works with waitpid. */
176 pid = waitpid (-1, &status, 0);
179 [make_cv_union_wait=yes], [make_cv_union_wait=no])])
180 if test "$make_cv_union_wait" = yes; then
181 AC_DEFINE(HAVE_UNION_WAIT, 1, [Define this if you have the \`union wait' type in <sys/wait.h>.])
183 AC_MSG_RESULT($make_cv_union_wait)
186 # See if the user wants to use pmake's "customs" distributed build capability
190 AC_HELP_STRING([--with-customs=DIR],
191 [enable remote jobs via Customs--see README.customs]),
194 *) make_cppflags="$CPPFLAGS"
197 *) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
198 make_ldflags="$LDFLAGS -L$with_customs/lib" ;;
201 AC_CHECK_HEADER(customs.h,
203 LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags"],
205 CPPFLAGS="$make_cppflags" make_badcust=yes])
208 # Tell automake about this, so it can include the right .c files.
209 AM_CONDITIONAL(USE_CUSTOMS, test "$use_customs" = true)
211 # See if we can handle the job server feature, and if the user wants it.
213 AC_ARG_ENABLE(job-server,
214 AC_HELP_STRING([--disable-job-server],
215 [disallow recursive make communication during -jN]),
216 [make_cv_job_server="$enableval" user_job_server="$enableval"],
217 [make_cv_job_server="yes"])
220 case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
221 no/no) has_wait_nohang=no ;;
224 AC_CACHE_CHECK(for SA_RESTART, make_cv_sa_restart, [
225 AC_TRY_COMPILE([#include <signal.h>],
226 [return SA_RESTART;],
227 make_cv_sa_restart=yes,
228 make_cv_sa_restart=no)])
229 if test "$make_cv_sa_restart" != no; then
230 AC_DEFINE(HAVE_SA_RESTART, 1,
231 [Define if <signal.h> defines the SA_RESTART constant.])
234 case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/$make_cv_job_server" in
236 AC_DEFINE(MAKE_JOBSERVER, 1,
237 [Define this to enable job server support in GNU make.]);;
240 # Find the SCCS commands, so we can include them in our default rules.
242 AC_CACHE_CHECK(for location of SCCS get command, make_cv_path_sccs_get, [
243 if test -f /usr/sccs/get; then
244 make_cv_path_sccs_get=/usr/sccs/get
246 make_cv_path_sccs_get=get
248 AC_DEFINE_UNQUOTED(SCCS_GET, ["$make_cv_path_sccs_get"], [Define to the name of the SCCS 'get' command.])
250 ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
251 if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
252 test -f s.conftest; then
253 # We successfully created an SCCS file.
254 AC_CACHE_CHECK(if SCCS get command understands -G, make_cv_sys_get_minus_G, [
255 if $make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
256 test -f conftoast; then
257 make_cv_sys_get_minus_G=yes
259 make_cv_sys_get_minus_G=no
261 case "$make_cv_sys_get_minus_G" in
262 yes) AC_DEFINE(SCCS_GET_MINUS_G, 1,
263 [Define this if the SCCS 'get' command understands the '-G<file>' option.]);;
266 rm -f s.conftest conftoast
268 # Check the system to see if it provides GNU glob. If not, use our
271 AC_MSG_CHECKING(if system libc has GNU glob)
272 AC_CACHE_VAL(make_cv_sys_gnu_glob, [
273 AC_EGREP_CPP(gnu glob,[
274 #include <features.h>
278 #define GLOB_INTERFACE_VERSION 1
279 #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
280 # include <gnu-versions.h>
281 # if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
285 ], [AC_MSG_RESULT(yes)
286 make_cv_sys_gnu_glob=yes], [AC_MSG_RESULT([no; using local copy])
287 AC_SUBST(GLOBINC) GLOBINC='-I$(srcdir)/glob'
288 AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a
289 make_cv_sys_gnu_glob=no])])
290 # Tell automake about this, so it can build the right .c files.
291 AM_CONDITIONAL(USE_LOCAL_GLOB, test "$make_cv_sys_gnu_glob" = no)
293 # Let the makefile know what our build host is
295 AC_DEFINE_UNQUOTED(MAKE_HOST,"$host",[Build host information.])
299 # Include the Maintainer's Makefile section, if it's here.
301 MAINT_MAKEFILE=/dev/null
302 if test -r "$srcdir/maintMakefile"; then
303 MAINT_MAKEFILE="$srcdir/maintMakefile"
305 AC_SUBST_FILE(MAINT_MAKEFILE)
307 # Allow building with dmalloc
311 # Sanity check and inform the user of what we found
313 case "$make_badcust" in
315 echo "WARNING: --with-customs specified but no customs.h could be found;"
316 echo " disabling Customs support."
320 case "$with_customs" in
322 *) if test -f "$with_customs/lib/libcustoms.a"; then
326 echo "WARNING: '$with_customs/lib' does not appear to contain the"
327 echo " Customs library. You must build and install Customs"
328 echo " before compiling GNU make."
333 case "$has_wait_nohang" in
335 echo "WARNING: Your system has neither waitpid() nor wait3()."
336 echo " Without one of these, signal handling is unreliable."
337 echo " You should be aware that running GNU make with -j"
338 echo " could result in erratic behavior."
342 case "$make_cv_job_server/$user_job_server" in
344 echo "WARNING: Make job server requires a POSIX-ish system that"
345 echo " supports the pipe(), sigaction(), and either"
346 echo " waitpid() or wait3() functions. Your system doesn't"
347 echo " appear to provide one or more of those."
348 echo " Disabling job server support."
353 # Specify what files are to be created.
354 # We only generate the build.sh if we have a build.sh.in; we won't have
355 # one before we've created a distribution.
357 AC_CONFIG_FILES(Makefile glob/Makefile po/Makefile.in config/Makefile)
359 if test -f $srcdir/build.sh.in; then
360 AC_CONFIG_FILES(build.sh)
370 dnl comment-start: "dnl "
372 dnl comment-start-skip: "\\bdnl\\b\\s *"
373 dnl compile-command: "make configure config.h.in"