1 dnl Process this file with autoconf to produce a configure script.
3 dnl /* ========================================================================
4 dnl * Copyright 2013-2017 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:23 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
48 AC_SUBST([LIBTOOL_DEPS])
50 AC_PATH_PROG(AR, ar, ar)
51 AC_PATH_PROG(RM, rm, rm)
52 AC_PATH_PROG(CP, cp, cp)
53 AC_PATH_PROG(LN, ln, ln)
54 AC_PATH_PROG(LS, ls, ls)
55 AC_PATH_PROG(SED, sed, sed)
56 AC_PATH_PROG(MAKE, make)
58 dnl COMPILE-TIME OPTIONS
60 AM_GNU_GETTEXT_VERSION([0.16.1])
61 AM_GNU_GETTEXT([external])
63 dnl enable dmalloc per http://dmalloc.com
64 dnl NOTE: does not check c-client
65 AC_MSG_CHECKING([option: dmalloc enabled])
66 AC_ARG_ENABLE(dmalloc, AS_HELP_STRING([--enable-dmalloc],[Enable dmalloc debugging]))
67 if test x$enable_dmalloc = "xyes" ; then
73 AC_ARG_WITH(dmalloc-dir,
74 AS_HELP_STRING([--with-dmalloc-dir=DIR],[Root of dmalloc lib/include path]),
76 if test "x$withval" != "xno" ; then
77 enable_dmalloc = "yes"
78 CPPFLAGS="$CPPFLAGS -I${withval}"
79 LDFLAGS="$LDFLAGS -L${withval}"
83 if test x$enable_dmalloc = "xyes" ; then
84 AC_DEFINE(ENABLE_DMALLOC, 1, [Define enable dmalloc debugging])
87 dnl set ps command, this test is fragile, but it should mostly work
88 ALPINE_psefcmd="/bin/ps auxww"
92 AS_HELP_STRING([--with-ps-cmd="CMD"],[Use this command to check running commands. Default: /bin/ps auxww]),
94 if test "x$withval" = "xno" -o "x$withval" = "xyes" -o "x$withval" = "x" ; then
95 withval=$ALPINE_psefcmd
97 ALPINE_PSTEST=`$withval | $EGREP "$withval" | $EGREP -v $EGREP`
98 if test -n "$ALPINE_PSTEST" ; then
99 ALPINE_psefcmd="$withval"
102 if test "x$ALPINE_psefcmd" != "x$withval" ; then
103 AC_MSG_WARN(failed command $withval. Trying $ALPINE_psefcmd)
107 if test "$ALPINE_psfailed" = "1" -o "$ALPINE_PSTEST" = "-" ; then
108 withval="$ALPINE_psefcmd"
109 ALPINE_PSTEST=`$withval | $EGREP "$withval" | $EGREP -v $EGREP`
110 if test -z "$ALPINE_PSTEST" ; then
116 if test "$ALPINE_psfailed" = "0" ; then
117 AC_DEFINE_UNQUOTED([PSEFCMD], "$ALPINE_psefcmd", [ps command which outputs list of running commands])
120 dnl Set default locale dir.
123 if test -d /opt/local ; then
124 localedir="/opt/local/share/locale"
126 localedir="\${datadir}/locale"
130 localedir="/usr/share"
133 localedir="\${datadir}/locale"
137 AC_ARG_WITH(localedir,
138 AS_HELP_STRING([--with-localedir=DIR],[Name of gettext locale directory]),
150 AC_SUBST(localedir, "[$localedir]")
152 # Setup OS-Specific features
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])
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
169 AC_MSG_ERROR([No suitable MacOSX SDK found. Make sure Xcode tools are installed])
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"
181 AC_ARG_WITH(include-path,
182 AS_HELP_STRING([--with-include-path=PATHS],[Colon-separated list of directories used for include file search]),
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}"
197 AC_ARG_WITH(lib-path,
198 AS_HELP_STRING([--with-lib-path=PATHS],[Colon-separated list of directories used for library search]),
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}"
213 AC_ARG_WITH(pubcookie,
214 AS_HELP_STRING([--with-pubcookie],[Include support for UW-Pubcookie Web Authentication]),
216 if test "x$withval" != "xno" ; then
217 WEB_PUBCOOKIE_BUILD=web/src/pubcookie
223 AS_HELP_STRING([--with-web-bin=PATH],[Directory to hold Web Alpine component binary files]),
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])
245 dnl ??? set AM_CFLAGS to optimize ???
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
255 CFLAGS="`echo $AM_CFLAGS | ${SED} 's/-O2//'`"
256 alpine_c_client_gccoptlevel="-O0"
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])
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])
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
285 AC_DEFINE([NEVER_ALLOW_CHANGING_FROM], [], [Disallow users changing their From address])
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])
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])
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])
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)]),
328 AC_PATH_PROG(SENDMAIL, sendmail, "", $PATH:/usr/sbin:/usr/lib)
336 AC_PATH_PROG(SENDMAIL, sendmail, "", $PATH:/usr/sbin:/usr/lib)
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)]),
347 if test "x$withval" != "xno" ; then
348 smtp_msa_flags=$withval
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
356 AS_HELP_STRING([--with-npa=PATH],[Posting agent when no nntp-servers defined (inews)]),
362 AC_PATH_PROG(NPA_PROG, inews, "", $PATH:/usr/sbin:/usr/lib)
370 AC_PATH_PROG(NPA_PROG, inews, "", $PATH:/usr/sbin:/usr/lib)
374 AC_ARG_WITH(npa-flags,
375 AS_HELP_STRING([--with-npa-flags=FLAGS],[Flags to allow posting via local agent (-h)]),
377 if test "x$withval" != "xno" ; then
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)]),
393 AC_PATH_PROG(PWPROG, passwd, "", $PATH:/usr/sbin:/usr/lib)
396 AC_PATH_PROG(PWPROG, $withval, "", $PATH:/usr/sbin:/usr/lib)
401 AC_PATH_PROG(PWPROG, passwd, "", $PATH:/usr/sbin:/usr/lib)
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]),
411 if test "x$withval" != "xno" ; then
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
428 if test "x$SPELLPROG" != "xno" ; then
429 AC_PATH_PROG(alpine_simple_spellcheck, $SPELLPROG)
430 if test -n "$alpine_simple_spellcheck" ; then
433 alpine_simple_spellcheck="$alpine_simple_spellcheck -l"
436 alpine_simple_spellcheck="$alpine_simple_spellcheck --dont-backup --mode=email list"
439 alpine_simple_spellcheck="$alpine_simple_spellcheck -l"
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]),
451 if test "x$withval" != "xno" ; then
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
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
470 alpine_interactive_spellcheck="$alpine_interactive_spellcheck --dont-backup --mode=email check"
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
492 NONE) dpv=/usr/local/lib/pine.conf ;;
493 *) dpv=${prefix}/lib/pine.conf ;;
495 AC_ARG_WITH(system-pinerc,
496 AS_HELP_STRING([--with-system-pinerc=VALUE],[System pinerc (/usr/local/lib/pine.conf)]),
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
515 NONE) dpv=/usr/local/lib/pine.conf.fixed ;;
516 *) dpv=${prefix}/lib/pine.conf.fixed ;;
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)]),
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
539 NONE) dpv=/usr/local/lib/pine.info ;;
540 *) dpv=${prefix}/lib/pine.info ;;
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)]),
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)
563 AS_HELP_STRING([--with-$1=VALUE],[$4 ($3)]),
565 if test "x$withval" != "xno" ; then
569 AC_DEFINE_UNQUOTED($2, "$dpv", [Default configuration value])
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],
578 AS_HELP_STRING([--with-$1=VALUE],[$4 ($3)]),
580 if test "x$withval" != "xno" ; then
584 AC_DEFINE_UNQUOTED($2, $dpv, [Default configuration value])
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])
639 AC_ARG_WITH(passfile,
640 AS_HELP_STRING([--with-passfile=FILENAME],[Password cache file (recommended when S/MIME is enabled and configured)]),
648 alpine_PASSFILE=$withval
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]),
658 alpine_os_credential_cache=$withval
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)]),
665 alpine_os_credential_cache_method=$withval
668 if test -n "$alpine_PASSFILE" ; then
669 case $alpine_os_credential_cache in
673 alpine_os_credential_cache="no"
674 AC_MSG_NOTICE([--with-passfile definition overrides OS-Specific password caching])
677 AC_DEFINE_UNQUOTED([PASSFILE], "$alpine_PASSFILE", [Password cache file (recommended if S/MIME is enabled and configured)])
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)]),
690 AC_DEFINE_UNQUOTED([DF_SSHPATH], "$withval", [set default value of ssh command path (defining should cause ssh to be preferred to rsh)])
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")]),
705 AC_DEFINE_UNQUOTED([DF_SSHCMD], "$withval", [set default value of ssh command string (usually "%s %s -l %s exec /etc/r%sd")])
711 dnl Set SSLDIR for c-client make
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"
726 dnl preload c-client default locations/options
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"
734 alpine_SSLDIR="/usr/share/ssl"
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"
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"
767 elif test -f /etc/manjaro-release ; then
768 alpine_SSLDIR="/etc/ssl"
769 alpine_SSLCERTS="$alpine_SSLDIR/certs"
770 alpine_SSLKEYS="$alpine_SSLDIR/private"
771 alpine_SSLINCLUDE="/usr/include/openssl"
772 alpine_SSLLIB="/usr/lib"
774 alpine_SSLTYPE="nopwd"
776 alpine_SSLCERTS="/etc/ssl/certs"
780 alpine_SSLTYPE="nopwd"
781 dnl Originally this is where certs are, and they might still be there, even
782 dnl after installing Homebrew, MacPorts or Fink. We will use it if we cannot
783 dnl find it anywhere else.
784 alpine_SSLCERTS_ORIG="/System/Library/OpenSSL/certs"
785 if test -d /usr/local/opt/openssl ; then
786 alpine_SSLDIR="/usr/local/opt/openssl"
787 alpine_SSLINCLUDE="$alpine_SSLDIR/include"
788 alpine_SSLLIB="$alpine_SSLDIR/lib"
789 alpine_SSLCERTS="/usr/local/etc/openssl"
790 alpine_SSLKEYS="$alpine_SSLDIR/private"
791 elif test -d /opt/local/etc/openssl ; then
792 alpine_SSLDIR="/opt/local"
793 alpine_SSLINCLUDE="$alpine_SSLDIR/include"
794 alpine_SSLLIB="$alpine_SSLDIR/lib"
795 alpine_SSLCERTS="/opt/local/etc/openssl/certs"
796 alpine_SSLKEYS="/opt/local/etc/openssl/private"
797 elif test -d /sw/etc/ssl ; then
798 alpine_SSLDIR="/sw/etc/ssl"
799 alpine_SSLINCLUDE="/sw/include"
800 alpine_SSLLIB="/sw/lib"
801 alpine_SSLCERTS="/sw/etc/ssl/certs"
802 alpine_SSLKEYS="/sw/etc/ssl/private"
803 elif test -d /usr/local/ssl ; then
804 alpine_SSLDIR="/usr/local/ssl"
805 elif test -d /System/Library/OpenSSL ; then
806 alpine_SSLDIR="/System/Library/OpenSSL"
807 alpine_SSLCERTS="$alpine_SSLDIR/certs"
808 alpine_SSLKEYS="$alpine_SSLDIR/private"
809 alpine_SSLLIB="/usr/lib"
810 alpine_SSLINCLUDE="/usr/include/openssl"
814 alpine_SSLDIR="/etc/openssl"
815 alpine_SSLCERTS="$alpine_SSLDIR/certs"
816 alpine_SSLKEYS="$alpine_SSLDIR/private"
817 alpine_SSLINCLUDE="/usr/include/openssl"
818 alpine_SSLLIB="/usr/lib"
821 alpine_SSLDIR="/etc/openssl"
822 alpine_SSLCERTS="$alpine_SSLDIR/certs"
823 alpine_SSLKEYS="$alpine_SSLDIR/private"
824 alpine_SSLINCLUDE="/usr/include/openssl"
825 alpine_SSLLIB="/usr/lib"
828 alpine_SSLTYPE="nopwd"
830 alpine_SSLCERTS="/etc/ssl/certs"
833 alpine_SSLDIR="/etc/ssl"
834 alpine_SSLCERTS="$alpine_SSLDIR/certs"
835 alpine_SSLKEYS="$alpine_SSLDIR/private"
836 if test -d /usr/local/include/openssl ; then
837 alpine_SSLINCLUDE="/usr/local/include/openssl"
838 alpine_SSLLIB="/usr/local/lib"
840 alpine_SSLINCLUDE="/usr/include/openssl"
841 alpine_SSLLIB="/usr/lib"
845 alpine_SSLDIR="/etc/ssl"
846 alpine_SSLINCLUDE="/usr/include/openssl"
847 alpine_SSLLIB="/usr/lib"
848 alpine_SSLCERTS="/etc/ssl"
849 alpine_SSLKEYS="/etc/ssl/private"
852 alpine_SSLDIR="/usr/ssl"
853 alpine_SSLCERTS="$alpine_SSLDIR/certs"
854 alpine_SSLKEYS="$alpine_SSLDIR/certs"
855 alpine_SSLINCLUDE="/usr/include/openssl"
856 alpine_SSLLIB="/usr/lib"
858 *-sco-sysv* | *-sysv*UnixWare | *-sysv*OpenUNIX)
859 alpine_SSLTYPE="sco.nopwd"
860 alpine_SSLDIR="/usr/local/ssl"
863 if test -d /usr/include/openssl ; then
864 alpine_SSLINCLUDE="/usr/include/openssl"
865 elif test -d /usr/sfw/include/openssl ; then
866 alpine_SSLDIR="/usr/sfw"
867 elif test -d /opt/csw/include/openssl ; then
868 alpine_SSLDIR="/opt/csw"
869 if test -d /opt/csw/ssl/certs ; then
870 alpine_SSLCERTS="/opt/csw/ssl/certs"
873 if test -z "$alpine_SSLCERTS" -a -d /etc/certs ; then
874 alpine_SSLCERTS="/etc/certs"
878 alpine_SSLTYPE="nopwd"
879 alpine_SSLDIR="/usr/local/ssl"
884 if test "x$alpine_SSLTYPE" != "xnone" ; then
886 AS_HELP_STRING([--with-ssl-dir=DIR],[Root of SSL lib/include path]),
888 if test "x$withval" != "xno" ; then
889 alpine_SSLDIR=$withval
890 alpine_SSLINCLUDE=$alpine_SSLDIR/include
891 alpine_SSLLIB=$alpine_SSLDIR/lib
895 AC_ARG_WITH(ssl-certs-dir,
896 AS_HELP_STRING([--with-ssl-certs-dir=DIR],[Path to SSL certificate directory]),
898 if test "x$withval" != "xno" ; then
899 alpine_SSLCERTS=$withval
903 AC_ARG_WITH(ssl-include-dir,
904 AS_HELP_STRING([--with-ssl-include-dir=DIR],[SSL include file path]),
906 if test "x$withval" != "xno" ; then
907 alpine_SSLINCLUDE=$withval
911 AC_ARG_WITH(ssl-lib-dir,
912 AS_HELP_STRING([--with-ssl-lib-dir=DIR],[SSL library path]),
914 if test "x$withval" != "xno" ; then
915 alpine_SSLLIB=$withval
919 dnl setup globals so tests below work
920 if test -n "$alpine_SSLINCLUDE" ; then
921 CPPFLAGS="-I$alpine_SSLINCLUDE $CPPFLAGS"
922 elif test -n "$alpine_SSLDIR" ; then
923 CPPFLAGS="-I${alpine_SSLDIR}/include $CPPFLAGS"
925 if test -n "$alpine_SSLLIB" ; then
926 LDFLAGS="-L$alpine_SSLLIB $LDFLAGS"
927 elif test -n "$alpine_SSLDIR" ; then
928 LDFLAGS="-L${alpine_SSLDIR}/lib $LDFLAGS"
933 dnl Include Kerberos?
934 dnl Set GSSDIR for c-client make
936 AS_HELP_STRING([--without-krb5],[Disable Kerberos support]),
937 [ with_krb5=$withval ])
939 if test "x$with_krb5" = "xno" ; then
940 alpine_GSSTYPE="none"
944 AC_ARG_WITH(krb5-dir,
945 AS_HELP_STRING([--with-krb5-dir=DIR],[Root of Kerberos lib/include path]),
947 if test "x$withval" != "xno" ; then
948 CPPFLAGS="$CPPFLAGS -I${withval}/include"
949 LDFLAGS="$LDFLAGS -L${withval}/lib"
953 AC_ARG_WITH(krb5-include-dir,
954 AS_HELP_STRING([--with-krb5-include-dir=DIR],[Kerberos include file path]),
956 if test "x$withval" != "xno" ; then
957 CPPFLAGS="$CPPFLAGS -I$withval"
961 AC_ARG_WITH(krb5-lib-dir,
962 AS_HELP_STRING([--with-krb5-lib-dir=DIR],[Kerberos library path]),
964 if test "x$withval" != "xno" ; then
965 LDFLAGS="$LDFLAGS -L$withval"
972 AS_HELP_STRING([--without-ldap],[Disable LDAP query support]),
973 [ with_ldap=$withval ])
975 if test "x$with_ldap" = "xno" ; then
977 AC_MSG_NOTICE([Excluding LDAP Support])
979 dnl Do stuff to figure out where OpenLDAP is
982 AC_ARG_WITH(ldap-dir,
983 AS_HELP_STRING([--with-ldap-dir=DIR],[Root of LDAP lib/include path]),
985 if test "x$withval" != "xno" ; then
986 CPPFLAGS="$CPPFLAGS -I${withval}/include"
987 LDFLAGS="$LDFLAGS -L${withval}/lib"
991 AC_ARG_WITH(ldap-include-dir,
992 AS_HELP_STRING([--with-ldap-include-dir=DIR],[Directory containing LDAP include files]),
994 if test "x$withval" != "xno" ; then
995 CPPFLAGS="$CPPFLAGS -I$withval"
999 AC_ARG_WITH(ldap-lib-dir,
1000 AS_HELP_STRING([--with-ldap-lib-dir=DIR],[LDAP library path]),
1002 if test "x$withval" != "xno" ; then
1003 LDFLAGS="$LDFLAGS -L$withval"
1010 AS_HELP_STRING([--without-smime],[Disable S/MIME]),
1011 [ with_smime=$withval ])
1015 AS_HELP_STRING([--without-tcl],[Disable TCL, thus Web Alpine support]),
1016 [ with_tcl=$withval ])
1018 if test "x$with_tcl" = "xno" ; then
1020 AC_MSG_NOTICE([Excluding TCL Support, and thus Web Alpine Support])
1022 AC_ARG_WITH(tcl-lib,
1023 AS_HELP_STRING([--with-tcl-lib=LIBRARY],[Specific TCL Library, like \"tcl8.6\"]),
1025 if test "x$withval" != "xno" ; then
1026 alpine_TCLLIB=$withval
1029 AC_ARG_WITH(tcl-include,
1030 AS_HELP_STRING([--with-tcl-include=DIR],[Directory containing TCL include files]),
1032 if test "x$withval" != "xno" ; then
1033 CPPFLAGS="$CPPFLAGS -I$withval"
1034 alpine_TCLINC=$withval
1039 AC_ARG_WITH(supplied-regex,
1040 AS_HELP_STRING([--with-supplied-regex],[Use regex library supplied with alpine]),
1041 [ alpine_REGEX=$withval ])
1043 AC_ARG_WITH(pthread,
1044 AS_HELP_STRING([--without-pthread],[Do NOT test for nor build with POSIX thread support]),
1045 [ with_pthread=$withval ])
1047 AC_ARG_WITH(system-mail-directory,
1048 AS_HELP_STRING([--with-system-mail-directory=DIR],[Directory where local mail is delivered]),
1050 if test "x$withval" != "xno" ; then
1051 alpine_with_local_maildir="$withval"
1055 AC_ARG_WITH(c-client-target,
1056 AS_HELP_STRING([--with-c-client-target=TARGET],[IMAP build target (see imap/Makefile)]),
1058 if test "x$withval" != "xno" ;then
1059 alpine_with_c_client_target="$withval"
1064 dnl Assume PAM is *not* required and only set the systems that need it.
1067 dnl HOST-OS SPECIFIC DEFINITIONS
1068 dnl Tests and assignments below are mostly to coax the appropriate
1069 dnl build from c-client. Most of this will go away when c-client
1070 dnl adopts configure
1072 *-linux-gnu*|*-k*bsd*-gnu*|*-gnu*)
1073 alpine_path_delim="/"
1074 alpine_mode_readonly="(0600)"
1075 if test -f /etc/fedora-release ; then
1078 if test -d /etc/pki/tls ; then
1079 alpine_c_client_target="lfd"
1081 alpine_c_client_target="lrh"
1083 elif test -f /etc/mandrake-release ; then
1085 alpine_c_client_target="lmd"
1087 elif test -f /etc/redhat-release -o -f /etc/redhat_version ; then
1090 if test -d /etc/pki/tls ; then
1091 alpine_c_client_target="lr5"
1093 alpine_c_client_target="lrh"
1095 elif test -f /etc/debian_release -o -f /etc/debian_version ; then
1096 if test -d /etc/osso-af-init ; then
1098 alpine_c_client_target="ln8"
1101 alpine_c_client_target="ldb"
1104 elif test -f /etc/SuSE-release ; then
1106 alpine_c_client_target="lsu"
1110 AC_CHECK_LIB(pam, pam_start,
1112 alpine_c_client_target="lnp"
1116 if test -f /etc/shadow ; then
1117 alpine_c_client_target="slx"
1119 alpine_c_client_target="lnx"
1126 alpine_path_delim="/"
1127 alpine_mode_readonly="(0600)"
1128 LIBS="$LIBS -framework Carbon -framework ApplicationServices -framework Security"
1129 AM_CFLAGS="$AM_CFLAGS -Dbsd"
1130 dnl SEE include/system.h
1131 AC_DEFINE([OSX_TARGET],[1],[OSX TARGET])
1132 case "$alpine_os_credential_cache" in
1136 AC_DEFINE([APPLEKEYCHAIN], [1], [Use Apple OS X key chain for credential caching])
1139 AC_CHECK_LIB(pam, pam_start,
1141 AC_CHECK_HEADER([security/pam_appl.h],
1144 alpine_c_client_target="oxs"
1146 [ AC_CHECK_HEADER([pam/pam_appl.h],
1149 alpine_c_client_target="oxp"
1153 alpine_pam_none_reason="header files not found"
1158 alpine_c_client_target="osx"
1162 if test x$GCC = "xyes" ; then
1164 alpine_c_client_target="gso"
1165 CFLAGS="$CFLAGS -D__USE_LEGACY_PROTOTYPES__"
1168 alpine_c_client_target="soc"
1169 AC_DEFINE([__EXTENSIONS__], [1], [Enable extended pthread features on Solaris])
1171 alpine_path_delim="/"
1172 alpine_mode_readonly="(0600)"
1173 dnl possible other OS's need this.
1174 dnl Use autoconf 2.61's AC_USE_SYSTEM_EXTENSIONS at some point
1178 alpine_path_delim="/"
1179 alpine_mode_readonly="(0600)"
1180 alpine_c_client_target="s40"
1183 if test x$GCC = "xyes" ; then
1185 alpine_c_client_target="go5"
1188 alpine_c_client_target="sc5"
1190 alpine_path_delim="/"
1191 alpine_mode_readonly="(0600)"
1192 dnl possible other OS's need this.
1193 dnl Use autoconf 2.61's AC_USE_SYSTEM_EXTENSIONS at some point
1197 alpine_path_delim="/"
1198 alpine_mode_readonly="(0600)"
1199 alpine_c_client_target="nx3"
1203 alpine_path_delim="/"
1204 alpine_mode_readonly="(0600)"
1205 alpine_c_client_target="neb"
1209 alpine_path_delim="/"
1210 alpine_mode_readonly="(0600)"
1211 alpine_c_client_target="neb"
1215 alpine_path_delim="/"
1216 alpine_mode_readonly="(0600)"
1217 alpine_c_client_target="bsi"
1221 alpine_path_delim="/"
1222 alpine_mode_readonly="(0600)"
1223 alpine_c_client_target="bsf"
1224 LIBS="$LIBS $LIBINTL"
1228 alpine_path_delim="/"
1229 alpine_mode_readonly="(0600)"
1230 alpine_c_client_target="bso"
1231 LIBS="$LIBS $LIBINTL"
1235 alpine_path_delim="/"
1236 alpine_mode_readonly="(0600)"
1237 alpine_c_client_target="a52"
1241 alpine_path_delim="/"
1242 alpine_mode_readonly="(0600)"
1243 alpine_c_client_target="a41"
1247 alpine_path_delim="/"
1248 alpine_mode_readonly="(0600)"
1249 alpine_c_client_target="a32"
1251 *-*UNIX_SV | *-*-sysv5UnixWare7* | *-*OpenUNIX*)
1253 alpine_path_delim="/"
1254 alpine_mode_readonly="(0600)"
1255 alpine_c_client_target="uw2"
1259 alpine_path_delim="/"
1260 alpine_mode_readonly="(0600)"
1261 alpine_c_client_target="osf"
1265 alpine_path_delim="/"
1266 alpine_mode_readonly="(S_IREAD | S_IWRITE)"
1267 alpine_c_client_target="cyg"
1268 LIBS="$LIBS $LIBINTL"
1270 windows* | *-*-pw32*)
1272 alpine_path_delim="\\"
1273 alpine_mode_readonly="(S_IREAD | S_IWRITE)"
1274 alpine_c_client_target="wnt"
1275 AC_DEFINE([_WINDOWS], [1], [Windows is just too different])
1278 AC_MSG_ERROR(Unrecognized system: $host)
1284 AS_HELP_STRING([--without-ipv6],[Disable IPv6, primarily to work around resolver problems]),
1285 [ with_ipv6=$withval ])
1287 if test "x$with_ipv6" = "xno" ; then
1288 AC_MSG_NOTICE([Excluding IPv6 Support])
1289 c_client_specials="${c_client_specials}IP6=4 "
1292 c_client_ip6="touch imap/ip6"
1298 if test x$enable_dmalloc = "xyes" ; then
1299 if test "x$with_pthread" = "xyes" ; then
1300 dmalloc_lib=dmallocth
1305 AC_CHECK_LIB($dmalloc_lib,dmalloc_shutdown,,
1307 AC_MSG_ERROR($dmalloc_lib requested, but -ldmalloc not found)
1311 dnl which terminal cabability database
1312 AC_CHECK_LIB(tinfo, setupterm,
1314 alpine_termdata=info
1315 LIBS="$LIBS -ltinfo"
1318 AC_CHECK_LIB(ncurses, setupterm,
1320 alpine_termdata=info
1321 LIBS="$LIBS -lncurses"
1324 AC_CHECK_LIB(curses, setupterm,
1326 alpine_termdata=info
1327 LIBS="$LIBS -lcurses"
1330 AC_CHECK_LIB(termlib, tgetent,
1333 LIBS="$LIBS -ltermlib"
1336 AC_CHECK_LIB(termcap, tgetent,
1339 LIBS="$LIBS -ltermcap"
1342 AC_MSG_ERROR(Terminfo/termcap not found)
1348 case $alpine_termdata in
1350 AC_DEFINE(HAS_TERMINFO, [1], [Define if systems uses terminfo terminal database])
1353 AC_DEFINE(HAS_TERMCAP, [1], [Define if systems uses termcap terminal database])
1357 dnl is -ldl present? if so, add it
1358 AC_SEARCH_LIBS([dlopen], [dl dld],, [ alpine_DL="none" ])
1359 if test "x$alpine_DL" = "xnone" ; then
1360 AC_MSG_ERROR([No library containing dlopen found])
1364 dnl Check if openssl = LibreSSL
1365 if test "x$alpine_SSLTYPE" != "xnone" ; then
1366 AC_MSG_CHECKING([if OpenSSL is LibreSSL])
1372 #endif /* HAVE_STDINT_H */
1373 #include <openssl/ssl.h>
1375 #if OPENSSL_VERSION_NUMBER < 0x20000000L
1379 [ AC_MSG_RESULT(yes)
1380 alpine_SSLPROVIDER="libressl"
1384 [ AC_MSG_WARN([cross compiling: not checking])])
1387 dnl Check Openssl/LibreSSL version first
1388 if test "x$alpine_SSLTYPE" != "xnone" -a "x$alpine_SSLPROVIDER" != "xlibressl" ; then
1389 AC_MSG_CHECKING([Openssl library version >= 1.0.0c])
1395 #endif /* HAVE_STDINT_H */
1396 #include <openssl/ssl.h>
1398 #if OPENSSL_VERSION_NUMBER < 0x1000003fL
1402 [ AC_MSG_RESULT(yes)
1403 alpine_SSLPROVIDER="openssl"
1405 [ alpine_SSLTYPE="none" ],
1406 [ AC_MSG_WARN([cross compiling: not checking])])
1408 if test "x$alpine_SSLTYPE" = "xnone" ; then
1409 AC_MSG_ERROR(Install openssl version >= 1.0.0c)
1414 dnl Now check if we are working with version 1.1.0 of openssl
1415 if test "x$alpine_SSLTYPE" != "xnone" -a "x$alpine_SSLPROVIDER" != "xlibressl" ; then
1416 AC_MSG_CHECKING([Openssl library version >= 1.1.0])
1422 #endif /* HAVE_STDINT_H */
1423 #include <openssl/ssl.h>
1425 #if OPENSSL_VERSION_NUMBER < 0x10100000L
1429 [ AC_MSG_RESULT(yes)
1430 alpine_SSLVERSION="new"
1431 CFLAGS="$CFLAGS -DOPENSSL_1_1_0 -DOPENSSL_API_COMPAT=0x10100000L"
1434 alpine_SSLVERSION="old" ],
1435 [ AC_MSG_WARN([cross compiling: not checking])])
1438 dnl Crypto support is needed
1439 if test "x$alpine_SSLTYPE" != "xnone" ; then
1440 if test "x$alpine_SSLVERSION" = "xold" -o "x$alpine_SSLPROVIDER" = "xlibressl" ; then
1441 AC_SEARCH_LIBS(SSLeay,crypto,, [ alpine_CRYPTO="none" ])
1443 AC_SEARCH_LIBS(OpenSSL_version_num,crypto,, [ alpine_CRYPTO="none" ])
1445 if test "x$alpine_CRYPTO" = "xnone" ; then
1446 AC_MSG_ERROR(crypto library NOT found)
1451 AC_CHECK_HEADER(crypto.h, , [ alpine_CRYPTO_DEVEL="none" ])
1452 if test "x$alpine_CRYPTO_DEVEL" = "xnone" ; then
1453 AC_MSG_ERROR(crypto library file crypto.h NOT found. Install correspoding libcrypt-devel package)
1461 if test "x$alpine_SSLTYPE" != "xnone" ; then
1462 if test "x$alpine_SSLVERSION" = "xold" -o "x$alpine_SSLPROVIDER" = "xlibressl" ; then
1463 AC_SEARCH_LIBS(TLSv1_2_client_method,ssl,
1464 [ alpine_c_client_cflags="$alpine_c_client_cflags -DTLSV1_2"
1465 AC_DEFINE([SSL_SUPPORTS_TLSV1_2], [1], [SSL Supports TLSV1.2])
1468 AC_SEARCH_LIBS(TLS_client_method,ssl,, [ alpine_SSLTYPE="none"])
1469 AC_SEARCH_LIBS(DTLS_client_method,ssl,,[ alpine_SSLTYPE="none"])
1470 if test "x$alpine_SSLTYPE" != "xnone" ; then
1471 alpine_c_client_cflags="$alpine_c_client_cflags -DTLSV1_2"
1472 AC_DEFINE([SSL_SUPPORTS_TLSV1_2], [1], [SSL Supports TLSV1.2])
1477 dnl provide SSL support?
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(SSL_library_init,ssl,,[ alpine_SSLTYPE="none" ])
1481 if test "x$alpine_SSLTYPE" = "xnone" ; then
1482 AC_MSG_ERROR(No library containing SSL_library_init found in your path)
1486 AC_SEARCH_LIBS(OPENSSL_init_ssl,ssl,, [ alpine_SSLTYPE="none" ])
1487 if test "x$alpine_SSLTYPE" = "xnone" ; then
1488 AC_MSG_ERROR(No library containing OPENSSL_init_ssl found in your path)
1494 dnl provide LDAP support?
1495 if test "$alpine_with_ldap" = "yes" ; then
1497 AC_CHECK_LIB(lber, ber_alloc,
1501 AC_SEARCH_LIBS(ldap_initialize,ldap,
1506 AC_SEARCH_LIBS(ldap_open,ldap,
1512 if test "$alpine_has_ldap" = "yes" ; then
1513 AC_MSG_NOTICE([* * * Including LDAP Support])
1514 AC_DEFINE([ENABLE_LDAP], [], [Enable LDAP query support])
1518 dnl PAM support is needed to build c-client in some linux, and hence Alpine.
1519 if test "x$alpine_PAM" != "xnone" ; then
1520 AC_SEARCH_LIBS(pam_start,pam,
1523 AC_CHECK_HEADER([security/pam_appl.h],
1527 dnl Only mac is incompatible, do not spread bad habits.
1528 [ AC_CHECK_HEADER([pam/pam_appl.h],
1531 if test "x$alpine_c_client_target" != "xoxp" ; then
1533 alpine_pam_none_reason="header files not in security/ directory"
1538 alpine_pam_none_reason="header files not found"
1544 alpine_pam_none_reason="library files not found"
1546 if test -n "$alpine_pam_none_reason" ; then
1547 AC_MSG_ERROR(No PAM support: $alpine_pam_none_reason)
1552 dnl provide KRB5 support?
1553 if test "x$alpine_GSSTYPE" != "xnone" ; then
1554 AC_SEARCH_LIBS(gss_init_sec_context,gss gssapi gssapi_krb5,
1558 AC_CHECK_HEADER([gssapi/gssapi_generic.h],,
1560 if test ! -d /usr/kerberos/include ; then
1561 alpine_GSSTYPE="none"
1562 alpine_gss_none_reason="header files not found"
1567 alpine_GSSTYPE="none"
1568 alpine_gss_none_reason="libraries not found"
1570 if test -n "$alpine_gss_none_reason" ; then
1571 AC_MSG_NOTICE([NOT including Kerberos Support: $alpine_gss_none_reason])
1577 AC_HELP_STRING([--without-ntlm],[Disable NTLM client support]),
1578 [with_ntlm=$withval])
1580 dnl provide NTLM support?
1581 if test "x$with_ntlm" = "xno" ; then
1586 AC_SEARCH_LIBS(buildSmbNtlmAuthRequest, ntlm,
1588 AC_CHECK_HEADER([ntlm.h],
1591 AC_MSG_NOTICE([including NTLM support])
1595 alpine_ntlm_none_reason="header file ntlm.h not found"
1600 alpine_ntlm_none_reason="ntlm library not found"
1602 if test -n "$alpine_ntlm_none_reason" ; then
1603 AC_MSG_NOTICE([NOT including NTLM Support: $alpine_ntlm_none_reason])
1607 dnl check for tcl libraries for Web Alpine (HACKY)
1608 if test -n "$WEB_BUILD" ; then
1609 TCL_VERSIONS_DOT="tcl8.6 tcl8.5 tcl8.4 tcl8.3"
1610 TCL_VERSIONS_NODOT="`echo ${TCL_VERSIONS_DOT} | ${SED} 's/\.//g'`"
1611 TCL_VERSIONS="${TCL_VERSIONS_DOT} ${TCL_VERSIONS_NODOT} tcl"
1612 AC_SEARCH_LIBS([Tcl_Eval],[$alpine_TCLLIB ${TCL_VERSIONS}],,
1617 dnl look for header file
1618 if test -n "$alpine_TCLINC" ; then
1619 AC_CHECK_HEADER($alpine_TCLINC/tcl.h,,
1623 if test -z "$WEB_BUILD" ; then
1624 AC_MSG_NOTICE([Tcl Include file NOT found])
1627 AC_CHECK_HEADER(tcl.h,,
1629 for base in /usr /usr/local ; do
1630 for dir in ${TCL_VERSIONS} ; do
1631 if test -f $base/include/$dir/tcl.h ; then
1632 CPPFLAGS="$CPPFLAGS -I$base/include/$dir"
1637 if test "x$found" = "xyes" ; then
1641 if test "$found" != "yes" ; then
1643 AC_MSG_NOTICE([header file tcl.h NOT found: Web Alpine will not be built])
1649 dnl Local or supplied regex?
1650 if test "x$alpine_REGEX" != "xyes" ; then
1651 AC_SEARCH_LIBS([regcomp],posix regexp regex re,,
1653 if test x$alpine_REGEX = "xno" ; then
1654 AC_MSG_ERROR(Unable to find system regex library)
1660 if test "x$alpine_REGEX" != "xyes" ; then
1661 AC_CHECK_HEADER([regex.h],,
1663 if test x$alpine_REGEX = "xno" ; then
1664 AC_MSG_ERROR(Unable to find system regex include file)
1670 AC_DEFINE(HAVE_REGEX_H,1,[Regular expression header file exists])
1671 if test "x$alpine_REGEX" = "xyes" ; then
1672 CPPFLAGS="$CPPFLAGS -I${top_builddir}/regex"
1673 LDFLAGS="$LDFLAGS -L${top_builddir}/regex"
1675 REGEX_MAKEFILE="$REGEX_BUILD/Makefile"
1678 if test "x$with_pthread" != "xno" ; then
1679 AC_MSG_CHECKING([for pthread support])
1682 AC_MSG_RESULT([yes])
1685 AC_MSG_NOTICE([WARNING: pthread support on OpenBSD is unstable!])
1686 AM_CFLAGS="$AM_CFLAGS -pthread"
1689 LIBS="$PTHREAD_LIBS $LIBS"
1690 AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
1692 AC_DEFINE([HAVE_PTHREAD], [1], [System has pthread support])
1698 AC_SEARCH_LIBS([nanosleep], [rt posix4],
1700 AC_DEFINE([HAVE_NANOSLEEP], [1], [Define if system supports subsecond, non-alarm sleep])
1713 AC_HEADER_TIOCGWINSZ
1715 AC_CHECK_HEADERS([unistd.h])
1717 AC_CHECK_HEADERS([errno.h \
1743 dnl terminal line discipline?
1744 AC_CHECK_HEADER([termios.h],
1745 AC_DEFINE(HAS_TERMIOS, [1], [Define if systems uses termios terminal control]),
1747 AC_CHECK_HEADER([termio.h],
1748 AC_DEFINE(HAS_TERMIO, [1], [Define if systems uses termio terminal control]),
1750 AC_CHECK_HEADER([sgtty.h],
1751 AC_DEFINE(HAS_SGTTY, [1], [Define if systems uses old BSD-style terminal control]),
1753 AC_MSG_ERROR(Unable to figure out terminal control method)
1761 AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void.
1762 Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl
1763 AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
1764 [AC_LANG_PROGRAM([#include <sys/types.h>
1767 [return *(signal (0, 0)) (0) == 1;])],
1768 [ac_cv_type_signal=int],
1769 [ac_cv_type_signal=void])])
1770 AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
1771 (`int' or `void').])
1779 AC_CHECK_TYPES([union wait])
1781 AC_CHECK_HEADERS([stdint.h], [uint16=uint16_t], [
1782 AC_CHECK_HEADERS([inttypes.h], [uint16=uint16_t], [
1783 AC_CHECK_HEADERS([sys/types.h], [uint16=u_int16_t], [
1784 AC_CHECK_SIZEOF(unsigned short)
1785 if test $ac_cv_sizeof_unsigned_short -eq 2 ; then
1786 uint16="unsigned short"
1788 AC_CHECK_SIZEOF(unsigned int)
1789 if $ac_cv_sizeof_unsigned_int -eq 2 ; then
1790 uint16="unsigned int"
1792 AC_MSG_ERROR(Unable to determine 16 bit integer type)
1798 AC_DEFINE_UNQUOTED([UINT16], $uint16, [System defined unsigned 16 bit integer])
1800 AC_CHECK_HEADERS([stdint.h], [uint32=uint32_t], [
1801 AC_CHECK_HEADERS([inttypes.h], [uint32=uint32_t], [
1802 AC_CHECK_HEADERS([sys/types.h], [uint32=u_int32_t], [
1803 AC_CHECK_SIZEOF(unsigned int)
1804 if test $ac_cv_sizeof_unsigned_int -eq 4 ; then
1805 uint32="unsigned int"
1807 AC_CHECK_SIZEOF(unsigned long)
1808 if $ac_cv_sizeof_unsigned_long -eq 4 ; then
1809 uint32="unsigned long"
1811 AC_MSG_ERROR(Unable to determine 32 bit integer type)
1817 AC_DEFINE_UNQUOTED([UINT32], $uint32, [System defined unsigned 32 bit integer])
1819 AC_CACHE_CHECK(argument pointer type of qsort compare function and base,
1820 ac_cv_func_qsort_argtype,
1821 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1827 extern sortf(const void *, const void *);
1830 const void *b; { return 0; }
1832 qsort(base, 2, sizeof(char *), sortf);
1833 ]])],[ac_cv_func_qsort_argtype=void],[ac_cv_func_qsort_argtype=char])
1835 AC_DEFINE_UNQUOTED([qsort_t], $ac_cv_func_qsort_argtype, [qsort compare function argument type])
1837 dnl check for "struct passwd" ?
1839 AC_FUNC_SELECT_ARGTYPES
1843 dnl CHECK FOR LIBRARY FUNCTIONS
1846 AC_CHECK_FUNCS([strchr \
1879 AC_SEARCH_LIBS([gethostname],[nsl])
1881 AC_SEARCH_LIBS([socket],[socket],,
1886 AC_SEARCH_LIBS([bind],[bind],,
1891 dnl check for POSIX signal interface
1892 AC_CHECK_FUNCS([sigaction sigemptyset sigaddset sigprocmask],
1894 AC_DEFINE([POSIX_SIGNALS], [], [Define if system supports POSIX signal interface])
1897 AC_CHECK_FUNCS([sigset sigrelse],
1899 AC_DEFINE([SYSV_SIGNALS], [], [Define if system supports SYSV signal interface])
1903 AC_SEARCH_LIBS([syslog], [bsd socket inet],
1905 AC_DEFINE([HAVE_SYSLOG], [1], [Define if system supplies syslog() logging])
1909 dnl set pico newmail check directory
1910 if test -n "$alpine_with_local_maildir" ; then
1911 alpine_local_maildir=$alpine_with_local_maildir
1912 elif test -d /var/spool/mail ; then
1913 alpine_local_maildir="/var/spool/mail"
1914 elif test -d /var/mail ; then
1915 alpine_local_maildir="/var/mail"
1917 alpine_local_maildir="/usr/spool/mail"
1920 dnl set c-client make target
1921 if test -n "$alpine_with_c_client_target" ; then
1922 alpine_c_client_target=$alpine_with_c_client_target
1925 AC_DEFINE_UNQUOTED([SYSTYPE], "$systype", [Pine-Centric Host Specifier])
1926 AC_DEFINE_UNQUOTED([C_FILESEP],'$alpine_path_delim',[File name separator as character constant])
1927 AC_DEFINE_UNQUOTED([S_FILESEP],"$alpine_path_delim",[File name separator as string constant])
1928 AC_DEFINE_UNQUOTED([MAILDIR],"$alpine_local_maildir",[Path to local inboxes for pico newmail check])
1929 AC_DEFINE_UNQUOTED([MODE_READONLY], $alpine_mode_readonly, [File mode used to set readonly access])
1931 dnl c-client make particulars
1932 AC_SUBST([C_CLIENT_TARGET], $alpine_c_client_target)
1933 AC_SUBST([C_CLIENT_WITH_IPV6], $c_client_ip6)
1934 if test "x$alpine_SSLTYPE" = "xnone" ; then
1935 AC_MSG_NOTICE([* * * NOT Including SSL Support])
1936 c_client_specials="${c_client_specials}SSLTYPE=none "
1938 dnl issue any warnings for common OpenSSL issues
1940 if test -n "$alpine_SSLCERTS" -a -d "$alpine_SSLCERTS" ; then
1941 certdir="$alpine_SSLCERTS"
1942 elif test -n "$alpine_SSLDIR" -a -d "${alpine_SSLDIR}/certs" ; then
1943 certdir="${alpine_SSLDIR}/certs"
1944 elif test -n "$alpine_SSLDIR" -a -d "${alpine_SSLDIR}/ssl/certs" ; then
1945 certdir="${alpine_SSLDIR}/ssl/certs"
1946 elif test -n "$alpine_SSLCERTS_ORIG" -a -d "$alpine_SSLCERTS_ORIG" ; then
1947 certdir="$alpine_SSLCERTS_ORIG"
1948 elif test -n "$alpine_SSLCERTS" ; then
1949 certdir="$alpine_SSLCERTS"
1951 AC_MSG_NOTICE([SSL Problem: certificate directory not found])
1954 if test "x$with_smime" != "xno" ; then
1955 if test -n "$certdir" ; then
1956 AC_MSG_NOTICE([* * * S/MIME support enabled])
1957 AC_DEFINE([SMIME], [], [Enable S/MIME code])
1958 AC_DEFINE_UNQUOTED([SMIME_SSLCERTS],"$certdir",[Directory where S/MIME CACerts are located])
1964 if test -z "`ls ${certdir} | $EGREP '^@<:@0-9A-Fa-f@:>@{8}\.@<:@0-9@:>@'`" ; then
1965 SSL_BUNDLE_EXISTS="no"
1966 SSL_PEM="factory.pem ca-bundle.pem"
1967 for SSL_BUNDLE in $SSL_PEM
1969 if test -f ${certdir}/${SSL_BUNDLE} ; then
1970 SSL_BUNDLE_EXISTS="yes"
1977 if test "x$SSL_BUNDLE_EXISTS" = "xno" -a "x$SSL_CERT_LINK" = "xno" ; then
1978 AC_MSG_NOTICE([* * * No certificates found in "${certdir}".])
1979 AC_MSG_NOTICE([* * * This might indicate that CA certs did not get properly])
1980 AC_MSG_NOTICE([* * * installed. If you get certificate validation failures])
1981 AC_MSG_NOTICE([* * * in Alpine, this might be the reason for them.])
1984 if test -n "$alpine_SSLINCLUDE" ; then
1985 c_client_specials="${c_client_specials}SSLINCLUDE=$alpine_SSLINCLUDE "
1988 if test -n "$alpine_SSLLIB" ; then
1989 c_client_specials="${c_client_specials}SSLLIB=$alpine_SSLLIB "
1992 if test -n "$alpine_SSLDIR" ; then
1993 c_client_specials="${c_client_specials}SSLDIR=$alpine_SSLDIR "
1996 if test -n "$certdir" ; then
1997 c_client_specials="${c_client_specials}SSLCERTS=$certdir "
2000 if test -n "$alpine_SSLKEYS" ; then
2001 c_client_specials="${c_client_specials}SSLKEYS=$alpine_SSLKEYS "
2006 if test "x$alpine_GSSTYPE" != "xnone" ; then
2008 AC_MSG_NOTICE([* * * Including Kerberos5 functionality])
2012 if test "x$alpine_NTLM" != "xnone" ; then
2014 AC_MSG_NOTICE([* * * Including NTLM Authenticator])
2017 if test -n "$CPPFLAGS" ; then
2018 alpine_c_client_cflags="$alpine_c_client_cflags ${CPPFLAGS}"
2020 if test -n "$CFLAGS" ; then
2021 alpine_c_client_cflags="$alpine_c_client_cflags ${CFLAGS}"
2024 if test -n "$alpine_c_client_cflags" ; then
2025 AC_SUBST(C_CLIENT_CFLAGS, EXTRACFLAGS=\"$alpine_c_client_cflags\")
2028 if test -n "$LDFLAGS" ; then
2029 alpine_c_client_ldflags="$alpine_c_client_ldflags ${LDFLAGS}"
2031 if test -n "$LIBS" ; then
2032 alpine_c_client_ldflags="$alpine_c_client_ldflags ${LIBS}"
2035 if test -n "$alpine_c_client_ldflags" ; then
2036 AC_SUBST(C_CLIENT_LDFLAGS, EXTRALDFLAGS=\"$alpine_c_client_ldflags\")
2039 if test -n "$alpine_c_client_gccoptlevel" ; then
2040 AC_SUBST(C_CLIENT_GCCOPTLEVEL, GCCOPTLEVEL=\"$alpine_c_client_gccoptlevel\")
2043 c_client_auths="$extra_auth_gss $extra_auth_ntlm"
2044 AC_SUBST([C_CLIENT_AUTHS], $c_client_auths)
2046 AC_SUBST([C_CLIENT_SPECIALS], $c_client_specials)
2048 dnl Deal with Web Alpine
2049 if test -z "$WEB_BUILD" ; then
2050 WEB_PUBCOOKIE_BUILD=
2051 AC_MSG_NOTICE([* * * TCL libraries could not be found.])
2052 AC_MSG_NOTICE([* * * WEB ALPINE COMPONENT WILL NOT BE BUILT.])
2054 if test -n "$WEB_PUBCOOKIE_BUILD" ; then
2055 if test "x$alpine_GSSTYPE" = "xnone" ; then
2056 WEB_PUBCOOKIE_BUILD=
2057 AC_MSG_NOTICE([* * * Kerberos5 support not found.])
2058 AC_MSG_NOTICE([* * * WEB ALPINE PUBCOOKIE COMPONENT WILL NOT BE BUILT.])
2059 elif test -z "$WEB_BINDIR" ; then
2060 WEB_PUBCOOKIE_BUILD=
2061 AC_MSG_NOTICE([* * * Web Alpine binary directory not provided.])
2062 AC_MSG_ERROR([* * * --with-pubcookie requires --with-web-bin=PATH.
2063 Please re-run configure with these options:
2064 --with-pubcookie --with-web-bin=/usr/local/libexec/alpine/bin])
2066 AC_DEFINE([PUBCOOKIE],[1],[Include support for UW Pubcookie Web Authentication])
2067 WEB_PUBCOOKIE_LIB=../pubcookie/libauthgssproxy.a
2068 WEB_PUBCOOKIE_LINK=gssapi_proxy.l
2073 AC_SUBST([REGEX_BUILD])
2075 AC_SUBST([WEB_BUILD])
2076 AC_SUBST([WEB_BINDIR])
2077 AC_SUBST([WEB_PUBCOOKIE_BUILD])
2078 AC_SUBST([WEB_PUBCOOKIE_LIB])
2079 AC_SUBST([WEB_PUBCOOKIE_LINK])
2081 AC_SUBST([AM_CFLAGS])
2082 AC_SUBST([AM_LDFLAGS])
2084 AC_CONFIG_FILES([m4/Makefile po/Makefile.in $REGEX_MAKEFILE \
2085 pith/osdep/Makefile pith/charconv/Makefile pith/Makefile \
2086 pico/osdep/Makefile pico/Makefile \
2087 alpine/osdep/Makefile alpine/Makefile \
2088 web/src/Makefile web/src/pubcookie/Makefile \
2089 web/src/alpined.d/Makefile \