Install updated translations.
[make/kirr.git] / configure.in
blob6c7cbc925f9e72e2f8057814ec296ba4db1e8f3b
1 dnl Process this file with autoconf to produce a configure script.
2 AC_REVISION([$Id: configure.in,v 1.105 2001/07/05 00:35:03 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.79.1.90)
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/time.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_C_INLINE                     dnl gettext needs this.
40 AC_HEADER_STAT
41 AC_HEADER_TIME
43 dnl Handle internationalization
45 ALL_LINGUAS="da de es fr gl ja ko nl pl pt_BR ru tr"
46 pds_WITH_GETTEXT
48 jm_AC_TYPE_UINTMAX_T
49 AC_STRUCT_ST_MTIM_NSEC
50 AC_MSG_CHECKING([whether to use high resolution file timestamps])
51 AC_CACHE_VAL(make_cv_file_timestamp_hi_res, [
52   make_cv_file_timestamp_hi_res=no
53   if test $ac_cv_struct_st_mtim_nsec != no; then
54     AC_TRY_COMPILE([
55 #       if HAVE_INTTYPES_H
56 #        include <inttypes.h>
57 #       endif],
58       [char a[0x7fffffff < (uintmax_t) -1 >> 30 ? 1 : -1];],
59       make_cv_file_timestamp_hi_res=yes)
60   fi])
61 AC_MSG_RESULT($make_cv_file_timestamp_hi_res)
62 if test $make_cv_file_timestamp_hi_res = yes; then
63   val=1
64 else
65   val=0
67 AC_DEFINE_UNQUOTED(FILE_TIMESTAMP_HI_RES, $val,
68                    [Use high resolution file timestamps if nonzero.])
70 if test $make_cv_file_timestamp_hi_res = yes; then
71   # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
72   # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
73   AC_SEARCH_LIBS(clock_gettime, [rt posix4])
74   if test "$ac_cv_search_clock_gettime" != no; then
75     AC_DEFINE(HAVE_CLOCK_GETTIME, 1,
76               [Define if you have the clock_gettime function.])
77   fi
80 AC_SUBST(LIBOBJS)
82 AC_DEFUN(AC_CHECK_SYMBOL, [dnl
83 AC_MSG_CHECKING(for $1)
84 AC_CACHE_VAL(ac_cv_check_symbol_$1, [dnl
85 AC_TRY_LINK(, [extern char *sys_siglist[]; puts(*sys_siglist);],
86             ac_cv_check_symbol_$1=yes, ac_cv_check_symbol_$1=no)])
87 if test "$ac_cv_check_symbol_$1" = yes; then
88 changequote(,)dnl
89   ac_tr_symbol=`echo $1 | tr '[a-z]' '[A-Z]'`
90 changequote([,])dnl
91   AC_DEFINE_UNQUOTED(HAVE_${ac_tr_symbol})
93 AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
95 # See if we have a standard version of gettimeofday().  Since actual
96 # implementations can differ, just make sure we have the most common
97 # one.
98 AC_CACHE_CHECK([for standard gettimeofday], ac_cv_func_gettimeofday,
99   [ac_cv_func_gettimeofday=no
100    AC_TRY_RUN([#include <sys/time.h>
101                int main ()
102                {
103                  struct timeval t; t.tv_sec = -1; t.tv_usec = -1;
104                  exit (gettimeofday (&t, 0) != 0
105                        || t.tv_sec < 0 || t.tv_usec < 0);
106                }],
107               ac_cv_func_gettimeofday=yes,
108               ac_cv_func_gettimeofday=no,
109               ac_cv_func_gettimeofday="no (cross-compiling)")])
110 if test $ac_cv_func_gettimeofday = yes; then
111   AC_DEFINE(HAVE_GETTIMEOFDAY, 1,
112             [Define if you have a standard gettimeofday function])
115 AC_CHECK_FUNCS( memmove memcpy strchr strdup psignal mkstemp mktemp fdopen \
116                 bsd_signal dup2 getcwd sigsetmask sigaction getgroups \
117                 setlinebuf seteuid setegid setreuid setregid pipe \
118                 strerror strsignal)
120 AC_CHECK_SYMBOL(sys_siglist)
121 AC_FUNC_ALLOCA
122 AC_FUNC_VFORK
123 AC_FUNC_VPRINTF
124 AC_FUNC_STRCOLL
125 AC_FUNC_CLOSEDIR_VOID
126 AC_FUNC_SETVBUF_REVERSED
128 AC_CHECK_LIB(kstat, kstat_open) dnl _Must_ come before AC_FUNC_GETLOADAVG.
129 AC_CHECK_FUNCS(pstat_getdynamic) dnl Supposedly in AC_FUNC_GETLOADAVG, but...?
130 AC_FUNC_GETLOADAVG
132 # Check out the wait reality.
133 AC_CHECK_HEADERS(sys/wait.h)
134 AC_CHECK_FUNCS(waitpid wait3)
135 AC_MSG_CHECKING(for union wait)
136 AC_CACHE_VAL(make_cv_union_wait, [dnl
137 AC_TRY_LINK([#include <sys/types.h>
138 #include <sys/wait.h>],
139             [union wait status; int pid; pid = wait (&status);
140 #ifdef WEXITSTATUS
141 /* Some POSIXoid systems have both the new-style macros and the old
142    union wait type, and they do not work together.  If union wait
143    conflicts with WEXITSTATUS et al, we don't want to use it at all.  */
144 if (WEXITSTATUS (status) != 0) pid = -1;
145 #ifdef WTERMSIG
146 /* If we have WEXITSTATUS and WTERMSIG, just use them on ints.  */
147 -- blow chunks here --
148 #endif
149 #endif
150 #ifdef HAVE_WAITPID
151 /* Make sure union wait works with waitpid.  */
152 pid = waitpid (-1, &status, 0);
153 #endif
155             [make_cv_union_wait=yes], [make_cv_union_wait=no])])
156 if test "$make_cv_union_wait" = yes; then
157   AC_DEFINE(HAVE_UNION_WAIT, 1, [Define this if you have the \`union wait' type in <sys/wait.h>.])
159 AC_MSG_RESULT($make_cv_union_wait)
161 AC_DECL_SYS_SIGLIST
163 # The presence of the following is not meant to imply
164 # that make necessarily works on those systems.
165 AC_SEARCH_LIBS(getpwnam, sun)
167 AC_SUBST(REMOTE) REMOTE=stub
168 make_try_customs=no
169 AC_ARG_WITH(customs,
170 [  --with-customs=DIR      Enable remote jobs via Customs--see README.customs],
171 [case "$withval" in
172   n|no) ;;
173   *) make_cppflags="$CPPFLAGS"
174      case "$withval" in
175        y|ye|yes) ;;
176        *) CPPFLAGS="$CPPFLAGS -I$with_customs/include/customs"
177           make_ldflags="$LDFLAGS -L$with_customs/lib" ;;
178      esac
179      CF_NETLIBS
180      AC_CHECK_HEADER(customs.h,
181                      REMOTE=cstms
182                        LIBS="$LIBS -lcustoms" LDFLAGS="$make_ldflags",
183                      with_customs=no
184                        CPPFLAGS="$make_cppflags" make_badcust=yes)
185      ;;
186 esac])
188 dnl See if we can handle the job server feature, and if the user wants it.
190 AC_ARG_ENABLE(job-server,
191   [  --disable-job-server    Disallow recursive make communication during -jN],
192   [make_cv_job_server="$enableval" user_job_server="$enableval"],
193   [make_cv_job_server="yes"])
195 has_wait_nohang=yes
196 case "$ac_cv_func_waitpid/$ac_cv_func_wait3" in
197   no/no) has_wait_nohang=no ;;
198 esac
200 AC_CACHE_CHECK(for SA_RESTART, make_cv_sa_restart, [
201   AC_TRY_COMPILE([#include <signal.h>],
202       [return SA_RESTART;],
203       make_cv_sa_restart=yes,
204       make_cv_sa_restart=no)])
205 if test "$make_cv_sa_restart" != no; then
206   AC_DEFINE(HAVE_SA_RESTART, 1,
207      [Define if <signal.h> defines the SA_RESTART constant.])
210 case "$ac_cv_func_pipe/$ac_cv_func_sigaction/$make_cv_sa_restart/$has_wait_nohang/$make_cv_job_server" in
211   yes/yes/yes/yes/yes)
212     AC_DEFINE(MAKE_JOBSERVER, 1,
213               [Define this to enable job server support in GNU make.]);;
214 esac
216 dnl Allow building with dmalloc
218 AC_ARG_ENABLE(dmalloc,
219   [  --enable-dmalloc        Enable support for the dmalloc debugging library],
220   [make_cv_dmalloc="$enableval"],
221   [make_cv_dmalloc="no"])
223 case "$make_cv_dmalloc" in
224   yes) AC_CHECK_HEADERS(dmalloc.h)
225        AC_CHECK_LIB(dmalloc, dmalloc_shutdown)
226        CPPFLAGS="$CPPFLAGS -DDMALLOC_FUNC_CHECK" ;;
227 esac
229 AC_CACHE_CHECK(for location of SCCS get command, make_cv_path_sccs_get, [
230 if test -f /usr/sccs/get; then
231   make_cv_path_sccs_get=/usr/sccs/get
232 else
233   make_cv_path_sccs_get=get
234 fi])
235 AC_DEFINE_UNQUOTED(SCCS_GET,["$make_cv_path_sccs_get"])
237 ac_clean_files="$ac_clean_files s.conftest conftoast" # Remove these later.
238 if ( /usr/sccs/admin -n s.conftest || admin -n s.conftest ) >/dev/null 2>&1 &&
239    test -f s.conftest; then
240   # We successfully created an SCCS file.
241   AC_CACHE_CHECK(if SCCS get command understands -G, make_cv_sys_get_minus_G, [
242     if $make_cv_path_sccs_get -Gconftoast s.conftest >/dev/null 2>&1 &&
243        test -f conftoast; then
244        make_cv_sys_get_minus_G=yes
245     else
246        make_cv_sys_get_minus_G=no
247     fi])
248   case "$make_cv_sys_get_minus_G" in
249     yes) AC_DEFINE(SCCS_GET_MINUS_G, 1,
250            [Define this if the SCCS \`get' command understands the \`-G<file>' option.]);;
251   esac
253 rm -f s.conftest conftoast
255 AC_MSG_CHECKING(if system libc has GNU glob)
256 AC_CACHE_VAL(make_cv_sys_gnu_glob, [
257  AC_TRY_CPP([
258 #include <features.h>
259 #include <glob.h>
260 #include <fnmatch.h>
262 #define GLOB_INTERFACE_VERSION 1
263 #if defined _LIBC || !defined __GNU_LIBRARY__ || __GNU_LIBRARY__ <= 1
264 # error no gnu glob
265 #else
266 # include <gnu-versions.h>
267 # if _GNU_GLOB_INTERFACE_VERSION != GLOB_INTERFACE_VERSION
268 #  error no gnu glob
269 # endif
270 #endif
271  ], make_cv_sys_gnu_glob=yes, make_cv_sys_gnu_glob=no)])
272 case "$make_cv_sys_gnu_glob" in
273   yes) AC_MSG_RESULT(yes) ;;
274   no)  AC_MSG_RESULT([no; using local copy])
275        AC_SUBST(GLOBDIR) GLOBDIR=glob
276        AC_SUBST(GLOBINC) GLOBINC='-I$(srcdir)/glob'
277        AC_SUBST(GLOBLIB) GLOBLIB=glob/libglob.a
278        ;;
279 esac
281 AC_DEFINE_UNQUOTED(MAKE_HOST,"$host",[Build host information.])
282 MAKE_HOST="$host"
283 AC_SUBST(MAKE_HOST)
285 MAINT_MAKEFILE=/dev/null
286 if test -r "$srcdir/maintMakefile"; then
287   MAINT_MAKEFILE="$srcdir/maintMakefile"
289 AC_SUBST_FILE(MAINT_MAKEFILE)
291 AC_OUTPUT(build.sh Makefile glob/Makefile i18n/Makefile)
293 dnl If we don't yet have build.sh.in, build.sh is a bogus 0-length file
294 dnl so remove it.
295 dnl Can't do this because then remote builds with build.sh don't work.
296 dnl test -f build.sh.in || rm -f build.sh
299 case "$make_badcust" in
300   yes) echo
301        echo "WARNING: --with-customs specified but no customs.h could be found;"
302        echo "         disabling Customs support."
303        echo ;;
304 esac
306 case "$with_customs" in
307   ""|n|no|y|ye|yes) ;;
308   *) if test -f "$with_customs/lib/libcustoms.a"; then
309        :
310      else
311        echo
312        echo "WARNING: \`$with_customs/lib' does not appear to contain the"
313        echo "         Customs library.  You must build and install Customs"
314        echo "         before compiling GNU make."
315        echo
316      fi ;;
317 esac
319 case "$has_wait_nohang" in
320   no) echo
321       echo "WARNING: Your system has neither waitpid() nor wait3()."
322       echo "         Without one of these, signal handling is unreliable."
323       echo "         You should be aware that running GNU make with -j"
324       echo "         could result in erratic behavior."
325       echo ;;
326 esac
328 case "$make_cv_job_server/$user_job_server" in
329   no/yes) echo
330           echo "WARNING: Make job server requires a POSIX-ish system that"
331           echo "         supports the pipe(), sigaction(), and either"
332           echo "         waitpid() or wait3() functions.  Your system doesn't"
333           echo "         appear to provide one or more of those."
334           echo "         Disabling job server support."
335           echo ;;
336 esac
338 dnl Local Variables:
339 dnl comment-start: "dnl "
340 dnl comment-end: ""
341 dnl comment-start-skip: "\\bdnl\\b\\s *"
342 dnl compile-command: "make configure config.h.in"
343 dnl End: