* Small fix to SETUP DIRECTORY SERVERS screen, where Alpine would print
[alpine.git] / configure.ac
blob2418aaba68eb12aae0560e1b12711158a76d618e
1 dnl Process this file with autoconf to produce a configure script.
3 dnl /* ========================================================================
4 dnl  * Copyright 2013-2016 Eduardo Chappa
5 dnl  * Copyright 2006-2008 University of Washington
6 dnl  *
7 dnl  * Licensed under the Apache License, Version 2.0 (the "License");
8 dnl  * you may not use this file except in compliance with the License.
9 dnl  * You may obtain a copy of the License at
10 dnl  *
11 dnl  *     http://www.apache.org/licenses/LICENSE-2.0
12 dnl  *
13 dnl  * ========================================================================
14 dnl  */
16 AC_PREREQ([2.69])
18 AC_REVISION([Rev:18 by chappa@washington.edu])
20 dnl Alpine Version Number is in $srcdir/VERSION
21 AC_INIT([alpine],[m4_normalize(m4_include(VERSION))],[chappa@washington.edu])
23 AC_CONFIG_SRCDIR([include/system.h])
24 AC_CONFIG_HEADERS([include/config.h])
25 AC_CONFIG_MACRO_DIR([m4])
26 AM_INIT_AUTOMAKE([foreign nostdinc])
28 AM_MAINTAINER_MODE
30 AC_CANONICAL_HOST
32 AC_LANG(C)
34 AC_MSG_NOTICE([Configuring for $PACKAGE_STRING ($host))])
36 # start out with intent to build Web Alpine
37 WEB_BUILD=web/src/alpined.d
39 dnl CHECK PROGRAMS
41 AC_PROG_CC
42 AC_PROG_CC_STDC
43 AC_PROG_INSTALL
44 AC_PROG_MAKE_SET
45 AC_PROG_LN_S
46 AC_PROG_AWK
47 AC_PROG_RANLIB
48 LT_INIT
49 AC_SUBST([LIBTOOL_DEPS])
51 AC_PATH_PROG(AR, ar, ar)
52 AC_PATH_PROG(RM, rm, rm)
53 AC_PATH_PROG(CP, cp, cp)
54 AC_PATH_PROG(LN, ln, ln)
55 AC_PATH_PROG(LS, ls, ls)
56 AC_PATH_PROG(SED, sed, sed)
57 AC_PATH_PROG(MAKE, make)
59 dnl COMPILE-TIME OPTIONS
61 AM_GNU_GETTEXT_VERSION([0.16.1])
62 AM_GNU_GETTEXT([external])
64 dnl enable dmalloc per http://dmalloc.com
65 dnl NOTE: does not check c-client
66 AC_MSG_CHECKING([option: dmalloc enabled])
67 AC_ARG_ENABLE(dmalloc, AS_HELP_STRING([--enable-dmalloc],[Enable dmalloc debugging]))
68 if test x$enable_dmalloc = "xyes" ; then
69   AC_MSG_RESULT([yes])
70 else
71   AC_MSG_RESULT([no])
74 AC_ARG_WITH(dmalloc-dir,
75   AS_HELP_STRING([--with-dmalloc-dir=DIR],[Root of dmalloc lib/include path]),
76   [
77     if test "x$withval" != "xno" ; then
78       enable_dmalloc = "yes"
79       CPPFLAGS="$CPPFLAGS -I${withval}"
80       LDFLAGS="$LDFLAGS -L${withval}"
81     fi
82   ])
84 if test x$enable_dmalloc = "xyes" ; then
85   AC_DEFINE(ENABLE_DMALLOC, 1, [Define enable dmalloc debugging])
88 dnl set ps command, this test is fragile, but it should mostly work
89 ALPINE_psefcmd="/bin/ps auxww"
90 ALPINE_psfailed="0"
91 ALPINE_PSTEST="-"
92 AC_ARG_WITH(ps-cmd,
93   AS_HELP_STRING([--with-ps-cmd="CMD"],[Use this command to check running commands. Default: /bin/ps auxww]),
94   [
95     if test "x$withval" = "xno" -o "x$withval" = "xyes" -o "x$withval" = "x" ; then
96         withval=$ALPINE_psefcmd
97     fi
98     ALPINE_PSTEST=`$withval | $EGREP "$withval" | $EGREP -v $EGREP`
99     if test -n "$ALPINE_PSTEST" ; then
100        ALPINE_psefcmd="$withval"
101     else
102        ALPINE_psfailed="1"
103        if test "x$ALPINE_psefcmd" != "x$withval" ; then
104           AC_MSG_WARN(failed command $withval. Trying $ALPINE_psefcmd)
105        fi
106     fi
107   ])
108 if test "$ALPINE_psfailed" = "1" -o "$ALPINE_PSTEST" = "-" ; then
109    withval="$ALPINE_psefcmd"
110    ALPINE_PSTEST=`$withval | $EGREP "$withval" | $EGREP -v $EGREP`
111    if test -z "$ALPINE_PSTEST" ; then
112       ALPINE_psfailed="1"
113    else
114       ALPINE_psfailed="0"
115    fi
117 if test "$ALPINE_psfailed" = "0" ; then
118   AC_DEFINE_UNQUOTED([PSEFCMD], "$ALPINE_psefcmd", [ps command which outputs list of running commands])
121 dnl Set default locale dir.
122 case $host in
123     *apple-darwin*)
124       if test -d /opt/local ; then
125         localedir="/opt/local/share/locale"
126       else
127         localedir="\${datadir}/locale"
128       fi
129       ;;
130     *-*-cygwin)
131         localedir="/usr/share"
132       ;;
133     *)  
134       localedir="\${datadir}/locale"
135       ;;
136 esac
137 AC_ARG_WITH(localedir,
138   AS_HELP_STRING([--with-localedir=DIR],[Name of gettext locale directory]),
139   [
140     case $withval in
141       yes)
142         ;;
143       no)
144         ;;
145       *)
146         localedir=$withval
147         ;;
148     esac
149   ])
150 AC_SUBST(localedir, "[$localedir]")
152 # Setup OS-Specific features
153 case "$host" in
154   *darwin*)
155     dnl OS X Universal Binary Support
156     AC_ARG_ENABLE(osx-universal-binaries,
157       AS_HELP_STRING([--enable-osx-universal-binaries],[Produce universal binaries under OS X [[default=no]]]))
158     if test "x$enable_osx_universal_binaries" = "xyes" ; then
159       if test "x$enable_dependency_tracking" != xno ; then
160         AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
161 Please re-run configure with these options:
162     --disable-dependency-tracking --enable-osx-universal-binary])
163       fi
164       if [test -d /Developer/SDKs/MacOSX10.5.sdk] ; then
165         alpine_sysroot=/Developer/SDKs/MacOSX10.5.sdk
166       elif [test -d /Developer/SDKs/MacOSX10.4u.sdk] ; then
167         alpine_sysroot=/Developer/SDKs/MacOSX10.4u.sdk
168       else
169         AC_MSG_ERROR([No suitable MacOSX SDK found.  Make sure Xcode tools are installed])
170       fi
171       ub_cflags="-isysroot $alpine_sysroot -arch ppc -arch i386"
172       ub_ldflags="-Wl,-syslibroot,$alpine_sysroot -arch ppc -arch i386"
173       AM_CFLAGS="$AM_CFLAGS $ub_cflags"
174       AM_LDFLAGS="$AM_LDFLAGS $ub_ldflags"
175       alpine_c_client_cflags="$alpine_c_client_cflags $ub_cflags"
176       alpine_c_client_ldflags="$alpine_c_client_ldflags $ub_ldflags"
177     fi
178     ;;
179 esac
181 AC_ARG_WITH(include-path,
182   AS_HELP_STRING([--with-include-path=PATHS],[Colon-separated list of directories used for include file search]),
183   [
184     case $withval in
185       no)
186         ;;
187       yes)
188         ;;
189       *)
190         new_cppflags="-I`echo ${withval} | ${SED} 's/:/ -I/g'`"
191         CPPFLAGS="$CPPFLAGS ${new_cppflags}"
192         alpine_c_client_cflags="$alpine_c_client_cflags ${new_cppflags}"
193         ;;
194     esac
195   ])
197 AC_ARG_WITH(lib-path,
198   AS_HELP_STRING([--with-lib-path=PATHS],[Colon-separated list of directories used for library search]),
199   [
200     case $withval in
201       no)
202         ;;
203       yes)
204         ;;
205       *)
206         new_ldflags="-L`echo ${withval} | ${SED} 's/:/ -L/g'`"
207         LDFLAGS="$LDFLAGS $new_ldflags"
208         alpine_c_client_ldflags="$alpine_c_client_ldflags ${new_ldflags}"
209         ;;
210     esac
211   ])
213 AC_ARG_WITH(pubcookie,
214   AS_HELP_STRING([--with-pubcookie],[Include support for UW-Pubcookie Web Authentication]),
215   [
216     if test "x$withval" != "xno" ; then
217       WEB_PUBCOOKIE_BUILD=web/src/pubcookie
218     fi
219   ])
222 AC_ARG_WITH(web-bin,
223   AS_HELP_STRING([--with-web-bin=PATH],[Directory to hold Web Alpine component binary files]),
224   [
225     case "$withval" in
226       no)
227         ;;
228       yes)
229         ;;
230       *)
231         WEB_BINDIR=$withval
232         ;;
233     esac
234   ])
236 dnl disable debug, turned on by default
237 AC_MSG_CHECKING([option: debugging is enabled])
238 AC_ARG_ENABLE(debug, AS_HELP_STRING([--disable-debug],[Exclude debug messages from source]))
239 if test x$enable_debug != "xno" ; then
240   AM_CFLAGS="$AM_CFLAGS -g"
241   AC_DEFINE([DEBUG], [1], [Compile in debugging])
242   AC_DEFINE([DEBUGJOURNAL], [1], [Display debug messages in journal])
243   AC_MSG_RESULT([yes])
244 else
245 dnl ??? set AM_CFLAGS to optimize ???
246   AC_MSG_RESULT([no])
249 dnl disable optimization, on by default
250 AC_MSG_CHECKING([option: optimization is enabled])
251 AC_ARG_ENABLE(optimization, AS_HELP_STRING([--disable-optimization],[Exclude optimizing compiler flags]))
252 if test x$enable_optimization != "xno" ; then
253   AC_MSG_RESULT([yes])
254 else
255   CFLAGS="`echo $AM_CFLAGS | ${SED} 's/-O2//'`"
256   alpine_c_client_gccoptlevel="-O0"
257   AC_MSG_RESULT([no])
260 dnl disable mouse support
261 AC_MSG_CHECKING([option: mouse support enabled])
262 AC_ARG_ENABLE(mouse, AS_HELP_STRING([--disable-mouse],[Disable mouse support]))
263 if test x$enable_mouse != "xno" ; then
264   AC_DEFINE([MOUSE], [], [Compile in mouse support])
265   AC_MSG_RESULT([yes])
266 else
267    AC_MSG_RESULT([no])
270 dnl enable quotas
271 AC_MSG_CHECKING([option: quotas enabled])
272 AC_ARG_ENABLE(quotas, AS_HELP_STRING([--enable-quotas],[Enable disk quota checking on startup]))
273 if test x$enable_quotas = "xyes" ; then
274   AC_DEFINE([USE_QUOTAS], [], [Compile in quota check on startup])
275   AC_MSG_RESULT([yes])
276 else
277    AC_MSG_RESULT([no])
280 AC_MSG_CHECKING([option: From changing enabled])
281 AC_ARG_ENABLE(from_changing, AS_HELP_STRING([--disable-from-changing],[Disallow users changing From addresss]))
282 if test x$enable_from_changing != "xno" ; then
283   AC_MSG_RESULT([yes])
284 else
285   AC_DEFINE([NEVER_ALLOW_CHANGING_FROM], [], [Disallow users changing their From address])
286   AC_MSG_RESULT([no])
289 dnl enable background posting support
290 AC_MSG_CHECKING([option: background post enabled])
291 AC_ARG_ENABLE(background-post, AS_HELP_STRING([--disable-background-post],[Disable background posting]))
292 if test x$enable_background_post != "xno" ; then
293   AC_DEFINE([BACKGROUND_POST], [], [Enable background posting support])
294   AC_MSG_RESULT([yes])
295 else
296     AC_MSG_RESULT([no])
299 dnl enable keyboard locking support
300 AC_MSG_CHECKING([option: keyboard lock enabled])
301 AC_ARG_ENABLE(keyboard-lock, AS_HELP_STRING([--disable-keyboard-lock],[Disable keyboard locking]))
302 if test x$enable_keyboard_lock != "xno" ; then
303   AC_DEFINE([KEYBOARD_LOCK], [], [Enable keyboard lock support])
304   AC_MSG_RESULT([yes])
305 else
306   AC_MSG_RESULT([no])
309 dnl enable from encoding support
310 AC_MSG_CHECKING([option: from encoding enabled])
311 AC_ARG_ENABLE(from-encoding, AS_HELP_STRING([--enable-from-encoding],[Enable From encoding in sent messages]))
312 if test x$enable_from_encoding = "xyes" ; then
313   AC_DEFINE([ENCODE_FROMS], [], [Enable From address encoding in sent messages])
314   AC_MSG_RESULT([yes])
315 else
316   AC_MSG_RESULT([no])
319 dnl OPTION: name of local submission agent
320 dnl         Might not be sendmail, but it MUST speak SMTP on stdin/stdout
321 AC_ARG_WITH(smtp-msa,
322   AS_HELP_STRING([--with-smtp-msa=PATH],[Local Mail Submission Agent (sendmail)]),
323     [
324       case "$withval" in
325         no)
326           ;;
327         yes)
328           AC_PATH_PROG(SENDMAIL, sendmail, "", $PATH:/usr/sbin:/usr/lib)
329           ;;
330         *)
331           SENDMAIL=$withval
332           ;;
333       esac
334     ],
335     [
336           AC_PATH_PROG(SENDMAIL, sendmail, "", $PATH:/usr/sbin:/usr/lib)
337     ])
338 if test -n "$SENDMAIL" ; then
339     AC_DEFINE_UNQUOTED([SENDMAIL], "$SENDMAIL", [Local mail submission agent])
342 dnl OPTION: local msa arguments
343 smtp_msa_flags="-bs -odb -oem"
344 AC_ARG_WITH(smtp-msa-flags,
345   AS_HELP_STRING([--with-smtp-msa-flags=FLAGS],[MSA flags for SMTP on stdin/stdout (-bs -odb -oem)]),
346   [
347     if test "x$withval" != "xno" ; then
348       smtp_msa_flags=$withval
349     fi
350   ])
351 AC_DEFINE_UNQUOTED([SENDMAILFLAGS], "$smtp_msa_flags", [Local MSA flags for SMTP on stdin/stdout])
353 dnl OPTION: name of local news posting agent and flags
354 npa="inews"
355 AC_ARG_WITH(npa,
356   AS_HELP_STRING([--with-npa=PATH],[Posting agent when no nntp-servers defined (inews)]),
357     [
358       case "$withval" in
359         no)
360           ;;
361         yes)
362           AC_PATH_PROG(NPA_PROG, inews, "", $PATH:/usr/sbin:/usr/lib)
363           ;;
364         *)
365           NPA_PROG=$withval
366           ;;
367       esac
368     ],
369     [
370           AC_PATH_PROG(NPA_PROG, inews, "", $PATH:/usr/sbin:/usr/lib)
371     ])
373 npa_flags="-h"
374 AC_ARG_WITH(npa-flags,
375   AS_HELP_STRING([--with-npa-flags=FLAGS],[Flags to allow posting via local agent (-h)]),
376   [
377     if test "x$withval" != "xno" ; then
378       npa_flags=$withval
379     fi
380   ])
381 if test -n "$NPA_PROG" ; then
382   AC_DEFINE_UNQUOTED([SENDNEWS], "$NPA_PROG $npa_flags", [Posting agent to use when no nntp-servers defined])
385 dnl OPTION: password changing program
386 AC_ARG_WITH(password-prog,
387   AS_HELP_STRING([--with-password-prog=PATH],[Password change program (/bin/passwd)]),
388     [
389       case "$withval" in
390         no)
391           ;;
392         yes)
393           AC_PATH_PROG(PWPROG, passwd, "", $PATH:/usr/sbin:/usr/lib)
394           ;;
395         *)
396           AC_PATH_PROG(PWPROG, $withval, "", $PATH:/usr/sbin:/usr/lib)
397           ;;
398       esac
399     ],
400     [
401           AC_PATH_PROG(PWPROG, passwd, "", $PATH:/usr/sbin:/usr/lib)
402     ])
403 if test -n "$PWPROG" ; then
404     AC_DEFINE_UNQUOTED([PASSWD_PROG], "$PWPROG", [Program users use to change their password])
407 dnl OPTION: basic spell checking program
408 AC_ARG_WITH(simple-spellcheck,
409   AS_HELP_STRING([--with-simple-spellcheck=PROG],[Spellcheck program reads stdin, emits misspellings on stdout]),
410     [
411       if test "x$withval" != "xno" ; then
412         SPELLPROG=$withval
413       fi
414     ],
415     [
416       AC_CHECK_PROG([SPELLPROG], [hunspell], [hunspell], [])
417       if test -z "$SPELLPROG" ; then
418         AC_CHECK_PROG([SPELLPROG], [aspell], [aspell], [])
419         if test -z "$SPELLPROG" ; then
420           AC_CHECK_PROG([SPELLPROG], [ispell], [ispell], [])
421           if test -z "$SPELLPROG" ; then
422            SPELLPROG="spell"
423           fi
424         fi
425       fi
426     ])
428 if test "x$SPELLPROG" != "xno" ; then
429   AC_PATH_PROG(alpine_simple_spellcheck, $SPELLPROG)
430   if test -n "$alpine_simple_spellcheck" ; then
431     case "$SPELLPROG" in
432       hunspell)
433         alpine_simple_spellcheck="$alpine_simple_spellcheck -l"
434         ;;
435       aspell)
436         alpine_simple_spellcheck="$alpine_simple_spellcheck --dont-backup --mode=email list"
437         ;;
438       ispell)
439         alpine_simple_spellcheck="$alpine_simple_spellcheck -l"
440         ;;
441       *)
442         ;;
443     esac
444   fi
447 dnl OPTION: interactive spell checking program
448 AC_ARG_WITH(interactive-spellcheck,
449   AS_HELP_STRING([--with-interactive-spellcheck=PROG],[Interactive, filewise spell checker]),
450     [
451       if test "x$withval" != "xno" ; then
452         ISPELLPROG=$withval
453       fi
454     ],
455     [
456       AC_CHECK_PROG([ISPELLPROG], [hunspell], [hunspell], [])
457       if test -z "$ISPELLPROG" ; then
458         AC_CHECK_PROG([ISPELLPROG], [aspell], [aspell], [])
459         if test -z "$SPELLPROG" ; then
460           ISPELLPROG="ispell"
461         fi
462       fi
463     ])
465 if test "x$ISPELLPROG" != "xno" ; then
466   AC_PATH_PROG(alpine_interactive_spellcheck, $ISPELLPROG)
467   if test -n "$alpine_interactive_spellcheck" ; then
468     case "$ISPELLPROG" in
469       aspell)
470         alpine_interactive_spellcheck="$alpine_interactive_spellcheck --dont-backup --mode=email check"
471         ;;
472       *)
473         ;;
474     esac
475   fi
478 if test -n "$alpine_interactive_spellcheck" ; then
479     AC_DEFINE_UNQUOTED([DF_VAR_SPELLER], "$alpine_interactive_spellcheck", [Interactive, filewise spell checker])
482 if test -z "$alpine_simple_spellcheck" -a -n "$alpine_interactive_spellcheck" ; then
483   alpine_simple_spellcheck=test
485 AC_DEFINE_UNQUOTED([SPELLER], "$alpine_simple_spellcheck", [Simple spell checker: reads stdin, emits misspellings on stdout])
487 dnl OPTION: system-pinerc
488 dnl NOTE: historically we used /lib for the config dir.
489 dnl       don't ask, it was a long time ago. but, we can't
490 dnl       change it now without breaking compatibility
491 case "$prefix" in
492   NONE) dpv=/usr/local/lib/pine.conf ;;
493   *) dpv=${prefix}/lib/pine.conf ;;
494 esac
495 AC_ARG_WITH(system-pinerc,
496   AS_HELP_STRING([--with-system-pinerc=VALUE],[System pinerc (/usr/local/lib/pine.conf)]),
497     [
498       case "$withval" in
499         no)
500           ;;
501         yes)
502           ;;
503         *)
504           dpv=$withval
505           ;;
506       esac
507     ])
508 AC_DEFINE_UNQUOTED(SYSTEM_PINERC, "$dpv", [System pinerc])
510 dnl OPTION: system-fixed-pinerc
511 dnl NOTE: historically we used /lib for the config dir.
512 dnl       don't ask, it was a long time ago. but, we can't
513 dnl       change it now without breaking compatibility
514 case "$prefix" in
515   NONE) dpv=/usr/local/lib/pine.conf.fixed ;;
516   *) dpv=${prefix}/lib/pine.conf.fixed ;;
517 esac
518 AC_ARG_WITH(system-fixed-pinerc,
519   AS_HELP_STRING([--with-system-fixed-pinerc=VALUE],[System fixed pinerc (/usr/local/lib/pine.conf.fixed)]),
520     [
521       case "$withval" in
522         no)
523           ;;
524         yes)
525           ;;
526         *)
527           dpv=$withval
528           ;;
529       esac
530     ])
531 AC_DEFINE_UNQUOTED(SYSTEM_PINERC_FIXED, "$dpv", [System fixed pinerc])
533 dnl OPTION: local support information, file that contains information on
534 dnl         how to contact local support for Alpine.
535 dnl NOTE: historically we used /lib for the config dir.
536 dnl       don't ask, it was a long time ago. but, we can't
537 dnl       change it now without breaking compatibility
538 case "$prefix" in
539   NONE) dpv=/usr/local/lib/pine.info ;;
540   *) dpv=${prefix}/lib/pine.info ;;
541 esac
542 AC_ARG_WITH(local-support-info,
543   AS_HELP_STRING([--with-local-support-info=VALUE],[Local Support Info File (/usr/local/lib/pine.info)]),
544     [
545       case "$withval" in
546         no)
547           ;;
548         yes)
549           ;;
550         *)
551           dpv=$withval
552           ;;
553       esac
554     ])
555 AC_DEFINE_UNQUOTED(SYSTEM_PINE_INFO_PATH, "$dpv", [Local Support Info File])
557 dnl Function to simplify setting alpine/pico defaults
558 dnl usage: PINEVAR(configure-name, definition-name, definition-value, help)
559 AC_DEFUN([PINEVAR],
560   [
561     dpv=$3
562     AC_ARG_WITH($1,
563       AS_HELP_STRING([--with-$1=VALUE],[$4 ($3)]),
564       [
565         if test "x$withval" != "xno" ; then
566           dpv=$withval
567         fi
568       ])
569     AC_DEFINE_UNQUOTED($2, "$dpv", [Default configuration value])
570   ])
572 dnl Function to simplify setting pine/pico defaults
573 dnl usage: PINEVAR_UNQUOTED(configure-name, definition-name, definition-value, help)
574 AC_DEFUN([PINEVAR_UNQUOTED],
575   [
576     dpv=$3
577     AC_ARG_WITH($1,
578       AS_HELP_STRING([--with-$1=VALUE],[$4 ($3)]),
579       [
580         if test "x$withval" != "xno" ; then
581           dpv=$withval
582         fi
583       ])
584     AC_DEFINE_UNQUOTED($2, $dpv, [Default configuration value])
585   ])
587 PINEVAR(mailcheck-interval, DF_MAILCHECK, 150, [Specify default mail-check-interval])
588 PINEVAR_UNQUOTED(checkpoint-interval, CHECK_POINT_TIME, 420, [Specify default checkpoint-interval])
589 PINEVAR_UNQUOTED(checkpoint-frequency, CHECK_POINT_FREQ, 12, [State change count before checkpoint])
590 PINEVAR_UNQUOTED(display-rows, DEFAULT_LINES_ON_TERMINAL, 24, [Initial rows on display])
591 PINEVAR_UNQUOTED(display-columns, DEFAULT_COLUMNS_ON_TERMINAL, 80, [Initial columns on display])
592 PINEVAR_UNQUOTED(max-display-rows, MAX_SCREEN_ROWS, 200, [Maximum display rows])
593 PINEVAR_UNQUOTED(max-display-columns, MAX_SCREEN_COLS, 500, [Maximum display columns])
594 PINEVAR(fill-column, DF_FILLCOL, 74, [Default fill column])
595 PINEVAR_UNQUOTED(max_fill-column, MAX_FILLCOL, 80, [Maximum fill column])
596 PINEVAR_UNQUOTED(debug-level, DEFAULT_DEBUG, 2, [Specify default debug verbosity level])
597 PINEVAR_UNQUOTED(debug-files, NUMDEBUGFILES, 4, [Specify number of debug files])
598 PINEVAR(debug-file, DEBUGFILE, [.pine-debug], [Specify debug file name])
599 PINEVAR(forwarded-keyword, FORWARDED_FLAG, ["\$Forwarded"], [IMAP (c-client) keyword to store forwarded status])
600 PINEVAR(display-overlap, DF_OVERLAP, [2], [Lines preserved while paging])
601 PINEVAR(display-margin, DF_MARGIN, [0], [Lines visible while scrolling])
602 PINEVAR(default-fcc, DF_DEFAULT_FCC, [sent-mail], [Default sent mail folder])
603 PINEVAR(default-save-folder, DEFAULT_SAVE, [saved-messages], [Default save folder])
604 PINEVAR(default-legacy-postponed-folder, POSTPONED_MAIL, [postponed-mail], [Pre Pine 3.90 postponed folder])
605 PINEVAR(default-postponed-folder, POSTPONED_MSGS, [postponed-msgs], [Default postponed folder])
606 PINEVAR(default-trash-folder, TRASH_FOLDER, [Trash], [Default Trash folder for Web Alpine])
607 PINEVAR(default-interrupted-mail, INTERRUPTED_MAIL, [.pine-interrupted-mail], [Default folder for interrupted mail])
608 PINEVAR(default-dead-letter-folder, DEADLETTER, [dead.letter], [Default dead letter folder])
609 PINEVAR(default-mail-directory, DF_MAIL_DIRECTORY, [mail], [Default mail directory])
610 PINEVAR(default-inbox-name, INBOX_NAME, [INBOX], [Default inbox name])
611 PINEVAR(default-signature-file, DF_SIGNATURE_FILE, [.signature], [Default signature file])
612 PINEVAR(default-elm-style-save, DF_ELM_STYLE_SAVE, [no], [Default to Elm style save])
613 PINEVAR(default-header-in-reply, DF_HEADER_IN_REPLY, [no], [Include header in reply])
614 PINEVAR(default-old-style-reply, DF_OLD_STYLE_REPLY, [no], [Default to old style reply])
615 PINEVAR(default-use-only-domain-name, DF_USE_ONLY_DOMAIN_NAME, [no], [Default to using only the domain name])
616 PINEVAR(default-save-by-sender, DF_SAVE_BY_SENDER, [no], [Default to save by sender])
617 PINEVAR(default-sort-key, DF_SORT_KEY, [arrival], [Default sort key])
618 PINEVAR(default-addressbook-sort-rule, DF_AB_SORT_RULE, [fullname-with-lists-last], [Default addressbook sort rule])
619 PINEVAR(default-folder-sort-rule, DF_FLD_SORT_RULE, [alphabetical], [Default folder sort rule])
620 PINEVAR(default-saved-message-name-rule, DF_SAVED_MSG_NAME_RULE, [default-folder], [Default saved message name rule])
621 PINEVAR(default-fcc-rule, DF_FCC_RULE, [default-fcc], [Default fcc rule])
622 PINEVAR(default-standard-printer, DF_STANDARD_PRINTER, [lpr], [Default standard printern])
623 PINEVAR(default-ansi-printer, ANSI_PRINTER, [attached-to-ansi], [ANSI printer definition])
624 PINEVAR(default-addressbook, DF_ADDRESSBOOK, [.addressbook], [Default addressbook name])
625 PINEVAR(default-local-fullname, DF_LOCAL_FULLNAME, ["Local Support"], [Default local support fullname])
626 PINEVAR(default-local-address, DF_LOCAL_ADDRESS, [postmaster], [Default local support address])
627 PINEVAR(default-keyboard-lock-count, DF_KBLOCK_PASSWD_COUNT, [1], [Default keyboard lock count])
628 PINEVAR(default-remote-addressbook-history, DF_REMOTE_ABOOK_HISTORY, [3], [Default address book history count])
629 PINEVAR(smime-public-cert-directory, DF_PUBLICCERT_DIR, [.alpine-smime/public], [Default Public Cert Directory])
630 PINEVAR(smime-private-key-directory, DF_PRIVATEKEY_DIR, [.alpine-smime/private], [Default Private Key Directory])
631 PINEVAR(smime-cacert-directory, DF_CACERT_DIR, [.alpine-smime/ca], [Default Cert Authority Directory])
632 PINEVAR_UNQUOTED(default-printer, DF_DEFAULT_PRINTER, [ANSI_PRINTER], [Default printer])
634 AC_DEFINE_UNQUOTED([DF_PUBLIC_CONTAINER], "PublicContainer", [Name of default public container])
635 AC_DEFINE_UNQUOTED([DF_PRIVATE_CONTAINER], "PrivateContainer", [Name of default private container])
636 AC_DEFINE_UNQUOTED([DF_CA_CONTAINER], "CAContainer", [Name of default certificate authority container])
638 dnl set PASSFILE?
639 AC_ARG_WITH(passfile,
640   AS_HELP_STRING([--with-passfile=FILENAME],[Password cache file (recommended when S/MIME is enabled and configured)]),
641     [
642       case "$withval" in
643         no)
644           ;;
645         yes)
646           ;;
647         *)
648           alpine_PASSFILE=$withval
649           ;;
650       esac
651     ])
654 dnl os-specific credential cache?
655 AC_ARG_WITH(local-password-cache,
656  AS_HELP_STRING([--without-local-password-cache],[Disable OS-specific password cache, if supported]),
657    [
658      alpine_os_credential_cache=$withval
659    ])
661 dnl Particular os-specific credential cache?
662 AC_ARG_WITH(local-password-cache-method,
663  AS_HELP_STRING([--with-local-password-cache-method],[OS-specific credential cache (OSX=APPLEKEYCHAIN, Windows=WINCRED)]),
664    [
665      alpine_os_credential_cache_method=$withval
666    ])
668 if test -n "$alpine_PASSFILE" ; then
669   case $alpine_os_credential_cache in
670     no)
671       ;;
672     *)
673       alpine_os_credential_cache="no"
674       AC_MSG_NOTICE([--with-passfile definition overrides OS-Specific password caching])
675       ;;
676   esac
677   AC_DEFINE_UNQUOTED([PASSFILE], "$alpine_PASSFILE", [Password cache file (recommended if S/MIME is enabled and configured)])
680 dnl set DF_SSHPATH?
681 AC_ARG_WITH(default-sshpath,
682   AS_HELP_STRING([--with-default-sshpath=FILENAME],[set default value of ssh command path (defining should cause ssh to be preferred to rsh)]),
683     [
684       case "$withval" in
685         no)
686           ;;
687         yes)
688           ;;
689         *)
690           AC_DEFINE_UNQUOTED([DF_SSHPATH], "$withval", [set default value of ssh command path (defining should cause ssh to be preferred to rsh)])
691           ;;
692       esac
693     ])
695 dnl set DF_SSHCMD?
696 AC_ARG_WITH(default-sshcmd,
697   AS_HELP_STRING([--with-default-sshcmd=PERCENT_S_STRING],[set default value of ssh command string (usually "%s %s -l %s exec /etc/r%sd")]),
698     [
699       case "$withval" in
700         no)
701           ;;
702         yes)
703           ;;
704         *)
705           AC_DEFINE_UNQUOTED([DF_SSHCMD], "$withval", [set default value of ssh command string (usually "%s %s -l %s exec /etc/r%sd")])
706           ;;
707       esac
708     ])
710 dnl Include SSL?
711 dnl Set SSLDIR for c-client make
712 AC_ARG_WITH(ssl,
713   AS_HELP_STRING([--without-ssl],[Disable SSL support (OpenSSL)]),
714   [ with_ssl=$withval ])
716 if test "x$with_ssl" = "xno" ; then
717   alpine_SSLTYPE="none"
718 elif test -d /usr/local/ssl ; then
719 dnl When the system has openssl installed in its default location
720 dnl instead of the one used by the distribution assume that this
721 dnl is the one intended to be used.
722   alpine_SSLDIR="/usr/local/ssl"
723   alpine_SSLINCLUDE="$alpine_SSLDIR/include" 
724   alpine_SSLLIB="$alpine_SSLDIR/lib"
725 else
726   dnl preload c-client default locations/options
727   case $host in
728     *-linux-gnu*|*-k*bsd*-gnu*|*-gnu*)
729       if test -f /etc/fedora-release -o -f /etc/redhat-release -o -f /etc/redhat_version ; then  
730         alpine_SSLTYPE="nopwd"
731         if test -d /etc/pki/tls ; then  
732           alpine_SSLDIR="/etc/pki/tls"
733         else
734           alpine_SSLDIR="/usr/share/ssl"
735         fi
736         alpine_SSLCERTS="$alpine_SSLDIR/certs"
737         alpine_SSLKEYS="$alpine_SSLDIR/private"
738         alpine_SSLINCLUDE="/usr/include/openssl" 
739         alpine_SSLLIB="/usr/lib"
740       elif test -f /etc/mandrake-release ; then
741         alpine_SSLDIR="/usr/lib/ssl"
742         alpine_SSLCERTS="$alpine_SSLDIR/certs" 
743         alpine_SSLKEYS="$alpine_SSLDIR/private"
744         alpine_SSLINCLUDE="/usr/include/openssl" 
745         alpine_SSLLIB="/usr/lib"
746       elif test -f /etc/SuSE-release ; then
747         alpine_SSLTYPE="nopwd"
748         alpine_SSLDIR="/etc/ssl"
749         alpine_SSLCERTS="$alpine_SSLDIR/certs"
750         alpine_SSLKEYS="$alpine_SSLDIR/private"
751         alpine_SSLINCLUDE="/usr/include/openssl" 
752         alpine_SSLLIB="/usr/lib"
753       elif test -d /etc/osso-af-init ; then
754         alpine_SSLTYPE="nopwd"
755         alpine_SSLDIR="/usr"
756         alpine_SSLCERTS="/usr/share/certs"
757         alpine_SSLINCLUDE="/usr/include/openssl"
758         alpine_SSLLIB="/usr/lib"
759       elif test -f /etc/debian_release -o -f /etc/debian_version ; then
760         if test ! -d /etc/osso-af-init ; then
761            alpine_SSLDIR="/etc/ssl"
762            alpine_SSLCERTS="$alpine_SSLDIR/certs"
763            alpine_SSLKEYS="$alpine_SSLDIR/private"
764            alpine_SSLINCLUDE="/usr/include/openssl" 
765            alpine_SSLLIB="/usr/lib"
766         fi
767       else
768         alpine_SSLTYPE="nopwd"
769         alpine_SSLDIR="/usr"
770         alpine_SSLCERTS="/etc/ssl/certs"
771       fi
772       ;;
773     *-apple-darwin*)
774       alpine_SSLTYPE="nopwd"
775 dnl Originally this is where certs are, and they might still be there, even
776 dnl after installing Homebrew, MacPorts or Fink. We will use it if we cannot
777 dnl find it anywhere else.
778       alpine_SSLCERTS_ORIG="/System/Library/OpenSSL/certs"
779       if test -d /usr/local/opt/openssl ; then
780         alpine_SSLDIR="/usr/local/opt/openssl"
781         alpine_SSLINCLUDE="$alpine_SSLDIR/include"
782         alpine_SSLLIB="$alpine_SSLDIR/lib"
783         alpine_SSLCERTS="/usr/local/etc/openssl"
784         alpine_SSLKEYS="$alpine_SSLDIR/private"
785       elif test -d /opt/local/etc/openssl ; then
786         alpine_SSLDIR="/opt/local"
787         alpine_SSLINCLUDE="$alpine_SSLDIR/include"
788         alpine_SSLLIB="$alpine_SSLDIR/lib"
789         alpine_SSLCERTS="/opt/local/etc/openssl/certs"
790         alpine_SSLKEYS="/opt/local/etc/openssl/private"
791       elif test -d /sw/etc/ssl ; then
792         alpine_SSLDIR="/sw/etc/ssl"
793         alpine_SSLINCLUDE="/sw/include"
794         alpine_SSLLIB="/sw/lib"
795         alpine_SSLCERTS="/sw/etc/ssl/certs"
796         alpine_SSLKEYS="/sw/etc/ssl/private"
797       elif test -d /usr/local/ssl ; then
798         alpine_SSLDIR="/usr/local/ssl"
799       elif test -d /System/Library/OpenSSL ; then
800         alpine_SSLDIR="/System/Library/OpenSSL"
801         alpine_SSLCERTS="$alpine_SSLDIR/certs"
802         alpine_SSLKEYS="$alpine_SSLDIR/private"
803         alpine_SSLLIB="/usr/lib"
804         alpine_SSLINCLUDE="/usr/include/openssl"
805       fi
806       ;;
807     *-*-netbsd*)
808         alpine_SSLDIR="/etc/openssl"
809         alpine_SSLCERTS="$alpine_SSLDIR/certs"
810         alpine_SSLKEYS="$alpine_SSLDIR/private"
811         alpine_SSLINCLUDE="/usr/include/openssl"
812         alpine_SSLLIB="/usr/lib"
813       ;;
814     *-*-dragonfly*)
815         alpine_SSLDIR="/etc/openssl"
816         alpine_SSLCERTS="$alpine_SSLDIR/certs"
817         alpine_SSLKEYS="$alpine_SSLDIR/private"
818         alpine_SSLINCLUDE="/usr/include/openssl"
819         alpine_SSLLIB="/usr/lib"
820       ;;
821     *-openbsd*)
822         alpine_SSLTYPE="nopwd"
823         alpine_SSLDIR="/usr"
824         alpine_SSLCERTS="/etc/ssl/certs"
825       ;;
826     *-*-freebsd*)
827         alpine_SSLDIR="/etc/ssl"
828         alpine_SSLCERTS="$alpine_SSLDIR/certs"
829         alpine_SSLKEYS="$alpine_SSLDIR/private"
830         if test -d /usr/local/include/openssl ; then
831           alpine_SSLINCLUDE="/usr/local/include/openssl" 
832           alpine_SSLLIB="/usr/local/lib"
833         else
834           alpine_SSLINCLUDE="/usr/include/openssl" 
835           alpine_SSLLIB="/usr/lib"
836         fi
837       ;;
838     *-*-openbsd*)
839         alpine_SSLDIR="/etc/ssl"
840         alpine_SSLINCLUDE="/usr/include/openssl"
841         alpine_SSLLIB="/usr/lib"
842         alpine_SSLCERTS="/etc/ssl" 
843         alpine_SSLKEYS="/etc/ssl/private"
844       ;;
845     *-*-cygwin)
846         alpine_SSLDIR="/usr/ssl"
847         alpine_SSLCERTS="$alpine_SSLDIR/certs" 
848         alpine_SSLKEYS="$alpine_SSLDIR/certs"
849         alpine_SSLINCLUDE="/usr/include/openssl" 
850         alpine_SSLLIB="/usr/lib"
851       ;;
852     *-sco-sysv* | *-sysv*UnixWare | *-sysv*OpenUNIX)
853         alpine_SSLTYPE="sco.nopwd"
854         alpine_SSLDIR="/usr/local/ssl"
855       ;;
856     *-*-solaris*)
857       if test -d /usr/sfw/include/openssl ; then
858         alpine_SSLDIR="/usr/sfw"
859       elif test -d /opt/csw/include/openssl ; then
860         alpine_SSLDIR="/opt/csw"
861         if test -d /opt/csw/ssl/certs ; then
862           alpine_SSLCERTS="/opt/csw/ssl/certs"
863         fi
864       fi
865       if test -z "$alpine_SSLCERTS" -a -d /etc/certs ; then
866         alpine_SSLCERTS="/etc/certs"
867       fi
868       ;;
869     *)
870       alpine_SSLTYPE="nopwd"
871       alpine_SSLDIR="/usr/local/ssl"
872       ;;
873   esac
876 if test "x$alpine_SSLTYPE" != "xnone" ; then
877   AC_ARG_WITH(ssl-dir,
878     AS_HELP_STRING([--with-ssl-dir=DIR],[Root of SSL lib/include path]),
879     [
880       if test "x$withval" != "xno" ; then
881         alpine_SSLDIR=$withval
882         alpine_SSLINCLUDE=$alpine_SSLDIR/include
883         alpine_SSLLIB=$alpine_SSLDIR/lib
884       fi
885     ])
887   AC_ARG_WITH(ssl-certs-dir,
888     AS_HELP_STRING([--with-ssl-certs-dir=DIR],[Path to SSL certificate directory]),
889     [
890       if test "x$withval" != "xno" ; then
891         alpine_SSLCERTS=$withval
892       fi
893     ])
895   AC_ARG_WITH(ssl-include-dir,
896     AS_HELP_STRING([--with-ssl-include-dir=DIR],[SSL include file path]),
897     [
898       if test "x$withval" != "xno" ; then
899         alpine_SSLINCLUDE=$withval
900       fi
901     ])
903   AC_ARG_WITH(ssl-lib-dir,
904     AS_HELP_STRING([--with-ssl-lib-dir=DIR],[SSL library path]),
905     [
906       if test "x$withval" != "xno" ; then
907         alpine_SSLLIB=$withval
908       fi
909     ])
911   dnl setup globals so tests below work
912   if test -n "$alpine_SSLINCLUDE" ; then
913     CPPFLAGS="-I$alpine_SSLINCLUDE $CPPFLAGS"
914   elif test -n "$alpine_SSLDIR" ; then
915     CPPFLAGS="-I${alpine_SSLDIR}/include $CPPFLAGS"
916   fi
917   if test -n "$alpine_SSLLIB" ; then
918     LDFLAGS="-L$alpine_SSLLIB $LDFLAGS"
919   elif test -n "$alpine_SSLDIR" ; then
920     LDFLAGS="-L${alpine_SSLDIR}/lib $LDFLAGS"
921   fi
925 dnl Include Kerberos?
926 dnl Set GSSDIR for c-client make
927 AC_ARG_WITH(krb5,
928   AS_HELP_STRING([--without-krb5],[Disable Kerberos support]),
929   [ with_krb5=$withval ])
931 if test "x$with_krb5" = "xno" ; then
932   alpine_GSSTYPE="none"
933 else
934   alpine_GSSTYPE=
936   AC_ARG_WITH(krb5-dir,
937     AS_HELP_STRING([--with-krb5-dir=DIR],[Root of Kerberos lib/include path]),
938     [
939       if test "x$withval" != "xno" ; then
940         CPPFLAGS="$CPPFLAGS -I${withval}/include"
941         LDFLAGS="$LDFLAGS -L${withval}/lib"
942       fi
943     ])
945   AC_ARG_WITH(krb5-include-dir,
946     AS_HELP_STRING([--with-krb5-include-dir=DIR],[Kerberos include file path]),
947     [
948       if test "x$withval" != "xno" ; then
949         CPPFLAGS="$CPPFLAGS -I$withval"
950       fi
951     ])
953   AC_ARG_WITH(krb5-lib-dir,
954     AS_HELP_STRING([--with-krb5-lib-dir=DIR],[Kerberos library path]),
955     [
956       if test "x$withval" != "xno" ; then
957         LDFLAGS="$LDFLAGS -L$withval"
958       fi
959     ])
962 dnl Include LDAP?
963 AC_ARG_WITH(ldap,
964   AS_HELP_STRING([--without-ldap],[Disable LDAP query support]),
965   [ with_ldap=$withval ])
967 if test "x$with_ldap" = "xno" ; then
968   alpine_with_ldap=
969   AC_MSG_NOTICE([Excluding LDAP Support])
970 else
971   dnl Do stuff to figure out where OpenLDAP is
973   alpine_with_ldap=yes
974   AC_ARG_WITH(ldap-dir,
975     AS_HELP_STRING([--with-ldap-dir=DIR],[Root of LDAP lib/include path]),
976     [
977       if test "x$withval" != "xno" ; then 
978         CPPFLAGS="$CPPFLAGS -I${withval}/include"
979         LDFLAGS="$LDFLAGS -L${withval}/lib"
980       fi
981     ])
983   AC_ARG_WITH(ldap-include-dir,
984     AS_HELP_STRING([--with-ldap-include-dir=DIR],[Directory containing LDAP include files]),
985     [
986       if test "x$withval" != "xno" ; then
987         CPPFLAGS="$CPPFLAGS -I$withval"
988       fi
989     ])
991   AC_ARG_WITH(ldap-lib-dir,
992     AS_HELP_STRING([--with-ldap-lib-dir=DIR],[LDAP library path]),
993     [
994       if test "x$withval" != "xno" ; then
995         LDFLAGS="$LDFLAGS -L$withval"
996       fi
997     ])
1000 dnl Include SMIME?
1001 AC_ARG_WITH(smime,
1002   AS_HELP_STRING([--without-smime],[Disable S/MIME]),
1003   [ with_smime=$withval ])
1005 dnl Include TCL?
1006 AC_ARG_WITH(tcl,
1007   AS_HELP_STRING([--without-tcl],[Disable TCL, thus Web Alpine support]),
1008   [ with_tcl=$withval ])
1010 if test "x$with_tcl" = "xno" ; then
1011   WEB_BUILD=
1012   AC_MSG_NOTICE([Excluding TCL Support, and thus Web Alpine Support])
1013 else
1014   AC_ARG_WITH(tcl-lib,
1015     AS_HELP_STRING([--with-tcl-lib=LIBRARY],[Specific TCL Library, like \"tcl8.6\"]),
1016     [
1017       if test "x$withval" != "xno" ; then 
1018         alpine_TCLLIB=$withval
1019       fi
1020     ])
1021   AC_ARG_WITH(tcl-include,
1022     AS_HELP_STRING([--with-tcl-include=DIR],[Directory containing TCL include files]),
1023     [
1024       if test "x$withval" != "xno" ; then
1025         CPPFLAGS="$CPPFLAGS -I$withval"
1026         alpine_TCLINC=$withval
1027       fi
1028     ])
1031 AC_ARG_WITH(supplied-regex,
1032   AS_HELP_STRING([--with-supplied-regex],[Use regex library supplied with alpine]),
1033   [ alpine_REGEX=$withval ])
1035 AC_ARG_WITH(pthread,
1036   AS_HELP_STRING([--without-pthread],[Do NOT test for nor build with POSIX thread support]),
1037   [ with_pthread=$withval ])
1039 AC_ARG_WITH(system-mail-directory,
1040   AS_HELP_STRING([--with-system-mail-directory=DIR],[Directory where local mail is delivered]),
1041   [
1042     if test "x$withval" != "xno" ; then
1043       alpine_with_local_maildir="$withval"
1044     fi
1045   ])
1047 AC_ARG_WITH(c-client-target,
1048   AS_HELP_STRING([--with-c-client-target=TARGET],[IMAP build target (see imap/Makefile)]),
1049   [
1050     if test "x$withval" != "xno" ;then
1051       alpine_with_c_client_target="$withval"
1052     fi
1053   ])
1056 dnl Assume PAM is *not* required and only set the systems that need it.
1057 alpine_PAM="none"
1059 dnl HOST-OS SPECIFIC DEFINITIONS
1060 dnl Tests and assignments below are mostly to coax the appropriate
1061 dnl build from c-client.  Most of this will go away when c-client
1062 dnl adopts configure
1063 case "$host" in
1064   *-linux-gnu*|*-k*bsd*-gnu*|*-gnu*)
1065     alpine_path_delim="/"
1066     alpine_mode_readonly="(0600)"
1067     if test -f /etc/fedora-release ; then  
1068       systype="LFD"
1069       alpine_PAM="yes"
1070       if test -d /etc/pki/tls ; then  
1071         alpine_c_client_target="lfd"
1072       else
1073         alpine_c_client_target="lrh"
1074       fi
1075     elif test -f /etc/mandrake-release ; then
1076       systype="LMD"
1077       alpine_c_client_target="lmd"
1078       alpine_PAM="yes"
1079     elif test -f /etc/redhat-release -o -f /etc/redhat_version ; then
1080       systype="LRH"
1081       alpine_PAM="yes"
1082       if test -d /etc/pki/tls ; then  
1083         alpine_c_client_target="lr5"
1084       else
1085         alpine_c_client_target="lrh"
1086       fi
1087     elif test -f /etc/debian_release -o -f /etc/debian_version ; then
1088       if test -d /etc/osso-af-init ; then
1089         systype="LN8"
1090         alpine_c_client_target="ln8"
1091       else
1092         systype="DEB"
1093         alpine_c_client_target="ldb"
1094         alpine_PAM="yes"
1095       fi
1096     elif test -f /etc/SuSE-release ; then
1097       systype="LSU"
1098       alpine_c_client_target="lsu"
1099       alpine_PAM="yes"
1100     else
1101       systype="LNX"
1102       AC_CHECK_LIB(pam, pam_start,
1103         [
1104           alpine_c_client_target="lnp"
1105           alpine_PAM="yes"
1106         ],
1107         [
1108           if test -f /etc/shadow ; then
1109             alpine_c_client_target="slx"
1110           else
1111             alpine_c_client_target="lnx"
1112           fi
1113         ])
1114     fi
1115     ;;
1116   *-apple-darwin*)
1117     systype="OSX"
1118     alpine_path_delim="/"
1119     alpine_mode_readonly="(0600)"
1120     LIBS="$LIBS -framework Carbon -framework ApplicationServices -framework Security"
1121     AM_CFLAGS="$AM_CFLAGS -Dbsd"
1122     dnl SEE include/system.h
1123     AC_DEFINE([OSX_TARGET],[1],[OSX TARGET])
1124     case "$alpine_os_credential_cache" in
1125       no)
1126         ;;
1127       *)
1128         AC_DEFINE([APPLEKEYCHAIN], [1], [Use Apple OS X key chain for credential caching])
1129         ;;
1130     esac
1131     AC_CHECK_LIB(pam, pam_start,
1132       [
1133         AC_CHECK_HEADER([security/pam_appl.h],
1134         [
1135           alpine_PAM="yes"
1136           alpine_c_client_target="oxs"
1137         ],
1138         [       AC_CHECK_HEADER([pam/pam_appl.h],
1139                 [
1140                    alpine_PAM="yes"
1141                    alpine_c_client_target="oxp" 
1142                 ],
1143                 [
1144                   alpine_PAM="none"
1145                   alpine_pam_none_reason="header files not found"
1146                 ])
1147         ])
1148       ],
1149       [
1150         alpine_c_client_target="osx"
1151       ])
1152     ;;
1153   *-*-solaris*)
1154     if test x$GCC = "xyes" ; then
1155       systype="GSO"
1156       alpine_c_client_target="gso"
1157     else
1158       systype="SOC"
1159       alpine_c_client_target="soc"
1160       AC_DEFINE([__EXTENSIONS__], [1], [Enable extended pthread features on Solaris])
1161     fi
1162     alpine_path_delim="/"
1163     alpine_mode_readonly="(0600)"
1164     dnl possible other OS's need this.
1165     dnl Use autoconf 2.61's AC_USE_SYSTEM_EXTENSIONS at some point
1166     ;;
1167   *-*-sunos4*)
1168     systype="SUN"
1169     alpine_path_delim="/"
1170     alpine_mode_readonly="(0600)"
1171     alpine_c_client_target="s40"
1172     ;;
1173   *-*-sco3.2v5*)
1174     if test x$GCC = "xyes" ; then
1175       systype="GO5"
1176       alpine_c_client_target="go5"
1177     else
1178       systype="SC5"
1179       alpine_c_client_target="sc5"
1180     fi
1181     alpine_path_delim="/"
1182     alpine_mode_readonly="(0600)"
1183     dnl possible other OS's need this.
1184     dnl Use autoconf 2.61's AC_USE_SYSTEM_EXTENSIONS at some point
1185     ;;
1186   *-next-*)
1187     systype="NXT"
1188     alpine_path_delim="/"
1189     alpine_mode_readonly="(0600)"
1190     alpine_c_client_target="nx3"
1191     ;;
1192   *-*-netbsd*)
1193     systype="NEB"
1194     alpine_path_delim="/"
1195     alpine_mode_readonly="(0600)"
1196     alpine_c_client_target="neb"
1197     ;;
1198   *-*-dragonfly*)
1199     systype="DFB"
1200     alpine_path_delim="/"
1201     alpine_mode_readonly="(0600)"
1202     alpine_c_client_target="neb"
1203     ;;
1204   *-*-bsdi*)
1205     systype="BSI"
1206     alpine_path_delim="/"
1207     alpine_mode_readonly="(0600)"
1208     alpine_c_client_target="bsi"
1209     ;;
1210   *-*-freebsd*)
1211     systype="BSF"
1212     alpine_path_delim="/"
1213     alpine_mode_readonly="(0600)"
1214     alpine_c_client_target="bsf"
1215     LIBS="$LIBS $LIBINTL"
1216     ;;
1217   *-*-openbsd*)
1218     systype="BSO"
1219     alpine_path_delim="/"
1220     alpine_mode_readonly="(0600)"
1221     alpine_c_client_target="bso"
1222     LIBS="$LIBS $LIBINTL"
1223     ;;
1224   *-*-aix5*)
1225     systype="A52"
1226     alpine_path_delim="/"
1227     alpine_mode_readonly="(0600)"
1228     alpine_c_client_target="a52"
1229     ;;
1230   *-*-aix4*)
1231     systype="A41"
1232     alpine_path_delim="/"
1233     alpine_mode_readonly="(0600)"
1234     alpine_c_client_target="a41"
1235     ;;
1236   *-*-aix3*)
1237     systype="A32"
1238     alpine_path_delim="/"
1239     alpine_mode_readonly="(0600)"
1240     alpine_c_client_target="a32"
1241     ;;
1242   *-*UNIX_SV | *-*-sysv5UnixWare7* | *-*OpenUNIX*)
1243     systype="UW2"
1244     alpine_path_delim="/"
1245     alpine_mode_readonly="(0600)"
1246     alpine_c_client_target="uw2"
1247     ;;
1248   *-*-osf5*)
1249     systype="OSF"
1250     alpine_path_delim="/"
1251     alpine_mode_readonly="(0600)"
1252     alpine_c_client_target="osf"
1253     ;;
1254   *-*-cygwin)
1255     systype="CYG"
1256     alpine_path_delim="/"
1257     alpine_mode_readonly="(S_IREAD | S_IWRITE)"
1258     alpine_c_client_target="cyg"
1259     LIBS="$LIBS $LIBINTL"
1260     ;;
1261   windows* | *-*-pw32*)
1262     systype="WNT"
1263     alpine_path_delim="\\"
1264     alpine_mode_readonly="(S_IREAD | S_IWRITE)"
1265     alpine_c_client_target="wnt"
1266     AC_DEFINE([_WINDOWS], [1], [Windows is just too different])
1267     ;;
1268   *)
1269     AC_MSG_ERROR(Unrecognized system: $host)
1270     ;;
1271 esac
1273 dnl Without IPv6?
1274 AC_ARG_WITH(ipv6,
1275   AS_HELP_STRING([--without-ipv6],[Disable IPv6, primarily to work around resolver problems]),
1276   [ with_ipv6=$withval ])
1278 if test "x$with_ipv6" = "xno" ; then
1279   AC_MSG_NOTICE([Excluding IPv6 Support])
1280   c_client_specials="${c_client_specials}IP6=4 "
1281   c_client_ip6="true"
1282 else
1283   c_client_ip6="touch imap/ip6"
1287 dnl CHECK LIBRARIES
1289 if test x$enable_dmalloc = "xyes" ; then
1290   if test "x$with_pthread" = "xyes" ; then
1291     dmalloc_lib=dmallocth
1292   else
1293     dmalloc_lib=dmalloc
1294   fi
1296   AC_CHECK_LIB($dmalloc_lib,dmalloc_shutdown,,
1297     [
1298       AC_MSG_ERROR($dmalloc_lib requested, but -ldmalloc not found)
1299     ])
1302 dnl which terminal cabability database
1303 AC_CHECK_LIB(tinfo, setupterm,
1304   [
1305     alpine_termdata=info
1306     LIBS="$LIBS -ltinfo"
1307   ],
1308   [
1309     AC_CHECK_LIB(ncurses, setupterm,
1310       [
1311         alpine_termdata=info
1312         LIBS="$LIBS -lncurses"
1313       ],
1314       [
1315         AC_CHECK_LIB(curses, setupterm,
1316           [
1317             alpine_termdata=info
1318             LIBS="$LIBS -lcurses"
1319           ],
1320           [
1321             AC_CHECK_LIB(termlib, tgetent,
1322               [
1323                 alpine_termdata=cap
1324                 LIBS="$LIBS -ltermlib"
1325               ],
1326               [
1327                 AC_CHECK_LIB(termcap, tgetent,
1328                   [
1329                     alpine_termdata=cap
1330                     LIBS="$LIBS -ltermcap"
1331                   ],
1332                   [
1333                     AC_MSG_ERROR(Terminfo/termcap not found)
1334                   ])
1335               ])
1336           ])
1337       ])
1338   ])
1339 case $alpine_termdata in
1340   info)
1341     AC_DEFINE(HAS_TERMINFO, [1], [Define if systems uses terminfo terminal database])
1342     ;;
1343   cap)
1344     AC_DEFINE(HAS_TERMCAP, [1], [Define if systems uses termcap terminal database])
1345     ;;
1346 esac
1348 dnl is -ldl present? if so, add it
1349 AC_SEARCH_LIBS([dlopen], [dl dld],, [ alpine_DL="none" ])
1350 if test "x$alpine_DL" = "xnone" ; then
1351     AC_MSG_ERROR([No library containing dlopen found])
1352     exit 1      
1355 dnl Check Openssl/LibreSSL version first
1356 if test "x$alpine_SSLTYPE" != "xnone" ; then
1357   AC_MSG_CHECKING([Openssl library version >= 1.0.0c])
1358   AC_RUN_IFELSE(
1359         [AC_LANG_SOURCE([[
1360 #include <stdio.h>
1361 #include <stdlib.h>
1362 #if HAVE_STDINT_H
1363 #include <stdint.h>
1364 #endif /* HAVE_STDINT_H */
1365 #include <openssl/ssl.h>
1366 int main(void) {
1368         if (OPENSSL_VERSION_NUMBER >= 0x1000003f)
1369                 exit(0);
1371         exit(2);
1373         ]])],
1374         [ AC_MSG_RESULT(yes) ],
1375         [ alpine_SSLTYPE="none" ],
1376         [ AC_MSG_WARN([cross compiling: not checking])])
1378     if test "x$alpine_SSLTYPE" = "xnone" ; then
1379         AC_MSG_ERROR(Install openssl version >= 1.0.0c)
1380         exit 1
1381     fi
1382     AC_SEARCH_LIBS(TLSv1_2_client_method,ssl,
1383         [ alpine_c_client_cflags="$alpine_c_client_cflags -DTLSV1_2"
1384           AC_DEFINE([SSL_SUPPORTS_TLSV1_2], [1], [SSL Supports TLSV1.2])
1385         ])
1388 dnl Crypto support is needed 
1389 if test "x$alpine_SSLTYPE" != "xnone" ; then
1390   AC_SEARCH_LIBS(SSLeay,crypto,, [ alpine_CRYPTO="none" ])
1391   if test "x$alpine_CRYPTO" = "xnone" ; then
1392      AC_MSG_ERROR(crypto library NOT found)
1393      exit 1
1394   fi
1397 dnl provide SSL support?
1398 if test "x$alpine_SSLTYPE" != "xnone" ; then
1399    AC_SEARCH_LIBS(SSL_library_init,ssl,,[ alpine_SSLTYPE="none" ])
1401   if test "x$alpine_SSLTYPE" = "xnone" ; then
1402      AC_MSG_ERROR(No library containing SSL_library_init found in your path)
1403      exit 1
1404   fi
1408 dnl provide LDAP support?
1409 if test "$alpine_with_ldap" = "yes" ; then
1410   alpine_has_ldap=
1411   AC_CHECK_LIB(lber, ber_alloc,
1412     [
1413       LIBS="$LIBS -llber"
1414     ])
1415   AC_SEARCH_LIBS(ldap_initialize,ldap,
1416     [
1417       alpine_has_ldap=yes
1418     ],
1419     [
1420       AC_SEARCH_LIBS(ldap_open,ldap,
1421         [
1422           alpine_has_ldap=yes
1423         ])
1424     ])
1426   if test "$alpine_has_ldap" = "yes" ; then
1427     AC_MSG_NOTICE([* * * Including LDAP Support])
1428     AC_DEFINE([ENABLE_LDAP], [], [Enable LDAP query support])
1429   fi
1432 dnl PAM support is needed to build c-client in some linux, and hence Alpine.
1433 if test "x$alpine_PAM" != "xnone" ; then
1434   AC_SEARCH_LIBS(pam_start,pam,
1435       [
1436         LIBS="$LIBS -lpam"
1437         AC_CHECK_HEADER([security/pam_appl.h],
1438         [
1439           alpine_PAM="yes"
1440         ],
1441         dnl Only mac is incompatible, do not spread bad habits.
1442         [ AC_CHECK_HEADER([pam/pam_appl.h],
1443           [
1444                 alpine_PAM="yes"
1445                 if test "x$alpine_c_client_target" != "xoxp" ; then
1446                    alpine_PAM="none"
1447                    alpine_pam_none_reason="header files not in security/ directory"
1448                 fi
1449           ],
1450           [
1451                 alpine_PAM="none"
1452                 alpine_pam_none_reason="header files not found"
1453           ])
1454         ])
1455       ],
1456       [
1457         alpine_PAM="none"
1458         alpine_pam_none_reason="library files not found"
1459       ])
1460     if test -n "$alpine_pam_none_reason" ; then
1461       AC_MSG_ERROR(No PAM support: $alpine_pam_none_reason)
1462   fi
1466 dnl provide KRB5 support?
1467 if test "x$alpine_GSSTYPE" != "xnone" ; then
1468   AC_SEARCH_LIBS(gss_init_sec_context,gss gssapi gssapi_krb5,
1469     [
1470       dnl MIT-based?
1471       LIBS="$LIBS -lkrb5"
1472       AC_CHECK_HEADER([gssapi/gssapi_generic.h],,
1473         [
1474           if test ! -d /usr/kerberos/include ; then
1475             alpine_GSSTYPE="none"
1476             alpine_gss_none_reason="header files not found"
1477           fi
1478         ])
1479     ],
1480     [
1481       alpine_GSSTYPE="none"
1482       alpine_gss_none_reason="libraries not found"
1483     ])
1484   if test -n "$alpine_gss_none_reason" ; then
1485     AC_MSG_NOTICE([NOT including Kerberos Support: $alpine_gss_none_reason])
1486   fi
1489 dnl check for tcl libraries for Web Alpine (HACKY)
1490 if test -n "$WEB_BUILD" ; then
1491 TCL_VERSIONS_DOT="tcl8.6 tcl8.5 tcl8.4 tcl8.3"
1492 TCL_VERSIONS_NODOT="`echo ${TCL_VERSIONS_DOT} | ${SED} 's/\.//g'`"
1493 TCL_VERSIONS="${TCL_VERSIONS_DOT} ${TCL_VERSIONS_NODOT} tcl"
1494   AC_SEARCH_LIBS([Tcl_Eval],[$alpine_TCLLIB ${TCL_VERSIONS}],,
1495     [
1496       WEB_BUILD=
1497     ])
1499   dnl look for header file
1500   if test -n "$alpine_TCLINC" ; then
1501     AC_CHECK_HEADER($alpine_TCLINC/tcl.h,,
1502       [
1503         WEB_BUILD=
1504       ])
1505     if test -z "$WEB_BUILD" ; then
1506       AC_MSG_NOTICE([Tcl Include file NOT found])
1507     fi
1508   else
1509     AC_CHECK_HEADER(tcl.h,,
1510       [
1511         for base in /usr /usr/local ; do
1512          for dir in ${TCL_VERSIONS} ; do
1513           AC_CHECK_FILE([$base/include/$dir/tcl.h],
1514             [
1515               found=yes
1516             ])
1517           if test "$found" = "yes" ; then
1518             CPPFLAGS="$CPPFLAGS -I$base/include/$dir"
1519             break
1520           fi
1521          done
1522          if test "$found" = "yes" ; then
1523             break
1524          fi
1525         done
1526         if test "$found" != "yes" ; then
1527             WEB_BUILD=
1528             AC_MSG_NOTICE([header file tcl.h NOT found: Web Alpine will not be built])
1529         fi
1530       ])
1531   fi
1534 dnl Local or supplied regex?
1535 if test "x$alpine_REGEX" != "xyes" ; then
1536   AC_SEARCH_LIBS([regcomp],posix regexp regex re,,
1537     [
1538       if test x$alpine_REGEX = "xno" ; then
1539         AC_MSG_ERROR(Unable to find system regex library)
1540       else
1541         alpine_REGEX=yes
1542       fi
1543     ])
1545 if test "x$alpine_REGEX" != "xyes" ; then
1546   AC_CHECK_HEADER([regex.h],,
1547     [
1548       if test x$alpine_REGEX = "xno" ; then
1549         AC_MSG_ERROR(Unable to find system regex include file)
1550       else
1551         alpine_REGEX=yes
1552       fi
1553     ])
1555 AC_DEFINE(HAVE_REGEX_H,1,[Regular expression header file exists])
1556 if test "x$alpine_REGEX" = "xyes" ; then
1557   CPPFLAGS="$CPPFLAGS -I${top_builddir}/regex"
1558   LDFLAGS="$LDFLAGS -L${top_builddir}/regex"
1559   REGEX_BUILD=regex
1560   REGEX_MAKEFILE="$REGEX_BUILD/Makefile"
1563 if test "x$with_pthread" != "xno" ; then
1564   AC_MSG_CHECKING([for pthread support])
1565   ACX_PTHREAD(
1566     [
1567       AC_MSG_RESULT([yes])
1568       case "$target" in
1569           *openbsd*)
1570             AC_MSG_NOTICE([WARNING: pthread support on OpenBSD is unstable!])
1571             AM_CFLAGS="$AM_CFLAGS -pthread"
1572             ;;
1573       esac
1574       LIBS="$PTHREAD_LIBS $LIBS"
1575       AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
1576       CC="$PTHREAD_CC"
1577       AC_DEFINE([HAVE_PTHREAD], [1], [System has pthread support])
1578     ],
1579     [
1580       AC_MSG_RESULT([no])
1581     ])
1583   AC_SEARCH_LIBS([nanosleep], [rt posix4],
1584     [
1585       AC_DEFINE([HAVE_NANOSLEEP], [1], [Define if system supports subsecond, non-alarm sleep])
1586     ])
1591 dnl CHECK HEADERS
1593 AC_HEADER_STDC
1594 AC_HEADER_DIRENT
1595 AC_HEADER_STAT
1596 AC_HEADER_SYS_WAIT
1597 AC_HEADER_TIME
1598 AC_HEADER_TIOCGWINSZ
1600 AC_CHECK_HEADERS([unistd.h])
1602 AC_CHECK_HEADERS([errno.h \
1603                   ctype.h \
1604                   fcntl.h \
1605                   signal.h \
1606                   setjmp.h \
1607                   memory.h \
1608                   sys/ioctl.h \
1609                   sys/param.h \
1610                   sys/socket.h \
1611                   sys/uio.h \
1612                   sys/un.h \
1613                   limits.h \
1614                   wchar.h \
1615                   sys/poll.h \
1616                   stropts.h \
1617                   netdb.h \
1618                   syslog.h \
1619                   sys/syslog.h \
1620                   locale.h \
1621                   langinfo.h \
1622                   utime.h \
1623                   sys/utime.h \
1624                   pthread.h \
1625                   pwd.h \
1626                   assert.h])
1628 dnl terminal line discipline?
1629 AC_CHECK_HEADER([termios.h],
1630   AC_DEFINE(HAS_TERMIOS, [1], [Define if systems uses termios terminal control]),
1631   [
1632     AC_CHECK_HEADER([termio.h],
1633       AC_DEFINE(HAS_TERMIO, [1], [Define if systems uses termio terminal control]),
1634       [
1635         AC_CHECK_HEADER([sgtty.h],
1636           AC_DEFINE(HAS_SGTTY, [1], [Define if systems uses old BSD-style terminal control]),
1637         [
1638           AC_MSG_ERROR(Unable to figure out terminal control method)
1639         ])
1640       ])
1641   ])
1644 dnl CHECK TYPEDEFS
1646 AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void.
1647 Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl
1648 AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
1649 [AC_LANG_PROGRAM([#include <sys/types.h>
1650 #include <signal.h>
1652                  [return *(signal (0, 0)) (0) == 1;])],
1653                    [ac_cv_type_signal=int],
1654                    [ac_cv_type_signal=void])])
1655 AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
1656                     (`int' or `void').])
1658 AC_TYPE_SIZE_T
1659 AC_TYPE_MODE_T
1660 AC_TYPE_PID_T
1661 AC_TYPE_UID_T
1662 AC_STRUCT_TM
1664 AC_CHECK_TYPES([union wait])
1666 AC_CHECK_HEADERS([stdint.h], [uint16=uint16_t], [
1667   AC_CHECK_HEADERS([inttypes.h], [uint16=uint16_t], [
1668     AC_CHECK_HEADERS([sys/types.h], [uint16=u_int16_t], [
1669       AC_CHECK_SIZEOF(unsigned short)
1670       if test $ac_cv_sizeof_unsigned_short -eq 2 ; then
1671         uint16="unsigned short"
1672       else
1673         AC_CHECK_SIZEOF(unsigned int)
1674         if $ac_cv_sizeof_unsigned_int -eq 2 ; then
1675           uint16="unsigned int"
1676         else
1677           AC_MSG_ERROR(Unable to determine 16 bit integer type)
1678         fi
1679       fi
1680     ])
1681   ])
1683 AC_DEFINE_UNQUOTED([UINT16], $uint16, [System defined unsigned 16 bit integer])
1685 AC_CHECK_HEADERS([stdint.h], [uint32=uint32_t], [
1686   AC_CHECK_HEADERS([inttypes.h], [uint32=uint32_t], [
1687     AC_CHECK_HEADERS([sys/types.h], [uint32=u_int32_t], [
1688       AC_CHECK_SIZEOF(unsigned int)
1689       if test $ac_cv_sizeof_unsigned_int -eq 4 ; then
1690         uint32="unsigned int"
1691       else
1692         AC_CHECK_SIZEOF(unsigned long)
1693         if $ac_cv_sizeof_unsigned_long -eq 4 ; then
1694           uint32="unsigned long"
1695         else
1696           AC_MSG_ERROR(Unable to determine 32 bit integer type)
1697         fi
1698       fi
1699     ])
1700   ])
1702 AC_DEFINE_UNQUOTED([UINT32], $uint32, [System defined unsigned 32 bit integer])
1704 AC_CACHE_CHECK(argument pointer type of qsort compare function and base,
1705 ac_cv_func_qsort_argtype,
1706 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1707 #if     HAVE_STDLIB_H
1708 #include "stdlib.h"
1709 #endif
1711 extern void *base;
1712 extern sortf(const void *, const void *);
1713 int sortf(a, b)
1714   const void *a;
1715   const void *b; { return 0; }
1716 ]], [[
1717 qsort(base, 2, sizeof(char *), sortf);
1718 ]])],[ac_cv_func_qsort_argtype=void],[ac_cv_func_qsort_argtype=char])
1720 AC_DEFINE_UNQUOTED([qsort_t], $ac_cv_func_qsort_argtype, [qsort compare function argument type])
1722 dnl check for "struct passwd" ?
1724 AC_FUNC_SELECT_ARGTYPES
1726 AC_FUNC_STRCOLL
1728 dnl CHECK FOR LIBRARY FUNCTIONS
1730 AC_FUNC_FORK
1731 AC_CHECK_FUNCS([strchr \
1732                 memcpy \
1733                 strtol \
1734                 strtoul \
1735                 select \
1736                 poll \
1737                 qsort \
1738                 getuid \
1739                 getpwuid \
1740                 getpwnam \
1741                 gettimeofday \
1742                 tmpfile \
1743                 uname \
1744                 rename \
1745                 read \
1746                 signal \
1747                 setjmp \
1748                 chown \
1749                 wait4 \
1750                 waitpid \
1751                 wait \
1752                 srandom \
1753                 popen \
1754                 pclose \
1755                 fsync \
1756                 truncate \
1757                 listen \
1758                 wcwidth \
1759                 mbstowcs \
1760                 wcrtomb \
1761                 putenv \
1762                 setenv])
1764 AC_SEARCH_LIBS([gethostname],[nsl])
1766 AC_SEARCH_LIBS([socket],[socket],,
1767   [
1768     WEB_BUILD=
1769   ])
1771 AC_SEARCH_LIBS([bind],[bind],,
1772   [
1773     WEB_BUILD=
1774   ])
1776 dnl check for POSIX signal interface
1777 AC_CHECK_FUNCS([sigaction sigemptyset sigaddset sigprocmask],
1778   [
1779     AC_DEFINE([POSIX_SIGNALS], [], [Define if system supports POSIX signal interface])
1780   ],
1781   [
1782     AC_CHECK_FUNCS([sigset sigrelse],
1783       [
1784         AC_DEFINE([SYSV_SIGNALS], [], [Define if system supports SYSV signal interface])
1785       ])
1786   ])
1788 AC_SEARCH_LIBS([syslog], [bsd socket inet],
1789   [
1790     AC_DEFINE([HAVE_SYSLOG], [1], [Define if system supplies syslog() logging])
1791   ])
1794 dnl set pico newmail check directory
1795 if test -n "$alpine_with_local_maildir" ; then
1796     alpine_local_maildir=$alpine_with_local_maildir
1797 elif test -d /var/spool/mail ; then
1798     alpine_local_maildir="/var/spool/mail"
1799 elif test -d /var/mail ; then
1800     alpine_local_maildir="/var/mail"
1801 else
1802     alpine_local_maildir="/usr/spool/mail"
1805 dnl set c-client make target
1806 if test -n "$alpine_with_c_client_target" ; then
1807     alpine_c_client_target=$alpine_with_c_client_target
1810 AC_DEFINE_UNQUOTED([SYSTYPE], "$systype", [Pine-Centric Host Specifier])
1811 AC_DEFINE_UNQUOTED([C_FILESEP],'$alpine_path_delim',[File name separator as character constant])
1812 AC_DEFINE_UNQUOTED([S_FILESEP],"$alpine_path_delim",[File name separator as string constant])
1813 AC_DEFINE_UNQUOTED([MAILDIR],"$alpine_local_maildir",[Path to local inboxes for pico newmail check])
1814 AC_DEFINE_UNQUOTED([MODE_READONLY], $alpine_mode_readonly, [File mode used to set readonly access])
1816 dnl c-client make particulars
1817 AC_SUBST([C_CLIENT_TARGET], $alpine_c_client_target)
1818 AC_SUBST([C_CLIENT_WITH_IPV6], $c_client_ip6)
1819 if test "x$alpine_SSLTYPE" = "xnone" ; then 
1820   AC_MSG_NOTICE([* * *  NOT Including SSL Support])
1821   c_client_specials="${c_client_specials}SSLTYPE=none "
1822 else
1823   dnl issue any warnings for common OpenSSL issues
1825   if test -n "$alpine_SSLCERTS" -a -d "$alpine_SSLCERTS" ; then
1826     certdir="$alpine_SSLCERTS"
1827   elif test -n "$alpine_SSLDIR" -a -d "${alpine_SSLDIR}/certs" ; then
1828     certdir="${alpine_SSLDIR}/certs"
1829   elif test -n "$alpine_SSLDIR" -a -d "${alpine_SSLDIR}/ssl/certs" ; then
1830     certdir="${alpine_SSLDIR}/ssl/certs"
1831   elif test -n "$alpine_SSLCERTS_ORIG" -a -d "$alpine_SSLCERTS_ORIG" ; then
1832     certdir="$alpine_SSLCERTS_ORIG"
1833   elif test -n "$alpine_SSLCERTS" ; then
1834     certdir="$alpine_SSLCERTS"
1835   else
1836     AC_MSG_NOTICE([SSL Problem: certificate directory not found])
1837   fi
1839   if test "x$with_smime" != "xno" ; then
1840     if test -n "$certdir" ; then
1841       AC_MSG_NOTICE([* * * S/MIME support enabled])
1842       AC_DEFINE([SMIME], [], [Enable S/MIME code])
1843       AC_DEFINE_UNQUOTED([SMIME_SSLCERTS],"$certdir",[Directory where S/MIME CACerts are located])
1844     fi
1845   fi
1848   SSL_CERT_LINK="no"
1849   if test -z "`ls ${certdir} | $EGREP '^@<:@0-9A-Fa-f@:>@{8}\.@<:@0-9@:>@'`" ; then
1850      SSL_BUNDLE_EXISTS="no"
1851      SSL_PEM="factory.pem ca-bundle.pem"
1852      for SSL_BUNDLE in $SSL_PEM
1853      do
1854        if test -f ${certdir}/${SSL_BUNDLE} ; then
1855           SSL_BUNDLE_EXISTS="yes"
1856        fi
1857      done
1858   else
1859      SSL_CERT_LINK="yes"
1860   fi
1862   if test "x$SSL_BUNDLE_EXISTS" = "xno" -a "x$SSL_CERT_LINK" = "xno" ; then
1863      AC_MSG_NOTICE([* * * No certificates found in "${certdir}".])
1864      AC_MSG_NOTICE([* * *   This might indicate that CA certs did not get properly])
1865      AC_MSG_NOTICE([* * *   installed.  If you get certificate validation failures])
1866      AC_MSG_NOTICE([* * *   in Alpine, this might be the reason for them.])
1867   fi
1869   if test -n "$alpine_SSLINCLUDE" ; then
1870     c_client_specials="${c_client_specials}SSLINCLUDE=$alpine_SSLINCLUDE "
1871   fi
1873   if test -n "$alpine_SSLLIB" ; then
1874     c_client_specials="${c_client_specials}SSLLIB=$alpine_SSLLIB "
1875   fi
1877   if test -n "$alpine_SSLDIR" ; then
1878     c_client_specials="${c_client_specials}SSLDIR=$alpine_SSLDIR "
1879   fi
1881   if test -n "$certdir" ; then
1882     c_client_specials="${c_client_specials}SSLCERTS=$certdir "
1883   fi
1885   if test -n "$alpine_SSLKEYS" ; then
1886       c_client_specials="${c_client_specials}SSLKEYS=$alpine_SSLKEYS "
1887   fi
1890 if test "x$alpine_GSSTYPE" != "xnone" ; then
1891   c_client_specials="${c_client_specials}EXTRAAUTHENTICATORS=gss "
1892   AC_MSG_NOTICE([* * * Including Kerberos5 functionality])
1895 if test -n "$CPPFLAGS" ; then
1896   alpine_c_client_cflags="$alpine_c_client_cflags ${CPPFLAGS}"
1898 if test -n "$CFLAGS" ; then
1899   alpine_c_client_cflags="$alpine_c_client_cflags ${CFLAGS}"
1902 if test -n "$alpine_c_client_cflags" ; then
1903   AC_SUBST(C_CLIENT_CFLAGS, EXTRACFLAGS=\"$alpine_c_client_cflags\")
1906 if test -n "$LDFLAGS" ; then
1907   alpine_c_client_ldflags="$alpine_c_client_ldflags ${LDFLAGS}"
1909 if test -n "$LIBS" ; then
1910   alpine_c_client_ldflags="$alpine_c_client_ldflags ${LIBS}"
1913 if test -n "$alpine_c_client_ldflags" ; then
1914   AC_SUBST(C_CLIENT_LDFLAGS, EXTRALDFLAGS=\"$alpine_c_client_ldflags\")
1917 if test -n "$alpine_c_client_gccoptlevel" ; then
1918   AC_SUBST(C_CLIENT_GCCOPTLEVEL, GCCOPTLEVEL=\"$alpine_c_client_gccoptlevel\")
1921 AC_SUBST([C_CLIENT_SPECIALS], $c_client_specials)
1923 dnl Deal with Web Alpine
1924 if test -z "$WEB_BUILD" ; then
1925   WEB_PUBCOOKIE_BUILD=
1926   AC_MSG_NOTICE([* * * TCL libraries could not be found.])
1927   AC_MSG_NOTICE([* * * WEB ALPINE COMPONENT WILL NOT BE BUILT.])
1928 else
1929   if test -n "$WEB_PUBCOOKIE_BUILD" ; then
1930     if test "x$alpine_GSSTYPE" = "xnone" ; then
1931       WEB_PUBCOOKIE_BUILD=
1932       AC_MSG_NOTICE([* * * Kerberos5 support not found.])
1933       AC_MSG_NOTICE([* * * WEB ALPINE PUBCOOKIE COMPONENT WILL NOT BE BUILT.])
1934     elif test -z "$WEB_BINDIR" ; then
1935       WEB_PUBCOOKIE_BUILD=
1936       AC_MSG_NOTICE([* * * Web Alpine binary directory not provided.])
1937         AC_MSG_ERROR([* * * --with-pubcookie requires --with-web-bin=PATH.
1938         Please re-run configure with these options:
1939         --with-pubcookie --with-web-bin=/usr/local/libexec/alpine/bin])
1940     else
1941       AC_DEFINE([PUBCOOKIE],[1],[Include support for UW Pubcookie Web Authentication])
1942       WEB_PUBCOOKIE_LIB=../pubcookie/libauthgssproxy.a
1943       WEB_PUBCOOKIE_LINK=gssapi_proxy.l
1944     fi
1945   fi
1948 AC_SUBST([REGEX_BUILD])
1950 AC_SUBST([WEB_BUILD])
1951 AC_SUBST([WEB_BINDIR])
1952 AC_SUBST([WEB_PUBCOOKIE_BUILD])
1953 AC_SUBST([WEB_PUBCOOKIE_LIB])
1954 AC_SUBST([WEB_PUBCOOKIE_LINK])
1956 AC_SUBST([AM_CFLAGS])
1957 AC_SUBST([AM_LDFLAGS])
1959 AC_CONFIG_FILES([m4/Makefile po/Makefile.in $REGEX_MAKEFILE \
1960           pith/osdep/Makefile pith/charconv/Makefile pith/Makefile \
1961           pico/osdep/Makefile pico/Makefile \
1962           alpine/osdep/Makefile alpine/Makefile \
1963           web/src/Makefile web/src/pubcookie/Makefile \
1964           web/src/alpined.d/Makefile \
1965           Makefile])
1966 AC_OUTPUT