* Implement GNU gettext internationalization support in GNU make.
[make.git] / configure.in
blobdde4e92b1a635cef4c025745a10a25ea681682d2
1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION([$Id: configure.in,v 1.89 2000/01/22 08:57:17 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.78.90a)
7 AM_CONFIG_HEADER(config.h)
9 dnl Regular configure stuff
11 AC_CANONICAL_HOST
12 AC_PROG_MAKE_SET
13 AC_PROG_CC
14 AC_PROG_INSTALL
15 AC_CHECK_PROG(AR, ar, ar, ar)
16 AC_PROG_RANLIB
17 AC_PROG_CPP                     dnl Later checks need this.
18 AC_AIX
19 AC_ISC_POSIX
20 AC_MINIX
22 AC_CHECK_PROG(PERL, perl, perl, perl)   dnl Needed for the test suite (only)
24 dnl This test must come as early as possible after the compiler configuration
25 dnl tests, because the choice of the file model can (in principle) affect
26 dnl whether functions and headers are available, whether they work, etc.
27 AC_SYS_LARGEFILE
29 AC_HEADER_STDC
30 AC_HEADER_DIRENT
31 AC_TYPE_UID_T                   dnl Also does gid_t.
32 AC_TYPE_PID_T
33 AC_TYPE_SIGNAL
34 AC_CHECK_HEADERS(stdlib.h unistd.h limits.h sys/param.h fcntl.h string.h \
35                  memory.h sys/timeb.h)
36 AC_PROG_CC_C_O
37 AM_PROG_CC_STDC
38 AC_C_CONST                      dnl getopt needs this.
39 AC_HEADER_STAT
41 AC_STRUCT_ST_MTIM_NSEC
42 jm_AC_TYPE_UINTMAX_T
44 AC_SUBST(LIBOBJS)
46 AC_DEFUN(AC_CHECK_SYMBOL, [dnl
47 AC_MSG_CHECKING(for $1)
48 AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
49 AC_TRY_LINK(, [extern char *sys_siglist[]; puts(*sys_siglist);],
50             ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)])
51 if test "$ac_cv_check_symbol_$1" = yes; then
52 changequote(,)dnl
53   ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'`
54 changequote([,])dnl
55   AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol})
57 AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
59 # clock_gettime is in -lposix4 in Solaris 2.6.
60 AC_CHECK_LIB(posix4, clock_gettime)
62 AC_CHECK_FUNCS(memmove strchr memcpy strdup psignal mktemp pstat_getdynamic \
63                clock_gettime dup2 getcwd sigsetmask sigaction getgroups \
64                setlinebuf seteuid setegid setreuid setregid pipe \
65                strerror strsignal)
66 AC_CHECK_SYMBOL(sys_siglist)
67 AC_FUNC_ALLOCA
68 AC_FUNC_VFORK
69 AC_FUNC_VPRINTF
70 AC_FUNC_STRCOLL
71 AC_FUNC_CLOSEDIR_VOID
72 AC_FUNC_SETVBUF_REVERSED
73 AC_FUNC_SELECT
75 AC_CHECK_LIB(kstat, kstat_open) dnl _Must_ come before AC_FUNC_GETLOADAVG.
76 AC_FUNC_GETLOADAVG
78 # Check out the wait reality.
79 AC_CHECK_HEADERS(sys/wait.h)
80 AC_CHECK_FUNCS(waitpid wait3)
81 AC_MSG_CHECKING(for union wait)
82 AC_CACHE_VAL(make_cv_union_wait, [dnl
83 AC_TRY_LINK([#include <sys/types.h>
84 #include <sys/wait.h>],
85             [union wait status; int pid; pid = wait (&status);
86 #ifdef WEXITSTATUS
87 /* Some POSIXoid systems have both the new-style macros and the old
88    union wait type, and they do not work together.  If union wait
89    conflicts with WEXITSTATUS et al, we don't want to use it at all.  */
90 if (WEXITSTATUS (status) != 0) pid = -1;
91 #ifdef WTERMSIG
92 /* If we have WEXITSTATUS and WTERMSIG, just use them on ints.  */
93 -- blow chunks here --
94 #endif
95 #endif
96 #ifdef HAVE_WAITPID
97 /* Make sure union wait works with waitpid.  */
98 pid = waitpid (-1, &status, 0);
99 #endif
101             [make_cv_union_wait=yes], [make_cv_union_wait=no])])
102 if test "$make_cv_union_wait" = yes; then
103   AC_DEFINE(HAVE_UNION_WAIT)
105 AC_MSG_RESULT($make_cv_union_wait)
107 AC_DECL_SYS_SIGLIST
109 dnl Handle internationalization
111 ALL_LINGUAS=
112 AM_GNU_GETTEXT
114 # The presence of the following is not meant to imply
115 # that make necessarily works on those systems.
116 AC_CHECK_LIB(sun, getpwnam)
118 AC_SUBST(REMOTE) REMOTE=stub
119 make_try_customs=no
120 AC_ARG_WITH(customs,
121 [  --with-customs=DIR      Enable remote jobs via Customs--see README.customs],
122 [case "$withval" in
123   n|no) ;;
124   *) make_cppflags="$CPPFLAGS"
125      case "$withval" in
126        y|ye|yes) ;;
127        *) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
128           make_ldflags="$LDFLAGS -L$with_customs/lib" ;;
129      esac
130      CF_NETLIBS
131      AC_CHECK_HEADER(customs.h,
132                      REMOTE=cstms
133                        LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags",
134                      with_customs=no
135                        CPPFLAGS="$make_cppflags" make_badcust=yes)
136      ;;
137 esac])
139 dnl See if we can handle the job server feature, and if the user wants it.
141 AC_ARG_ENABLE(job-server,
142   [  --disable-job-server    Disallow recursive make communication during -jN],
143   [make_cv_job_server="$enableval" user_job_server="$enableval"],
144   [make_cv_job_server="yes"])
146 has_wait_nohang=yes
147 case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
148   no/no) has_wait_nohang=no ;;
149 esac
151 case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$has_wait_nohang/$make_cv_job_server" in
152   yes/yes/yes/yes) AC_DEFINE(MAKE_JOBSERVER) ;;
153 esac
155 dnl Allow building with dmalloc
157 AC_ARG_ENABLE(dmalloc,
158   [  --enable-dmalloc        Enable support for the dmalloc debugging library],
159   [make_cv_dmalloc="$enableval"],
160   [make_cv_dmalloc="no"])
162 case "$make_cv_dmalloc" in
163   yes) AC_CHECK_HEADERS(dmalloc.h)
164        AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
165        CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" ;;
166 esac
168 AC_CACHE_CHECK(for location of SCCS get command, make_cv_path_sccs_get, [
169 if test -f /usr/sccs/get; then
170   make_cv_path_sccs_get=/usr/sccs/get
171 else
172   make_cv_path_sccs_get=get
173 fi])
174 AC_DEFINE_UNQUOTED(SCCS_GET,["$make_cv_path_sccs_get"])
176 ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
177 if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
178    test -f s.conftest; then
179   # We successfully created an SCCS file.
180   AC_CACHE_CHECK(if SCCS get command understands -G, make_cv_sys_get_minus_G, [
181     if $make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
182        test -f conftoast; then
183        make_cv_sys_get_minus_G=yes
184     else
185        make_cv_sys_get_minus_G=no
186     fi])
187   case "$make_cv_sys_get_minus_G" in
188     yes) AC_DEFINE(SCCS_GET_MINUS_G);;
189   esac
191 rm -f s.conftest conftoast
193 AC_MSG_CHECKING(if system libc has GNU glob)
194 AC_CACHE_VAL(make_cv_sys_gnu_glob, [
195  AC_TRY_CPP([
196 #include <features.h>
197 #include <glob.h>
198 #include <fnmatch.h>
200 #define GLOB_INTERFACE_VERSION 1
201 #if defined _LIBC || !defined __GNU_LIBRARY__ || __GNU_LIBRARY__ <= 1
202 # error no gnu glob
203 #else
204 # include <gnu-versions.h>
205 # if _GNU_GLOB_INTERFACE_VERSION != GLOB_INTERFACE_VERSION
206 #  error no gnu glob
207 # endif
208 #endif
209  ], make_cv_sys_gnu_glob=yes, make_cv_sys_gnu_glob=no)])
210 case "$make_cv_sys_gnu_glob" in
211   yes) AC_MSG_RESULT(yes) ;;
212   no)  AC_MSG_RESULT([no; using local copy])
213        AC_SUBST(GLOBDIR) GLOBDIR=glob
214        AC_SUBST(GLOBINC) GLOBINC='-I$(srcdir)/glob'
215        AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a
216        ;;
217 esac
219 AC_DEFINE_UNQUOTED(MAKE_HOST,"$host",[Build host information.])
220 MAKE_HOST="$host"
221 AC_SUBST(MAKE_HOST)
223 MAINT_MAKEFILE=/dev/null
224 if test -r "$srcdir/maintMakefile"; then
225   MAINT_MAKEFILE="$srcdir/maintMakefile"
227 AC_SUBST_FILE(MAINT_MAKEFILE)
229 AC_OUTPUT(build.sh Makefile glob/Makefile intl/Makefile po/Makefile.in)
231 dnl If we don't yet have build.sh.in, build.sh is a bogus 0-length file
232 dnl so remove it.
233 dnl Can't do this because then remote builds with build.sh don't work.
234 dnl test -f build.sh.in || rm -f build.sh
237 case "$make_badcust" in
238   yes) echo
239        echo "WARNING: --with-customs specified but no customs.h could be found;"
240        echo "         disabling Customs support."
241        echo ;;
242 esac
244 case "$with_customs" in
245   ""|n|no|y|ye|yes) ;;
246   *) if test -f "$with_customs/lib/libcustoms.a"; then
247        :
248      else
249        echo
250        echo "WARNING: \`$with_customs/lib' does not appear to contain the"
251        echo "         Customs library.  You must build and install Customs"
252        echo "         before compiling GNU make."
253        echo
254      fi ;;
255 esac
257 case "$has_wait_nohang" in
258   no) echo
259       echo "WARNING: Your system has neither waitpid() nor wait3()."
260       echo "         Without one of these, signal handling is unreliable."
261       echo "         You should be aware that running GNU make with -j"
262       echo "         could result in erratic behavior."
263       echo ;;
264 esac
266 case "$make_cv_job_server/$user_job_server" in
267   no/yes) echo
268           echo "WARNING: Make job server requires a POSIX-ish system that"
269           echo "         supports the pipe(), sigaction(), and either"
270           echo "         waitpid() or wait3() functions.  Your system doesn't"
271           echo "         appear to provide one or more of those."
272           echo "         Disabling job server support."
273           echo ;;
274 esac
276 dnl Local Variables:
277 dnl comment-start: "dnl "
278 dnl comment-end: ""
279 dnl comment-start-skip: "\\bdnl\\b\\s *"
280 dnl compile-command: "make configure config.h.in"
281 dnl End: