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