1 # Process this file with autoconf to produce a configure script.
3 AC_INIT(GNU make,3.79.2rc1,bug-make@gnu.org)
7 AC_REVISION([[$Id: configure.in,v 1.107 2002/04/22 04:35:20 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 unistd.h limits.h sys/param.h fcntl.h string.h \
51 memory.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 setlinebuf seteuid setegid setreuid setregid pipe \
130 AC_FUNC_CLOSEDIR_VOID
131 AC_FUNC_SETVBUF_REVERSED
136 # Check out the wait reality.
137 AC_CHECK_HEADERS(sys/wait.h)
138 AC_CHECK_FUNCS(waitpid wait3)
139 AC_MSG_CHECKING(for union wait)
140 AC_CACHE_VAL(make_cv_union_wait, [dnl
141 AC_TRY_LINK([#include <sys/types.h>
142 #include <sys/wait.h>],
143 [union wait status; int pid; pid = wait (&status);
145 /* Some POSIXoid systems have both the new-style macros and the old
146 union wait type, and they do not work together. If union wait
147 conflicts with WEXITSTATUS et al, we don't want to use it at all. */
148 if (WEXITSTATUS (status) != 0) pid = -1;
150 /* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
151 -- blow chunks here --
155 /* Make sure union wait works with waitpid. */
156 pid = waitpid (-1, &status, 0);
159 [make_cv_union_wait=yes], [make_cv_union_wait=no])])
160 if test "$make_cv_union_wait" = yes; then
161 AC_DEFINE(HAVE_UNION_WAIT, 1, [Define this if you have the \`union wait' type in <sys/wait.h>.])
163 AC_MSG_RESULT($make_cv_union_wait)
166 # See if the user wants to use pmake's "customs" distributed build capability
170 AC_HELP_STRING([--with-customs=DIR],
171 [Enable remote jobs via Customs--see README.customs]),
174 *) make_cppflags="$CPPFLAGS"
177 *) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
178 make_ldflags="$LDFLAGS -L$with_customs/lib" ;;
181 AC_CHECK_HEADER(customs.h,
183 LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags"],
185 CPPFLAGS="$make_cppflags" make_badcust=yes])
188 # Tell automake about this, so it can include the right .c files.
189 AM_CONDITIONAL(USE_CUSTOMS, test $use_customs = true)
191 # See if we can handle the job server feature, and if the user wants it.
193 AC_ARG_ENABLE(job-server,
194 AC_HELP_STRING([--disable-job-server],
195 [Disallow recursive make communication during -jN]),
196 [make_cv_job_server="$enableval" user_job_server="$enableval"],
197 [make_cv_job_server="yes"])
200 case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
201 no/no) has_wait_nohang=no ;;
204 AC_CACHE_CHECK(for SA_RESTART, make_cv_sa_restart, [
205 AC_TRY_COMPILE([#include <signal.h>],
206 [return SA_RESTART;],
207 make_cv_sa_restart=yes,
208 make_cv_sa_restart=no)])
209 if test "$make_cv_sa_restart" != no; then
210 AC_DEFINE(HAVE_SA_RESTART, 1,
211 [Define if <signal.h> defines the SA_RESTART constant.])
214 case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/$make_cv_job_server" in
216 AC_DEFINE(MAKE_JOBSERVER, 1,
217 [Define this to enable job server support in GNU make.]);;
220 # Find the SCCS commands, so we can include them in our default rules.
222 AC_CACHE_CHECK(for location of SCCS get command, make_cv_path_sccs_get, [
223 if test -f /usr/sccs/get; then
224 make_cv_path_sccs_get=/usr/sccs/get
226 make_cv_path_sccs_get=get
228 AC_DEFINE_UNQUOTED(SCCS_GET, ["$make_cv_path_sccs_get"], [Define to the name of the SCCS 'get' command.])
230 ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
231 if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
232 test -f s.conftest; then
233 # We successfully created an SCCS file.
234 AC_CACHE_CHECK(if SCCS get command understands -G, make_cv_sys_get_minus_G, [
235 if $make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
236 test -f conftoast; then
237 make_cv_sys_get_minus_G=yes
239 make_cv_sys_get_minus_G=no
241 case "$make_cv_sys_get_minus_G" in
242 yes) AC_DEFINE(SCCS_GET_MINUS_G, 1,
243 [Define this if the SCCS 'get' command understands the '-G<file>' option.]);;
246 rm -f s.conftest conftoast
248 # Check the system to see if it provides GNU glob. If not, use our
251 AC_MSG_CHECKING(if system libc has GNU glob)
252 AC_CACHE_VAL(make_cv_sys_gnu_glob, [
253 AC_EGREP_CPP(gnu glob,[
254 #include <features.h>
258 #define GLOB_INTERFACE_VERSION 1
259 #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
260 # include <gnu-versions.h>
261 # if _GNU_GLOB_INTERFACE_VERSION == GLOB_INTERFACE_VERSION
265 ], [AC_MSG_RESULT(yes)
266 make_cv_sys_gnu_glob=yes], [AC_MSG_RESULT([no; using local copy])
267 AC_SUBST(GLOBINC) GLOBINC='-I$(srcdir)/glob'
268 AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a
269 make_cv_sys_gnu_glob=no])])
270 # Tell automake about this, so it can build the right .c files.
271 AM_CONDITIONAL(USE_LOCAL_GLOB, test $make_cv_sys_gnu_glob = no)
273 # Let the makefile know what our build host is
275 AC_DEFINE_UNQUOTED(MAKE_HOST,"$host",[Build host information.])
279 # Include the Maintainer's Makefile section, if it's here.
281 MAINT_MAKEFILE=/dev/null
282 if test -r "$srcdir/maintMakefile"; then
283 MAINT_MAKEFILE="$srcdir/maintMakefile"
285 AC_SUBST_FILE(MAINT_MAKEFILE)
287 # Allow building with dmalloc
291 # Sanity check and inform the user of what we found
293 case "$make_badcust" in
295 echo "WARNING: --with-customs specified but no customs.h could be found;"
296 echo " disabling Customs support."
300 case "$with_customs" in
302 *) if test -f "$with_customs/lib/libcustoms.a"; then
306 echo "WARNING: '$with_customs/lib' does not appear to contain the"
307 echo " Customs library. You must build and install Customs"
308 echo " before compiling GNU make."
313 case "$has_wait_nohang" in
315 echo "WARNING: Your system has neither waitpid() nor wait3()."
316 echo " Without one of these, signal handling is unreliable."
317 echo " You should be aware that running GNU make with -j"
318 echo " could result in erratic behavior."
322 case "$make_cv_job_server/$user_job_server" in
324 echo "WARNING: Make job server requires a POSIX-ish system that"
325 echo " supports the pipe(), sigaction(), and either"
326 echo " waitpid() or wait3() functions. Your system doesn't"
327 echo " appear to provide one or more of those."
328 echo " Disabling job server support."
333 # Specify what files are to be created.
334 # We only generate the build.sh if we have a build.sh.in; we won't have
335 # one before we've created a distribution.
337 AC_CONFIG_FILES(Makefile glob/Makefile po/Makefile.in config/Makefile)
339 if test -f $srcdir/build.sh.in; then
340 AC_CONFIG_FILES(build.sh)
350 dnl comment-start: "dnl "
352 dnl comment-start-skip: "\\bdnl\\b\\s *"
353 dnl compile-command: "make configure config.h.in"