f06a1d206b719ed3ca42af29f21adb4944ed29d2
[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 Check for lorder and tsort commands
159 AC_CHECK_PROG(LORDER, lorder, lorder, no)dnl
160 AC_CHECK_PROG(TSORT, tsort, tsort, no)dnl
161
162 dnl If either doesn't exist, replace them with echo and cat
163 if test x$ac_cv_prog_LORDER != xlorder -o x$ac_cv_prog_TSORT != xtsort; then
164   LORDER=echo
165   TSORT=cat
166   AC_SUBST(LORDER)dnl
167   AC_SUBST(TSORT)dnl
168 fi
169
170 dnl Look for `ls'
171 pathtmp=/usr/bin:/bin:/usr/local/bin:/usr/xpg4/bin:/usr/ucb
172 AC_PATH_PROG(lspath, ls, no, [$pathtmp])
173
174 dnl See how we get ls to display the owner and the group
175 if test "$lspath" != "no"; then
176   AC_CACHE_CHECK(how to get ls to show us the group ownership of a file, 
177                  nmh_cv_ls_grpopt,
178   [if test x"`$lspath -dl / | $AWK '{print $9}'`" = x"/"; then
179     dnl There were 9 parameters, so unless this is a really bizarre, nonstandard
180     dnl ls, it would seem -l gave us both the user and group.  On this type of
181     dnl ls, -g makes _only_ the group be displayed (and not the user).
182     nmh_cv_ls_grpopt="-l"
183   else
184     dnl Looks like -l only gave us the user, so we need -g to get the group too.
185     nmh_cv_ls_grpopt="-lg"
186   fi])
187 fi
188
189 dnl Look for `more'
190 pathtmp=/usr/bin:/bin:/usr/ucb:/usr/local/bin
191 AC_PATH_PROG(morepath, more, no, [$pathtmp])
192
193 dnl If pager is not specified yet,
194 dnl then use `more' as the default.
195 if test -z "$pagerpath"; then
196   pagerpath="$morepath"
197 fi
198 AC_SUBST(pagerpath)dnl
199
200 dnl Look for `sendmail'
201 pathtmp=/usr/lib:/usr/sbin:/usr/etc:/usr/ucblib:/usr/bin:/bin
202 AC_PATH_PROG(sendmailpath, sendmail, no, [$pathtmp])
203
204 dnl Look for `vi'
205 pathtmp=/usr/bin:/bin:/usr/ucb:/usr/local/bin
206 AC_PATH_PROG(vipath, vi, no, [$pathtmp])
207
208 dnl If editor is not specified yet,
209 dnl then use `vi' as the default.
210 if test -z "$editorpath"; then
211   editorpath="$vipath"
212 fi
213 AC_SUBST(editorpath)dnl
214
215 dnl Check for broken vi
216 AC_CACHE_CHECK(for broken vi, nmh_cv_attvibug,
217 [if echo 'r /nonexist-file
218 q' | ex > /dev/null 2>&1
219 then
220         nmh_cv_attvibug=no
221 else
222         nmh_cv_attvibug=yes
223 fi])
224  
225 if test "$nmh_cv_attvibug" = yes; then
226   AC_DEFINE(ATTVIBUG)
227 fi
228
229 dnl ----------------------------------------------------------
230 dnl FIND MAIL SPOOL AND SEE IF WE NEED TO MAKE inc SETGID MAIL
231 dnl ----------------------------------------------------------
232 AC_CACHE_CHECK(where mail spool is located, nmh_cv_mailspool,
233 [for mailspool in /var/mail        dnl
234                   /var/spool/mail  dnl
235                   /usr/spool/mail  dnl
236                   /dev/null;       dnl Just in case we fall through
237 do
238   test -d $mailspool && break
239 done
240 nmh_cv_mailspool=$mailspool
241 ])
242 mailspool=$nmh_cv_mailspool
243 AC_SUBST(mailspool)dnl
244
245 dnl See whether the mail spool directory is world-writable.
246 if test "$lspath" != "no" -a "$cutpath" != "no"; then
247   AC_CACHE_CHECK(whether the mail spool is world-writable, 
248                  nmh_cv_mailspool_world_writable,
249   [if test "`$lspath -dlL $mailspool | $cutpath -c9`" = "-"; then
250     nmh_cv_mailspool_world_writable=no
251   else
252     nmh_cv_mailspool_world_writable=yes
253   fi])
254 fi
255
256 dnl ...If it's not, we need to #define MAILGROUP to 1 and make inc setgid.
257 if test x"$nmh_cv_mailspool_world_writable" = x"no"; then
258   dnl do we really need both of these?
259   AC_DEFINE(MAILGROUP)
260   SETGID_MAIL=1
261 fi
262 AC_SUBST(SETGID_MAIL)dnl
263
264 dnl see if we can determine which group owns the mail spool dir
265 AC_CACHE_CHECK(what group owns the mail spool, nmh_cv_ls_mail_grp,
266 [nmh_cv_ls_mail_grp=`$lspath -dL $nmh_cv_ls_grpopt $mailspool|$AWK '{print $4}'`
267  dnl Should we just set it to whatever ls reports, rather than only allowing
268  dnl certain values...?
269  if test x$nmh_cv_ls_mail_grp = xmail; then
270    MAIL_SPOOL_GRP="mail"
271  elif test x$nmh_cv_ls_mail_grp = xwheel; then
272    MAIL_SPOOL_GRP="wheel"
273  else
274    MAIL_SPOOL_GRP="'0'"
275  fi])
276 AC_SUBST(MAIL_SPOOL_GRP)dnl
277
278 dnl ------------------
279 dnl CHECK HEADER FILES
280 dnl ------------------
281 AC_HEADER_DIRENT
282 AC_HEADER_STDC
283 AC_HEADER_TIME
284 AC_HEADER_SYS_WAIT
285 AC_HEADER_STAT
286 AC_CHECK_HEADERS(string.h memory.h stdlib.h unistd.h errno.h fcntl.h \
287                  limits.h crypt.h termcap.h termio.h termios.h locale.h \
288                  netdb.h sys/param.h sys/time.h sys/utsname.h arpa/inet.h \
289                  arpa/ftp.h)
290
291
292 AC_CACHE_CHECK(POSIX termios, nmh_cv_sys_posix_termios,
293 [AC_TRY_LINK([#include <sys/types.h>
294 #include <unistd.h>
295 #include <termios.h>],
296 [/* SunOS 4.0.3 has termios.h but not the library calls.  */
297 tcgetattr(0, 0);],
298   nmh_cv_sys_posix_termios=yes, nmh_cv_sys_posix_termios=no)])
299  
300 if test $nmh_cv_sys_posix_termios = yes; then
301   AC_CACHE_CHECK(TIOCGWINSZ in termios.h,
302   nmh_cv_header_termios_h_tiocgwinsz,
303   [AC_TRY_LINK([#include <sys/types.h>
304 #include <termios.h>],
305   [int x = TIOCGWINSZ;],
306   nmh_cv_header_termios_h_tiocgwinsz=yes,
307   nmh_cv_header_termios_h_tiocgwinsz=no)])
308 else
309   nmh_cv_header_termios_h_tiocgwinsz=no
310 fi
311  
312 if test $nmh_cv_header_termios_h_tiocgwinsz = no; then
313   AC_CACHE_CHECK(TIOCGWINSZ in sys/ioctl.h,
314   nmh_cv_header_sys_ioctl_h_tiocgwinsz,
315   [AC_TRY_LINK([#include <sys/types.h>
316 #include <sys/ioctl.h>],
317   [int x = TIOCGWINSZ;],
318   nmh_cv_header_sys_ioctl_h_tiocgwinsz=yes,
319   nmh_cv_header_sys_ioctl_h_tiocgwinsz=no)])
320   if test $nmh_cv_header_sys_ioctl_h_tiocgwinsz = yes; then
321     AC_DEFINE(GWINSZ_IN_SYS_IOCTL)
322   fi
323 fi
324  
325 dnl
326 dnl Checks for _IO_write_ptr. A Linuxism used by nmh on linux. We
327 dnl really use a whole set of them, but this check should be
328 dnl sufficient.
329 dnl
330 AC_CHECK_HEADER(libio.h, [
331   AC_EGREP_HEADER(_IO_write_ptr, libio.h, [
332     AC_DEFINE(LINUX_STDIO) ]) ]) 
333
334 AC_CHECK_HEADER([sys/ptem.h], AC_DEFINE(WINSIZE_IN_PTEM))
335
336 dnl ---------------
337 dnl CHECK FUNCTIONS
338 dnl ---------------
339 AC_FUNC_VFORK
340 AC_CHECK_LIB(mkstemp,mkstemp)
341 AC_CHECK_FUNCS(waitpid wait3 sigaction sigprocmask sigblock sigsetmask \
342                sighold sigrelse writev lstat uname tzset killpg mkstemp \
343                sethostent gethostbyname)
344
345 dnl sigsetjmp may be a macro
346 AC_MSG_CHECKING(for sigsetjmp)
347 AC_TRY_LINK([#include <setjmp.h>], [sigsetjmp((void *)0, 0);],
348         [AC_DEFINE(HAVE_SIGSETJMP) AC_MSG_RESULT(yes)], AC_MSG_RESULT(no))
349
350 AC_REPLACE_FUNCS(snprintf strerror strdup)
351
352 dnl -------------------
353 dnl CHECK FOR LIBRARIES
354 dnl -------------------
355 dnl Check location of modf
356 AC_CHECK_FUNC(modf, , AC_CHECK_LIB(m, modf))
357
358 dnl Checks for network libraries (nsl, socket)
359 AC_CHECK_NETLIBS
360
361 dnl Check for bug in libraries such that ruserpass
362 dnl needs to be linked as _ruserpass.
363 AC_CHECK_RUSERPASS
364
365 termcap_curses_order="termcap curses ncurses"
366 for lib in $termcap_curses_order; do
367   AC_CHECK_LIB(${lib}, tgetent, [TERMLIB="-l$lib"; break])
368 done
369 AC_SUBST(TERMLIB)dnl
370
371
372 dnl --------------
373 dnl CHECK FOR NDBM
374 dnl --------------
375 dnl Checks for ndbm
376 AC_CHECK_FUNC(dbm_open, ,
377   AC_CHECK_LIB(ndbm, dbm_open, ,
378     AC_CHECK_LIB(dbm, dbm_open)))
379
380 dnl ----------------
381 dnl CHECK FOR NDBM.H
382 dnl ----------------
383 AC_CHECK_HEADERS(db1/ndbm.h)
384
385 dnl ----------------
386 dnl CHECK FOR HESIOD
387 dnl ----------------
388 if test x$with_hesiod != x -a x$with_hesiod != xno; then
389   if test x$with_hesiod != xyes; then
390     HESIOD_INCLUDES="-I$with_hesiod/include"
391     HESIOD_LIBS="-L$with_hesiod/lib"
392   fi
393   AC_CHECK_FUNC(res_send, ,
394     AC_CHECK_LIB(resolv, res_send))
395   AC_CHECK_LIB(hesiod, hes_resolve, [HESIOD_LIBS="$HESIOD_LIBS -lhesiod"],
396     [AC_MSG_ERROR(Hesiod library not found)], $HESIOD_LIBS)
397 fi
398 AC_SUBST(HESIOD_INCLUDES)dnl
399 AC_SUBST(HESIOD_LIBS)dnl
400
401 dnl ----------------------------------
402 dnl CHECK FOR KRB4 (Kerberos4 support)
403 dnl ----------------------------------
404 if test x$with_krb4 != x -a x$with_krb4 != xno; then
405   if test x$with_krb4 != xyes; then
406     KRB4_INCLUDES="-I$with_krb4/include"
407     if test -d "$with_krb4/include/kerberosIV"; then
408       KRB4_INCLUDES="$KRB4_INCLUDES -I$with_krb4/include/kerberosIV"
409     fi
410     KRB4_LIBS="-L$with_krb4/lib"
411   elif test -d /usr/include/kerberosIV; then
412     KRB4_INCLUDES="-I/usr/include/kerberosIV"
413   fi
414   AC_CHECK_LIB(krb4, krb_rd_req,
415     [KRB4_LIBS="$KRB4_LIBS -lkrb4 -ldes425 -lkrb5 -lcrypto -lcom_err"],
416     [AC_CHECK_LIB(krb, krb_rd_req,
417       [KRB4_LIBS="$KRB4_LIBS -lkrb -ldes"],
418       [AC_MSG_ERROR(Kerberos 4 libraries not found)],
419       $KRB4_LIBS -ldes)],
420     $KRB4_LIBS -ldes425 -lkrb5 -lcrypto -lcom_err)
421 fi
422 AC_SUBST(KRB4_INCLUDES)dnl
423 AC_SUBST(KRB4_LIBS)dnl
424
425 dnl ---------------------
426 dnl CHECK TERMCAP LIBRARY
427 dnl ---------------------
428
429 dnl Add the termcap library, so that the following configure
430 dnl tests will find it when it tries to link test programs.
431 nmh_save_LIBS="$LIBS"
432 LIBS="$TERMLIB $LIBS"
433
434 dnl Checks for external variable ospeed in the termcap library.
435 AC_CACHE_CHECK(if an include file defines ospeed,
436 nmh_cv_decl_ospeed_include_defines,
437 [AC_TRY_LINK(
438 [#include <sys/types.h>
439 #if HAVE_TERMIOS_H
440 #include <termios.h>
441 #endif
442 #if HAVE_TERMCAP_H
443 #include <termcap.h>
444 #endif], [ospeed = 0;],
445 nmh_cv_decl_ospeed_include_defines=yes,
446 nmh_cv_decl_ospeed_include_defines=no)])
447  
448 if test $nmh_cv_decl_ospeed_include_defines = no; then
449   AC_CACHE_CHECK(if you must define ospeed,
450   nmh_cv_decl_ospeed_must_define,
451   [AC_TRY_LINK( ,[extern short ospeed; ospeed = 0;],
452   nmh_cv_decl_ospeed_must_define=yes,
453   nmh_cv_decl_ospeed_must_define=no)])
454 fi
455  
456 if test $nmh_cv_decl_ospeed_include_defines = yes; then
457   AC_DEFINE(HAVE_OSPEED)
458 elif test $nmh_cv_decl_ospeed_must_define = yes; then
459   AC_DEFINE(HAVE_OSPEED)
460   AC_DEFINE(MUST_DEFINE_OSPEED)
461 fi
462
463 dnl dnl Checks if tgetent accepts NULL and will
464 dnl dnl allocate its own termcap buffer.
465 dnl AC_CACHE_CHECK(if tgetent accepts NULL,
466 dnl nmh_cv_func_tgetent_accepts_null,
467 dnl [AC_TRY_RUN([main(){int i = tgetent((char*)0,"vt100");exit(!i || i == -1);}],
468 dnl   nmh_cv_func_tgetent_accepts_null=yes,
469 dnl   nmh_cv_func_tgetent_accepts_null=no,
470 dnl   nmh_cv_func_tgetent_accepts_null=no)])
471 dnl if test $nmh_cv_func_tgetent_accepts_null = yes; then
472 dnl   AC_DEFINE(TGETENT_ACCEPTS_NULL)
473 dnl fi
474
475 dnl Now put the libraries back to what it was before we
476 dnl starting checking the termcap library.
477 LIBS="$nmh_save_LIBS"
478
479 dnl --------------
480 dnl CHECK TYPEDEFS
481 dnl --------------
482 AC_TYPE_SIGNAL
483 AC_TYPE_PID_T
484 AC_TYPE_OFF_T
485 AC_TYPE_UID_T
486 AC_TYPE_MODE_T
487 AC_TYPE_SIZE_T
488
489 dnl Check for sigset_t.  Currently I'm looking in
490 dnl <sys/types.h> and <signal.h>.  Others might need
491 dnl to be added.
492 AC_CACHE_CHECK(for sigset_t, nmh_cv_type_sigset_t,
493 [AC_TRY_COMPILE(
494 [#include <sys/types.h>
495 #include <signal.h>], [sigset_t tempsigset;],
496   nmh_cv_type_sigset_t=yes, nmh_cv_type_sigset_t=no)])
497 if test $nmh_cv_type_sigset_t = no; then
498   AC_DEFINE(sigset_t, unsigned int)
499 fi
500
501 dnl ----------------
502 dnl CHECK STRUCTURES
503 dnl ----------------
504 AC_STRUCT_ST_BLKSIZE
505
506 AC_CACHE_CHECK(for tm_gmtoff in struct tm, nmh_cv_struct_tm_gmtoff,
507 [AC_TRY_COMPILE(
508 [#ifdef TIME_WITH_SYS_TIME
509 # include <sys/time.h>
510 # include <time.h>
511 #else
512 # ifdef TM_IN_SYS_TIME
513 #  include <sys/time.h>
514 # else
515 #  include <time.h>
516 # endif
517 #endif],
518 [struct tm temptm; temptm.tm_gmtoff = 0;],
519   nmh_cv_struct_tm_gmtoff=yes, nmh_cv_struct_tm_gmtoff=no)])
520 if test $nmh_cv_struct_tm_gmtoff = yes; then
521   AC_DEFINE(HAVE_TM_GMTOFF)
522 fi
523
524 dnl -------------
525 dnl CHECK SIGNALS
526 dnl -------------
527 dnl What style of signal do you have (POSIX, BSD, or SYSV)?
528 AC_MSG_CHECKING(what style of signals to use)
529 if test $ac_cv_func_sigaction = yes -a $ac_cv_func_sigprocmask = yes; then
530   signals_style=POSIX_SIGNALS
531   AC_DEFINE(POSIX_SIGNALS)
532   AC_DEFINE(RELIABLE_SIGNALS)
533 elif test $ac_cv_func_sigblock = yes -a $ac_cv_func_sigsetmask = yes; then
534   signals_style=BSD_SIGNALS
535   AC_DEFINE(BSD_SIGNALS)
536   AC_DEFINE(RELIABLE_SIGNALS)
537 elif test $ac_cv_func_sighold = yes -a $ac_cv_func_sigrelse = yes; then
538   signals_style=SYSV_SIGNALS
539   AC_DEFINE(SYSV_SIGNALS)
540 else
541   signals_style=NO_SIGNAL_BLOCKING
542   AC_DEFINE(NO_SIGNAL_BLOCKING)
543 fi
544
545 AC_MSG_RESULT($signals_style)
546
547 dnl Where is <signal.h> located?  Needed as input for signames.awk
548 AC_CACHE_CHECK(where signal.h is located, nmh_cv_path_signal_h,
549 [for SIGNAL_H in /usr/include/bsd/sys/signal.h  dnl Next
550                  /usr/include/asm/signal.h      dnl Linux 1.3.0 and above
551                  /usr/include/asm/signum.h      dnl some versions of Linux/Alpha
552                  /usr/include/linux/signal.h    dnl Linux up to 1.2.11
553                  /usr/include/sys/signal.h      dnl Almost everybody else
554                  /dev/null;                     dnl Just in case we fall through
555 do
556   test -f $SIGNAL_H && \
557   grep '#[      ]*define[       ][      ]*SIG[0-9A-Z]*[         ]*[0-9][0-9]*' $SIGNAL_H > /dev/null && \
558   break
559 done
560 nmh_cv_path_signal_h=$SIGNAL_H
561 ])
562 SIGNAL_H=$nmh_cv_path_signal_h
563 AC_SUBST(SIGNAL_H)dnl
564
565 dnl ----------------
566 dnl OS SPECIFIC DEFINES
567 dnl ----------------
568 case "$target_os" in
569
570   solaris2*)
571     AC_DEFINE(SYS5)
572     AC_DEFINE(SVR4)
573     ;;
574   irix*)
575     AC_DEFINE(SYS5)
576     AC_DEFINE(SVR4)
577     ;;
578   osf*)
579     AC_DEFINE(SYS5)
580     AC_DEFINE(SVR4)
581     ;;
582   aix*)
583     AC_DEFINE(SYS5)
584     AC_DEFINE(SVR4)
585     ;;
586   sunos4*)
587     AC_DEFINE(BSD42)
588     ;;
589   freebsd*)  
590     AC_DEFINE(BSD42)
591     AC_DEFINE(BSD44)
592     ;;
593   netbsd*)
594     AC_DEFINE(BSD42)
595     AC_DEFINE(BSD44)
596     ;;
597   openbsd*)
598     AC_DEFINE(BSD42)
599     AC_DEFINE(BSD44)
600     ;;
601   bsd/os*)
602     AC_DEFINE(BSD42)
603     AC_DEFINE(BSD44)
604     ;;
605   sco5*)
606     AC_DEFINE(SYS5)
607     AC_DEFINE(SCO_5_STDIO)
608     ;;
609 esac
610
611
612 dnl ----------------
613 dnl OUTPUT MAKEFILES
614 dnl ----------------
615 AC_OUTPUT(Makefile config/Makefile h/Makefile sbr/Makefile uip/Makefile \
616           zotnet/Makefile zotnet/mts/Makefile zotnet/tws/Makefile \
617           zotnet/mf/Makefile zotnet/bboards/Makefile mts/Makefile \
618           mts/smtp/Makefile mts/sendmail/Makefile mts/mmdf/Makefile \
619           etc/Makefile man/Makefile, \
620           [test -z "$CONFIG_HEADERS" || echo > stamp-h])
621
622 eval "nmhbin=${bindir}";         eval "nmhbin2=${nmhbin}"
623 eval "nmhsysconf=${sysconfdir}"; eval "nmhsysconf2=${nmhsysconf}"
624 eval "nmhlib=${libdir}";         eval "nmhlib2=${nmhlib}"
625 eval "nmhman=${mandir}"
626
627 echo "
628 nmh configuration
629 -----------------
630 nmh version               : ${VERSION}
631 target os                 : ${target}
632 compiler                  : ${CC}
633 compiler flags            : ${CFLAGS}
634 linker flags              : ${LDFLAGS}
635 source code location      : ${srcdir}
636 binary install path       : ${nmhbin2}
637 libary install path       : ${nmhlib2}
638 config files install path : ${nmhsysconf2}
639 man page install path     : ${nmhman}
640 transport system          : ${MTS}
641 default editor            : ${editorpath}
642 default pager             : ${pagerpath}"
643 echo ""