1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION([$Id: configure.in,v 1.69 1999/07/21 05:53:27 psmith Exp $])
3 AC_PREREQ(2.13)dnl dnl Minimum Autoconf version required.
4 AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
6 AM_INIT_AUTOMAKE(make, 3.77.xx)
7 AM_CONFIG_HEADER(config.h)
9 dnl Regular configure stuff
14 AC_CHECK_PROG(AR, ar, ar, ar)
16 AC_PROG_CPP dnl Later checks need this.
21 dnl This test must come as early as possible after the compiler configuration
22 dnl tests, because the choice of the file model can (in principle) affect
23 dnl whether functions and headers are available, whether they work, etc.
28 AC_TYPE_UID_T dnl Also does gid_t.
31 AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/param.h fcntl.h string.h \
34 AC_C_CONST dnl getopt needs this.
37 AC_STRUCT_ST_MTIM_NSEC
42 AC_DEFUN(AC_CHECK_SYMBOL, [dnl
43 AC_MSG_CHECKING(for $1)
44 AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
45 AC_TRY_LINK(, [extern char *sys_siglist[]; puts(*sys_siglist);],
46 ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)])
47 if test "$ac_cv_check_symbol_$1" = yes; then
49 ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'`
51 AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol})
53 AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
55 # clock_gettime is in -lposix4 in Solaris 2.6.
56 AC_CHECK_LIB(posix4, clock_gettime)
58 AC_CHECK_FUNCS(memmove strdup psignal mktemp pstat_getdynamic \
59 clock_gettime dup2 getcwd sigsetmask getgroups setlinebuf \
60 seteuid setegid setreuid setregid strerror strsignal pipe)
61 AC_CHECK_SYMBOL(sys_siglist)
67 AC_FUNC_SETVBUF_REVERSED
70 AC_CHECK_LIB(kstat, kstat_open)
72 # Check out the wait reality.
73 AC_CHECK_HEADERS(sys/wait.h)
74 AC_CHECK_FUNCS(waitpid wait3)
75 AC_MSG_CHECKING(for union wait)
76 AC_CACHE_VAL(make_cv_union_wait, [dnl
77 AC_TRY_LINK([#include <sys/types.h>
78 #include <sys/wait.h>],
79 [union wait status; int pid; pid = wait (&status);
81 /* Some POSIXoid systems have both the new-style macros and the old
82 union wait type, and they do not work together. If union wait
83 conflicts with WEXITSTATUS et al, we don't want to use it at all. */
84 if (WEXITSTATUS (status) != 0) pid = -1;
86 /* If we have WEXITSTATUS and WTERMSIG, just use them on ints. */
87 -- blow chunks here --
91 /* Make sure union wait works with waitpid. */
92 pid = waitpid (-1, &status, 0);
95 [make_cv_union_wait=yes], [make_cv_union_wait=no])])
96 if test "$make_cv_union_wait" = yes; then
97 AC_DEFINE(HAVE_UNION_WAIT)
99 AC_MSG_RESULT($make_cv_union_wait)
103 # The presence of the following is not meant to imply
104 # that make necessarily works on those systems.
105 AC_CHECK_LIB(sun, getpwnam)
107 AC_SUBST(REMOTE) REMOTE=stub
110 [ --with-customs=DIR Enable remote jobs via Customs--see README.customs],
113 *) make_cppflags="$CPPFLAGS"
116 *) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
117 make_ldflags="$LDFLAGS -L$with_customs/lib" ;;
120 AC_CHECK_HEADER(customs.h,
122 LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags",
124 CPPFLAGS="$make_cppflags" make_badcust=yes)
128 dnl See if we can handle the job server feature, and if the user wants it.
130 AC_ARG_ENABLE(job-server,
131 [ --disable-job-server Disallow recursive make communication during -jN],
132 [make_cv_job_server="$enableval"],
133 [make_cv_job_server="yes"])
135 case "$ac_cv_func_pipe $make_cv_job_server" in
136 "yes yes") AC_DEFINE(MAKE_JOBSERVER) ;;
139 dnl Allow building with dmalloc
141 AC_ARG_ENABLE(dmalloc,
142 [ --enable-dmalloc Enable support for the dmalloc debugging library],
143 [make_cv_dmalloc="$enableval"],
144 [make_cv_dmalloc="no"])
146 case "$make_cv_dmalloc" in
147 yes) AC_CHECK_HEADERS(dmalloc.h)
148 AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
149 CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" ;;
152 AC_CACHE_CHECK(for location of SCCS get command, make_cv_path_sccs_get, [
153 if test -f /usr/sccs/get; then
154 make_cv_path_sccs_get=/usr/sccs/get
156 make_cv_path_sccs_get=get
158 AC_DEFINE_UNQUOTED(SCCS_GET,["$make_cv_path_sccs_get"])
160 ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
161 if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
162 test -f s.conftest; then
163 # We successfully created an SCCS file.
164 AC_CACHE_CHECK(if SCCS get command understands -G, make_cv_sys_get_minus_G, [
165 if $make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
166 test -f conftoast; then
167 make_cv_sys_get_minus_G=yes
169 make_cv_sys_get_minus_G=no
171 case "$make_cv_sys_get_minus_G" in
172 yes) AC_DEFINE(SCCS_GET_MINUS_G);;
175 rm -f s.conftest conftoast
177 AC_MSG_CHECKING(if system libc has GNU glob)
178 AC_CACHE_VAL(make_cv_sys_gnu_glob, [
180 #include <features.h>
184 #define GLOB_INTERFACE_VERSION 1
185 #if defined _LIBC || !defined __GNU_LIBRARY__ || __GNU_LIBRARY__ <= 1
188 # include <gnu-versions.h>
189 # if _GNU_GLOB_INTERFACE_VERSION != GLOB_INTERFACE_VERSION
193 ], make_cv_sys_gnu_glob=yes, make_cv_sys_gnu_glob=no)])
194 case "$make_cv_sys_gnu_glob" in
195 yes) AC_MSG_RESULT(yes) ;;
196 no) AC_MSG_RESULT([no; using local copy])
197 CPPFLAGS="$CPPFLAGS -I$srcdir/glob"
198 AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a
203 MAINT_MAKEFILE=/dev/null
204 if test -r $srcdir/maintMakefile; then
205 MAINT_MAKEFILE="$srcdir/maintMakefile"
207 AC_SUBST_FILE(MAINT_MAKEFILE)
209 dnl build.sh is also an AC_OUTPUT, but we can't specify it here because
210 dnl it's built from build.template and autoconf will crap out. So, we
211 dnl build it in the makefiles themselves.
213 AC_OUTPUT(Makefile glob/Makefile)
215 case "$make_badcust" in
217 echo "WARNING: --with-customs specified but no customs.h could be found;"
218 echo " disabling Customs support."
222 case "$with_customs" in
224 *) if test -f "$with_customs/lib/libcustoms.a"; then
228 echo "WARNING: \`$with_customs/lib' does not appear to contain the"
229 echo " Customs library. You must build and install Customs"
230 echo " before compiling GNU make."
235 case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
237 echo "WARNING: Your system has neither waitpid() nor wait3()."
238 echo " Without one of these, signal handling is unreliable."
239 echo " You should be aware that running GNU make with -j"
240 echo " could result in erratic behavior."
245 dnl comment-start: "dnl "
247 dnl comment-start-skip: "\\bdnl\\b\\s *"
248 dnl compile-command: "make configure config.h.in"