1 dnl Process this file with autoconf to produce a configure script.
3 dnl /* ========================================================================
4 dnl * Copyright 2013-2018 Eduardo Chappa
5 dnl * Copyright 2006-2008 University of Washington
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
11 dnl * http://www.apache.org/licenses/LICENSE-2.0
13 dnl * ========================================================================
18 AC_REVISION([Rev:26 by chappa@washington.edu])
20 dnl Alpine Version Number is in $srcdir/VERSION
21 AC_INIT([alpine],[m4_esyscmd(tr -d \\n < 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])
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
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
74 AC_ARG_WITH(dmalloc-dir,
75 AS_HELP_STRING([--with-dmalloc-dir=DIR],[Root of dmalloc lib/include path]),
77 if test "x$withval" != "xno" ; then
78 enable_dmalloc = "yes"
79 CPPFLAGS="$CPPFLAGS -I${withval}"
80 LDFLAGS="$LDFLAGS -L${withval}"
84 if test x$enable_dmalloc = "xyes" ; then
85 AC_DEFINE(ENABLE_DMALLOC, 1, [Define enable dmalloc debugging])
88 dnl set date and hostname
89 ALPINE_datestamp=`date`
90 AC_ARG_WITH(date-stamp,
91 AS_HELP_STRING([--with-date-stamp=DATE],[Set this as the date this program was built. Default: output of `date`]),
93 if test "x$withval" != "xno" ; then
94 ALPINE_datestamp=$withval
97 AC_SUBST([ALPINE_DATESTAMP], $ALPINE_datestamp)
99 ALPINE_hoststamp=`hostname`
100 AC_ARG_WITH(host-stamp,
101 AS_HELP_STRING([--with-host-stamp=HOST],[Set name of computer for compilation. Default: output of `hostname`]),
103 if test "x$withval" != "xno" ; then
104 ALPINE_hoststamp="$withval"
107 AC_SUBST([ALPINE_HOSTSTAMP], $ALPINE_hoststamp)
109 dnl set ps command, this test is fragile, but it should mostly work
110 ALPINE_psefcmd="/bin/ps auxww"
114 AS_HELP_STRING([--with-ps-cmd="CMD"],[Use this command to check running commands. Default: /bin/ps auxww]),
116 if test "x$withval" = "xno" -o "x$withval" = "xyes" -o "x$withval" = "x" ; then
117 withval=$ALPINE_psefcmd
119 ALPINE_PSTEST=`$withval | $EGREP "$withval" | $EGREP -v $EGREP`
120 if test -n "$ALPINE_PSTEST" ; then
121 ALPINE_psefcmd="$withval"
124 if test "x$ALPINE_psefcmd" != "x$withval" ; then
125 AC_MSG_WARN(failed command $withval. Trying $ALPINE_psefcmd)
129 if test "$ALPINE_psfailed" = "1" -o "$ALPINE_PSTEST" = "-" ; then
130 withval="$ALPINE_psefcmd"
131 ALPINE_PSTEST=`$withval | $EGREP "$withval" | $EGREP -v $EGREP`
132 if test -z "$ALPINE_PSTEST" ; then
138 if test "$ALPINE_psfailed" = "0" ; then
139 AC_DEFINE_UNQUOTED([PSEFCMD], "$ALPINE_psefcmd", [ps command which outputs list of running commands])
142 dnl Set default locale dir.
145 if test -d /opt/local ; then
146 localedir="/opt/local/share/locale"
148 localedir="\${datadir}/locale"
152 localedir="/usr/share"
155 localedir="\${datadir}/locale"
159 AC_ARG_WITH(localedir,
160 AS_HELP_STRING([--with-localedir=DIR],[Name of gettext locale directory]),
172 AC_SUBST(localedir, "[$localedir]")
174 # Setup OS-Specific features
177 dnl OS X Universal Binary Support
178 AC_ARG_ENABLE(osx-universal-binaries,
179 AS_HELP_STRING([--enable-osx-universal-binaries],[Produce universal binaries under OS X [[default=no]]]))
180 if test "x$enable_osx_universal_binaries" = "xyes" ; then
181 if test "x$enable_dependency_tracking" != xno ; then
182 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
183 Please re-run configure with these options:
184 --disable-dependency-tracking --enable-osx-universal-binary])
186 if [test -d /Developer/SDKs/MacOSX10.5.sdk] ; then
187 alpine_sysroot=/Developer/SDKs/MacOSX10.5.sdk
188 elif [test -d /Developer/SDKs/MacOSX10.4u.sdk] ; then
189 alpine_sysroot=/Developer/SDKs/MacOSX10.4u.sdk
191 AC_MSG_ERROR([No suitable MacOSX SDK found. Make sure Xcode tools are installed])
193 ub_cflags="-isysroot $alpine_sysroot -arch ppc -arch i386"
194 ub_ldflags="-Wl,-syslibroot,$alpine_sysroot -arch ppc -arch i386"
195 AM_CFLAGS="$AM_CFLAGS $ub_cflags"
196 AM_LDFLAGS="$AM_LDFLAGS $ub_ldflags"
197 alpine_c_client_cflags="$alpine_c_client_cflags $ub_cflags"
198 alpine_c_client_ldflags="$alpine_c_client_ldflags $ub_ldflags"
203 AC_ARG_WITH(include-path,
204 AS_HELP_STRING([--with-include-path=PATHS],[Colon-separated list of directories used for include file search]),
212 new_cppflags="-I`echo ${withval} | ${SED} 's/:/ -I/g'`"
213 CPPFLAGS="$CPPFLAGS ${new_cppflags}"
214 alpine_c_client_cflags="$alpine_c_client_cflags ${new_cppflags}"
219 AC_ARG_WITH(lib-path,
220 AS_HELP_STRING([--with-lib-path=PATHS],[Colon-separated list of directories used for library search]),
228 new_ldflags="-L`echo ${withval} | ${SED} 's/:/ -L/g'`"
229 LDFLAGS="$LDFLAGS $new_ldflags"
230 alpine_c_client_ldflags="$alpine_c_client_ldflags ${new_ldflags}"
235 AC_ARG_WITH(pubcookie,
236 AS_HELP_STRING([--with-pubcookie],[Include support for UW-Pubcookie Web Authentication]),
238 if test "x$withval" != "xno" ; then
239 WEB_PUBCOOKIE_BUILD=web/src/pubcookie
245 AS_HELP_STRING([--with-web-bin=PATH],[Directory to hold Web Alpine component binary files]),
258 dnl disable debug, turned on by default
259 AC_MSG_CHECKING([option: debugging is enabled])
260 AC_ARG_ENABLE(debug, AS_HELP_STRING([--disable-debug],[Exclude debug messages from source]))
261 if test x$enable_debug != "xno" ; then
262 AM_CFLAGS="$AM_CFLAGS -g"
263 AC_DEFINE([DEBUG], [1], [Compile in debugging])
264 AC_DEFINE([DEBUGJOURNAL], [1], [Display debug messages in journal])
267 dnl ??? set AM_CFLAGS to optimize ???
271 dnl disable optimization, on by default
272 AC_MSG_CHECKING([option: optimization is enabled])
273 AC_ARG_ENABLE(optimization, AS_HELP_STRING([--disable-optimization],[Exclude optimizing compiler flags]))
274 if test x$enable_optimization != "xno" ; then
277 CFLAGS="`echo $AM_CFLAGS | ${SED} 's/-O2//'`"
278 alpine_c_client_gccoptlevel="-O0"
282 dnl disable mouse support
283 AC_MSG_CHECKING([option: mouse support enabled])
284 AC_ARG_ENABLE(mouse, AS_HELP_STRING([--disable-mouse],[Disable mouse support]))
285 if test x$enable_mouse != "xno" ; then
286 AC_DEFINE([MOUSE], [], [Compile in mouse support])
293 AC_MSG_CHECKING([option: quotas enabled])
294 AC_ARG_ENABLE(quotas, AS_HELP_STRING([--enable-quotas],[Enable disk quota checking on startup]))
295 if test x$enable_quotas = "xyes" ; then
296 AC_DEFINE([USE_QUOTAS], [], [Compile in quota check on startup])
302 AC_MSG_CHECKING([option: From changing enabled])
303 AC_ARG_ENABLE(from_changing, AS_HELP_STRING([--disable-from-changing],[Disallow users changing From addresss]))
304 if test x$enable_from_changing != "xno" ; then
307 AC_DEFINE([NEVER_ALLOW_CHANGING_FROM], [], [Disallow users changing their From address])
311 dnl enable background posting support
312 AC_MSG_CHECKING([option: background post enabled])
313 AC_ARG_ENABLE(background-post, AS_HELP_STRING([--disable-background-post],[Disable background posting]))
314 if test x$enable_background_post != "xno" ; then
315 AC_DEFINE([BACKGROUND_POST], [], [Enable background posting support])
321 dnl enable keyboard locking support
322 AC_MSG_CHECKING([option: keyboard lock enabled])
323 AC_ARG_ENABLE(keyboard-lock, AS_HELP_STRING([--disable-keyboard-lock],[Disable keyboard locking]))
324 if test x$enable_keyboard_lock != "xno" ; then
325 AC_DEFINE([KEYBOARD_LOCK], [], [Enable keyboard lock support])
331 dnl enable from encoding support
332 AC_MSG_CHECKING([option: from encoding enabled])
333 AC_ARG_ENABLE(from-encoding, AS_HELP_STRING([--enable-from-encoding],[Enable From encoding in sent messages]))
334 if test x$enable_from_encoding = "xyes" ; then
335 AC_DEFINE([ENCODE_FROMS], [], [Enable From address encoding in sent messages])
341 dnl OPTION: name of local submission agent
342 dnl Might not be sendmail, but it MUST speak SMTP on stdin/stdout
343 AC_ARG_WITH(smtp-msa,
344 AS_HELP_STRING([--with-smtp-msa=PATH],[Local Mail Submission Agent (sendmail)]),
350 AC_PATH_PROG(SENDMAIL, sendmail, "", $PATH:/usr/sbin:/usr/lib)
358 AC_PATH_PROG(SENDMAIL, sendmail, "", $PATH:/usr/sbin:/usr/lib)
360 if test -n "$SENDMAIL" ; then
361 AC_DEFINE_UNQUOTED([SENDMAIL], "$SENDMAIL", [Local mail submission agent])
364 dnl OPTION: local msa arguments
365 smtp_msa_flags="-bs -odb -oem"
366 AC_ARG_WITH(smtp-msa-flags,
367 AS_HELP_STRING([--with-smtp-msa-flags=FLAGS],[MSA flags for SMTP on stdin/stdout (-bs -odb -oem)]),
369 if test "x$withval" != "xno" ; then
370 smtp_msa_flags=$withval
373 AC_DEFINE_UNQUOTED([SENDMAILFLAGS], "$smtp_msa_flags", [Local MSA flags for SMTP on stdin/stdout])
375 dnl OPTION: name of local news posting agent and flags
378 AS_HELP_STRING([--with-npa=PATH],[Posting agent when no nntp-servers defined (inews)]),
384 AC_PATH_PROG(NPA_PROG, inews, "", $PATH:/usr/sbin:/usr/lib)
392 AC_PATH_PROG(NPA_PROG, inews, "", $PATH:/usr/sbin:/usr/lib)
396 AC_ARG_WITH(npa-flags,
397 AS_HELP_STRING([--with-npa-flags=FLAGS],[Flags to allow posting via local agent (-h)]),
399 if test "x$withval" != "xno" ; then
403 if test -n "$NPA_PROG" ; then
404 AC_DEFINE_UNQUOTED([SENDNEWS], "$NPA_PROG $npa_flags", [Posting agent to use when no nntp-servers defined])
407 dnl OPTION: password changing program
408 AC_ARG_WITH(password-prog,
409 AS_HELP_STRING([--with-password-prog=PATH],[Password change program (/bin/passwd)]),
415 AC_PATH_PROG(PWPROG, passwd, "", $PATH:/usr/sbin:/usr/lib)
418 AC_PATH_PROG(PWPROG, $withval, "", $PATH:/usr/sbin:/usr/lib)
423 AC_PATH_PROG(PWPROG, passwd, "", $PATH:/usr/sbin:/usr/lib)
425 if test -n "$PWPROG" ; then
426 AC_DEFINE_UNQUOTED([PASSWD_PROG], "$PWPROG", [Program users use to change their password])
429 dnl OPTION: basic spell checking program
430 AC_ARG_WITH(simple-spellcheck,
431 AS_HELP_STRING([--with-simple-spellcheck=PROG],[Spellcheck program reads stdin, emits misspellings on stdout]),
433 if test "x$withval" != "xno" ; then
438 AC_CHECK_PROG([SPELLPROG], [hunspell], [hunspell], [])
439 if test -z "$SPELLPROG" ; then
440 AC_CHECK_PROG([SPELLPROG], [aspell], [aspell], [])
441 if test -z "$SPELLPROG" ; then
442 AC_CHECK_PROG([SPELLPROG], [ispell], [ispell], [])
443 if test -z "$SPELLPROG" ; then
450 if test "x$SPELLPROG" != "xno" ; then
451 AC_PATH_PROG(alpine_simple_spellcheck, $SPELLPROG)
452 if test -n "$alpine_simple_spellcheck" ; then
455 alpine_simple_spellcheck="$alpine_simple_spellcheck -l"
458 alpine_simple_spellcheck="$alpine_simple_spellcheck --dont-backup --mode=email list"
461 alpine_simple_spellcheck="$alpine_simple_spellcheck -l"
469 dnl OPTION: interactive spell checking program
470 AC_ARG_WITH(interactive-spellcheck,
471 AS_HELP_STRING([--with-interactive-spellcheck=PROG],[Interactive, filewise spell checker]),
473 if test "x$withval" != "xno" ; then
478 AC_CHECK_PROG([ISPELLPROG], [hunspell], [hunspell], [])
479 if test -z "$ISPELLPROG" ; then
480 AC_CHECK_PROG([ISPELLPROG], [aspell], [aspell], [])
481 if test -z "$SPELLPROG" ; then
487 if test "x$ISPELLPROG" != "xno" ; then
488 AC_PATH_PROG(alpine_interactive_spellcheck, $ISPELLPROG)
489 if test -n "$alpine_interactive_spellcheck" ; then
490 case "$ISPELLPROG" in
492 alpine_interactive_spellcheck="$alpine_interactive_spellcheck --dont-backup --mode=email check"
500 if test -n "$alpine_interactive_spellcheck" ; then
501 AC_DEFINE_UNQUOTED([DF_VAR_SPELLER], "$alpine_interactive_spellcheck", [Interactive, filewise spell checker])
504 if test -z "$alpine_simple_spellcheck" -a -n "$alpine_interactive_spellcheck" ; then
505 alpine_simple_spellcheck=test
507 AC_DEFINE_UNQUOTED([SPELLER], "$alpine_simple_spellcheck", [Simple spell checker: reads stdin, emits misspellings on stdout])
509 dnl OPTION: system-pinerc
510 dnl NOTE: historically we used /lib for the config dir.
511 dnl don't ask, it was a long time ago. but, we can't
512 dnl change it now without breaking compatibility
514 NONE) dpv=/usr/local/lib/pine.conf ;;
515 *) dpv=${prefix}/lib/pine.conf ;;
517 AC_ARG_WITH(system-pinerc,
518 AS_HELP_STRING([--with-system-pinerc=VALUE],[System pinerc (/usr/local/lib/pine.conf)]),
530 AC_DEFINE_UNQUOTED(SYSTEM_PINERC, "$dpv", [System pinerc])
532 dnl OPTION: system-fixed-pinerc
533 dnl NOTE: historically we used /lib for the config dir.
534 dnl don't ask, it was a long time ago. but, we can't
535 dnl change it now without breaking compatibility
537 NONE) dpv=/usr/local/lib/pine.conf.fixed ;;
538 *) dpv=${prefix}/lib/pine.conf.fixed ;;
540 AC_ARG_WITH(system-fixed-pinerc,
541 AS_HELP_STRING([--with-system-fixed-pinerc=VALUE],[System fixed pinerc (/usr/local/lib/pine.conf.fixed)]),
553 AC_DEFINE_UNQUOTED(SYSTEM_PINERC_FIXED, "$dpv", [System fixed pinerc])
555 dnl OPTION: local support information, file that contains information on
556 dnl how to contact local support for Alpine.
557 dnl NOTE: historically we used /lib for the config dir.
558 dnl don't ask, it was a long time ago. but, we can't
559 dnl change it now without breaking compatibility
561 NONE) dpv=/usr/local/lib/pine.info ;;
562 *) dpv=${prefix}/lib/pine.info ;;
564 AC_ARG_WITH(local-support-info,
565 AS_HELP_STRING([--with-local-support-info=VALUE],[Local Support Info File (/usr/local/lib/pine.info)]),
577 AC_DEFINE_UNQUOTED(SYSTEM_PINE_INFO_PATH, "$dpv", [Local Support Info File])
579 dnl Function to simplify setting alpine/pico defaults
580 dnl usage: PINEVAR(configure-name, definition-name, definition-value, help)
585 AS_HELP_STRING([--with-$1=VALUE],[$4 ($3)]),
587 if test "x$withval" != "xno" ; then
591 AC_DEFINE_UNQUOTED($2, "$dpv", [Default configuration value])
594 dnl Function to simplify setting pine/pico defaults
595 dnl usage: PINEVAR_UNQUOTED(configure-name, definition-name, definition-value, help)
596 AC_DEFUN([PINEVAR_UNQUOTED],
600 AS_HELP_STRING([--with-$1=VALUE],[$4 ($3)]),
602 if test "x$withval" != "xno" ; then
606 AC_DEFINE_UNQUOTED($2, $dpv, [Default configuration value])
609 PINEVAR(mailcheck-interval, DF_MAILCHECK, 150, [Specify default mail-check-interval])
610 PINEVAR_UNQUOTED(checkpoint-interval, CHECK_POINT_TIME, 420, [Specify default checkpoint-interval])
611 PINEVAR_UNQUOTED(checkpoint-frequency, CHECK_POINT_FREQ, 12, [State change count before checkpoint])
612 PINEVAR_UNQUOTED(display-rows, DEFAULT_LINES_ON_TERMINAL, 24, [Initial rows on display])
613 PINEVAR_UNQUOTED(display-columns, DEFAULT_COLUMNS_ON_TERMINAL, 80, [Initial columns on display])
614 PINEVAR_UNQUOTED(max-display-rows, MAX_SCREEN_ROWS, 200, [Maximum display rows])
615 PINEVAR_UNQUOTED(max-display-columns, MAX_SCREEN_COLS, 500, [Maximum display columns])
616 PINEVAR(fill-column, DF_FILLCOL, 74, [Default fill column])
617 PINEVAR_UNQUOTED(max_fill-column, MAX_FILLCOL, 80, [Maximum fill column])
618 PINEVAR_UNQUOTED(debug-level, DEFAULT_DEBUG, 2, [Specify default debug verbosity level])
619 PINEVAR_UNQUOTED(debug-files, NUMDEBUGFILES, 4, [Specify number of debug files])
620 PINEVAR(debug-file, DEBUGFILE, [.pine-debug], [Specify debug file name])
621 PINEVAR(forwarded-keyword, FORWARDED_FLAG, ["\$Forwarded"], [IMAP (c-client) keyword to store forwarded status])
622 PINEVAR(display-overlap, DF_OVERLAP, [2], [Lines preserved while paging])
623 PINEVAR(display-margin, DF_MARGIN, [0], [Lines visible while scrolling])
624 PINEVAR(default-fcc, DF_DEFAULT_FCC, [sent-mail], [Default sent mail folder])
625 PINEVAR(default-save-folder, DEFAULT_SAVE, [saved-messages], [Default save folder])
626 PINEVAR(default-legacy-postponed-folder, POSTPONED_MAIL, [postponed-mail], [Pre Pine 3.90 postponed folder])
627 PINEVAR(default-postponed-folder, POSTPONED_MSGS, [postponed-msgs], [Default postponed folder])
628 PINEVAR(default-trash-folder, TRASH_FOLDER, [Trash], [Default Trash folder for Web Alpine])
629 PINEVAR(default-interrupted-mail, INTERRUPTED_MAIL, [.pine-interrupted-mail], [Default folder for interrupted mail])
630 PINEVAR(default-dead-letter-folder, DEADLETTER, [dead.letter], [Default dead letter folder])
631 PINEVAR(default-mail-directory, DF_MAIL_DIRECTORY, [mail], [Default mail directory])
632 PINEVAR(default-inbox-name, INBOX_NAME, [INBOX], [Default inbox name])
633 PINEVAR(default-signature-file, DF_SIGNATURE_FILE, [.signature], [Default signature file])
634 PINEVAR(default-elm-style-save, DF_ELM_STYLE_SAVE, [no], [Default to Elm style save])
635 PINEVAR(default-header-in-reply, DF_HEADER_IN_REPLY, [no], [Include header in reply])
636 PINEVAR(default-old-style-reply, DF_OLD_STYLE_REPLY, [no], [Default to old style reply])
637 PINEVAR(default-use-only-domain-name, DF_USE_ONLY_DOMAIN_NAME, [no], [Default to using only the domain name])
638 PINEVAR(default-save-by-sender, DF_SAVE_BY_SENDER, [no], [Default to save by sender])
639 PINEVAR(default-sort-key, DF_SORT_KEY, [arrival], [Default sort key])
640 PINEVAR(default-addressbook-sort-rule, DF_AB_SORT_RULE, [fullname-with-lists-last], [Default addressbook sort rule])
641 PINEVAR(default-folder-sort-rule, DF_FLD_SORT_RULE, [alphabetical], [Default folder sort rule])
642 PINEVAR(default-saved-message-name-rule, DF_SAVED_MSG_NAME_RULE, [default-folder], [Default saved message name rule])
643 PINEVAR(default-fcc-rule, DF_FCC_RULE, [default-fcc], [Default fcc rule])
644 PINEVAR(default-standard-printer, DF_STANDARD_PRINTER, [lpr], [Default standard printern])
645 PINEVAR(default-ansi-printer, ANSI_PRINTER, [attached-to-ansi], [ANSI printer definition])
646 PINEVAR(default-addressbook, DF_ADDRESSBOOK, [.addressbook], [Default addressbook name])
647 PINEVAR(default-local-fullname, DF_LOCAL_FULLNAME, ["Local Support"], [Default local support fullname])
648 PINEVAR(default-local-address, DF_LOCAL_ADDRESS, [postmaster], [Default local support address])
649 PINEVAR(default-keyboard-lock-count, DF_KBLOCK_PASSWD_COUNT, [1], [Default keyboard lock count])
650 PINEVAR(default-remote-addressbook-history, DF_REMOTE_ABOOK_HISTORY, [3], [Default address book history count])
651 PINEVAR(smime-public-cert-directory, DF_PUBLICCERT_DIR, [.alpine-smime/public], [Default Public Cert Directory])
652 PINEVAR(smime-private-key-directory, DF_PRIVATEKEY_DIR, [.alpine-smime/private], [Default Private Key Directory])
653 PINEVAR(smime-cacert-directory, DF_CACERT_DIR, [.alpine-smime/ca], [Default Cert Authority Directory])
654 PINEVAR_UNQUOTED(default-printer, DF_DEFAULT_PRINTER, [ANSI_PRINTER], [Default printer])
656 AC_DEFINE_UNQUOTED([DF_PUBLIC_CONTAINER], "PublicContainer", [Name of default public container])
657 AC_DEFINE_UNQUOTED([DF_PRIVATE_CONTAINER], "PrivateContainer", [Name of default private container])
658 AC_DEFINE_UNQUOTED([DF_CA_CONTAINER], "CAContainer", [Name of default certificate authority container])
661 AC_ARG_WITH(passfile,
662 AS_HELP_STRING([--with-passfile=FILENAME],[Password cache file (recommended when S/MIME is enabled and configured)]),
670 alpine_PASSFILE=$withval
676 dnl os-specific credential cache?
677 AC_ARG_WITH(local-password-cache,
678 AS_HELP_STRING([--without-local-password-cache],[Disable OS-specific password cache, if supported]),
680 alpine_os_credential_cache=$withval
683 dnl Particular os-specific credential cache?
684 AC_ARG_WITH(local-password-cache-method,
685 AS_HELP_STRING([--with-local-password-cache-method],[OS-specific credential cache (OSX=APPLEKEYCHAIN, Windows=WINCRED)]),
687 alpine_os_credential_cache_method=$withval
690 if test -n "$alpine_PASSFILE" ; then
691 case $alpine_os_credential_cache in
695 alpine_os_credential_cache="no"
696 AC_MSG_NOTICE([--with-passfile definition overrides OS-Specific password caching])
699 AC_DEFINE_UNQUOTED([PASSFILE], "$alpine_PASSFILE", [Password cache file (recommended if S/MIME is enabled and configured)])
703 AC_ARG_WITH(default-sshpath,
704 AS_HELP_STRING([--with-default-sshpath=FILENAME],[set default value of ssh command path (defining should cause ssh to be preferred to rsh)]),
712 AC_DEFINE_UNQUOTED([DF_SSHPATH], "$withval", [set default value of ssh command path (defining should cause ssh to be preferred to rsh)])
718 AC_ARG_WITH(default-sshcmd,
719 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")]),
727 AC_DEFINE_UNQUOTED([DF_SSHCMD], "$withval", [set default value of ssh command string (usually "%s %s -l %s exec /etc/r%sd")])
733 dnl Set SSLDIR for c-client make
735 AS_HELP_STRING([--without-ssl],[Disable SSL support (OpenSSL)]),
736 [ with_ssl=$withval ])
738 if test "x$with_ssl" = "xno" ; then
739 alpine_SSLTYPE="none"
740 elif test -d /usr/local/ssl ; then
741 dnl When the system has openssl installed in its default location
742 dnl instead of the one used by the distribution assume that this
743 dnl is the one intended to be used.
744 alpine_SSLDIR="/usr/local/ssl"
745 alpine_SSLINCLUDE="$alpine_SSLDIR/include"
746 alpine_SSLLIB="$alpine_SSLDIR/lib"
748 dnl preload c-client default locations/options
750 *-linux-gnu*|*-k*bsd*-gnu*|*-gnu*)
751 if test -f /etc/fedora-release -o -f /etc/redhat-release -o -f /etc/redhat_version ; then
752 alpine_SSLTYPE="nopwd"
753 if test -d /etc/pki/tls ; then
754 alpine_SSLDIR="/etc/pki/tls"
756 alpine_SSLDIR="/usr/share/ssl"
758 alpine_SSLCERTS="$alpine_SSLDIR/certs"
759 alpine_SSLKEYS="$alpine_SSLDIR/private"
760 alpine_SSLINCLUDE="/usr/include/openssl"
761 alpine_SSLLIB="/usr/lib"
762 elif test -f /etc/mandrake-release ; then
763 alpine_SSLDIR="/usr/lib/ssl"
764 alpine_SSLCERTS="$alpine_SSLDIR/certs"
765 alpine_SSLKEYS="$alpine_SSLDIR/private"
766 alpine_SSLINCLUDE="/usr/include/openssl"
767 alpine_SSLLIB="/usr/lib"
768 elif test -f /etc/SuSE-release ; then
769 alpine_SSLTYPE="nopwd"
770 alpine_SSLDIR="/etc/ssl"
771 alpine_SSLCERTS="$alpine_SSLDIR/certs"
772 alpine_SSLKEYS="$alpine_SSLDIR/private"
773 alpine_SSLINCLUDE="/usr/include/openssl"
774 alpine_SSLLIB="/usr/lib"
775 elif test -d /etc/osso-af-init ; then
776 alpine_SSLTYPE="nopwd"
778 alpine_SSLCERTS="/usr/share/certs"
779 alpine_SSLINCLUDE="/usr/include/openssl"
780 alpine_SSLLIB="/usr/lib"
781 elif test -f /etc/debian_release -o -f /etc/debian_version ; then
782 if test ! -d /etc/osso-af-init ; then
783 alpine_SSLDIR="/etc/ssl"
784 alpine_SSLCERTS="$alpine_SSLDIR/certs"
785 alpine_SSLKEYS="$alpine_SSLDIR/private"
786 alpine_SSLINCLUDE="/usr/include/openssl"
787 alpine_SSLLIB="/usr/lib"
789 elif test -f /etc/manjaro-release ; then
790 alpine_SSLDIR="/etc/ssl"
791 alpine_SSLCERTS="$alpine_SSLDIR/certs"
792 alpine_SSLKEYS="$alpine_SSLDIR/private"
793 alpine_SSLINCLUDE="/usr/include/openssl"
794 alpine_SSLLIB="/usr/lib"
796 alpine_SSLTYPE="nopwd"
798 alpine_SSLCERTS="/etc/ssl/certs"
802 alpine_SSLTYPE="nopwd"
803 dnl Originally this is where certs are, and they might still be there, even
804 dnl after installing Homebrew, MacPorts or Fink. We will use it if we cannot
805 dnl find it anywhere else.
806 alpine_SSLCERTS_ORIG="/System/Library/OpenSSL/certs"
807 if test -d /usr/local/opt/openssl ; then
808 alpine_SSLDIR="/usr/local/opt/openssl"
809 alpine_SSLINCLUDE="$alpine_SSLDIR/include"
810 alpine_SSLLIB="$alpine_SSLDIR/lib"
811 alpine_SSLCERTS="/usr/local/etc/openssl"
812 alpine_SSLKEYS="$alpine_SSLDIR/private"
813 elif test -d /opt/local/etc/openssl ; then
814 alpine_SSLDIR="/opt/local"
815 alpine_SSLINCLUDE="$alpine_SSLDIR/include"
816 alpine_SSLLIB="$alpine_SSLDIR/lib"
817 alpine_SSLCERTS="/opt/local/etc/openssl/certs"
818 alpine_SSLKEYS="/opt/local/etc/openssl/private"
819 elif test -d /sw/etc/ssl ; then
820 alpine_SSLDIR="/sw/etc/ssl"
821 alpine_SSLINCLUDE="/sw/include"
822 alpine_SSLLIB="/sw/lib"
823 alpine_SSLCERTS="/sw/etc/ssl/certs"
824 alpine_SSLKEYS="/sw/etc/ssl/private"
825 elif test -d /usr/local/ssl ; then
826 alpine_SSLDIR="/usr/local/ssl"
827 elif test -d /System/Library/OpenSSL ; then
828 alpine_SSLDIR="/System/Library/OpenSSL"
829 alpine_SSLCERTS="$alpine_SSLDIR/certs"
830 alpine_SSLKEYS="$alpine_SSLDIR/private"
831 alpine_SSLLIB="/usr/lib"
832 alpine_SSLINCLUDE="/usr/include/openssl"
836 alpine_SSLDIR="/etc/openssl"
837 alpine_SSLCERTS="$alpine_SSLDIR/certs"
838 alpine_SSLKEYS="$alpine_SSLDIR/private"
839 alpine_SSLINCLUDE="/usr/include/openssl"
840 alpine_SSLLIB="/usr/lib"
843 alpine_SSLDIR="/etc/openssl"
844 alpine_SSLCERTS="$alpine_SSLDIR/certs"
845 alpine_SSLKEYS="$alpine_SSLDIR/private"
846 alpine_SSLINCLUDE="/usr/include/openssl"
847 alpine_SSLLIB="/usr/lib"
850 alpine_SSLTYPE="nopwd"
852 alpine_SSLCERTS="/etc/ssl/certs"
855 alpine_SSLDIR="/etc/ssl"
856 alpine_SSLCERTS="$alpine_SSLDIR/certs"
857 alpine_SSLKEYS="$alpine_SSLDIR/private"
858 if test -d /usr/local/include/openssl ; then
859 alpine_SSLINCLUDE="/usr/local/include/openssl"
860 alpine_SSLLIB="/usr/local/lib"
862 alpine_SSLINCLUDE="/usr/include/openssl"
863 alpine_SSLLIB="/usr/lib"
867 alpine_SSLDIR="/etc/ssl"
868 alpine_SSLINCLUDE="/usr/include/openssl"
869 alpine_SSLLIB="/usr/lib"
870 alpine_SSLCERTS="/etc/ssl"
871 alpine_SSLKEYS="/etc/ssl/private"
874 alpine_SSLDIR="/usr/ssl"
875 alpine_SSLCERTS="$alpine_SSLDIR/certs"
876 alpine_SSLKEYS="$alpine_SSLDIR/certs"
877 alpine_SSLINCLUDE="/usr/include/openssl"
878 alpine_SSLLIB="/usr/lib"
880 *-sco-sysv* | *-sysv*UnixWare | *-sysv*OpenUNIX)
881 alpine_SSLTYPE="sco.nopwd"
882 alpine_SSLDIR="/usr/local/ssl"
885 if test -d /usr/include/openssl ; then
886 alpine_SSLINCLUDE="/usr/include/openssl"
887 elif test -d /usr/sfw/include/openssl ; then
888 alpine_SSLDIR="/usr/sfw"
889 elif test -d /opt/csw/include/openssl ; then
890 alpine_SSLDIR="/opt/csw"
891 if test -d /opt/csw/ssl/certs ; then
892 alpine_SSLCERTS="/opt/csw/ssl/certs"
895 if test -z "$alpine_SSLCERTS" -a -d /etc/certs ; then
896 alpine_SSLCERTS="/etc/certs"
900 alpine_SSLTYPE="nopwd"
901 alpine_SSLDIR="/usr/local/ssl"
906 if test "x$alpine_SSLTYPE" != "xnone" ; then
908 AS_HELP_STRING([--with-ssl-dir=DIR],[Root of SSL lib/include path]),
910 if test "x$withval" != "xno" ; then
911 alpine_SSLDIR=$withval
912 alpine_SSLINCLUDE=$alpine_SSLDIR/include
913 alpine_SSLLIB=$alpine_SSLDIR/lib
917 AC_ARG_WITH(ssl-certs-dir,
918 AS_HELP_STRING([--with-ssl-certs-dir=DIR],[Path to SSL certificate directory]),
920 if test "x$withval" != "xno" ; then
921 alpine_SSLCERTS=$withval
925 AC_ARG_WITH(ssl-include-dir,
926 AS_HELP_STRING([--with-ssl-include-dir=DIR],[SSL include file path]),
928 if test "x$withval" != "xno" ; then
929 alpine_SSLINCLUDE=$withval
933 AC_ARG_WITH(ssl-lib-dir,
934 AS_HELP_STRING([--with-ssl-lib-dir=DIR],[SSL library path]),
936 if test "x$withval" != "xno" ; then
937 alpine_SSLLIB=$withval
941 dnl setup globals so tests below work
942 if test -n "$alpine_SSLINCLUDE" ; then
943 CPPFLAGS="-I$alpine_SSLINCLUDE $CPPFLAGS"
944 elif test -n "$alpine_SSLDIR" ; then
945 CPPFLAGS="-I${alpine_SSLDIR}/include $CPPFLAGS"
947 if test -n "$alpine_SSLLIB" ; then
948 LDFLAGS="-L$alpine_SSLLIB $LDFLAGS"
949 elif test -n "$alpine_SSLDIR" ; then
950 LDFLAGS="-L${alpine_SSLDIR}/lib $LDFLAGS"
955 dnl Include Kerberos?
956 dnl Set GSSDIR for c-client make
958 AS_HELP_STRING([--without-krb5],[Disable Kerberos support]),
959 [ with_krb5=$withval ])
961 if test "x$with_krb5" = "xno" ; then
962 alpine_GSSTYPE="none"
966 AC_ARG_WITH(krb5-dir,
967 AS_HELP_STRING([--with-krb5-dir=DIR],[Root of Kerberos lib/include path]),
969 if test "x$withval" != "xno" ; then
970 CPPFLAGS="$CPPFLAGS -I${withval}/include"
971 LDFLAGS="$LDFLAGS -L${withval}/lib"
975 AC_ARG_WITH(krb5-include-dir,
976 AS_HELP_STRING([--with-krb5-include-dir=DIR],[Kerberos include file path]),
978 if test "x$withval" != "xno" ; then
979 CPPFLAGS="$CPPFLAGS -I$withval"
983 AC_ARG_WITH(krb5-lib-dir,
984 AS_HELP_STRING([--with-krb5-lib-dir=DIR],[Kerberos library path]),
986 if test "x$withval" != "xno" ; then
987 LDFLAGS="$LDFLAGS -L$withval"
994 AS_HELP_STRING([--without-ldap],[Disable LDAP query support]),
995 [ with_ldap=$withval ])
997 if test "x$with_ldap" = "xno" ; then
999 AC_MSG_NOTICE([Excluding LDAP Support])
1001 dnl Do stuff to figure out where OpenLDAP is
1005 alpine_LDAPDIR="/usr/local"
1006 alpine_LDAPINCLUDE="${LDAPDIR}/include"
1007 alpine_LDAPLIB="${LDAPDIR}/lib"
1011 alpine_with_ldap=yes
1013 AC_ARG_WITH(ldap-dir,
1014 AS_HELP_STRING([--with-ldap-dir=DIR],[Root of LDAP lib/include path]),
1016 if test "x$withval" != "xno" ; then
1017 alpine_LDAPDIR="${withval}"
1018 alpine_LDAPINCLUDE="${LDAPDIR}/include"
1019 alpine_LDAPLIB="${LDAPDIR}/lib"
1023 AC_ARG_WITH(ldap-include-dir,
1024 AS_HELP_STRING([--with-ldap-include-dir=DIR],[Directory containing LDAP include files]),
1026 if test "x$withval" != "xno" ; then
1027 alpine_LDAPINCLUDE="$withval"
1031 AC_ARG_WITH(ldap-lib-dir,
1032 AS_HELP_STRING([--with-ldap-lib-dir=DIR],[LDAP library path]),
1034 if test "x$withval" != "xno" ; then
1035 alpine_LDAPLIB="${withval}"
1039 if test -n "$alpine_LDAPINCLUDE" ; then
1040 CPPFLAGS="$CPPFLAGS -I${alpine_LDAPINCLUDE}/include"
1042 if test -n "$alpine_LDAPLIB" ; then
1043 LDFLAGS="$LDFLAGS -L${alpine_LDAPLIB}/lib"
1049 AS_HELP_STRING([--without-smime],[Disable S/MIME]),
1050 [ with_smime=$withval ])
1054 AS_HELP_STRING([--without-tcl],[Disable TCL, thus Web Alpine support]),
1055 [ with_tcl=$withval ])
1057 if test "x$with_tcl" = "xno" ; then
1059 AC_MSG_NOTICE([Excluding TCL Support, and thus Web Alpine Support])
1061 AC_ARG_WITH(tcl-lib,
1062 AS_HELP_STRING([--with-tcl-lib=LIBRARY],[Specific TCL Library, like \"tcl8.6\"]),
1064 if test "x$withval" != "xno" ; then
1065 alpine_TCLLIB=$withval
1068 AC_ARG_WITH(tcl-include,
1069 AS_HELP_STRING([--with-tcl-include=DIR],[Directory containing TCL include files]),
1071 if test "x$withval" != "xno" ; then
1072 CPPFLAGS="$CPPFLAGS -I$withval"
1073 alpine_TCLINC=$withval
1078 AC_ARG_WITH(supplied-regex,
1079 AS_HELP_STRING([--with-supplied-regex],[Use regex library supplied with alpine]),
1080 [ alpine_REGEX=$withval ])
1082 AC_ARG_WITH(pthread,
1083 AS_HELP_STRING([--without-pthread],[Do NOT test for nor build with POSIX thread support]),
1084 [ with_pthread=$withval ])
1086 AC_ARG_WITH(system-mail-directory,
1087 AS_HELP_STRING([--with-system-mail-directory=DIR],[Directory where local mail is delivered]),
1089 if test "x$withval" != "xno" ; then
1090 alpine_with_local_maildir="$withval"
1094 AC_ARG_WITH(c-client-target,
1095 AS_HELP_STRING([--with-c-client-target=TARGET],[IMAP build target (see imap/Makefile)]),
1097 if test "x$withval" != "xno" ;then
1098 alpine_with_c_client_target="$withval"
1103 dnl Assume PAM is *not* required and only set the systems that need it.
1106 dnl HOST-OS SPECIFIC DEFINITIONS
1107 dnl Tests and assignments below are mostly to coax the appropriate
1108 dnl build from c-client. Most of this will go away when c-client
1109 dnl adopts configure
1111 *-linux-gnu*|*-k*bsd*-gnu*|*-gnu*)
1112 alpine_path_delim="/"
1113 alpine_mode_readonly="(0600)"
1114 if test -f /etc/fedora-release ; then
1117 if test -d /etc/pki/tls ; then
1118 alpine_c_client_target="lfd"
1120 alpine_c_client_target="lrh"
1122 elif test -f /etc/mandrake-release ; then
1124 alpine_c_client_target="lmd"
1126 elif test -f /etc/redhat-release -o -f /etc/redhat_version ; then
1129 if test -d /etc/pki/tls ; then
1130 alpine_c_client_target="lr5"
1132 alpine_c_client_target="lrh"
1134 elif test -f /etc/debian_release -o -f /etc/debian_version ; then
1135 if test -d /etc/osso-af-init ; then
1137 alpine_c_client_target="ln8"
1140 alpine_c_client_target="ldb"
1143 elif test -f /etc/SuSE-release ; then
1145 alpine_c_client_target="lsu"
1149 AC_CHECK_LIB(pam, pam_start,
1151 alpine_c_client_target="lnp"
1155 if test -f /etc/shadow ; then
1156 alpine_c_client_target="slx"
1158 alpine_c_client_target="lnx"
1165 alpine_path_delim="/"
1166 alpine_mode_readonly="(0600)"
1167 LIBS="$LIBS -framework Carbon -framework ApplicationServices -framework Security"
1168 AM_CFLAGS="$AM_CFLAGS -Dbsd"
1169 dnl SEE include/system.h
1170 AC_DEFINE([OSX_TARGET],[1],[OSX TARGET])
1171 case "$alpine_os_credential_cache" in
1175 AC_DEFINE([APPLEKEYCHAIN], [1], [Use Apple OS X key chain for credential caching])
1178 AC_CHECK_LIB(pam, pam_start,
1180 AC_CHECK_HEADER([security/pam_appl.h],
1183 alpine_c_client_target="oxs"
1185 [ AC_CHECK_HEADER([pam/pam_appl.h],
1188 alpine_c_client_target="oxp"
1192 alpine_pam_none_reason="header files not found"
1197 alpine_c_client_target="osx"
1201 if test x$GCC = "xyes" ; then
1203 alpine_c_client_target="gso"
1204 CFLAGS="$CFLAGS -D__USE_LEGACY_PROTOTYPES__"
1207 alpine_c_client_target="soc"
1208 AC_DEFINE([__EXTENSIONS__], [1], [Enable extended pthread features on Solaris])
1210 alpine_path_delim="/"
1211 alpine_mode_readonly="(0600)"
1212 dnl possible other OS's need this.
1213 dnl Use autoconf 2.61's AC_USE_SYSTEM_EXTENSIONS at some point
1217 alpine_path_delim="/"
1218 alpine_mode_readonly="(0600)"
1219 alpine_c_client_target="s40"
1222 if test x$GCC = "xyes" ; then
1224 alpine_c_client_target="go5"
1227 alpine_c_client_target="sc5"
1229 alpine_path_delim="/"
1230 alpine_mode_readonly="(0600)"
1231 dnl possible other OS's need this.
1232 dnl Use autoconf 2.61's AC_USE_SYSTEM_EXTENSIONS at some point
1236 alpine_path_delim="/"
1237 alpine_mode_readonly="(0600)"
1238 alpine_c_client_target="nx3"
1242 alpine_path_delim="/"
1243 alpine_mode_readonly="(0600)"
1244 alpine_c_client_target="neb"
1248 alpine_path_delim="/"
1249 alpine_mode_readonly="(0600)"
1250 alpine_c_client_target="neb"
1254 alpine_path_delim="/"
1255 alpine_mode_readonly="(0600)"
1256 alpine_c_client_target="bsi"
1260 alpine_path_delim="/"
1261 alpine_mode_readonly="(0600)"
1262 alpine_c_client_target="bsf"
1263 LIBS="$LIBS $LIBINTL"
1267 alpine_path_delim="/"
1268 alpine_mode_readonly="(0600)"
1269 alpine_c_client_target="bso"
1270 LIBS="$LIBS $LIBINTL"
1274 alpine_path_delim="/"
1275 alpine_mode_readonly="(0600)"
1276 alpine_c_client_target="a52"
1280 alpine_path_delim="/"
1281 alpine_mode_readonly="(0600)"
1282 alpine_c_client_target="a41"
1286 alpine_path_delim="/"
1287 alpine_mode_readonly="(0600)"
1288 alpine_c_client_target="a32"
1290 *-*UNIX_SV | *-*-sysv5UnixWare7* | *-*OpenUNIX*)
1292 alpine_path_delim="/"
1293 alpine_mode_readonly="(0600)"
1294 alpine_c_client_target="uw2"
1298 alpine_path_delim="/"
1299 alpine_mode_readonly="(0600)"
1300 alpine_c_client_target="osf"
1304 alpine_path_delim="/"
1305 alpine_mode_readonly="(S_IREAD | S_IWRITE)"
1306 alpine_c_client_target="cyg"
1307 LIBS="$LIBS $LIBINTL"
1309 windows* | *-*-pw32*)
1311 alpine_path_delim="\\"
1312 alpine_mode_readonly="(S_IREAD | S_IWRITE)"
1313 alpine_c_client_target="wnt"
1314 AC_DEFINE([_WINDOWS], [1], [Windows is just too different])
1317 AC_MSG_ERROR(Unrecognized system: $host)
1323 AS_HELP_STRING([--without-ipv6],[Disable IPv6, primarily to work around resolver problems]),
1324 [ with_ipv6=$withval ])
1326 if test "x$with_ipv6" = "xno" ; then
1327 AC_MSG_NOTICE([Excluding IPv6 Support])
1328 c_client_specials="${c_client_specials}IP6=4 "
1331 c_client_ip6="touch imap/ip6"
1337 if test x$enable_dmalloc = "xyes" ; then
1338 if test "x$with_pthread" = "xyes" ; then
1339 dmalloc_lib=dmallocth
1344 AC_CHECK_LIB($dmalloc_lib,dmalloc_shutdown,,
1346 AC_MSG_ERROR($dmalloc_lib requested, but -ldmalloc not found)
1350 dnl which terminal cabability database
1351 AC_CHECK_LIB(tinfo, setupterm,
1353 alpine_termdata=info
1354 LIBS="$LIBS -ltinfo"
1357 AC_CHECK_LIB(ncurses, setupterm,
1359 alpine_termdata=info
1360 LIBS="$LIBS -lncurses"
1363 AC_CHECK_LIB(curses, setupterm,
1365 alpine_termdata=info
1366 LIBS="$LIBS -lcurses"
1369 AC_CHECK_LIB(termlib, tgetent,
1372 LIBS="$LIBS -ltermlib"
1375 AC_CHECK_LIB(termcap, tgetent,
1378 LIBS="$LIBS -ltermcap"
1381 AC_MSG_ERROR(Terminfo/termcap not found)
1387 case $alpine_termdata in
1389 AC_DEFINE(HAS_TERMINFO, [1], [Define if systems uses terminfo terminal database])
1392 AC_DEFINE(HAS_TERMCAP, [1], [Define if systems uses termcap terminal database])
1396 dnl is -ldl present? if so, add it
1397 AC_SEARCH_LIBS([dlopen], [dl dld],, [ alpine_DL="none" ])
1398 if test "x$alpine_DL" = "xnone" ; then
1399 AC_MSG_ERROR([No library containing dlopen found])
1403 dnl Check if openssl = LibreSSL
1404 if test "x$alpine_SSLTYPE" != "xnone" ; then
1405 AC_MSG_CHECKING([if OpenSSL is LibreSSL])
1411 #endif /* HAVE_STDINT_H */
1412 #include <openssl/ssl.h>
1414 #if OPENSSL_VERSION_NUMBER < 0x20000000L
1418 [ AC_MSG_RESULT(yes)
1419 alpine_SSLPROVIDER="libressl"
1423 [ AC_MSG_WARN([cross compiling: not checking])])
1426 dnl Check Openssl/LibreSSL version first
1427 if test "x$alpine_SSLTYPE" != "xnone" -a "x$alpine_SSLPROVIDER" != "xlibressl" ; then
1428 AC_MSG_CHECKING([Openssl library version >= 1.0.0c])
1434 #endif /* HAVE_STDINT_H */
1435 #include <openssl/ssl.h>
1437 #if OPENSSL_VERSION_NUMBER < 0x1000003fL
1441 [ AC_MSG_RESULT(yes)
1442 alpine_SSLPROVIDER="openssl"
1444 [ alpine_SSLTYPE="none" ],
1445 [ AC_MSG_WARN([cross compiling: not checking])])
1447 if test "x$alpine_SSLTYPE" = "xnone" ; then
1448 AC_MSG_ERROR(Install openssl version >= 1.0.0c)
1453 dnl Now check if we are working with version 1.1.0 of openssl
1454 if test "x$alpine_SSLTYPE" != "xnone" -a "x$alpine_SSLPROVIDER" != "xlibressl" ; then
1455 AC_MSG_CHECKING([Openssl library version >= 1.1.0])
1461 #endif /* HAVE_STDINT_H */
1462 #include <openssl/ssl.h>
1464 #if OPENSSL_VERSION_NUMBER < 0x10100000L
1468 [ AC_MSG_RESULT(yes)
1469 alpine_SSLVERSION="new"
1470 CFLAGS="$CFLAGS -DOPENSSL_1_1_0 -DOPENSSL_API_COMPAT=0x10100000L"
1473 alpine_SSLVERSION="old" ],
1474 [ AC_MSG_WARN([cross compiling: not checking])])
1477 dnl Crypto support is needed
1478 if test "x$alpine_SSLTYPE" != "xnone" ; then
1479 if test "x$alpine_SSLVERSION" = "xold" -o "x$alpine_SSLPROVIDER" = "xlibressl" ; then
1480 AC_SEARCH_LIBS(SSLeay,crypto,, [ alpine_CRYPTO="none" ])
1482 AC_SEARCH_LIBS(OpenSSL_version_num,crypto,, [ alpine_CRYPTO="none" ])
1484 if test "x$alpine_CRYPTO" = "xnone" ; then
1485 AC_MSG_ERROR(crypto library NOT found)
1490 AC_CHECK_HEADER(crypto.h, , [ alpine_CRYPTO_DEVEL="none" ])
1491 if test "x$alpine_CRYPTO_DEVEL" = "xnone" ; then
1492 AC_MSG_ERROR(crypto library file crypto.h NOT found. Install correspoding libcrypt-devel package)
1500 if test "x$alpine_SSLTYPE" != "xnone" ; then
1501 if test "x$alpine_SSLVERSION" = "xold" -o "x$alpine_SSLPROVIDER" = "xlibressl" ; then
1502 AC_SEARCH_LIBS(TLSv1_2_client_method,ssl,
1503 [ alpine_c_client_cflags="$alpine_c_client_cflags -DTLSV1_2"
1504 AC_DEFINE([SSL_SUPPORTS_TLSV1_2], [1], [SSL Supports TLSV1.2])
1507 AC_SEARCH_LIBS(TLS_client_method,ssl,, [ alpine_SSLTYPE="none"])
1508 AC_SEARCH_LIBS(DTLS_client_method,ssl,,[ alpine_SSLTYPE="none"])
1509 if test "x$alpine_SSLTYPE" != "xnone" ; then
1510 alpine_c_client_cflags="$alpine_c_client_cflags -DTLSV1_2"
1511 AC_DEFINE([SSL_SUPPORTS_TLSV1_2], [1], [SSL Supports TLSV1.2])
1516 dnl provide SSL support?
1517 if test "x$alpine_SSLTYPE" != "xnone" ; then
1518 if test "x$alpine_SSLVERSION" = "xold" -o "x$alpine_SSLPROVIDER" = "xlibressl" ; then
1519 AC_SEARCH_LIBS(SSL_library_init,ssl,,[ alpine_SSLTYPE="none" ])
1520 if test "x$alpine_SSLTYPE" = "xnone" ; then
1521 AC_MSG_ERROR(No library containing SSL_library_init found in your path)
1525 AC_SEARCH_LIBS(OPENSSL_init_ssl,ssl,, [ alpine_SSLTYPE="none" ])
1526 if test "x$alpine_SSLTYPE" = "xnone" ; then
1527 AC_MSG_ERROR(No library containing OPENSSL_init_ssl found in your path)
1533 dnl provide LDAP support?
1534 if test "$alpine_with_ldap" = "yes" ; then
1536 AC_CHECK_LIB(lber, ber_alloc,
1540 AC_SEARCH_LIBS(ldap_initialize,ldap,
1545 AC_SEARCH_LIBS(ldap_open,ldap,
1551 if test "$alpine_has_ldap" = "yes" ; then
1552 AC_MSG_NOTICE([* * * Including LDAP Support])
1553 AC_DEFINE([ENABLE_LDAP], [], [Enable LDAP query support])
1557 dnl PAM support is needed to build c-client in some linux, and hence Alpine.
1558 if test "x$alpine_PAM" != "xnone" ; then
1559 AC_SEARCH_LIBS(pam_start,pam,
1562 AC_CHECK_HEADER([security/pam_appl.h],
1566 dnl Only mac is incompatible, do not spread bad habits.
1567 [ AC_CHECK_HEADER([pam/pam_appl.h],
1570 if test "x$alpine_c_client_target" != "xoxp" ; then
1572 alpine_pam_none_reason="header files not in security/ directory"
1577 alpine_pam_none_reason="header files not found"
1583 alpine_pam_none_reason="library files not found"
1585 if test -n "$alpine_pam_none_reason" ; then
1586 AC_MSG_ERROR(No PAM support: $alpine_pam_none_reason)
1591 dnl provide KRB5 support?
1592 if test "x$alpine_GSSTYPE" != "xnone" ; then
1593 AC_SEARCH_LIBS(gss_init_sec_context,gss gssapi gssapi_krb5,
1597 AC_CHECK_HEADER([gssapi/gssapi_generic.h],,
1599 if test ! -d /usr/kerberos/include ; then
1600 alpine_GSSTYPE="none"
1601 alpine_gss_none_reason="header files not found"
1606 alpine_GSSTYPE="none"
1607 alpine_gss_none_reason="libraries not found"
1609 if test -n "$alpine_gss_none_reason" ; then
1610 AC_MSG_NOTICE([NOT including Kerberos Support: $alpine_gss_none_reason])
1616 AC_HELP_STRING([--without-ntlm],[Disable NTLM client support]),
1617 [with_ntlm=$withval])
1619 dnl provide NTLM support?
1620 if test "x$with_ntlm" = "xno" ; then
1625 AC_SEARCH_LIBS(buildSmbNtlmAuthRequest, ntlm,
1627 AC_CHECK_HEADER([ntlm.h],
1630 AC_MSG_NOTICE([including NTLM support])
1634 alpine_ntlm_none_reason="header file ntlm.h not found"
1639 alpine_ntlm_none_reason="ntlm library not found"
1641 if test -n "$alpine_ntlm_none_reason" ; then
1642 AC_MSG_NOTICE([NOT including NTLM Support: $alpine_ntlm_none_reason])
1646 dnl check for tcl libraries for Web Alpine (HACKY)
1647 if test -n "$WEB_BUILD" ; then
1648 TCL_VERSIONS_DOT="tcl8.6 tcl8.5 tcl8.4 tcl8.3"
1649 TCL_VERSIONS_NODOT="`echo ${TCL_VERSIONS_DOT} | ${SED} 's/\.//g'`"
1650 TCL_VERSIONS="${TCL_VERSIONS_DOT} ${TCL_VERSIONS_NODOT} tcl"
1651 AC_SEARCH_LIBS([Tcl_Eval],[$alpine_TCLLIB ${TCL_VERSIONS}],,
1656 dnl look for header file
1657 if test -n "$alpine_TCLINC" ; then
1658 AC_CHECK_HEADER($alpine_TCLINC/tcl.h,,
1662 if test -z "$WEB_BUILD" ; then
1663 AC_MSG_NOTICE([Tcl Include file NOT found])
1666 AC_CHECK_HEADER(tcl.h,,
1668 for base in /usr /usr/local ; do
1669 for dir in ${TCL_VERSIONS} ; do
1670 if test -f $base/include/$dir/tcl.h ; then
1671 CPPFLAGS="$CPPFLAGS -I$base/include/$dir"
1676 if test "x$found" = "xyes" ; then
1680 if test "$found" != "yes" ; then
1682 AC_MSG_NOTICE([header file tcl.h NOT found: Web Alpine will not be built])
1688 dnl Local or supplied regex?
1689 if test "x$alpine_REGEX" != "xyes" ; then
1690 AC_SEARCH_LIBS([regcomp],posix regexp regex re,,
1692 if test x$alpine_REGEX = "xno" ; then
1693 AC_MSG_ERROR(Unable to find system regex library)
1699 if test "x$alpine_REGEX" != "xyes" ; then
1700 AC_CHECK_HEADER([regex.h],,
1702 if test x$alpine_REGEX = "xno" ; then
1703 AC_MSG_ERROR(Unable to find system regex include file)
1709 AC_DEFINE(HAVE_REGEX_H,1,[Regular expression header file exists])
1710 if test "x$alpine_REGEX" = "xyes" ; then
1711 CPPFLAGS="$CPPFLAGS -I${top_builddir}/regex"
1712 LDFLAGS="$LDFLAGS -L${top_builddir}/regex"
1714 REGEX_MAKEFILE="$REGEX_BUILD/Makefile"
1717 if test "x$with_pthread" != "xno" ; then
1718 AC_MSG_CHECKING([for pthread support])
1721 AC_MSG_RESULT([yes])
1724 AC_MSG_NOTICE([WARNING: pthread support on OpenBSD is unstable!])
1725 AM_CFLAGS="$AM_CFLAGS -pthread"
1728 LIBS="$PTHREAD_LIBS $LIBS"
1729 AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
1731 AC_DEFINE([HAVE_PTHREAD], [1], [System has pthread support])
1737 AC_SEARCH_LIBS([nanosleep], [rt posix4],
1739 AC_DEFINE([HAVE_NANOSLEEP], [1], [Define if system supports subsecond, non-alarm sleep])
1752 AC_HEADER_TIOCGWINSZ
1754 AC_CHECK_HEADERS([unistd.h])
1756 AC_CHECK_HEADERS([errno.h \
1782 dnl terminal line discipline?
1783 AC_CHECK_HEADER([termios.h],
1784 AC_DEFINE(HAS_TERMIOS, [1], [Define if systems uses termios terminal control]),
1786 AC_CHECK_HEADER([termio.h],
1787 AC_DEFINE(HAS_TERMIO, [1], [Define if systems uses termio terminal control]),
1789 AC_CHECK_HEADER([sgtty.h],
1790 AC_DEFINE(HAS_SGTTY, [1], [Define if systems uses old BSD-style terminal control]),
1792 AC_MSG_ERROR(Unable to figure out terminal control method)
1800 AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void.
1801 Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl
1802 AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
1803 [AC_LANG_PROGRAM([#include <sys/types.h>
1806 [return *(signal (0, 0)) (0) == 1;])],
1807 [ac_cv_type_signal=int],
1808 [ac_cv_type_signal=void])])
1809 AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
1810 (`int' or `void').])
1818 AC_CHECK_TYPES([union wait])
1820 AC_CHECK_HEADERS([stdint.h], [uint16=uint16_t], [
1821 AC_CHECK_HEADERS([inttypes.h], [uint16=uint16_t], [
1822 AC_CHECK_HEADERS([sys/types.h], [uint16=u_int16_t], [
1823 AC_CHECK_SIZEOF(unsigned short)
1824 if test $ac_cv_sizeof_unsigned_short -eq 2 ; then
1825 uint16="unsigned short"
1827 AC_CHECK_SIZEOF(unsigned int)
1828 if $ac_cv_sizeof_unsigned_int -eq 2 ; then
1829 uint16="unsigned int"
1831 AC_MSG_ERROR(Unable to determine 16 bit integer type)
1837 AC_DEFINE_UNQUOTED([UINT16], $uint16, [System defined unsigned 16 bit integer])
1839 AC_CHECK_HEADERS([stdint.h], [uint32=uint32_t], [
1840 AC_CHECK_HEADERS([inttypes.h], [uint32=uint32_t], [
1841 AC_CHECK_HEADERS([sys/types.h], [uint32=u_int32_t], [
1842 AC_CHECK_SIZEOF(unsigned int)
1843 if test $ac_cv_sizeof_unsigned_int -eq 4 ; then
1844 uint32="unsigned int"
1846 AC_CHECK_SIZEOF(unsigned long)
1847 if $ac_cv_sizeof_unsigned_long -eq 4 ; then
1848 uint32="unsigned long"
1850 AC_MSG_ERROR(Unable to determine 32 bit integer type)
1856 AC_DEFINE_UNQUOTED([UINT32], $uint32, [System defined unsigned 32 bit integer])
1858 AC_CACHE_CHECK(argument pointer type of qsort compare function and base,
1859 ac_cv_func_qsort_argtype,
1860 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1866 extern sortf(const void *, const void *);
1869 const void *b; { return 0; }
1871 qsort(base, 2, sizeof(char *), sortf);
1872 ]])],[ac_cv_func_qsort_argtype=void],[ac_cv_func_qsort_argtype=char])
1874 AC_DEFINE_UNQUOTED([qsort_t], $ac_cv_func_qsort_argtype, [qsort compare function argument type])
1876 dnl check for "struct passwd" ?
1878 AC_FUNC_SELECT_ARGTYPES
1882 dnl CHECK FOR LIBRARY FUNCTIONS
1885 AC_CHECK_FUNCS([strchr \
1918 AC_SEARCH_LIBS([gethostname],[nsl])
1920 AC_SEARCH_LIBS([socket],[socket],,
1925 AC_SEARCH_LIBS([bind],[bind],,
1930 dnl check for POSIX signal interface
1931 AC_CHECK_FUNCS([sigaction sigemptyset sigaddset sigprocmask],
1933 AC_DEFINE([POSIX_SIGNALS], [], [Define if system supports POSIX signal interface])
1936 AC_CHECK_FUNCS([sigset sigrelse],
1938 AC_DEFINE([SYSV_SIGNALS], [], [Define if system supports SYSV signal interface])
1942 AC_SEARCH_LIBS([syslog], [bsd socket inet],
1944 AC_DEFINE([HAVE_SYSLOG], [1], [Define if system supplies syslog() logging])
1948 dnl set pico newmail check directory
1949 if test -n "$alpine_with_local_maildir" ; then
1950 alpine_local_maildir=$alpine_with_local_maildir
1951 elif test -d /var/spool/mail ; then
1952 alpine_local_maildir="/var/spool/mail"
1953 elif test -d /var/mail ; then
1954 alpine_local_maildir="/var/mail"
1956 alpine_local_maildir="/usr/spool/mail"
1959 dnl set c-client make target
1960 if test -n "$alpine_with_c_client_target" ; then
1961 alpine_c_client_target=$alpine_with_c_client_target
1964 AC_DEFINE_UNQUOTED([SYSTYPE], "$systype", [Pine-Centric Host Specifier])
1965 AC_DEFINE_UNQUOTED([C_FILESEP],'$alpine_path_delim',[File name separator as character constant])
1966 AC_DEFINE_UNQUOTED([S_FILESEP],"$alpine_path_delim",[File name separator as string constant])
1967 AC_DEFINE_UNQUOTED([MAILDIR],"$alpine_local_maildir",[Path to local inboxes for pico newmail check])
1968 AC_DEFINE_UNQUOTED([MODE_READONLY], $alpine_mode_readonly, [File mode used to set readonly access])
1970 dnl c-client make particulars
1971 AC_SUBST([C_CLIENT_TARGET], $alpine_c_client_target)
1972 AC_SUBST([C_CLIENT_WITH_IPV6], $c_client_ip6)
1973 if test "x$alpine_SSLTYPE" = "xnone" ; then
1974 AC_MSG_NOTICE([* * * NOT Including SSL Support])
1975 c_client_specials="${c_client_specials}SSLTYPE=none "
1977 dnl issue any warnings for common OpenSSL issues
1979 if test -n "$alpine_SSLCERTS" -a -d "$alpine_SSLCERTS" ; then
1980 certdir="$alpine_SSLCERTS"
1981 elif test -n "$alpine_SSLDIR" -a -d "${alpine_SSLDIR}/certs" ; then
1982 certdir="${alpine_SSLDIR}/certs"
1983 elif test -n "$alpine_SSLDIR" -a -d "${alpine_SSLDIR}/ssl/certs" ; then
1984 certdir="${alpine_SSLDIR}/ssl/certs"
1985 elif test -n "$alpine_SSLCERTS_ORIG" -a -d "$alpine_SSLCERTS_ORIG" ; then
1986 certdir="$alpine_SSLCERTS_ORIG"
1987 elif test -n "$alpine_SSLCERTS" ; then
1988 certdir="$alpine_SSLCERTS"
1990 AC_MSG_NOTICE([SSL Problem: certificate directory not found])
1993 if test "x$with_smime" != "xno" ; then
1994 if test -n "$certdir" ; then
1995 AC_MSG_NOTICE([* * * S/MIME support enabled])
1996 AC_DEFINE([SMIME], [], [Enable S/MIME code])
1997 AC_DEFINE_UNQUOTED([SMIME_SSLCERTS],"$certdir",[Directory where S/MIME CACerts are located])
2003 if test -z "`ls ${certdir} | $EGREP '^@<:@0-9A-Fa-f@:>@{8}\.@<:@0-9@:>@'`" ; then
2004 SSL_BUNDLE_EXISTS="no"
2005 SSL_PEM="factory.pem ca-bundle.pem ca-bundle.crt"
2006 for SSL_BUNDLE in $SSL_PEM
2008 if test -f ${certdir}/${SSL_BUNDLE} ; then
2009 SSL_BUNDLE_EXISTS="yes"
2016 if test "x$SSL_BUNDLE_EXISTS" = "xno" -a "x$SSL_CERT_LINK" = "xno" ; then
2017 AC_MSG_NOTICE([* * * No certificates found in "${certdir}".])
2018 AC_MSG_NOTICE([* * * This might indicate that CA certs did not get properly])
2019 AC_MSG_NOTICE([* * * installed. If you get certificate validation failures])
2020 AC_MSG_NOTICE([* * * in Alpine, this might be the reason for them.])
2023 if test -n "$alpine_SSLINCLUDE" ; then
2024 c_client_specials="${c_client_specials}SSLINCLUDE=$alpine_SSLINCLUDE "
2027 if test -n "$alpine_SSLLIB" ; then
2028 c_client_specials="${c_client_specials}SSLLIB=$alpine_SSLLIB "
2031 if test -n "$alpine_SSLDIR" ; then
2032 c_client_specials="${c_client_specials}SSLDIR=$alpine_SSLDIR "
2035 if test -n "$certdir" ; then
2036 c_client_specials="${c_client_specials}SSLCERTS=$certdir "
2039 if test -n "$alpine_SSLKEYS" ; then
2040 c_client_specials="${c_client_specials}SSLKEYS=$alpine_SSLKEYS "
2045 if test "x$alpine_GSSTYPE" != "xnone" ; then
2047 AC_MSG_NOTICE([* * * Including Kerberos5 functionality])
2051 if test "x$alpine_NTLM" != "xnone" ; then
2053 AC_MSG_NOTICE([* * * Including NTLM Authenticator])
2056 if test -n "$CPPFLAGS" ; then
2057 alpine_c_client_cflags="$alpine_c_client_cflags ${CPPFLAGS}"
2059 if test -n "$CFLAGS" ; then
2060 alpine_c_client_cflags="$alpine_c_client_cflags ${CFLAGS}"
2063 if test -n "$alpine_c_client_cflags" ; then
2064 AC_SUBST(C_CLIENT_CFLAGS, EXTRACFLAGS=\"$alpine_c_client_cflags\")
2067 if test -n "$LDFLAGS" ; then
2068 alpine_c_client_ldflags="$alpine_c_client_ldflags ${LDFLAGS}"
2070 if test -n "$LIBS" ; then
2071 alpine_c_client_ldflags="$alpine_c_client_ldflags ${LIBS}"
2074 if test -n "$alpine_c_client_ldflags" ; then
2075 AC_SUBST(C_CLIENT_LDFLAGS, EXTRALDFLAGS=\"$alpine_c_client_ldflags\")
2078 if test -n "$alpine_c_client_gccoptlevel" ; then
2079 AC_SUBST(C_CLIENT_GCCOPTLEVEL, GCCOPTLEVEL=\"$alpine_c_client_gccoptlevel\")
2082 c_client_auths="$extra_auth_gss $extra_auth_ntlm"
2083 AC_SUBST([C_CLIENT_AUTHS], $c_client_auths)
2085 AC_SUBST([C_CLIENT_SPECIALS], $c_client_specials)
2087 dnl Deal with Web Alpine
2088 if test -z "$WEB_BUILD" ; then
2089 WEB_PUBCOOKIE_BUILD=
2090 AC_MSG_NOTICE([* * * TCL libraries could not be found.])
2091 AC_MSG_NOTICE([* * * WEB ALPINE COMPONENT WILL NOT BE BUILT.])
2093 if test -n "$WEB_PUBCOOKIE_BUILD" ; then
2094 if test "x$alpine_GSSTYPE" = "xnone" ; then
2095 WEB_PUBCOOKIE_BUILD=
2096 AC_MSG_NOTICE([* * * Kerberos5 support not found.])
2097 AC_MSG_NOTICE([* * * WEB ALPINE PUBCOOKIE COMPONENT WILL NOT BE BUILT.])
2098 elif test -z "$WEB_BINDIR" ; then
2099 WEB_PUBCOOKIE_BUILD=
2100 AC_MSG_NOTICE([* * * Web Alpine binary directory not provided.])
2101 AC_MSG_ERROR([* * * --with-pubcookie requires --with-web-bin=PATH.
2102 Please re-run configure with these options:
2103 --with-pubcookie --with-web-bin=/usr/local/libexec/alpine/bin])
2105 AC_DEFINE([PUBCOOKIE],[1],[Include support for UW Pubcookie Web Authentication])
2106 WEB_PUBCOOKIE_LIB=../pubcookie/libauthgssproxy.a
2107 WEB_PUBCOOKIE_LINK=gssapi_proxy.l
2112 AC_SUBST([REGEX_BUILD])
2114 AC_SUBST([WEB_BUILD])
2115 AC_SUBST([WEB_BINDIR])
2116 AC_SUBST([WEB_PUBCOOKIE_BUILD])
2117 AC_SUBST([WEB_PUBCOOKIE_LIB])
2118 AC_SUBST([WEB_PUBCOOKIE_LINK])
2120 AC_SUBST([AM_CFLAGS])
2121 AC_SUBST([AM_LDFLAGS])
2123 AC_CONFIG_FILES([m4/Makefile po/Makefile.in $REGEX_MAKEFILE \
2124 pith/osdep/Makefile pith/charconv/Makefile pith/Makefile \
2125 pico/osdep/Makefile pico/Makefile \
2126 alpine/osdep/Makefile alpine/Makefile \
2127 web/src/Makefile web/src/pubcookie/Makefile \
2128 web/src/alpined.d/Makefile \