fixed libtool check, sort of...
[mmh] / configure.in
1 dnl
2 dnl configure.in -- autoconf template for nmh
3 dnl
4 dnl $Id$
5 dnl
6
7 AC_INIT(h/nmh.h)
8 AC_CONFIG_HEADER(config.h)
9
10 AC_CANONICAL_SYSTEM
11
12 dnl ---------------------
13 dnl define a macro or two
14 dnl ---------------------
15
16 AC_DEFUN(NMH_PROG_GNU_LIBTOOL, [
17   tmptest=`$LIBTOOL --version 2>&1 | grep GNU`
18   if test x"$tmptest" != x  ; then
19     GNU_LIBTOOL=1
20     AC_SUBST(GNU_LIBTOOL)
21   fi
22 ] )
23   
24
25 dnl What version of nmh are we building?
26 VERSION=`sed -e 's/nmh-//' ${srcdir}/VERSION`
27 echo "configuring for nmh-$VERSION"
28 AC_SUBST(VERSION)dnl
29
30 dnl -------------------------
31 dnl CHECK COMMAND LINE OPTION
32 dnl -------------------------
33 dnl What method of posting should post use?
34 undefine([mts])dnl
35 AC_ARG_WITH(mts,
36 [  --with-mts=MTS          specify the mail transport agent])
37
38 if test x$with_mts = xsmtp; then
39   MTS="smtp"
40   MTSLIB="mts/smtp/libsmtp.a"
41   AC_DEFINE(SMTPMTS)dnl
42 elif test x$with_mts = xsendmail; then
43   MTS="sendmail"
44   MTSLIB="mts/sendmail/libsend.a"
45   AC_DEFINE(SENDMTS)dnl
46 else
47   MTS="smtp"
48   MTSLIB="mts/smtp/libsmtp.a"
49   AC_DEFINE(SMTPMTS)dnl
50 fi
51
52 AC_SUBST(MTS)
53 AC_SUBST(MTSLIB)
54
55 dnl What should be the default editor?
56 undefine([editor])dnl
57 AC_ARG_WITH(editor,
58 [  --with-editor=EDITOR    specify the default editor])
59
60 if test -n "$with_editor"; then
61   editorpath="$with_editor"
62 fi
63
64 dnl What should be the default pager?
65 undefine([pager])dnl
66 AC_ARG_WITH(pager,
67 [  --with-pager=PAGER      specify the default pager])
68
69 if test -n "$with_pager"; then
70   pagerpath="$with_pager"
71 fi
72
73 dnl Do you want mhe support?
74 undefine([nmh-mhe])dnl
75 AC_ARG_ENABLE(nmh-mhe,
76 [  --enable-nmh-mhe        enable mhe support (DEFAULT)])
77
78 dnl mhe support is on by default, so define it unless
79 dnl explicitly disabled.
80 if test x$enable_nmh_mhe != xno; then
81   AC_DEFINE(MHE)dnl
82 fi
83
84 dnl Do you want client-side support for pop
85 undefine([nmh-pop])dnl
86 AC_ARG_ENABLE(nmh-pop,
87 [  --enable-nmh-pop        enable client-side support for pop])
88 if test x$enable_nmh_pop = xyes; then
89   AC_DEFINE(POP)dnl
90   POPLIB=popsbr.o
91   POPSED='/^%nmhbeginpop%/d;/^%nmhendpop%/d'
92 else
93   POPSED='/^%nmhbeginpop%/,/^%nmhendpop%/d'
94 fi
95 AC_SUBST(POPLIB)dnl
96 AC_SUBST(POPSED)dnl
97
98 dnl Do you want client-side support for kpop
99 AC_ARG_WITH(krb4,
100 [  --with-krb4=PREFIX      specify location of Kerberos V4 for kpop support])
101 if test x$with_krb4 != x -a x$with_krb4 != xno; then
102   AC_DEFINE(KPOP)dnl
103   AC_DEFINE(KPOP_PRINCIPAL, "pop")dnl
104 fi
105
106 dnl Do you want support for hesiod
107 AC_ARG_WITH(hesiod,
108 [  --with-hesiod=PREFIX    specify location of Hesiod])
109 if test x$with_hesiod != x -a x$with_hesiod != xno; then
110   AC_DEFINE(HESIOD)dnl
111 fi
112
113 dnl Do you want to debug nmh?
114 undefine([nmh-debug])dnl
115 AC_ARG_ENABLE(nmh-debug,
116 [  --enable-nmh-debug      enable nmh code debugging])
117
118 dnl ----------------------------------------------------
119 dnl Default location is /usr/local/nmh/{bin,etc,lib,man}
120 dnl ----------------------------------------------------
121 AC_PREFIX_DEFAULT(/usr/local/nmh)
122
123 dnl ------------------
124 dnl CHECK THE COMPILER
125 dnl ------------------
126 dnl We want these before the checks,
127 dnl so the checks can modify their values.
128 test -z "$CFLAGS" && CFLAGS= auto_cflags=1
129 if test x$enable_nmh_debug = xyes; then
130   test -z "$LDFLAGS" && LDFLAGS=-g
131 fi
132
133 AC_PROG_CC
134
135 dnl if the user hasn't specified CFLAGS, then
136 dnl   if compiler is gcc, then
137 dnl     use -O2 and some warning flags
138 dnl   else use -O
139 if test -n "$auto_cflags"; then
140   if test x$enable_nmh_debug = xyes; then
141     if test -n "$GCC"; then
142       test -z "$CFLAGS" && CFLAGS="-Wall -g" || CFLAGS="$CFLAGS -Wall -g"
143     else
144       test -z "$CFLAGS" && CFLAGS=-g || CFLAGS="$CFLAGS -g"
145     fi
146   else
147     test -z "$LDFLAGS" && LDFLAGS=-s
148     if test -n "$GCC"; then
149       test -z "$CFLAGS" && CFLAGS=-O2 || CFLAGS="$CFLAGS -O2"
150     else
151       test -z "$CFLAGS" && CFLAGS=-O  || CFLAGS="$CFLAGS -O"
152     fi
153   fi
154 fi
155
156 AC_C_CONST              dnl Does compiler support `const'.
157
158 dnl ------------------
159 dnl CHECK FOR PROGRAMS
160 dnl ------------------
161 AC_PROG_MAKE_SET        dnl Does make define $MAKE
162 AC_PROG_INSTALL         dnl Check for BSD compatible `install'
163 AC_PROG_RANLIB          dnl Check for `ranlib'
164 AC_PROG_AWK             dnl Check for mawk,gawk,nawk, then awk
165 AC_PROG_LEX             dnl Check for lex/flex
166
167 dnl Look for `cut'
168 pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb
169 AC_PATH_PROG(cutpath, cut, no, [$pathtmp])
170
171
172 dnl try to figure out which one we've got
173 AC_CHECK_PROG(LIBTOOL, libtool, libtool, , [$pathtmp])
174 NMH_PROG_GNU_LIBTOOL
175
176 dnl Check for lorder and tsort commands
177 AC_CHECK_PROG(LORDER, lorder, lorder, no)dnl
178 AC_CHECK_PROG(TSORT, tsort, tsort, no)dnl
179
180 dnl If either doesn't exist, replace them with echo and cat
181 if test x$ac_cv_prog_LORDER != xlorder -o x$ac_cv_prog_TSORT != xtsort; then
182   LORDER=echo
183   TSORT=cat
184   AC_SUBST(LORDER)dnl
185   AC_SUBST(TSORT)dnl
186 dnl Mac OS X has lorder, but sh is too broken for it to work
187 dnl elif test -z "`lorder config/config.c 2>&1 | grep config/config.c`" ; then
188 dnl   LORDER=echo
189 dnl   TSORT=cat
190 dnl   AC_SUBST(LORDER)dnl
191 dnl   AC_SUBST(TSORT)dnl
192 fi
193
194 dnl Look for `ls'
195 pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb
196 AC_PATH_PROG(lspath, ls, no, [$pathtmp])
197
198 dnl See how we get ls to display the owner and the group
199 if test "$lspath" != "no"; then
200   AC_CACHE_CHECK(how to get ls to show us the group ownership of a file, 
201                  nmh_cv_ls_grpopt,
202   [if test x"`$lspath -dl / | $AWK '{print $9}'`" = x"/"; then
203     dnl There were 9 parameters, so unless this is a really bizarre, nonstandard
204     dnl ls, it would seem -l gave us both the user and group.  On this type of
205     dnl ls, -g makes _only_ the group be displayed (and not the user).
206     nmh_cv_ls_grpopt="-l"
207   else
208     dnl Looks like -l only gave us the user, so we need -g to get the group too.
209     nmh_cv_ls_grpopt="-lg"
210   fi])
211 fi
212
213 dnl Look for `more'
214 pathtmp=/usr/bin:/bin:/usr/ucb:/usr/local/bin
215 AC_PATH_PROG(morepath, more, no, [$pathtmp])
216
217 dnl If pager is not specified yet,
218 dnl then use `more' as the default.
219 if test -z "$pagerpath"; then
220   pagerpath="$morepath"
221 fi
222 AC_SUBST(pagerpath)dnl
223
224 dnl Look for `sendmail'
225 pathtmp=/usr/lib:/usr/sbin:/usr/etc:/usr/ucblib:/usr/bin:/bin
226 AC_PATH_PROG(sendmailpath, sendmail, no, [$pathtmp])
227
228 dnl Look for `vi'
229 pathtmp=/usr/bin:/bin:/usr/ucb:/usr/local/bin
230 AC_PATH_PROG(vipath, vi, no, [$pathtmp])
231
232 dnl If editor is not specified yet,
233 dnl then use `vi' as the default.
234 if test -z "$editorpath"; then
235   editorpath="$vipath"
236 fi
237 AC_SUBST(editorpath)dnl
238
239 dnl Check for broken vi
240 AC_CACHE_CHECK(for broken vi, nmh_cv_attvibug,
241 [if echo 'r /nonexist-file
242 q' | ex > /dev/null 2>&1
243 then
244         nmh_cv_attvibug=no
245 else
246         nmh_cv_attvibug=yes
247 fi])
248  
249 if test "$nmh_cv_attvibug" = yes; then
250   AC_DEFINE(ATTVIBUG)
251 fi
252
253 dnl ----------------------------------------------------------
254 dnl FIND MAIL SPOOL AND SEE IF WE NEED TO MAKE inc SETGID MAIL
255 dnl ----------------------------------------------------------
256 AC_CACHE_CHECK(where mail spool is located, nmh_cv_mailspool,
257 [for mailspool in /var/mail        dnl
258                   /var/spool/mail  dnl
259                   /usr/spool/mail  dnl
260                   /dev/null;       dnl Just in case we fall through
261 do
262   test -d $mailspool && break
263 done
264 nmh_cv_mailspool=$mailspool
265 ])
266 mailspool=$nmh_cv_mailspool
267 AC_SUBST(mailspool)dnl
268
269 dnl See whether the mail spool directory is world-writable.
270 if test "$lspath" != "no" -a "$cutpath" != "no"; then
271   AC_CACHE_CHECK(whether the mail spool is world-writable, 
272                  nmh_cv_mailspool_world_writable,
273   [if test "`$lspath -dlL $mailspool | $cutpath -c9`" = "-"; then
274     nmh_cv_mailspool_world_writable=no
275   else
276     nmh_cv_mailspool_world_writable=yes
277   fi])
278 fi
279
280 dnl ...If it's not, we need to #define MAILGROUP to 1 and make inc setgid.
281 if test x"$nmh_cv_mailspool_world_writable" = x"no"; then
282   dnl do we really need both of these?
283   AC_DEFINE(MAILGROUP)
284   SETGID_MAIL=1
285 fi
286 AC_SUBST(SETGID_MAIL)dnl
287
288 dnl see if we can determine which group owns the mail spool dir
289 AC_CACHE_CHECK(what group owns the mail spool, nmh_cv_ls_mail_grp,
290 [nmh_cv_ls_mail_grp=`$lspath -dL $nmh_cv_ls_grpopt $mailspool|$AWK '{print $4}'`
291  dnl Should we just set it to whatever ls reports, rather than only allowing
292  dnl certain values...?
293  if test x$nmh_cv_ls_mail_grp = xmail; then
294    MAIL_SPOOL_GRP="mail"
295  elif test x$nmh_cv_ls_mail_grp = xwheel; then
296    MAIL_SPOOL_GRP="wheel"
297  else
298    MAIL_SPOOL_GRP="'0'"
299  fi])
300 AC_SUBST(MAIL_SPOOL_GRP)dnl
301
302 dnl ------------------
303 dnl CHECK HEADER FILES
304 dnl ------------------
305 AC_HEADER_DIRENT
306 AC_HEADER_STDC
307 AC_HEADER_TIME
308 AC_HEADER_SYS_WAIT
309 AC_HEADER_STAT
310 AC_CHECK_HEADERS(string.h memory.h stdlib.h unistd.h errno.h fcntl.h \
311                  limits.h crypt.h termcap.h termio.h termios.h locale.h \
312                  netdb.h sys/param.h sys/time.h sys/utsname.h arpa/inet.h \
313                  arpa/ftp.h)
314
315
316 AC_CACHE_CHECK(POSIX termios, nmh_cv_sys_posix_termios,
317 [AC_TRY_LINK([#include <sys/types.h>
318 #include <unistd.h>
319 #include <termios.h>],
320 [/* SunOS 4.0.3 has termios.h but not the library calls.  */
321 tcgetattr(0, 0);],
322   nmh_cv_sys_posix_termios=yes, nmh_cv_sys_posix_termios=no)])
323  
324 if test $nmh_cv_sys_posix_termios = yes; then
325   AC_CACHE_CHECK(TIOCGWINSZ in termios.h,
326   nmh_cv_header_termios_h_tiocgwinsz,
327   [AC_TRY_LINK([#include <sys/types.h>
328 #include <termios.h>],
329   [int x = TIOCGWINSZ;],
330   nmh_cv_header_termios_h_tiocgwinsz=yes,
331   nmh_cv_header_termios_h_tiocgwinsz=no)])
332 else
333   nmh_cv_header_termios_h_tiocgwinsz=no
334 fi
335  
336 if test $nmh_cv_header_termios_h_tiocgwinsz = no; then
337   AC_CACHE_CHECK(TIOCGWINSZ in sys/ioctl.h,
338   nmh_cv_header_sys_ioctl_h_tiocgwinsz,
339   [AC_TRY_LINK([#include <sys/types.h>
340 #include <sys/ioctl.h>],
341   [int x = TIOCGWINSZ;],
342   nmh_cv_header_sys_ioctl_h_tiocgwinsz=yes,
343   nmh_cv_header_sys_ioctl_h_tiocgwinsz=no)])
344   if test $nmh_cv_header_sys_ioctl_h_tiocgwinsz = yes; then
345     AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
346   fi
347 fi
348  
349 dnl
350 dnl Checks for _IO_write_ptr. A Linuxism used by nmh on linux. We
351 dnl really use a whole set of them, but this check should be
352 dnl sufficient.
353 dnl
354 AC_CHECK_HEADER(libio.h, [
355   AC_EGREP_HEADER(_IO_write_ptr, libio.h, [
356     AC_DEFINE(LINUX_STDIO) ]) ]) 
357
358 AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM))
359
360 dnl ---------------
361 dnl CHECK FUNCTIONS
362 dnl ---------------
363 AC_FUNC_VFORK
364 AC_CHECK_LIB(mkstemp,mkstemp)
365 AC_CHECK_FUNCS(waitpid wait3 sigaction sigprocmask sigblock sigsetmask \
366                sighold sigrelse writev lstat uname tzset killpg mkstemp \
367                sethostent)
368
369 dnl solaris screws ths up
370 AC_CHECK_FUNC(gethostbyname, [AC_DEFINE(HAVE_GETHOSTBYNAME)],
371   AC_CHECK_LIB(nsl, gethostbyname, [AC_DEFINE(HAVE_GETHOSTBYNAME)] ) )
372
373 dnl sigsetjmp may be a macro
374 AC_MSG_CHECKING(for sigsetjmp)
375 AC_TRY_LINK([#include <setjmp.h>], [sigsetjmp((void *)0, 0);],
376         [AC_DEFINE(HAVE_SIGSETJMP) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no))
377
378 AC_REPLACE_FUNCS(snprintf strerror strdup)
379
380 dnl -------------------
381 dnl CHECK FOR LIBRARIES
382 dnl -------------------
383 dnl Check location of modf
384 AC_CHECK_FUNC(modf, , AC_CHECK_LIB(m, modf))
385
386 dnl Checks for network libraries (nsl, socket)
387 AC_CHECK_NETLIBS
388
389 dnl Check for bug in libraries such that ruserpass
390 dnl needs to be linked as _ruserpass.
391 AC_CHECK_RUSERPASS
392
393 termcap_curses_order="termcap curses ncurses"
394 for lib in $termcap_curses_order; do
395   AC_CHECK_LIB(${lib}, tgetent, [TERMLIB="-l$lib"; break])
396 done
397 AC_SUBST(TERMLIB)dnl
398
399
400 dnl --------------
401 dnl CHECK FOR NDBM
402 dnl --------------
403 dnl Checks for ndbm
404 AC_CHECK_FUNC(dbm_open, ,
405   AC_CHECK_LIB(ndbm, dbm_open, ,
406     AC_CHECK_LIB(dbm, dbm_open)))
407
408 dnl ----------------
409 dnl CHECK FOR NDBM.H
410 dnl ----------------
411 AC_CHECK_HEADERS(db1/ndbm.h)
412
413 dnl ----------------
414 dnl CHECK FOR HESIOD
415 dnl ----------------
416 if test x$with_hesiod != x -a x$with_hesiod != xno; then
417   if test x$with_hesiod != xyes; then
418     HESIOD_INCLUDES="-I$with_hesiod/include"
419     HESIOD_LIBS="-L$with_hesiod/lib"
420   fi
421   AC_CHECK_FUNC(res_send, ,
422     AC_CHECK_LIB(resolv, res_send))
423   AC_CHECK_LIB(hesiod, hes_resolve, [HESIOD_LIBS="$HESIOD_LIBS -lhesiod"],
424     [AC_MSG_ERROR(Hesiod library not found)], $HESIOD_LIBS)
425 fi
426 AC_SUBST(HESIOD_INCLUDES)dnl
427 AC_SUBST(HESIOD_LIBS)dnl
428
429 dnl ----------------------------------
430 dnl CHECK FOR KRB4 (Kerberos4 support)
431 dnl ----------------------------------
432 if test x$with_krb4 != x -a x$with_krb4 != xno; then
433   if test x$with_krb4 != xyes; then
434     KRB4_INCLUDES="-I$with_krb4/include"
435     if test -d "$with_krb4/include/kerberosIV"; then
436       KRB4_INCLUDES="$KRB4_INCLUDES -I$with_krb4/include/kerberosIV"
437     fi
438     KRB4_LIBS="-L$with_krb4/lib"
439   elif test -d /usr/include/kerberosIV; then
440     KRB4_INCLUDES="-I/usr/include/kerberosIV"
441   fi
442   AC_CHECK_LIB(krb4, krb_rd_req,
443     [KRB4_LIBS="$KRB4_LIBS -lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err"],
444     [AC_CHECK_LIB(krb, krb_rd_req,
445       [KRB4_LIBS="$KRB4_LIBS -lkrb -ldes"],
446       [AC_MSG_ERROR(Kerberos 4 libraries not found)],
447       $KRB4_LIBS -ldes)],
448     $KRB4_LIBS -ldes425 -lkrb5 -lcrypto -lcom_err)
449 fi
450 AC_SUBST(KRB4_INCLUDES)dnl
451 AC_SUBST(KRB4_LIBS)dnl
452
453 dnl ---------------------
454 dnl CHECK TERMCAP LIBRARY
455 dnl ---------------------
456
457 dnl Add the termcap library, so that the following configure
458 dnl tests will find it when it tries to link test programs.
459 nmh_save_LIBS="$LIBS"
460 LIBS="$TERMLIB $LIBS"
461
462 dnl Checks for external variable ospeed in the termcap library.
463 AC_CACHE_CHECK(if an include file defines ospeed,
464 nmh_cv_decl_ospeed_include_defines,
465 [AC_TRY_LINK(
466 [#include <sys/types.h>
467 #if HAVE_TERMIOS_H
468 #include <termios.h>
469 #endif
470 #if HAVE_TERMCAP_H
471 #include <termcap.h>
472 #endif], [ospeed = 0;],
473 nmh_cv_decl_ospeed_include_defines=yes,
474 nmh_cv_decl_ospeed_include_defines=no)])
475  
476 if test $nmh_cv_decl_ospeed_include_defines = no; then
477   AC_CACHE_CHECK(if you must define ospeed,
478   nmh_cv_decl_ospeed_must_define,
479   [AC_TRY_LINK( ,[extern short ospeed; ospeed = 0;],
480   nmh_cv_decl_ospeed_must_define=yes,
481   nmh_cv_decl_ospeed_must_define=no)])
482 fi
483  
484 if test $nmh_cv_decl_ospeed_include_defines = yes; then
485   AC_DEFINE(HAVE_OSPEED)
486 elif test $nmh_cv_decl_ospeed_must_define = yes; then
487   AC_DEFINE(HAVE_OSPEED)
488   AC_DEFINE(MUST_DEFINE_OSPEED)
489 fi
490
491 dnl dnl Checks if tgetent accepts NULL and will
492 dnl dnl allocate its own termcap buffer.
493 dnl AC_CACHE_CHECK(if tgetent accepts NULL,
494 dnl nmh_cv_func_tgetent_accepts_null,
495 dnl [AC_TRY_RUN([main(){int i = tgetent((char*)0,"vt100");exit(!i || i == -1);}],
496 dnl   nmh_cv_func_tgetent_accepts_null=yes,
497 dnl   nmh_cv_func_tgetent_accepts_null=no,
498 dnl   nmh_cv_func_tgetent_accepts_null=no)])
499 dnl if test $nmh_cv_func_tgetent_accepts_null = yes; then
500 dnl   AC_DEFINE(TGETENT_ACCEPTS_NULL)
501 dnl fi
502
503 dnl Now put the libraries back to what it was before we
504 dnl starting checking the termcap library.
505 LIBS="$nmh_save_LIBS"
506
507 dnl --------------
508 dnl CHECK TYPEDEFS
509 dnl --------------
510 AC_TYPE_SIGNAL
511 AC_TYPE_PID_T
512 AC_TYPE_OFF_T
513 AC_TYPE_UID_T
514 AC_TYPE_MODE_T
515 AC_TYPE_SIZE_T
516
517 dnl Check for sigset_t.  Currently I'm looking in
518 dnl <sys/types.h> and <signal.h>.  Others might need
519 dnl to be added.
520 AC_CACHE_CHECK(for sigset_t, nmh_cv_type_sigset_t,
521 [AC_TRY_COMPILE(
522 [#include <sys/types.h>
523 #include <signal.h>], [sigset_t tempsigset;],
524   nmh_cv_type_sigset_t=yes, nmh_cv_type_sigset_t=no)])
525 if test $nmh_cv_type_sigset_t = no; then
526   AC_DEFINE(sigset_t, unsigned int)
527 fi
528
529 dnl ----------------
530 dnl CHECK STRUCTURES
531 dnl ----------------
532 AC_STRUCT_ST_BLKSIZE
533
534 AC_CACHE_CHECK(for tm_gmtoff in struct tm, nmh_cv_struct_tm_gmtoff,
535 [AC_TRY_COMPILE(
536 [#ifdef TIME_WITH_SYS_TIME
537 # include <sys/time.h>
538 # include <time.h>
539 #else
540 # ifdef TM_IN_SYS_TIME
541 #  include <sys/time.h>
542 # else
543 #  include <time.h>
544 # endif
545 #endif],
546 [struct tm temptm; temptm.tm_gmtoff = 0;],
547   nmh_cv_struct_tm_gmtoff=yes, nmh_cv_struct_tm_gmtoff=no)])
548 if test $nmh_cv_struct_tm_gmtoff = yes; then
549   AC_DEFINE(HAVE_TM_GMTOFF)
550 fi
551
552 dnl -------------
553 dnl CHECK SIGNALS
554 dnl -------------
555 dnl What style of signal do you have (POSIX, BSD, or SYSV)?
556 AC_MSG_CHECKING(what style of signals to use)
557 if test $ac_cv_func_sigaction = yes -a $ac_cv_func_sigprocmask = yes; then
558   signals_style=POSIX_SIGNALS
559   AC_DEFINE(POSIX_SIGNALS)
560   AC_DEFINE(RELIABLE_SIGNALS)
561 elif test $ac_cv_func_sigblock = yes -a $ac_cv_func_sigsetmask = yes; then
562   signals_style=BSD_SIGNALS
563   AC_DEFINE(BSD_SIGNALS)
564   AC_DEFINE(RELIABLE_SIGNALS)
565 elif test $ac_cv_func_sighold = yes -a $ac_cv_func_sigrelse = yes; then
566   signals_style=SYSV_SIGNALS
567   AC_DEFINE(SYSV_SIGNALS)
568 else
569   signals_style=NO_SIGNAL_BLOCKING
570   AC_DEFINE(NO_SIGNAL_BLOCKING)
571 fi
572
573 AC_MSG_RESULT($signals_style)
574
575 dnl Where is <signal.h> located?  Needed as input for signames.awk
576 AC_CACHE_CHECK(where signal.h is located, nmh_cv_path_signal_h,
577 [for SIGNAL_H in /usr/include/bsd/sys/signal.h  dnl Next
578                  /usr/include/asm/signal.h      dnl Linux 1.3.0 and above
579                  /usr/include/asm/signum.h      dnl some versions of Linux/Alpha
580                  /usr/include/linux/signal.h    dnl Linux up to 1.2.11
581                  /usr/include/sys/signal.h      dnl Almost everybody else
582                  /dev/null;                     dnl Just in case we fall through
583 do
584   test -f $SIGNAL_H && \
585   grep '#[      ]*define[       ][      ]*SIG[0-9A-Z]*[         ]*[0-9][0-9]*' $SIGNAL_H > /dev/null && \
586   break
587 done
588 nmh_cv_path_signal_h=$SIGNAL_H
589 ])
590 SIGNAL_H=$nmh_cv_path_signal_h
591 AC_SUBST(SIGNAL_H)dnl
592
593 dnl ----------------
594 dnl OS SPECIFIC DEFINES
595 dnl ----------------
596 case "$target_os" in
597
598   solaris2*)
599     AC_DEFINE(SYS5)
600     AC_DEFINE(SVR4)
601     ;;
602   irix*)
603     AC_DEFINE(SYS5)
604     AC_DEFINE(SVR4)
605     ;;
606   osf*)
607     AC_DEFINE(SYS5)
608     AC_DEFINE(SVR4)
609     ;;
610   aix*)
611     AC_DEFINE(SYS5)
612     AC_DEFINE(SVR4)
613     ;;
614   sunos4*)
615     AC_DEFINE(BSD42)
616     ;;
617   freebsd*)  
618     AC_DEFINE(BSD42)
619     AC_DEFINE(BSD44)
620     ;;
621   netbsd*)
622     AC_DEFINE(BSD42)
623     AC_DEFINE(BSD44)
624     ;;
625   openbsd*)
626     AC_DEFINE(BSD42)
627     AC_DEFINE(BSD44)
628     ;;
629   bsd/os*)
630     AC_DEFINE(BSD42)
631     AC_DEFINE(BSD44)
632     ;;
633   sco5*)
634     AC_DEFINE(SYS5)
635     AC_DEFINE(SCO_5_STDIO)
636     ;;
637 esac
638
639
640 dnl ----------------
641 dnl OUTPUT MAKEFILES
642 dnl ----------------
643 AC_OUTPUT(Makefile config/Makefile h/Makefile sbr/Makefile uip/Makefile \
644           zotnet/Makefile zotnet/mts/Makefile zotnet/tws/Makefile \
645           zotnet/mf/Makefile zotnet/bboards/Makefile mts/Makefile \
646           mts/smtp/Makefile mts/sendmail/Makefile mts/mmdf/Makefile \
647           etc/Makefile man/Makefile, \
648           [test -z "$CONFIG_HEADERS" || echo > stamp-h])
649
650 eval "nmhbin=${bindir}";         eval "nmhbin2=${nmhbin}"
651 eval "nmhsysconf=${sysconfdir}"; eval "nmhsysconf2=${nmhsysconf}"
652 eval "nmhlib=${libdir}";         eval "nmhlib2=${nmhlib}"
653 eval "nmhman=${mandir}"
654
655 echo "
656 nmh configuration
657 -----------------
658 nmh version               : ${VERSION}
659 target os                 : ${target}
660 compiler                  : ${CC}
661 compiler flags            : ${CFLAGS}
662 linker flags              : ${LDFLAGS}
663 source code location      : ${srcdir}
664 binary install path       : ${nmhbin2}
665 libary install path       : ${nmhlib2}
666 config files install path : ${nmhsysconf2}
667 man page install path     : ${nmhman}
668 transport system          : ${MTS}
669 default editor            : ${editorpath}
670 default pager             : ${pagerpath}"
671 echo ""