add a test for repl on a ASCII only system
[mmh] / configure.ac
1 dnl
2 dnl configure.ac -- autoconf template for mmh
3 dnl
4
5 dnl Move this up a bit
6 AC_PREREQ(2.61)
7 dnl (I was able to configure with autoconf-2.59 --meillo 2012-03-22)
8
9 AC_INIT(mmh, m4_normalize(m4_include([VERSION])))
10 AC_CONFIG_SRCDIR(h/mh.h)
11 AC_CONFIG_HEADER(config.h)
12
13 AC_CANONICAL_TARGET
14
15 dnl ---------------------
16 dnl define a macro or two
17 dnl ---------------------
18
19 AC_DEFUN([NMH_PROG_GNU_LIBTOOL], [
20 if test -n "$LIBTOOL" ; then
21   tmptest=`$LIBTOOL --version 2>&1 | grep GNU`
22   if test x"$tmptest" != x  ; then
23     GNU_LIBTOOL=1
24     AC_SUBST(GNU_LIBTOOL)dnl
25   fi
26 fi
27 ] )
28
29 echo "configuring for AC_PACKAGE_NAME-AC_PACKAGE_VERSION"
30 AC_SUBST(VERSION,AC_PACKAGE_VERSION)dnl
31
32 dnl What date of mmh are we building?
33 DATE=`cat ${srcdir}/DATE`
34 echo "configuring for mmh dated $DATE"
35 AC_SUBST(DATE)dnl
36
37 dnl --------------------------
38 dnl CHECK COMMAND LINE OPTIONS
39 dnl --------------------------
40
41 dnl Do you want to debug mmh?
42 AC_ARG_ENABLE(debug,
43   AS_HELP_STRING([--enable-debug],[enable nmh code debugging]))
44 dnl The old redundant --enable-nmh-debug is deprecated and undocumented.
45 if test x"$enable_nmh_debug" = x"yes"; then
46   enable_debug=yes
47 fi
48
49 dnl What method of locking to use?
50 AC_ARG_WITH(locking,
51   AS_HELP_STRING([--with-locking=@<:@dot|fcntl|flock|lockf@:>@],
52   [specify the file locking method]))
53
54 if test x"$with_locking" = x"dot"; then
55   LOCKTYPE="dot"
56   AC_DEFINE(DOT_LOCKING, 1, [Define to use dot based file locking.])dnl
57 elif test x"$with_locking" = x"flock"; then
58   LOCKTYPE="flock"
59   AC_DEFINE(FLOCK_LOCKING, 1, [Define to use flock() based locking.])dnl
60 elif test x"$with_locking" = x"lockf"; then
61   LOCKTYPE="lockf"
62   AC_DEFINE(LOCKF_LOCKING, 1, [Define to use lockf() based locking.])dnl
63 elif test x"$with_locking" = x"fcntl"; then
64   LOCKTYPE="fcntl"
65   AC_DEFINE(FCNTL_LOCKING, 1, [Define to use fnctl() based locking.])dnl
66 else
67   LOCKTYPE="dot"
68   AC_DEFINE(DOT_LOCKING)dnl
69 fi
70
71 dnl Should we use a locking directory?
72 AC_ARG_WITH(lockdir,
73   AS_HELP_STRING([--with-lockdir=dir], [Store dot-lock files in "dir"]), [
74     AS_IF([test "x$with_lockdir" = xyes],[
75       AC_MSG_ERROR([--with-lockdir requires an argument])])
76 ])
77
78 if test x"$with_lockdir" != x; then
79   LOCKDIR="$with_lockdir"
80   AC_DEFINE_UNQUOTED(LOCKDIR, ["$with_lockdir"],
81                      [Directory to store dot-locking lock files.])dnl
82 fi
83
84
85 dnl ----------------------------------------------------
86 dnl Default location is /usr/local/mmh/{bin,etc,lib,share/man}
87 dnl ----------------------------------------------------
88 AC_PREFIX_DEFAULT(/usr/local/mmh)
89
90
91 dnl ------------------
92 dnl CHECK THE COMPILER
93 dnl ------------------
94 dnl We want these before the checks,
95 dnl so the checks can modify their values.
96 test -z "$CFLAGS" && CFLAGS= auto_cflags=1
97 if test x"$enable_debug" = x"yes"; then
98   test -z "$LDFLAGS" && LDFLAGS=-g
99 fi
100
101 AC_PROG_CC
102
103 AC_CACHE_CHECK(whether compiler supports -Wno-pointer-sign, nmh_cv_has_noptrsign,
104 [nmh_saved_cflags="$CFLAGS"
105  CFLAGS="$CFLAGS -Wno-pointer-sign"
106  AC_TRY_COMPILE([],[],nmh_cv_has_noptrsign=yes,nmh_cv_has_noptrsign=no)
107  CFLAGS="$nmh_saved_cflags"])
108
109 dnl if the user hasn't specified CFLAGS, then
110 dnl   if compiler is gcc, then
111 dnl     use -O2 and some warning flags
112 dnl   else use -O
113 dnl We use -Wall; if the compiler supports it we also use -Wno-pointer-sign,
114 dnl because gcc 4 now produces a lot of new warnings which are probably mostly
115 dnl spurious and which in any case we don't want to deal with now.
116 if test "$nmh_cv_has_noptrsign" = "yes"; then
117   nmh_gcc_warnflags="-Wall -Wno-pointer-sign"
118 else
119   nmh_gcc_warnflags="-Wall"
120 fi
121
122 if test -n "$auto_cflags"; then
123   if test x"$enable_debug" = x"yes"; then
124     if test -n "$GCC"; then
125       test -z "$CFLAGS" && CFLAGS="$nmh_gcc_warnflags -g" || CFLAGS="$CFLAGS $nmh_gcc_warnflags -g"
126     else
127       test -z "$CFLAGS" && CFLAGS=-g || CFLAGS="$CFLAGS -g"
128     fi
129   else
130     if test -z "$LDFLAGS"; then
131       case "$build_os" in
132         darwin*)
133           LDFLAGS=
134           ;;
135         *)
136           LDFLAGS=-s
137           ;;
138       esac
139     fi
140     if test -n "$GCC"; then
141       test -z "$CFLAGS" && CFLAGS="$nmh_gcc_warnflags -O2" || CFLAGS="$CFLAGS $nmh_gcc_warnflags -O2"
142     else
143       test -z "$CFLAGS" && CFLAGS=-O  || CFLAGS="$CFLAGS -O"
144     fi
145   fi
146 fi
147
148 AC_C_CONST          dnl Does compiler support `const'.
149
150 dnl ------------------
151 dnl CHECK FOR PROGRAMS
152 dnl ------------------
153 AC_PROG_MAKE_SET    dnl Does make define $MAKE
154 AC_PROG_INSTALL     dnl Check for BSD compatible `install'
155 AC_PROG_RANLIB      dnl Check for `ranlib'
156 AC_PROG_AWK         dnl Check for mawk,gawk,nawk, then awk
157 AC_PROG_LEX         dnl Check for lex/flex
158
159 dnl Look for `cut'
160 pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb
161 AC_PATH_PROG(cutpath, cut, no, [$pathtmp])
162
163 dnl ----------------------------------------------
164 dnl check for lclint, and lint if it doesn't exist
165 dnl ----------------------------------------------
166 AC_CHECK_PROG(linttmp1, lclint, lclint, no)dnl
167 if test x$ac_cv_prog_linttmp1 != xno ; then
168   LINT=$ac_cv_prog_linttmp1
169   LINTFLAGS="-weak +posixlib -macrovarprefixexclude"
170 else
171   AC_CHECK_PROG(linttmp2, lint, lint, no)dnl
172   if test x$ac_cv_prog_linttmp2 != xno ; then
173     LINT=$ac_cv_prog_linttmp2
174     LINTFLAGS=""
175   else
176     LINT="echo 'No lint program found'"
177     LINTFLAGS=""
178   fi
179 fi
180 AC_SUBST(LINT)dnl
181 AC_SUBST(LINTFLAGS)dnl
182
183 dnl try to figure out which one we've got
184 AC_CHECK_PROG(LIBTOOL, libtool, libtool, , [$pathtmp])
185 NMH_PROG_GNU_LIBTOOL
186
187 dnl Check for lorder and tsort commands
188 AC_CHECK_PROG(LORDER, lorder, lorder, no)dnl
189 AC_CHECK_PROG(TSORT, tsort, tsort, no)dnl
190
191 dnl If either doesn't exist, replace them with echo and cat
192 if test x$ac_cv_prog_LORDER != xlorder -o x$ac_cv_prog_TSORT != xtsort; then
193   LORDER=echo
194   TSORT=cat
195   AC_SUBST(LORDER)dnl
196   AC_SUBST(TSORT)dnl
197 dnl Mac OS X has lorder, but sh is too broken for it to work
198 dnl elif test -z "`lorder config/config.c 2>&1 | grep config/config.c`" ; then
199 dnl   LORDER=echo
200 dnl   TSORT=cat
201 dnl   AC_SUBST(LORDER)dnl
202 dnl   AC_SUBST(TSORT)dnl
203 fi
204
205 dnl Check whether tsort can deal with loops
206 AC_CACHE_CHECK(whether tsort can deal with loops, nmh_cv_tsort_loop,
207   [if test -z "`echo a b b a | tsort 2>/dev/null | grep a`" ; then
208     nmh_cv_tsort_loop=no
209   else
210     nmh_cv_tsort_loop=yes
211   fi])
212 if test x$nmh_cv_tsort_loop = xno ; then
213   LORDER=echo
214   TSORT=cat
215   AC_SUBST(LORDER)dnl
216   AC_SUBST(TSORT)dnl
217 fi
218
219 dnl Look for `ls'
220 pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb
221 AC_PATH_PROG(lspath, ls, no, [$pathtmp])
222
223 dnl See how we get ls to display the owner and the group
224 if test "$lspath" != "no"; then
225   AC_CACHE_CHECK(how to get ls to show us the group ownership of a file,
226                  nmh_cv_ls_grpopt,
227   [if test x"`$lspath -dl / | $AWK '{print $9}'`" = x"/"; then
228     dnl There were 9 parameters, so unless this is a really bizarre, nonstandard
229     dnl ls, it would seem -l gave us both the user and group.  On this type of
230     dnl ls, -g makes _only_ the group be displayed (and not the user).
231     nmh_cv_ls_grpopt="-l"
232   else
233     dnl Looks like -l only gave us the user, so we need -g to get the group too.
234     nmh_cv_ls_grpopt="-lg"
235   fi])
236 fi
237
238 dnl Look for `sendmail'
239 pathtmp=/usr/lib:/usr/sbin:/usr/etc:/usr/ucblib:/usr/bin:/bin
240 AC_PATH_PROG(sendmailpath, sendmail, /usr/sbin/sendmail, [$pathtmp])
241
242 dnl Look for `vi'
243 pathtmp=/usr/bin:/bin:/usr/ucb:/usr/local/bin
244 AC_PATH_PROG(vipath, vi, /bin/vi, [$pathtmp])
245
246 dnl ----------------------------------------------------------
247 dnl FIND MAIL SPOOL AND SEE IF WE NEED TO MAKE inc SETGID MAIL
248 dnl ----------------------------------------------------------
249 AC_CACHE_CHECK(where mail spool is located, nmh_cv_mailspool,
250 [for mailspool in /var/mail        dnl
251                   /var/spool/mail  dnl
252                   /usr/spool/mail  dnl
253                   /dev/null;       dnl Just in case we fall through
254 do
255   test -d $mailspool && break
256 done
257 nmh_cv_mailspool=$mailspool
258 ])
259 mailspool=$nmh_cv_mailspool
260 AC_SUBST(mailspool)dnl
261
262 dnl See whether the mail spool directory is world-writable.
263 if test "$lspath" != "no" -a "$cutpath" != "no"; then
264   AC_CACHE_CHECK(whether the mail spool is world-writable,
265                  nmh_cv_mailspool_world_writable,
266   [if test "`$lspath -dl $mailspool/ | $cutpath -c9`" = "-"; then
267     nmh_cv_mailspool_world_writable=no
268   else
269     nmh_cv_mailspool_world_writable=yes
270   fi])
271 fi
272
273 dnl Also, check for liblockfile (as found on Debian systems)
274 AC_CHECK_HEADER(lockfile.h, AC_CHECK_LIB(lockfile, lockfile_create) )
275
276 dnl and whether its companion program dotlockfile is setgid
277 AC_PATH_PROG(dotlockfilepath, dotlockfile, no)
278 if test "$ac_cv_lib_lockfile_lockfile_create" != "no" ; then
279   if test "$ac_cv_path_dotlockfilepath" != "no" ; then
280     AC_CACHE_CHECK(whether dotlockfile is setgid, nmh_cv_dotlockfile_setgid,
281     [ if test -g "$ac_cv_path_dotlockfilepath" ; then
282         nmh_cv_dotlockfile_setgid=yes
283       else
284         nmh_cv_dotlockfile_setgid=no
285       fi])
286   fi
287 fi
288
289 dnl If mailspool is not world-writable and dotlockfile is not setgid,
290 dnl we need to #define MAILGROUP to 1 and make inc setgid.
291 if test x"$LOCKTYPE" = x"dot" -a x"$nmh_cv_mailspool_world_writable" = x"no" -a x"$nmh_cv_dotlockfile_setgid" != x"yes" ; then
292   dnl do we really need both of these?
293   AC_DEFINE(MAILGROUP,1,
294     [Define to 1 if you need to make `inc' set-group-id because your mail spool is not world writable. There are no guarantees as to the safety of doing this, but this #define will add some extra security checks.])dnl
295   SETGID_MAIL=1
296 fi
297 AC_SUBST(SETGID_MAIL)dnl
298
299 dnl Use ls to see which group owns the mail spool directory.
300 AC_CACHE_CHECK(what group owns the mail spool, nmh_cv_ls_mail_grp,
301 [nmh_cv_ls_mail_grp=`$lspath -dL $nmh_cv_ls_grpopt $mailspool|$AWK '{print $4}'`
302 ])
303 MAIL_SPOOL_GRP=$nmh_cv_ls_mail_grp
304 AC_SUBST(MAIL_SPOOL_GRP)dnl
305
306 dnl ------------------
307 dnl CHECK HEADER FILES
308 dnl ------------------
309
310 dnl On glibc we need to define at least the '_XOPEN_SOURCE' level of features,
311 dnl or wchar.h doesn't declare a prototype for wcwidth(). But if we only define
312 dnl that level then db.h won't compile. So we define _GNU_SOURCE which turns
313 dnl on everything. Perhaps other OSes need some feature switch set to get wcwidth()
314 dnl declared; if so they should have an entry added to this case statement.
315 dnl NB that we must define this on the compiler command line, not in config.h,
316 dnl because it must be set before any system header is included and there's no
317 dnl portable way to make sure that files generated by lex include config.h
318 dnl before system header files.
319
320 case "$target_os" in
321   linux*)
322     # Like DEFS, but doesn't get stomped on by configure when using config.h:
323     OURDEFS="$OURDEFS -D_GNU_SOURCE"
324     ;;
325 esac
326 AC_SUBST(OURDEFS)
327
328 AC_HEADER_STDC
329 AC_HEADER_TIOCGWINSZ
330 AC_CHECK_HEADERS(fcntl.h crypt.h termcap.h \
331                  langinfo.h wchar.h wctype.h iconv.h \
332                  sys/param.h sys/time.h sys/stream.h )
333
334 dnl
335 dnl Checks for _IO_write_ptr. A Linuxism used by nmh on linux. We
336 dnl really use a whole set of them, but this check should be
337 dnl sufficient.
338 dnl
339 AC_CHECK_HEADER(libio.h, [
340   AC_EGREP_HEADER(_IO_write_ptr, libio.h, [
341     AC_DEFINE(LINUX_STDIO,1,[Use the Linux _IO_*_ptr defines from <libio.h>.]) ]) ])
342
343 AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM,1,
344   [Define to 1 if `struct winsize' requires <sys/ptem.h>.]),,
345 [[#if HAVE_SYS_STREAM_H
346 #  include <sys/stream.h>
347 #endif
348 ]])
349
350 dnl ---------------
351 dnl CHECK FUNCTIONS
352 dnl ---------------
353 AC_CHECK_FUNCS(nl_langinfo mbtowc wcwidth)
354
355 dnl Look for the initgroups() declaration.  On AIX 4.[13], Solaris 4.1.3, and
356 dnl ULTRIX 4.2A the function is defined in libc but there's no declaration in
357 dnl any system header.
358 dnl
359 dnl On Solaris 2.[456], the declaration is in <grp.h>.  On HP-UX 9-11 and
360 dnl (reportedly) FreeBSD 3.[23], it's in <unistd.h>.  Any other locations we
361 dnl need to check?
362 AH_TEMPLATE(INITGROUPS_HEADER, [Define to the header containing the declaration of `initgroups'.])
363 AC_EGREP_HEADER(initgroups, grp.h, AC_DEFINE(INITGROUPS_HEADER, <grp.h>),
364                 AC_EGREP_HEADER(initgroups, unistd.h,
365                                 AC_DEFINE(INITGROUPS_HEADER, <unistd.h>)))
366
367 dnl Check for multibyte character set support
368 if test "x$ac_cv_header_wchar_h" = "xyes" -a "x$ac_cv_header_wctype_h" = "xyes" \
369     -a "x$ac_cv_func_wcwidth" = "xyes" -a "x$ac_cv_func_mbtowc" = "xyes"; then
370   AC_DEFINE(MULTIBYTE_SUPPORT, 1,
371     [Define to enable support for multibyte character sets.])
372 fi
373
374 dnl -------------------
375 dnl CHECK FOR LIBRARIES
376 dnl -------------------
377 dnl Check location of modf
378 AC_CHECK_FUNC(modf, , AC_CHECK_LIB(m, modf))
379
380 termcap_curses_order="termcap curses ncurses tinfo"
381 for lib in $termcap_curses_order; do
382   AC_CHECK_LIB(${lib}, tgetent, [TERMLIB="-l$lib"; break])
383 done
384 AC_SUBST(TERMLIB)dnl
385 if test "x$TERMLIB" = "x"; then
386         echo 'Could not find tgetent() in any library.'
387         echo 'Is there a ncurses-devel package that you can install?'
388         exit 1
389 fi
390
391
392 dnl ---------------
393 dnl CHECK FOR ICONV
394 dnl ---------------
395
396 dnl Find iconv. It may be in libiconv and may be iconv() or libiconv()
397 if test "x$ac_cv_header_iconv_h" = "xyes"; then
398   AC_CHECK_FUNC(iconv, ac_found_iconv=yes, ac_found_iconv=no)
399   if test "x$ac_found_iconv" = "xno"; then
400     AC_CHECK_LIB(iconv, iconv, ac_found_iconv=yes)
401     if test "x$ac_found_iconv" = "xno"; then
402       AC_CHECK_LIB(iconv, libiconv, ac_found_iconv=yes)
403     fi
404     if test "x$ac_found_iconv" != "xno"; then
405       LIBS="-liconv $LIBS"
406     fi
407   else
408     dnl Handle case where there is a native iconv but iconv.h is from libiconv
409     AC_CHECK_DECL(_libiconv_version,
410       [ AC_CHECK_LIB(iconv, libiconv, LIBS="-liconv $LIBS") ],,
411       [ #include <iconv.h> ])
412   fi
413 fi
414 if test "x$ac_found_iconv" = xyes; then
415   AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
416 fi
417
418 dnl Check if iconv uses const in prototype declaration
419 if test "x$ac_found_iconv" = "xyes"; then
420   AC_CACHE_CHECK(for iconv declaration, ac_cv_iconv_const,
421     [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
422         #include <iconv.h>]],
423         [[#ifdef __cplusplus
424           "C"
425           #endif
426           #if defined(__STDC__) || defined(__cplusplus)
427           size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
428           #else
429           size_t iconv();
430           #endif]])],
431       [ac_cv_iconv_const=],
432       [ac_cv_iconv_const=const])])
433   AC_DEFINE_UNQUOTED([ICONV_CONST], $ac_cv_iconv_const,
434     [Define as const if the declaration of iconv() needs const.])
435 fi
436
437
438 dnl ---------------------
439 dnl CHECK TERMCAP LIBRARY
440 dnl ---------------------
441
442 dnl Add the termcap library, so that the following configure
443 dnl tests will find it when it tries to link test programs.
444 nmh_save_LIBS="$LIBS"
445 LIBS="$TERMLIB $LIBS"
446
447 dnl Check if tgetent accepts NULL (and will allocate its own termcap buffer)
448 dnl Some termcaps reportedly accept a zero buffer, but then dump core
449 dnl in tgetstr().
450 dnl Under Cygwin test program crashes but exit code is still 0. So,
451 dnl we test for a file that porgram should create
452 AH_TEMPLATE([TGETENT_ACCEPTS_NULL],
453 [Define to 1 if tgetent() accepts NULL as a buffer.])
454 AC_CACHE_CHECK(if tgetent accepts NULL,
455 nmh_cv_func_tgetent_accepts_null,
456 [AC_TRY_RUN([
457 main()
458 {
459         char buf[4096];
460         int r1 = tgetent(buf, "vt100");
461         int r2 = tgetent(NULL,"vt100");
462         if (r1 >= 0 && r1 == r2) {
463                 char tbuf[1024], *u;
464                 u = tbuf;
465                         tgetstr("cl", &u);
466                 creat("conftest.tgetent", 0640);
467         }
468         exit((r1 != r2) || r2 == -1);
469 }
470 ],
471   if test -f conftest.tgetent; then
472     nmh_cv_func_tgetent_accepts_null=yes
473   else
474     nmh_cv_func_tgetent_accepts_null=no
475   fi,
476   nmh_cv_func_tgetent_accepts_null=no,
477   nmh_cv_func_tgetent_accepts_null=no)])
478 if test x$nmh_cv_func_tgetent_accepts_null = xyes; then
479   AC_DEFINE(TGETENT_ACCEPTS_NULL)
480 fi
481 AC_CACHE_CHECK(if tgetent returns 0 on success,
482 nmh_cv_func_tgetent_zero_success,
483 [AC_TRY_RUN([
484 main()
485 {
486         char buf[4096];
487         int r1 = tgetent(buf, "!@#$%^&*");
488         int r2 = tgetent(buf, "vt100");
489         if (r1 < 0 && r2 == 0) {
490                 char tbuf[1024], *u;
491                 u = tbuf;
492                         tgetstr("cl", &u);
493                 creat("conftest.tgetent0", 0640);
494         }
495         exit(r1 == r2);
496 }
497 ],
498   if test -f conftest.tgetent0; then
499     nmh_cv_func_tgetent_zero_success=yes
500   else
501     nmh_cv_func_tgetent_zero_success=no
502   fi,
503   nmh_cv_func_tgetent_zero_success=no,
504   nmh_cv_func_tgetent_zero_success=no)])
505 AH_TEMPLATE([TGETENT_SUCCESS],
506 [Define to what tgetent() returns on success (0 on HP-UX X/Open curses).])
507 if test x$nmh_cv_func_tgetent_zero_success = xyes; then
508   AC_DEFINE(TGETENT_SUCCESS, 0)
509 else
510   AC_DEFINE(TGETENT_SUCCESS, 1)
511 fi
512
513 dnl Now put the libraries back to what it was before we
514 dnl starting checking the termcap library.
515 LIBS="$nmh_save_LIBS"
516
517 dnl --------------
518 dnl CHECK TYPEDEFS
519 dnl --------------
520 AC_TYPE_PID_T
521 AC_TYPE_OFF_T
522 AC_TYPE_UID_T
523 AC_TYPE_MODE_T
524 AC_TYPE_SIZE_T
525
526 dnl ----------------
527 dnl CHECK STRUCTURES
528 dnl ----------------
529
530 dnl For platforms such as FreeBSD that have tm_gmtoff in struct tm.
531 dnl (FreeBSD has a timezone() function but not a timezone global
532 dnl variable that is visible).
533 AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include <time.h>])
534
535 AC_STRUCT_DIRENT_D_TYPE
536
537 dnl Where is <signal.h> located?  Needed as input for signames.awk
538 AC_CACHE_CHECK(where signal.h is located, nmh_cv_path_signal_h,
539 [for SIGNAL_H in /usr/include/bsd/sys/signal.h  dnl Next
540                  /usr/include/asm/signal.h      dnl Linux 1.3.0 and above
541                  /usr/include/asm/signum.h      dnl some versions of Linux/Alpha
542                  /usr/include/linux/signal.h    dnl Linux up to 1.2.11
543                  /usr/include/sys/signal.h      dnl Almost everybody else
544                  /dev/null;                     dnl Just in case we fall through
545 do
546   test -f $SIGNAL_H && \
547   grep '#[         ]*define[         ][         ]*SIG[0-9A-Z]*[         ]*[0-9][0-9]*' $SIGNAL_H > /dev/null && \
548   break
549 done
550 nmh_cv_path_signal_h=$SIGNAL_H
551 ])
552 SIGNAL_H=$nmh_cv_path_signal_h
553 AC_SUBST(SIGNAL_H)dnl
554
555
556 dnl ----------------
557 dnl OUTPUT MAKEFILES
558 dnl ----------------
559 AC_CONFIG_FILES(Makefile config/Makefile h/Makefile sbr/Makefile uip/Makefile \
560                 etc/Makefile man/Makefile)
561 AC_CONFIG_COMMANDS([stamp],[test -z "$CONFIG_HEADERS" || echo > stamp-h])
562 AC_OUTPUT
563
564 dnl These odd looking assignments are done to expand out unexpanded
565 dnl variables in bindir et al (for instance mandir is '${datarootdir}/man',
566 dnl but expanding that gives '${prefix}/share/man', so we need to expand
567 dnl again to get the final answer.
568 dnl We only use the expanded versions to print the install paths in
569 dnl the final summary and should use them nowhere else (see the autoconf
570 dnl docs for the rationale for bindir etc being unexpanded).
571 eval "nmhbin=${bindir}";         eval "nmhbin=${nmhbin}"
572 eval "nmhsysconf=${sysconfdir}"; eval "nmhsysconf=${nmhsysconf}"
573 eval "nmhlib=${libdir}";         eval "nmhlib=${nmhlib}"
574 eval "nmhman=${mandir}";         eval "nmhman=${nmhman}"
575
576 cat <<!
577 mmh configuration
578 -----------------
579 mmh version            : AC_PACKAGE_VERSION
580 target os              : ${target}
581 compiler               : ${CC}
582 compiler flags         : ${CFLAGS}
583 linker flags           : ${LDFLAGS}
584 definitions            : ${OURDEFS}
585 source code location   : ${srcdir}
586
587 binary install path    : ${nmhbin}
588 library install path   : ${nmhlib}
589 config install path    : ${nmhsysconf}
590 man page install path  : ${nmhman}
591
592 sendmail path          : ${sendmailpath}
593 mail spool             : ${mailspool}
594
595 file locking type      : ${LOCKTYPE}
596 !
597 if test x"$LOCKTYPE" = x"dot" && test x"$LOCKDIR" != x; then
598         echo "lockfile directory     : ${LOCKDIR}"
599 fi