Update the README template.
[make/kirr.git] / configure.in
blob0e0afcab67994c90364c385df65703d2298d8534
1 # Process this file with autoconf to produce a configure script.
3 AC_INIT(GNU make,3.79.2a1,bug-make@gnu.org)
5 AC_PREREQ(2.53)
7 AC_REVISION([[$Id: configure.in,v 1.108 2002/05/10 03:15:08 psmith Exp $]])
9 # Autoconf setup
10 AC_CONFIG_AUX_DIR(config)
11 AC_CONFIG_SRCDIR(vpath.c)
12 AM_CONFIG_HEADER(config.h)
14 # Automake setup
15 AM_INIT_AUTOMAKE
16 AC_PROG_MAKE_SET
18 # Checks for programs.
19 AC_PROG_CC
20 AC_PROG_INSTALL
21 AC_PROG_RANLIB
22 AC_PROG_CPP
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
28 AC_CANONICAL_HOST
29 AC_AIX
30 AC_ISC_POSIX
31 AC_MINIX
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.
40 AC_SYS_LARGEFILE
42 # Checks for libraries.
43 AC_SEARCH_LIBS(getpwnam, [sun])
45 # Checks for header files.
46 AC_HEADER_STDC
47 AC_HEADER_DIRENT
48 AC_HEADER_STAT
49 AC_HEADER_TIME
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)
53 AM_PROG_CC_C_O
54 AM_PROG_CC_STDC
55 AC_C_CONST
56 AC_TYPE_SIGNAL
57 AC_TYPE_UID_T
58 AC_TYPE_PID_T
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
74     AC_TRY_COMPILE([
75 #       if HAVE_INTTYPES_H
76 #        include <inttypes.h>
77 #       endif],
78       [char a[0x7fffffff < (uintmax_t) -1 >> 30 ? 1 : -1];],
79       make_cv_file_timestamp_hi_res=yes)
80   fi])
81 AC_MSG_RESULT($make_cv_file_timestamp_hi_res)
82 if test "$make_cv_file_timestamp_hi_res" = yes; then
83   val=1
84 else
85   val=0
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.])
97   fi
101 # See if we have a standard version of gettimeofday().  Since actual
102 # implementations can differ, just make sure we have the most common
103 # one.
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>
107                int main ()
108                {
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);
112                }],
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 \
124                 strerror strsignal)
126 make_FUNC_SETVBUF_REVERSED
128 # strcoll() is used by the GNU glob library
129 AC_FUNC_STRCOLL
131 AC_FUNC_ALLOCA
132 AC_FUNC_VFORK
133 AC_FUNC_VPRINTF
134 AC_FUNC_CLOSEDIR_VOID
136 AC_FUNC_GETLOADAVG
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>],
143       [struct nlist nl;
144        nl.n_name = "string";
145        return 0;],
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.])
151   fi
154 AC_DECL_SYS_SIGLIST
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);
164 #ifdef WEXITSTATUS
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;
169 #ifdef WTERMSIG
170 /* If we have WEXITSTATUS and WTERMSIG, just use them on ints.  */
171 -- blow chunks here --
172 #endif
173 #endif
174 #ifdef HAVE_WAITPID
175 /* Make sure union wait works with waitpid.  */
176 pid = waitpid (-1, &status, 0);
177 #endif
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
188 use_customs=false
189 AC_ARG_WITH(customs,
190   AC_HELP_STRING([--with-customs=DIR],
191                  [enable remote jobs via Customs--see README.customs]),
192   [case $withval in
193     n|no) : ;;
194     *) make_cppflags="$CPPFLAGS"
195        case $withval in
196          y|ye|yes) : ;;
197          *) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
198             make_ldflags="$LDFLAGS -L$with_customs/lib" ;;
199        esac
200        CF_NETLIBS
201        AC_CHECK_HEADER(customs.h,
202                        [use_customs=true
203                          LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags"],
204                        [with_customs=no
205                          CPPFLAGS="$make_cppflags" make_badcust=yes])
206        ;;
207   esac])
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"])
219 has_wait_nohang=yes
220 case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
221   no/no) has_wait_nohang=no ;;
222 esac
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
235   yes/yes/yes/yes/yes)
236     AC_DEFINE(MAKE_JOBSERVER, 1,
237               [Define this to enable job server support in GNU make.]);;
238 esac
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
245 else
246   make_cv_path_sccs_get=get
247 fi])
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
258     else
259        make_cv_sys_get_minus_G=no
260     fi])
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.]);;
264   esac
266 rm -f s.conftest conftoast
268 # Check the system to see if it provides GNU glob.  If not, use our
269 # local version.
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>
275 #include <glob.h>
276 #include <fnmatch.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
282 #  gnu glob
283 # endif
284 #endif
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.])
296 MAKE_HOST="$host"
297 AC_SUBST(MAKE_HOST)
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
308 AM_WITH_DMALLOC
311 # Sanity check and inform the user of what we found
313 case "$make_badcust" in
314   yes) echo
315        echo "WARNING: --with-customs specified but no customs.h could be found;"
316        echo "         disabling Customs support."
317        echo ;;
318 esac
320 case "$with_customs" in
321   ""|n|no|y|ye|yes) ;;
322   *) if test -f "$with_customs/lib/libcustoms.a"; then
323        :
324      else
325        echo
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."
329        echo
330      fi ;;
331 esac
333 case "$has_wait_nohang" in
334   no) echo
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."
339       echo ;;
340 esac
342 case "$make_cv_job_server/$user_job_server" in
343   no/yes) echo
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."
349           echo ;;
350 esac
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)
364 # OK, do it!
366 AC_OUTPUT
369 dnl Local Variables:
370 dnl comment-start: "dnl "
371 dnl comment-end: ""
372 dnl comment-start-skip: "\\bdnl\\b\\s *"
373 dnl compile-command: "make configure config.h.in"
374 dnl End: