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:21 by chappa@washington.edu])
20 dnl Alpine Version Number is in $srcdir/VERSION
21 AC_INIT([alpine],[m4_normalize(m4_include(VERSION))],[chappa@washington.edu])
23 AC_CONFIG_SRCDIR([include/system.h])
24 AC_CONFIG_HEADERS([include/config.h])
25 AC_CONFIG_MACRO_DIR([m4])
26 AM_INIT_AUTOMAKE([foreign nostdinc])
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 ps command, this test is fragile, but it should mostly work
89 ALPINE_psefcmd="/bin/ps auxww"
93 AS_HELP_STRING([--with-ps-cmd="CMD"],[Use this command to check running commands. Default: /bin/ps auxww]),
95 if test "x$withval" = "xno" -o "x$withval" = "xyes" -o "x$withval" = "x" ; then
96 withval=$ALPINE_psefcmd
98 ALPINE_PSTEST=`$withval | $EGREP "$withval" | $EGREP -v $EGREP`
99 if test -n "$ALPINE_PSTEST" ; then
100 ALPINE_psefcmd="$withval"
103 if test "x$ALPINE_psefcmd" != "x$withval" ; then
104 AC_MSG_WARN(failed command $withval. Trying $ALPINE_psefcmd)
108 if test "$ALPINE_psfailed" = "1" -o "$ALPINE_PSTEST" = "-" ; then
109 withval="$ALPINE_psefcmd"
110 ALPINE_PSTEST=`$withval | $EGREP "$withval" | $EGREP -v $EGREP`
111 if test -z "$ALPINE_PSTEST" ; then
117 if test "$ALPINE_psfailed" = "0" ; then
118 AC_DEFINE_UNQUOTED([PSEFCMD], "$ALPINE_psefcmd", [ps command which outputs list of running commands])
121 dnl Set default locale dir.
124 if test -d /opt/local ; then
125 localedir="/opt/local/share/locale"
127 localedir="\${datadir}/locale"
131 localedir="/usr/share"
134 localedir="\${datadir}/locale"
138 AC_ARG_WITH(localedir,
139 AS_HELP_STRING([--with-localedir=DIR],[Name of gettext locale directory]),
151 AC_SUBST(localedir, "[$localedir]")
153 # Setup OS-Specific features
156 dnl OS X Universal Binary Support
157 AC_ARG_ENABLE(osx-universal-binaries,
158 AS_HELP_STRING([--enable-osx-universal-binaries],[Produce universal binaries under OS X [[default=no]]]))
159 if test "x$enable_osx_universal_binaries" = "xyes" ; then
160 if test "x$enable_dependency_tracking" != xno ; then
161 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
162 Please re-run configure with these options:
163 --disable-dependency-tracking --enable-osx-universal-binary])
165 if [test -d /Developer/SDKs/MacOSX10.5.sdk] ; then
166 alpine_sysroot=/Developer/SDKs/MacOSX10.5.sdk
167 elif [test -d /Developer/SDKs/MacOSX10.4u.sdk] ; then
168 alpine_sysroot=/Developer/SDKs/MacOSX10.4u.sdk
170 AC_MSG_ERROR([No suitable MacOSX SDK found. Make sure Xcode tools are installed])
172 ub_cflags="-isysroot $alpine_sysroot -arch ppc -arch i386"
173 ub_ldflags="-Wl,-syslibroot,$alpine_sysroot -arch ppc -arch i386"
174 AM_CFLAGS="$AM_CFLAGS $ub_cflags"
175 AM_LDFLAGS="$AM_LDFLAGS $ub_ldflags"
176 alpine_c_client_cflags="$alpine_c_client_cflags $ub_cflags"
177 alpine_c_client_ldflags="$alpine_c_client_ldflags $ub_ldflags"
182 AC_ARG_WITH(include-path,
183 AS_HELP_STRING([--with-include-path=PATHS],[Colon-separated list of directories used for include file search]),
191 new_cppflags="-I`echo ${withval} | ${SED} 's/:/ -I/g'`"
192 CPPFLAGS="$CPPFLAGS ${new_cppflags}"
193 alpine_c_client_cflags="$alpine_c_client_cflags ${new_cppflags}"
198 AC_ARG_WITH(lib-path,
199 AS_HELP_STRING([--with-lib-path=PATHS],[Colon-separated list of directories used for library search]),
207 new_ldflags="-L`echo ${withval} | ${SED} 's/:/ -L/g'`"
208 LDFLAGS="$LDFLAGS $new_ldflags"
209 alpine_c_client_ldflags="$alpine_c_client_ldflags ${new_ldflags}"
214 AC_ARG_WITH(pubcookie,
215 AS_HELP_STRING([--with-pubcookie],[Include support for UW-Pubcookie Web Authentication]),
217 if test "x$withval" != "xno" ; then
218 WEB_PUBCOOKIE_BUILD=web/src/pubcookie
224 AS_HELP_STRING([--with-web-bin=PATH],[Directory to hold Web Alpine component binary files]),
237 dnl disable debug, turned on by default
238 AC_MSG_CHECKING([option: debugging is enabled])
239 AC_ARG_ENABLE(debug, AS_HELP_STRING([--disable-debug],[Exclude debug messages from source]))
240 if test x$enable_debug != "xno" ; then
241 AM_CFLAGS="$AM_CFLAGS -g"
242 AC_DEFINE([DEBUG], [1], [Compile in debugging])
243 AC_DEFINE([DEBUGJOURNAL], [1], [Display debug messages in journal])
246 dnl ??? set AM_CFLAGS to optimize ???
250 dnl disable optimization, on by default
251 AC_MSG_CHECKING([option: optimization is enabled])
252 AC_ARG_ENABLE(optimization, AS_HELP_STRING([--disable-optimization],[Exclude optimizing compiler flags]))
253 if test x$enable_optimization != "xno" ; then
256 CFLAGS="`echo $AM_CFLAGS | ${SED} 's/-O2//'`"
257 alpine_c_client_gccoptlevel="-O0"
261 dnl disable mouse support
262 AC_MSG_CHECKING([option: mouse support enabled])
263 AC_ARG_ENABLE(mouse, AS_HELP_STRING([--disable-mouse],[Disable mouse support]))
264 if test x$enable_mouse != "xno" ; then
265 AC_DEFINE([MOUSE], [], [Compile in mouse support])
272 AC_MSG_CHECKING([option: quotas enabled])
273 AC_ARG_ENABLE(quotas, AS_HELP_STRING([--enable-quotas],[Enable disk quota checking on startup]))
274 if test x$enable_quotas = "xyes" ; then
275 AC_DEFINE([USE_QUOTAS], [], [Compile in quota check on startup])
281 AC_MSG_CHECKING([option: From changing enabled])
282 AC_ARG_ENABLE(from_changing, AS_HELP_STRING([--disable-from-changing],[Disallow users changing From addresss]))
283 if test x$enable_from_changing != "xno" ; then
286 AC_DEFINE([NEVER_ALLOW_CHANGING_FROM], [], [Disallow users changing their From address])
290 dnl enable background posting support
291 AC_MSG_CHECKING([option: background post enabled])
292 AC_ARG_ENABLE(background-post, AS_HELP_STRING([--disable-background-post],[Disable background posting]))
293 if test x$enable_background_post != "xno" ; then
294 AC_DEFINE([BACKGROUND_POST], [], [Enable background posting support])
300 dnl enable keyboard locking support
301 AC_MSG_CHECKING([option: keyboard lock enabled])
302 AC_ARG_ENABLE(keyboard-lock, AS_HELP_STRING([--disable-keyboard-lock],[Disable keyboard locking]))
303 if test x$enable_keyboard_lock != "xno" ; then
304 AC_DEFINE([KEYBOARD_LOCK], [], [Enable keyboard lock support])
310 dnl enable from encoding support
311 AC_MSG_CHECKING([option: from encoding enabled])
312 AC_ARG_ENABLE(from-encoding, AS_HELP_STRING([--enable-from-encoding],[Enable From encoding in sent messages]))
313 if test x$enable_from_encoding = "xyes" ; then
314 AC_DEFINE([ENCODE_FROMS], [], [Enable From address encoding in sent messages])
320 dnl OPTION: name of local submission agent
321 dnl Might not be sendmail, but it MUST speak SMTP on stdin/stdout
322 AC_ARG_WITH(smtp-msa,
323 AS_HELP_STRING([--with-smtp-msa=PATH],[Local Mail Submission Agent (sendmail)]),
329 AC_PATH_PROG(SENDMAIL, sendmail, "", $PATH:/usr/sbin:/usr/lib)
337 AC_PATH_PROG(SENDMAIL, sendmail, "", $PATH:/usr/sbin:/usr/lib)
339 if test -n "$SENDMAIL" ; then
340 AC_DEFINE_UNQUOTED([SENDMAIL], "$SENDMAIL", [Local mail submission agent])
343 dnl OPTION: local msa arguments
344 smtp_msa_flags="-bs -odb -oem"
345 AC_ARG_WITH(smtp-msa-flags,
346 AS_HELP_STRING([--with-smtp-msa-flags=FLAGS],[MSA flags for SMTP on stdin/stdout (-bs -odb -oem)]),
348 if test "x$withval" != "xno" ; then
349 smtp_msa_flags=$withval
352 AC_DEFINE_UNQUOTED([SENDMAILFLAGS], "$smtp_msa_flags", [Local MSA flags for SMTP on stdin/stdout])
354 dnl OPTION: name of local news posting agent and flags
357 AS_HELP_STRING([--with-npa=PATH],[Posting agent when no nntp-servers defined (inews)]),
363 AC_PATH_PROG(NPA_PROG, inews, "", $PATH:/usr/sbin:/usr/lib)
371 AC_PATH_PROG(NPA_PROG, inews, "", $PATH:/usr/sbin:/usr/lib)
375 AC_ARG_WITH(npa-flags,
376 AS_HELP_STRING([--with-npa-flags=FLAGS],[Flags to allow posting via local agent (-h)]),
378 if test "x$withval" != "xno" ; then
382 if test -n "$NPA_PROG" ; then
383 AC_DEFINE_UNQUOTED([SENDNEWS], "$NPA_PROG $npa_flags", [Posting agent to use when no nntp-servers defined])
386 dnl OPTION: password changing program
387 AC_ARG_WITH(password-prog,
388 AS_HELP_STRING([--with-password-prog=PATH],[Password change program (/bin/passwd)]),
394 AC_PATH_PROG(PWPROG, passwd, "", $PATH:/usr/sbin:/usr/lib)
397 AC_PATH_PROG(PWPROG, $withval, "", $PATH:/usr/sbin:/usr/lib)
402 AC_PATH_PROG(PWPROG, passwd, "", $PATH:/usr/sbin:/usr/lib)
404 if test -n "$PWPROG" ; then
405 AC_DEFINE_UNQUOTED([PASSWD_PROG], "$PWPROG", [Program users use to change their password])
408 dnl OPTION: basic spell checking program
409 AC_ARG_WITH(simple-spellcheck,
410 AS_HELP_STRING([--with-simple-spellcheck=PROG],[Spellcheck program reads stdin, emits misspellings on stdout]),
412 if test "x$withval" != "xno" ; then
417 AC_CHECK_PROG([SPELLPROG], [hunspell], [hunspell], [])
418 if test -z "$SPELLPROG" ; then
419 AC_CHECK_PROG([SPELLPROG], [aspell], [aspell], [])
420 if test -z "$SPELLPROG" ; then
421 AC_CHECK_PROG([SPELLPROG], [ispell], [ispell], [])
422 if test -z "$SPELLPROG" ; then
429 if test "x$SPELLPROG" != "xno" ; then
430 AC_PATH_PROG(alpine_simple_spellcheck, $SPELLPROG)
431 if test -n "$alpine_simple_spellcheck" ; then
434 alpine_simple_spellcheck="$alpine_simple_spellcheck -l"
437 alpine_simple_spellcheck="$alpine_simple_spellcheck --dont-backup --mode=email list"
440 alpine_simple_spellcheck="$alpine_simple_spellcheck -l"
448 dnl OPTION: interactive spell checking program
449 AC_ARG_WITH(interactive-spellcheck,
450 AS_HELP_STRING([--with-interactive-spellcheck=PROG],[Interactive, filewise spell checker]),
452 if test "x$withval" != "xno" ; then
457 AC_CHECK_PROG([ISPELLPROG], [hunspell], [hunspell], [])
458 if test -z "$ISPELLPROG" ; then
459 AC_CHECK_PROG([ISPELLPROG], [aspell], [aspell], [])
460 if test -z "$SPELLPROG" ; then
466 if test "x$ISPELLPROG" != "xno" ; then
467 AC_PATH_PROG(alpine_interactive_spellcheck, $ISPELLPROG)
468 if test -n "$alpine_interactive_spellcheck" ; then
469 case "$ISPELLPROG" in
471 alpine_interactive_spellcheck="$alpine_interactive_spellcheck --dont-backup --mode=email check"
479 if test -n "$alpine_interactive_spellcheck" ; then
480 AC_DEFINE_UNQUOTED([DF_VAR_SPELLER], "$alpine_interactive_spellcheck", [Interactive, filewise spell checker])
483 if test -z "$alpine_simple_spellcheck" -a -n "$alpine_interactive_spellcheck" ; then
484 alpine_simple_spellcheck=test
486 AC_DEFINE_UNQUOTED([SPELLER], "$alpine_simple_spellcheck", [Simple spell checker: reads stdin, emits misspellings on stdout])
488 dnl OPTION: system-pinerc
489 dnl NOTE: historically we used /lib for the config dir.
490 dnl don't ask, it was a long time ago. but, we can't
491 dnl change it now without breaking compatibility
493 NONE) dpv=/usr/local/lib/pine.conf ;;
494 *) dpv=${prefix}/lib/pine.conf ;;
496 AC_ARG_WITH(system-pinerc,
497 AS_HELP_STRING([--with-system-pinerc=VALUE],[System pinerc (/usr/local/lib/pine.conf)]),
509 AC_DEFINE_UNQUOTED(SYSTEM_PINERC, "$dpv", [System pinerc])
511 dnl OPTION: system-fixed-pinerc
512 dnl NOTE: historically we used /lib for the config dir.
513 dnl don't ask, it was a long time ago. but, we can't
514 dnl change it now without breaking compatibility
516 NONE) dpv=/usr/local/lib/pine.conf.fixed ;;
517 *) dpv=${prefix}/lib/pine.conf.fixed ;;
519 AC_ARG_WITH(system-fixed-pinerc,
520 AS_HELP_STRING([--with-system-fixed-pinerc=VALUE],[System fixed pinerc (/usr/local/lib/pine.conf.fixed)]),
532 AC_DEFINE_UNQUOTED(SYSTEM_PINERC_FIXED, "$dpv", [System fixed pinerc])
534 dnl OPTION: local support information, file that contains information on
535 dnl how to contact local support for Alpine.
536 dnl NOTE: historically we used /lib for the config dir.
537 dnl don't ask, it was a long time ago. but, we can't
538 dnl change it now without breaking compatibility
540 NONE) dpv=/usr/local/lib/pine.info ;;
541 *) dpv=${prefix}/lib/pine.info ;;
543 AC_ARG_WITH(local-support-info,
544 AS_HELP_STRING([--with-local-support-info=VALUE],[Local Support Info File (/usr/local/lib/pine.info)]),
556 AC_DEFINE_UNQUOTED(SYSTEM_PINE_INFO_PATH, "$dpv", [Local Support Info File])
558 dnl Function to simplify setting alpine/pico defaults
559 dnl usage: PINEVAR(configure-name, definition-name, definition-value, help)
564 AS_HELP_STRING([--with-$1=VALUE],[$4 ($3)]),
566 if test "x$withval" != "xno" ; then
570 AC_DEFINE_UNQUOTED($2, "$dpv", [Default configuration value])
573 dnl Function to simplify setting pine/pico defaults
574 dnl usage: PINEVAR_UNQUOTED(configure-name, definition-name, definition-value, help)
575 AC_DEFUN([PINEVAR_UNQUOTED],
579 AS_HELP_STRING([--with-$1=VALUE],[$4 ($3)]),
581 if test "x$withval" != "xno" ; then
585 AC_DEFINE_UNQUOTED($2, $dpv, [Default configuration value])
588 PINEVAR(mailcheck-interval, DF_MAILCHECK, 150, [Specify default mail-check-interval])
589 PINEVAR_UNQUOTED(checkpoint-interval, CHECK_POINT_TIME, 420, [Specify default checkpoint-interval])
590 PINEVAR_UNQUOTED(checkpoint-frequency, CHECK_POINT_FREQ, 12, [State change count before checkpoint])
591 PINEVAR_UNQUOTED(display-rows, DEFAULT_LINES_ON_TERMINAL, 24, [Initial rows on display])
592 PINEVAR_UNQUOTED(display-columns, DEFAULT_COLUMNS_ON_TERMINAL, 80, [Initial columns on display])
593 PINEVAR_UNQUOTED(max-display-rows, MAX_SCREEN_ROWS, 200, [Maximum display rows])
594 PINEVAR_UNQUOTED(max-display-columns, MAX_SCREEN_COLS, 500, [Maximum display columns])
595 PINEVAR(fill-column, DF_FILLCOL, 74, [Default fill column])
596 PINEVAR_UNQUOTED(max_fill-column, MAX_FILLCOL, 80, [Maximum fill column])
597 PINEVAR_UNQUOTED(debug-level, DEFAULT_DEBUG, 2, [Specify default debug verbosity level])
598 PINEVAR_UNQUOTED(debug-files, NUMDEBUGFILES, 4, [Specify number of debug files])
599 PINEVAR(debug-file, DEBUGFILE, [.pine-debug], [Specify debug file name])
600 PINEVAR(forwarded-keyword, FORWARDED_FLAG, ["\$Forwarded"], [IMAP (c-client) keyword to store forwarded status])
601 PINEVAR(display-overlap, DF_OVERLAP, [2], [Lines preserved while paging])
602 PINEVAR(display-margin, DF_MARGIN, [0], [Lines visible while scrolling])
603 PINEVAR(default-fcc, DF_DEFAULT_FCC, [sent-mail], [Default sent mail folder])
604 PINEVAR(default-save-folder, DEFAULT_SAVE, [saved-messages], [Default save folder])
605 PINEVAR(default-legacy-postponed-folder, POSTPONED_MAIL, [postponed-mail], [Pre Pine 3.90 postponed folder])
606 PINEVAR(default-postponed-folder, POSTPONED_MSGS, [postponed-msgs], [Default postponed folder])
607 PINEVAR(default-trash-folder, TRASH_FOLDER, [Trash], [Default Trash folder for Web Alpine])
608 PINEVAR(default-interrupted-mail, INTERRUPTED_MAIL, [.pine-interrupted-mail], [Default folder for interrupted mail])
609 PINEVAR(default-dead-letter-folder, DEADLETTER, [dead.letter], [Default dead letter folder])
610 PINEVAR(default-mail-directory, DF_MAIL_DIRECTORY, [mail], [Default mail directory])
611 PINEVAR(default-inbox-name, INBOX_NAME, [INBOX], [Default inbox name])
612 PINEVAR(default-signature-file, DF_SIGNATURE_FILE, [.signature], [Default signature file])
613 PINEVAR(default-elm-style-save, DF_ELM_STYLE_SAVE, [no], [Default to Elm style save])
614 PINEVAR(default-header-in-reply, DF_HEADER_IN_REPLY, [no], [Include header in reply])
615 PINEVAR(default-old-style-reply, DF_OLD_STYLE_REPLY, [no], [Default to old style reply])
616 PINEVAR(default-use-only-domain-name, DF_USE_ONLY_DOMAIN_NAME, [no], [Default to using only the domain name])
617 PINEVAR(default-save-by-sender, DF_SAVE_BY_SENDER, [no], [Default to save by sender])
618 PINEVAR(default-sort-key, DF_SORT_KEY, [arrival], [Default sort key])
619 PINEVAR(default-addressbook-sort-rule, DF_AB_SORT_RULE, [fullname-with-lists-last], [Default addressbook sort rule])
620 PINEVAR(default-folder-sort-rule, DF_FLD_SORT_RULE, [alphabetical], [Default folder sort rule])
621 PINEVAR(default-saved-message-name-rule, DF_SAVED_MSG_NAME_RULE, [default-folder], [Default saved message name rule])
622 PINEVAR(default-fcc-rule, DF_FCC_RULE, [default-fcc], [Default fcc rule])
623 PINEVAR(default-standard-printer, DF_STANDARD_PRINTER, [lpr], [Default standard printern])
624 PINEVAR(default-ansi-printer, ANSI_PRINTER, [attached-to-ansi], [ANSI printer definition])
625 PINEVAR(default-addressbook, DF_ADDRESSBOOK, [.addressbook], [Default addressbook name])
626 PINEVAR(default-local-fullname, DF_LOCAL_FULLNAME, ["Local Support"], [Default local support fullname])
627 PINEVAR(default-local-address, DF_LOCAL_ADDRESS, [postmaster], [Default local support address])
628 PINEVAR(default-keyboard-lock-count, DF_KBLOCK_PASSWD_COUNT, [1], [Default keyboard lock count])
629 PINEVAR(default-remote-addressbook-history, DF_REMOTE_ABOOK_HISTORY, [3], [Default address book history count])
630 PINEVAR(smime-public-cert-directory, DF_PUBLICCERT_DIR, [.alpine-smime/public], [Default Public Cert Directory])
631 PINEVAR(smime-private-key-directory, DF_PRIVATEKEY_DIR, [.alpine-smime/private], [Default Private Key Directory])
632 PINEVAR(smime-cacert-directory, DF_CACERT_DIR, [.alpine-smime/ca], [Default Cert Authority Directory])
633 PINEVAR_UNQUOTED(default-printer, DF_DEFAULT_PRINTER, [ANSI_PRINTER], [Default printer])
635 AC_DEFINE_UNQUOTED([DF_PUBLIC_CONTAINER], "PublicContainer", [Name of default public container])
636 AC_DEFINE_UNQUOTED([DF_PRIVATE_CONTAINER], "PrivateContainer", [Name of default private container])
637 AC_DEFINE_UNQUOTED([DF_CA_CONTAINER], "CAContainer", [Name of default certificate authority container])
640 AC_ARG_WITH(passfile,
641 AS_HELP_STRING([--with-passfile=FILENAME],[Password cache file (recommended when S/MIME is enabled and configured)]),
649 alpine_PASSFILE=$withval
655 dnl os-specific credential cache?
656 AC_ARG_WITH(local-password-cache,
657 AS_HELP_STRING([--without-local-password-cache],[Disable OS-specific password cache, if supported]),
659 alpine_os_credential_cache=$withval
662 dnl Particular os-specific credential cache?
663 AC_ARG_WITH(local-password-cache-method,
664 AS_HELP_STRING([--with-local-password-cache-method],[OS-specific credential cache (OSX=APPLEKEYCHAIN, Windows=WINCRED)]),
666 alpine_os_credential_cache_method=$withval
669 if test -n "$alpine_PASSFILE" ; then
670 case $alpine_os_credential_cache in
674 alpine_os_credential_cache="no"
675 AC_MSG_NOTICE([--with-passfile definition overrides OS-Specific password caching])
678 AC_DEFINE_UNQUOTED([PASSFILE], "$alpine_PASSFILE", [Password cache file (recommended if S/MIME is enabled and configured)])
682 AC_ARG_WITH(default-sshpath,
683 AS_HELP_STRING([--with-default-sshpath=FILENAME],[set default value of ssh command path (defining should cause ssh to be preferred to rsh)]),
691 AC_DEFINE_UNQUOTED([DF_SSHPATH], "$withval", [set default value of ssh command path (defining should cause ssh to be preferred to rsh)])
697 AC_ARG_WITH(default-sshcmd,
698 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")]),
706 AC_DEFINE_UNQUOTED([DF_SSHCMD], "$withval", [set default value of ssh command string (usually "%s %s -l %s exec /etc/r%sd")])
712 dnl Set SSLDIR for c-client make
714 AS_HELP_STRING([--without-ssl],[Disable SSL support (OpenSSL)]),
715 [ with_ssl=$withval ])
717 if test "x$with_ssl" = "xno" ; then
718 alpine_SSLTYPE="none"
719 elif test -d /usr/local/ssl ; then
720 dnl When the system has openssl installed in its default location
721 dnl instead of the one used by the distribution assume that this
722 dnl is the one intended to be used.
723 alpine_SSLDIR="/usr/local/ssl"
724 alpine_SSLINCLUDE="$alpine_SSLDIR/include"
725 alpine_SSLLIB="$alpine_SSLDIR/lib"
727 dnl preload c-client default locations/options
729 *-linux-gnu*|*-k*bsd*-gnu*|*-gnu*)
730 if test -f /etc/fedora-release -o -f /etc/redhat-release -o -f /etc/redhat_version ; then
731 alpine_SSLTYPE="nopwd"
732 if test -d /etc/pki/tls ; then
733 alpine_SSLDIR="/etc/pki/tls"
735 alpine_SSLDIR="/usr/share/ssl"
737 alpine_SSLCERTS="$alpine_SSLDIR/certs"
738 alpine_SSLKEYS="$alpine_SSLDIR/private"
739 alpine_SSLINCLUDE="/usr/include/openssl"
740 alpine_SSLLIB="/usr/lib"
741 elif test -f /etc/mandrake-release ; then
742 alpine_SSLDIR="/usr/lib/ssl"
743 alpine_SSLCERTS="$alpine_SSLDIR/certs"
744 alpine_SSLKEYS="$alpine_SSLDIR/private"
745 alpine_SSLINCLUDE="/usr/include/openssl"
746 alpine_SSLLIB="/usr/lib"
747 elif test -f /etc/SuSE-release ; then
748 alpine_SSLTYPE="nopwd"
749 alpine_SSLDIR="/etc/ssl"
750 alpine_SSLCERTS="$alpine_SSLDIR/certs"
751 alpine_SSLKEYS="$alpine_SSLDIR/private"
752 alpine_SSLINCLUDE="/usr/include/openssl"
753 alpine_SSLLIB="/usr/lib"
754 elif test -d /etc/osso-af-init ; then
755 alpine_SSLTYPE="nopwd"
757 alpine_SSLCERTS="/usr/share/certs"
758 alpine_SSLINCLUDE="/usr/include/openssl"
759 alpine_SSLLIB="/usr/lib"
760 elif test -f /etc/debian_release -o -f /etc/debian_version ; then
761 if test ! -d /etc/osso-af-init ; then
762 alpine_SSLDIR="/etc/ssl"
763 alpine_SSLCERTS="$alpine_SSLDIR/certs"
764 alpine_SSLKEYS="$alpine_SSLDIR/private"
765 alpine_SSLINCLUDE="/usr/include/openssl"
766 alpine_SSLLIB="/usr/lib"
768 elif test -f /etc/manjaro-release ; then
769 alpine_SSLDIR="/etc/ssl"
770 alpine_SSLCERTS="$alpine_SSLDIR/certs"
771 alpine_SSLKEYS="$alpine_SSLDIR/private"
772 alpine_SSLINCLUDE="/usr/include/openssl"
773 alpine_SSLLIB="/usr/lib"
775 alpine_SSLTYPE="nopwd"
777 alpine_SSLCERTS="/etc/ssl/certs"
781 alpine_SSLTYPE="nopwd"
782 dnl Originally this is where certs are, and they might still be there, even
783 dnl after installing Homebrew, MacPorts or Fink. We will use it if we cannot
784 dnl find it anywhere else.
785 alpine_SSLCERTS_ORIG="/System/Library/OpenSSL/certs"
786 if test -d /usr/local/opt/openssl ; then
787 alpine_SSLDIR="/usr/local/opt/openssl"
788 alpine_SSLINCLUDE="$alpine_SSLDIR/include"
789 alpine_SSLLIB="$alpine_SSLDIR/lib"
790 alpine_SSLCERTS="/usr/local/etc/openssl"
791 alpine_SSLKEYS="$alpine_SSLDIR/private"
792 elif test -d /opt/local/etc/openssl ; then
793 alpine_SSLDIR="/opt/local"
794 alpine_SSLINCLUDE="$alpine_SSLDIR/include"
795 alpine_SSLLIB="$alpine_SSLDIR/lib"
796 alpine_SSLCERTS="/opt/local/etc/openssl/certs"
797 alpine_SSLKEYS="/opt/local/etc/openssl/private"
798 elif test -d /sw/etc/ssl ; then
799 alpine_SSLDIR="/sw/etc/ssl"
800 alpine_SSLINCLUDE="/sw/include"
801 alpine_SSLLIB="/sw/lib"
802 alpine_SSLCERTS="/sw/etc/ssl/certs"
803 alpine_SSLKEYS="/sw/etc/ssl/private"
804 elif test -d /usr/local/ssl ; then
805 alpine_SSLDIR="/usr/local/ssl"
806 elif test -d /System/Library/OpenSSL ; then
807 alpine_SSLDIR="/System/Library/OpenSSL"
808 alpine_SSLCERTS="$alpine_SSLDIR/certs"
809 alpine_SSLKEYS="$alpine_SSLDIR/private"
810 alpine_SSLLIB="/usr/lib"
811 alpine_SSLINCLUDE="/usr/include/openssl"
815 alpine_SSLDIR="/etc/openssl"
816 alpine_SSLCERTS="$alpine_SSLDIR/certs"
817 alpine_SSLKEYS="$alpine_SSLDIR/private"
818 alpine_SSLINCLUDE="/usr/include/openssl"
819 alpine_SSLLIB="/usr/lib"
822 alpine_SSLDIR="/etc/openssl"
823 alpine_SSLCERTS="$alpine_SSLDIR/certs"
824 alpine_SSLKEYS="$alpine_SSLDIR/private"
825 alpine_SSLINCLUDE="/usr/include/openssl"
826 alpine_SSLLIB="/usr/lib"
829 alpine_SSLTYPE="nopwd"
831 alpine_SSLCERTS="/etc/ssl/certs"
834 alpine_SSLDIR="/etc/ssl"
835 alpine_SSLCERTS="$alpine_SSLDIR/certs"
836 alpine_SSLKEYS="$alpine_SSLDIR/private"
837 if test -d /usr/local/include/openssl ; then
838 alpine_SSLINCLUDE="/usr/local/include/openssl"
839 alpine_SSLLIB="/usr/local/lib"
841 alpine_SSLINCLUDE="/usr/include/openssl"
842 alpine_SSLLIB="/usr/lib"
846 alpine_SSLDIR="/etc/ssl"
847 alpine_SSLINCLUDE="/usr/include/openssl"
848 alpine_SSLLIB="/usr/lib"
849 alpine_SSLCERTS="/etc/ssl"
850 alpine_SSLKEYS="/etc/ssl/private"
853 alpine_SSLDIR="/usr/ssl"
854 alpine_SSLCERTS="$alpine_SSLDIR/certs"
855 alpine_SSLKEYS="$alpine_SSLDIR/certs"
856 alpine_SSLINCLUDE="/usr/include/openssl"
857 alpine_SSLLIB="/usr/lib"
859 *-sco-sysv* | *-sysv*UnixWare | *-sysv*OpenUNIX)
860 alpine_SSLTYPE="sco.nopwd"
861 alpine_SSLDIR="/usr/local/ssl"
864 if test -d /usr/include/openssl ; then
865 alpine_SSLINCLUDE="/usr/include/openssl"
866 elif test -d /usr/sfw/include/openssl ; then
867 alpine_SSLDIR="/usr/sfw"
868 elif test -d /opt/csw/include/openssl ; then
869 alpine_SSLDIR="/opt/csw"
870 if test -d /opt/csw/ssl/certs ; then
871 alpine_SSLCERTS="/opt/csw/ssl/certs"
874 if test -z "$alpine_SSLCERTS" -a -d /etc/certs ; then
875 alpine_SSLCERTS="/etc/certs"
879 alpine_SSLTYPE="nopwd"
880 alpine_SSLDIR="/usr/local/ssl"
885 if test "x$alpine_SSLTYPE" != "xnone" ; then
887 AS_HELP_STRING([--with-ssl-dir=DIR],[Root of SSL lib/include path]),
889 if test "x$withval" != "xno" ; then
890 alpine_SSLDIR=$withval
891 alpine_SSLINCLUDE=$alpine_SSLDIR/include
892 alpine_SSLLIB=$alpine_SSLDIR/lib
896 AC_ARG_WITH(ssl-certs-dir,
897 AS_HELP_STRING([--with-ssl-certs-dir=DIR],[Path to SSL certificate directory]),
899 if test "x$withval" != "xno" ; then
900 alpine_SSLCERTS=$withval
904 AC_ARG_WITH(ssl-include-dir,
905 AS_HELP_STRING([--with-ssl-include-dir=DIR],[SSL include file path]),
907 if test "x$withval" != "xno" ; then
908 alpine_SSLINCLUDE=$withval
912 AC_ARG_WITH(ssl-lib-dir,
913 AS_HELP_STRING([--with-ssl-lib-dir=DIR],[SSL library path]),
915 if test "x$withval" != "xno" ; then
916 alpine_SSLLIB=$withval
920 dnl setup globals so tests below work
921 if test -n "$alpine_SSLINCLUDE" ; then
922 CPPFLAGS="-I$alpine_SSLINCLUDE $CPPFLAGS"
923 elif test -n "$alpine_SSLDIR" ; then
924 CPPFLAGS="-I${alpine_SSLDIR}/include $CPPFLAGS"
926 if test -n "$alpine_SSLLIB" ; then
927 LDFLAGS="-L$alpine_SSLLIB $LDFLAGS"
928 elif test -n "$alpine_SSLDIR" ; then
929 LDFLAGS="-L${alpine_SSLDIR}/lib $LDFLAGS"
934 dnl Include Kerberos?
935 dnl Set GSSDIR for c-client make
937 AS_HELP_STRING([--without-krb5],[Disable Kerberos support]),
938 [ with_krb5=$withval ])
940 if test "x$with_krb5" = "xno" ; then
941 alpine_GSSTYPE="none"
945 AC_ARG_WITH(krb5-dir,
946 AS_HELP_STRING([--with-krb5-dir=DIR],[Root of Kerberos lib/include path]),
948 if test "x$withval" != "xno" ; then
949 CPPFLAGS="$CPPFLAGS -I${withval}/include"
950 LDFLAGS="$LDFLAGS -L${withval}/lib"
954 AC_ARG_WITH(krb5-include-dir,
955 AS_HELP_STRING([--with-krb5-include-dir=DIR],[Kerberos include file path]),
957 if test "x$withval" != "xno" ; then
958 CPPFLAGS="$CPPFLAGS -I$withval"
962 AC_ARG_WITH(krb5-lib-dir,
963 AS_HELP_STRING([--with-krb5-lib-dir=DIR],[Kerberos library path]),
965 if test "x$withval" != "xno" ; then
966 LDFLAGS="$LDFLAGS -L$withval"
973 AS_HELP_STRING([--without-ldap],[Disable LDAP query support]),
974 [ with_ldap=$withval ])
976 if test "x$with_ldap" = "xno" ; then
978 AC_MSG_NOTICE([Excluding LDAP Support])
980 dnl Do stuff to figure out where OpenLDAP is
983 AC_ARG_WITH(ldap-dir,
984 AS_HELP_STRING([--with-ldap-dir=DIR],[Root of LDAP lib/include path]),
986 if test "x$withval" != "xno" ; then
987 CPPFLAGS="$CPPFLAGS -I${withval}/include"
988 LDFLAGS="$LDFLAGS -L${withval}/lib"
992 AC_ARG_WITH(ldap-include-dir,
993 AS_HELP_STRING([--with-ldap-include-dir=DIR],[Directory containing LDAP include files]),
995 if test "x$withval" != "xno" ; then
996 CPPFLAGS="$CPPFLAGS -I$withval"
1000 AC_ARG_WITH(ldap-lib-dir,
1001 AS_HELP_STRING([--with-ldap-lib-dir=DIR],[LDAP library path]),
1003 if test "x$withval" != "xno" ; then
1004 LDFLAGS="$LDFLAGS -L$withval"
1011 AS_HELP_STRING([--without-smime],[Disable S/MIME]),
1012 [ with_smime=$withval ])
1016 AS_HELP_STRING([--without-tcl],[Disable TCL, thus Web Alpine support]),
1017 [ with_tcl=$withval ])
1019 if test "x$with_tcl" = "xno" ; then
1021 AC_MSG_NOTICE([Excluding TCL Support, and thus Web Alpine Support])
1023 AC_ARG_WITH(tcl-lib,
1024 AS_HELP_STRING([--with-tcl-lib=LIBRARY],[Specific TCL Library, like \"tcl8.6\"]),
1026 if test "x$withval" != "xno" ; then
1027 alpine_TCLLIB=$withval
1030 AC_ARG_WITH(tcl-include,
1031 AS_HELP_STRING([--with-tcl-include=DIR],[Directory containing TCL include files]),
1033 if test "x$withval" != "xno" ; then
1034 CPPFLAGS="$CPPFLAGS -I$withval"
1035 alpine_TCLINC=$withval
1040 AC_ARG_WITH(supplied-regex,
1041 AS_HELP_STRING([--with-supplied-regex],[Use regex library supplied with alpine]),
1042 [ alpine_REGEX=$withval ])
1044 AC_ARG_WITH(pthread,
1045 AS_HELP_STRING([--without-pthread],[Do NOT test for nor build with POSIX thread support]),
1046 [ with_pthread=$withval ])
1048 AC_ARG_WITH(system-mail-directory,
1049 AS_HELP_STRING([--with-system-mail-directory=DIR],[Directory where local mail is delivered]),
1051 if test "x$withval" != "xno" ; then
1052 alpine_with_local_maildir="$withval"
1056 AC_ARG_WITH(c-client-target,
1057 AS_HELP_STRING([--with-c-client-target=TARGET],[IMAP build target (see imap/Makefile)]),
1059 if test "x$withval" != "xno" ;then
1060 alpine_with_c_client_target="$withval"
1065 dnl Assume PAM is *not* required and only set the systems that need it.
1068 dnl HOST-OS SPECIFIC DEFINITIONS
1069 dnl Tests and assignments below are mostly to coax the appropriate
1070 dnl build from c-client. Most of this will go away when c-client
1071 dnl adopts configure
1073 *-linux-gnu*|*-k*bsd*-gnu*|*-gnu*)
1074 alpine_path_delim="/"
1075 alpine_mode_readonly="(0600)"
1076 if test -f /etc/fedora-release ; then
1079 if test -d /etc/pki/tls ; then
1080 alpine_c_client_target="lfd"
1082 alpine_c_client_target="lrh"
1084 elif test -f /etc/mandrake-release ; then
1086 alpine_c_client_target="lmd"
1088 elif test -f /etc/redhat-release -o -f /etc/redhat_version ; then
1091 if test -d /etc/pki/tls ; then
1092 alpine_c_client_target="lr5"
1094 alpine_c_client_target="lrh"
1096 elif test -f /etc/debian_release -o -f /etc/debian_version ; then
1097 if test -d /etc/osso-af-init ; then
1099 alpine_c_client_target="ln8"
1102 alpine_c_client_target="ldb"
1105 elif test -f /etc/SuSE-release ; then
1107 alpine_c_client_target="lsu"
1111 AC_CHECK_LIB(pam, pam_start,
1113 alpine_c_client_target="lnp"
1117 if test -f /etc/shadow ; then
1118 alpine_c_client_target="slx"
1120 alpine_c_client_target="lnx"
1127 alpine_path_delim="/"
1128 alpine_mode_readonly="(0600)"
1129 LIBS="$LIBS -framework Carbon -framework ApplicationServices -framework Security"
1130 AM_CFLAGS="$AM_CFLAGS -Dbsd"
1131 dnl SEE include/system.h
1132 AC_DEFINE([OSX_TARGET],[1],[OSX TARGET])
1133 case "$alpine_os_credential_cache" in
1137 AC_DEFINE([APPLEKEYCHAIN], [1], [Use Apple OS X key chain for credential caching])
1140 AC_CHECK_LIB(pam, pam_start,
1142 AC_CHECK_HEADER([security/pam_appl.h],
1145 alpine_c_client_target="oxs"
1147 [ AC_CHECK_HEADER([pam/pam_appl.h],
1150 alpine_c_client_target="oxp"
1154 alpine_pam_none_reason="header files not found"
1159 alpine_c_client_target="osx"
1163 if test x$GCC = "xyes" ; then
1165 alpine_c_client_target="gso"
1166 CFLAGS="$CFLAGS -D__USE_LEGACY_PROTOTYPES__"
1169 alpine_c_client_target="soc"
1170 AC_DEFINE([__EXTENSIONS__], [1], [Enable extended pthread features on Solaris])
1172 alpine_path_delim="/"
1173 alpine_mode_readonly="(0600)"
1174 dnl possible other OS's need this.
1175 dnl Use autoconf 2.61's AC_USE_SYSTEM_EXTENSIONS at some point
1179 alpine_path_delim="/"
1180 alpine_mode_readonly="(0600)"
1181 alpine_c_client_target="s40"
1184 if test x$GCC = "xyes" ; then
1186 alpine_c_client_target="go5"
1189 alpine_c_client_target="sc5"
1191 alpine_path_delim="/"
1192 alpine_mode_readonly="(0600)"
1193 dnl possible other OS's need this.
1194 dnl Use autoconf 2.61's AC_USE_SYSTEM_EXTENSIONS at some point
1198 alpine_path_delim="/"
1199 alpine_mode_readonly="(0600)"
1200 alpine_c_client_target="nx3"
1204 alpine_path_delim="/"
1205 alpine_mode_readonly="(0600)"
1206 alpine_c_client_target="neb"
1210 alpine_path_delim="/"
1211 alpine_mode_readonly="(0600)"
1212 alpine_c_client_target="neb"
1216 alpine_path_delim="/"
1217 alpine_mode_readonly="(0600)"
1218 alpine_c_client_target="bsi"
1222 alpine_path_delim="/"
1223 alpine_mode_readonly="(0600)"
1224 alpine_c_client_target="bsf"
1225 LIBS="$LIBS $LIBINTL"
1229 alpine_path_delim="/"
1230 alpine_mode_readonly="(0600)"
1231 alpine_c_client_target="bso"
1232 LIBS="$LIBS $LIBINTL"
1236 alpine_path_delim="/"
1237 alpine_mode_readonly="(0600)"
1238 alpine_c_client_target="a52"
1242 alpine_path_delim="/"
1243 alpine_mode_readonly="(0600)"
1244 alpine_c_client_target="a41"
1248 alpine_path_delim="/"
1249 alpine_mode_readonly="(0600)"
1250 alpine_c_client_target="a32"
1252 *-*UNIX_SV | *-*-sysv5UnixWare7* | *-*OpenUNIX*)
1254 alpine_path_delim="/"
1255 alpine_mode_readonly="(0600)"
1256 alpine_c_client_target="uw2"
1260 alpine_path_delim="/"
1261 alpine_mode_readonly="(0600)"
1262 alpine_c_client_target="osf"
1266 alpine_path_delim="/"
1267 alpine_mode_readonly="(S_IREAD | S_IWRITE)"
1268 alpine_c_client_target="cyg"
1269 LIBS="$LIBS $LIBINTL"
1271 windows* | *-*-pw32*)
1273 alpine_path_delim="\\"
1274 alpine_mode_readonly="(S_IREAD | S_IWRITE)"
1275 alpine_c_client_target="wnt"
1276 AC_DEFINE([_WINDOWS], [1], [Windows is just too different])
1279 AC_MSG_ERROR(Unrecognized system: $host)
1285 AS_HELP_STRING([--without-ipv6],[Disable IPv6, primarily to work around resolver problems]),
1286 [ with_ipv6=$withval ])
1288 if test "x$with_ipv6" = "xno" ; then
1289 AC_MSG_NOTICE([Excluding IPv6 Support])
1290 c_client_specials="${c_client_specials}IP6=4 "
1293 c_client_ip6="touch imap/ip6"
1299 if test x$enable_dmalloc = "xyes" ; then
1300 if test "x$with_pthread" = "xyes" ; then
1301 dmalloc_lib=dmallocth
1306 AC_CHECK_LIB($dmalloc_lib,dmalloc_shutdown,,
1308 AC_MSG_ERROR($dmalloc_lib requested, but -ldmalloc not found)
1312 dnl which terminal cabability database
1313 AC_CHECK_LIB(tinfo, setupterm,
1315 alpine_termdata=info
1316 LIBS="$LIBS -ltinfo"
1319 AC_CHECK_LIB(ncurses, setupterm,
1321 alpine_termdata=info
1322 LIBS="$LIBS -lncurses"
1325 AC_CHECK_LIB(curses, setupterm,
1327 alpine_termdata=info
1328 LIBS="$LIBS -lcurses"
1331 AC_CHECK_LIB(termlib, tgetent,
1334 LIBS="$LIBS -ltermlib"
1337 AC_CHECK_LIB(termcap, tgetent,
1340 LIBS="$LIBS -ltermcap"
1343 AC_MSG_ERROR(Terminfo/termcap not found)
1349 case $alpine_termdata in
1351 AC_DEFINE(HAS_TERMINFO, [1], [Define if systems uses terminfo terminal database])
1354 AC_DEFINE(HAS_TERMCAP, [1], [Define if systems uses termcap terminal database])
1358 dnl is -ldl present? if so, add it
1359 AC_SEARCH_LIBS([dlopen], [dl dld],, [ alpine_DL="none" ])
1360 if test "x$alpine_DL" = "xnone" ; then
1361 AC_MSG_ERROR([No library containing dlopen found])
1365 dnl Check if openssl = LibreSSL
1366 if test "x$alpine_SSLTYPE" != "xnone" ; then
1367 AC_MSG_CHECKING([if OpenSSL is LibreSSL])
1374 #endif /* HAVE_STDINT_H */
1375 #include <openssl/ssl.h>
1378 if (LIBRESSL_VERSION_NUMBER >= 0x20000000L)
1384 [ AC_MSG_RESULT(yes)
1385 alpine_SSLPROVIDER="libressl"
1389 [ AC_MSG_WARN([cross compiling: not checking])])
1392 dnl Check Openssl/LibreSSL version first
1393 if test "x$alpine_SSLTYPE" != "xnone" -a "x$alpine_SSLPROVIDER" != "xlibressl" ; then
1394 AC_MSG_CHECKING([Openssl library version >= 1.0.0c])
1401 #endif /* HAVE_STDINT_H */
1402 #include <openssl/ssl.h>
1405 if (OPENSSL_VERSION_NUMBER >= 0x1000003fL)
1411 [ AC_MSG_RESULT(yes)
1412 alpine_SSLPROVIDER="openssl"
1414 [ alpine_SSLTYPE="none" ],
1415 [ AC_MSG_WARN([cross compiling: not checking])])
1417 if test "x$alpine_SSLTYPE" = "xnone" ; then
1418 AC_MSG_ERROR(Install openssl version >= 1.0.0c)
1423 dnl Now check if we are working with version 1.1.0 of openssl
1424 if test "x$alpine_SSLTYPE" != "xnone" -a "x$alpine_SSLPROVIDER" != "xlibressl" ; then
1425 AC_MSG_CHECKING([Openssl library version >= 1.1.0])
1432 #endif /* HAVE_STDINT_H */
1433 #include <openssl/ssl.h>
1436 if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
1442 [ AC_MSG_RESULT(yes)
1443 alpine_SSLVERSION="new"
1444 CFLAGS="$CFLAGS -DOPENSSL_1_1_0 -DOPENSSL_API_COMPAT=0x10100000L"
1447 alpine_SSLVERSION="old" ],
1448 [ AC_MSG_WARN([cross compiling: not checking])])
1451 dnl Crypto support is needed
1452 if test "x$alpine_SSLTYPE" != "xnone" ; then
1453 if test "x$alpine_SSLVERSION" = "xold" -o "x$alpine_SSLPROVIDER" = "xlibressl" ; then
1454 AC_SEARCH_LIBS(SSLeay,crypto,, [ alpine_CRYPTO="none" ])
1456 AC_SEARCH_LIBS(OpenSSL_version_num,crypto,, [ alpine_CRYPTO="none" ])
1458 if test "x$alpine_CRYPTO" = "xnone" ; then
1459 AC_MSG_ERROR(crypto library NOT found)
1464 AC_CHECK_HEADER(crypto.h, , [ alpine_CRYPTO_DEVEL="none" ])
1465 if test "x$alpine_CRYPTO_DEVEL" = "xnone" ; then
1466 AC_MSG_ERROR(crypto library file crypto.h NOT found. Install correspoding libcrypt-devel package)
1474 if test "x$alpine_SSLTYPE" != "xnone" ; then
1475 if test "x$alpine_SSLVERSION" = "xold" -o "x$alpine_SSLPROVIDER" = "xlibressl" ; then
1476 AC_SEARCH_LIBS(TLSv1_2_client_method,ssl,
1477 [ alpine_c_client_cflags="$alpine_c_client_cflags -DTLSV1_2"
1478 AC_DEFINE([SSL_SUPPORTS_TLSV1_2], [1], [SSL Supports TLSV1.2])
1481 AC_SEARCH_LIBS(TLS_client_method,ssl,, [ alpine_SSLTYPE="none"])
1482 AC_SEARCH_LIBS(DTLS_client_method,ssl,,[ alpine_SSLTYPE="none"])
1483 if test "x$alpine_SSLTYPE" != "xnone" ; then
1484 AC_DEFINE([SSL_SUPPORTS_TLSV1_2], [1], [SSL Supports TLSV1.2])
1489 dnl provide SSL support?
1490 if test "x$alpine_SSLTYPE" != "xnone" ; then
1491 if test "x$alpine_SSLVERSION" = "xold" -o "x$alpine_SSLPROVIDER" = "xlibressl" ; then
1492 AC_SEARCH_LIBS(SSL_library_init,ssl,,[ alpine_SSLTYPE="none" ])
1493 if test "x$alpine_SSLTYPE" = "xnone" ; then
1494 AC_MSG_ERROR(No library containing SSL_library_init found in your path)
1498 AC_SEARCH_LIBS(OPENSSL_init_ssl,ssl,, [ alpine_SSLTYPE="none" ])
1499 if test "x$alpine_SSLTYPE" = "xnone" ; then
1500 AC_MSG_ERROR(No library containing OPENSSL_init_ssl found in your path)
1506 dnl provide LDAP support?
1507 if test "$alpine_with_ldap" = "yes" ; then
1509 AC_CHECK_LIB(lber, ber_alloc,
1513 AC_SEARCH_LIBS(ldap_initialize,ldap,
1518 AC_SEARCH_LIBS(ldap_open,ldap,
1524 if test "$alpine_has_ldap" = "yes" ; then
1525 AC_MSG_NOTICE([* * * Including LDAP Support])
1526 AC_DEFINE([ENABLE_LDAP], [], [Enable LDAP query support])
1530 dnl PAM support is needed to build c-client in some linux, and hence Alpine.
1531 if test "x$alpine_PAM" != "xnone" ; then
1532 AC_SEARCH_LIBS(pam_start,pam,
1535 AC_CHECK_HEADER([security/pam_appl.h],
1539 dnl Only mac is incompatible, do not spread bad habits.
1540 [ AC_CHECK_HEADER([pam/pam_appl.h],
1543 if test "x$alpine_c_client_target" != "xoxp" ; then
1545 alpine_pam_none_reason="header files not in security/ directory"
1550 alpine_pam_none_reason="header files not found"
1556 alpine_pam_none_reason="library files not found"
1558 if test -n "$alpine_pam_none_reason" ; then
1559 AC_MSG_ERROR(No PAM support: $alpine_pam_none_reason)
1564 dnl provide KRB5 support?
1565 if test "x$alpine_GSSTYPE" != "xnone" ; then
1566 AC_SEARCH_LIBS(gss_init_sec_context,gss gssapi gssapi_krb5,
1570 AC_CHECK_HEADER([gssapi/gssapi_generic.h],,
1572 if test ! -d /usr/kerberos/include ; then
1573 alpine_GSSTYPE="none"
1574 alpine_gss_none_reason="header files not found"
1579 alpine_GSSTYPE="none"
1580 alpine_gss_none_reason="libraries not found"
1582 if test -n "$alpine_gss_none_reason" ; then
1583 AC_MSG_NOTICE([NOT including Kerberos Support: $alpine_gss_none_reason])
1587 dnl check for tcl libraries for Web Alpine (HACKY)
1588 if test -n "$WEB_BUILD" ; then
1589 TCL_VERSIONS_DOT="tcl8.6 tcl8.5 tcl8.4 tcl8.3"
1590 TCL_VERSIONS_NODOT="`echo ${TCL_VERSIONS_DOT} | ${SED} 's/\.//g'`"
1591 TCL_VERSIONS="${TCL_VERSIONS_DOT} ${TCL_VERSIONS_NODOT} tcl"
1592 AC_SEARCH_LIBS([Tcl_Eval],[$alpine_TCLLIB ${TCL_VERSIONS}],,
1597 dnl look for header file
1598 if test -n "$alpine_TCLINC" ; then
1599 AC_CHECK_HEADER($alpine_TCLINC/tcl.h,,
1603 if test -z "$WEB_BUILD" ; then
1604 AC_MSG_NOTICE([Tcl Include file NOT found])
1607 AC_CHECK_HEADER(tcl.h,,
1609 for base in /usr /usr/local ; do
1610 for dir in ${TCL_VERSIONS} ; do
1611 AC_CHECK_FILE([$base/include/$dir/tcl.h],
1615 if test "$found" = "yes" ; then
1616 CPPFLAGS="$CPPFLAGS -I$base/include/$dir"
1620 if test "$found" = "yes" ; then
1624 if test "$found" != "yes" ; then
1626 AC_MSG_NOTICE([header file tcl.h NOT found: Web Alpine will not be built])
1632 dnl Local or supplied regex?
1633 if test "x$alpine_REGEX" != "xyes" ; then
1634 AC_SEARCH_LIBS([regcomp],posix regexp regex re,,
1636 if test x$alpine_REGEX = "xno" ; then
1637 AC_MSG_ERROR(Unable to find system regex library)
1643 if test "x$alpine_REGEX" != "xyes" ; then
1644 AC_CHECK_HEADER([regex.h],,
1646 if test x$alpine_REGEX = "xno" ; then
1647 AC_MSG_ERROR(Unable to find system regex include file)
1653 AC_DEFINE(HAVE_REGEX_H,1,[Regular expression header file exists])
1654 if test "x$alpine_REGEX" = "xyes" ; then
1655 CPPFLAGS="$CPPFLAGS -I${top_builddir}/regex"
1656 LDFLAGS="$LDFLAGS -L${top_builddir}/regex"
1658 REGEX_MAKEFILE="$REGEX_BUILD/Makefile"
1661 if test "x$with_pthread" != "xno" ; then
1662 AC_MSG_CHECKING([for pthread support])
1665 AC_MSG_RESULT([yes])
1668 AC_MSG_NOTICE([WARNING: pthread support on OpenBSD is unstable!])
1669 AM_CFLAGS="$AM_CFLAGS -pthread"
1672 LIBS="$PTHREAD_LIBS $LIBS"
1673 AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
1675 AC_DEFINE([HAVE_PTHREAD], [1], [System has pthread support])
1681 AC_SEARCH_LIBS([nanosleep], [rt posix4],
1683 AC_DEFINE([HAVE_NANOSLEEP], [1], [Define if system supports subsecond, non-alarm sleep])
1696 AC_HEADER_TIOCGWINSZ
1698 AC_CHECK_HEADERS([unistd.h])
1700 AC_CHECK_HEADERS([errno.h \
1726 dnl terminal line discipline?
1727 AC_CHECK_HEADER([termios.h],
1728 AC_DEFINE(HAS_TERMIOS, [1], [Define if systems uses termios terminal control]),
1730 AC_CHECK_HEADER([termio.h],
1731 AC_DEFINE(HAS_TERMIO, [1], [Define if systems uses termio terminal control]),
1733 AC_CHECK_HEADER([sgtty.h],
1734 AC_DEFINE(HAS_SGTTY, [1], [Define if systems uses old BSD-style terminal control]),
1736 AC_MSG_ERROR(Unable to figure out terminal control method)
1744 AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void.
1745 Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl
1746 AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
1747 [AC_LANG_PROGRAM([#include <sys/types.h>
1750 [return *(signal (0, 0)) (0) == 1;])],
1751 [ac_cv_type_signal=int],
1752 [ac_cv_type_signal=void])])
1753 AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
1754 (`int' or `void').])
1762 AC_CHECK_TYPES([union wait])
1764 AC_CHECK_HEADERS([stdint.h], [uint16=uint16_t], [
1765 AC_CHECK_HEADERS([inttypes.h], [uint16=uint16_t], [
1766 AC_CHECK_HEADERS([sys/types.h], [uint16=u_int16_t], [
1767 AC_CHECK_SIZEOF(unsigned short)
1768 if test $ac_cv_sizeof_unsigned_short -eq 2 ; then
1769 uint16="unsigned short"
1771 AC_CHECK_SIZEOF(unsigned int)
1772 if $ac_cv_sizeof_unsigned_int -eq 2 ; then
1773 uint16="unsigned int"
1775 AC_MSG_ERROR(Unable to determine 16 bit integer type)
1781 AC_DEFINE_UNQUOTED([UINT16], $uint16, [System defined unsigned 16 bit integer])
1783 AC_CHECK_HEADERS([stdint.h], [uint32=uint32_t], [
1784 AC_CHECK_HEADERS([inttypes.h], [uint32=uint32_t], [
1785 AC_CHECK_HEADERS([sys/types.h], [uint32=u_int32_t], [
1786 AC_CHECK_SIZEOF(unsigned int)
1787 if test $ac_cv_sizeof_unsigned_int -eq 4 ; then
1788 uint32="unsigned int"
1790 AC_CHECK_SIZEOF(unsigned long)
1791 if $ac_cv_sizeof_unsigned_long -eq 4 ; then
1792 uint32="unsigned long"
1794 AC_MSG_ERROR(Unable to determine 32 bit integer type)
1800 AC_DEFINE_UNQUOTED([UINT32], $uint32, [System defined unsigned 32 bit integer])
1802 AC_CACHE_CHECK(argument pointer type of qsort compare function and base,
1803 ac_cv_func_qsort_argtype,
1804 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1810 extern sortf(const void *, const void *);
1813 const void *b; { return 0; }
1815 qsort(base, 2, sizeof(char *), sortf);
1816 ]])],[ac_cv_func_qsort_argtype=void],[ac_cv_func_qsort_argtype=char])
1818 AC_DEFINE_UNQUOTED([qsort_t], $ac_cv_func_qsort_argtype, [qsort compare function argument type])
1820 dnl check for "struct passwd" ?
1822 AC_FUNC_SELECT_ARGTYPES
1826 dnl CHECK FOR LIBRARY FUNCTIONS
1829 AC_CHECK_FUNCS([strchr \
1862 AC_SEARCH_LIBS([gethostname],[nsl])
1864 AC_SEARCH_LIBS([socket],[socket],,
1869 AC_SEARCH_LIBS([bind],[bind],,
1874 dnl check for POSIX signal interface
1875 AC_CHECK_FUNCS([sigaction sigemptyset sigaddset sigprocmask],
1877 AC_DEFINE([POSIX_SIGNALS], [], [Define if system supports POSIX signal interface])
1880 AC_CHECK_FUNCS([sigset sigrelse],
1882 AC_DEFINE([SYSV_SIGNALS], [], [Define if system supports SYSV signal interface])
1886 AC_SEARCH_LIBS([syslog], [bsd socket inet],
1888 AC_DEFINE([HAVE_SYSLOG], [1], [Define if system supplies syslog() logging])
1892 dnl set pico newmail check directory
1893 if test -n "$alpine_with_local_maildir" ; then
1894 alpine_local_maildir=$alpine_with_local_maildir
1895 elif test -d /var/spool/mail ; then
1896 alpine_local_maildir="/var/spool/mail"
1897 elif test -d /var/mail ; then
1898 alpine_local_maildir="/var/mail"
1900 alpine_local_maildir="/usr/spool/mail"
1903 dnl set c-client make target
1904 if test -n "$alpine_with_c_client_target" ; then
1905 alpine_c_client_target=$alpine_with_c_client_target
1908 AC_DEFINE_UNQUOTED([SYSTYPE], "$systype", [Pine-Centric Host Specifier])
1909 AC_DEFINE_UNQUOTED([C_FILESEP],'$alpine_path_delim',[File name separator as character constant])
1910 AC_DEFINE_UNQUOTED([S_FILESEP],"$alpine_path_delim",[File name separator as string constant])
1911 AC_DEFINE_UNQUOTED([MAILDIR],"$alpine_local_maildir",[Path to local inboxes for pico newmail check])
1912 AC_DEFINE_UNQUOTED([MODE_READONLY], $alpine_mode_readonly, [File mode used to set readonly access])
1914 dnl c-client make particulars
1915 AC_SUBST([C_CLIENT_TARGET], $alpine_c_client_target)
1916 AC_SUBST([C_CLIENT_WITH_IPV6], $c_client_ip6)
1917 if test "x$alpine_SSLTYPE" = "xnone" ; then
1918 AC_MSG_NOTICE([* * * NOT Including SSL Support])
1919 c_client_specials="${c_client_specials}SSLTYPE=none "
1921 dnl issue any warnings for common OpenSSL issues
1923 if test -n "$alpine_SSLCERTS" -a -d "$alpine_SSLCERTS" ; then
1924 certdir="$alpine_SSLCERTS"
1925 elif test -n "$alpine_SSLDIR" -a -d "${alpine_SSLDIR}/certs" ; then
1926 certdir="${alpine_SSLDIR}/certs"
1927 elif test -n "$alpine_SSLDIR" -a -d "${alpine_SSLDIR}/ssl/certs" ; then
1928 certdir="${alpine_SSLDIR}/ssl/certs"
1929 elif test -n "$alpine_SSLCERTS_ORIG" -a -d "$alpine_SSLCERTS_ORIG" ; then
1930 certdir="$alpine_SSLCERTS_ORIG"
1931 elif test -n "$alpine_SSLCERTS" ; then
1932 certdir="$alpine_SSLCERTS"
1934 AC_MSG_NOTICE([SSL Problem: certificate directory not found])
1937 if test "x$with_smime" != "xno" ; then
1938 if test -n "$certdir" ; then
1939 AC_MSG_NOTICE([* * * S/MIME support enabled])
1940 AC_DEFINE([SMIME], [], [Enable S/MIME code])
1941 AC_DEFINE_UNQUOTED([SMIME_SSLCERTS],"$certdir",[Directory where S/MIME CACerts are located])
1947 if test -z "`ls ${certdir} | $EGREP '^@<:@0-9A-Fa-f@:>@{8}\.@<:@0-9@:>@'`" ; then
1948 SSL_BUNDLE_EXISTS="no"
1949 SSL_PEM="factory.pem ca-bundle.pem"
1950 for SSL_BUNDLE in $SSL_PEM
1952 if test -f ${certdir}/${SSL_BUNDLE} ; then
1953 SSL_BUNDLE_EXISTS="yes"
1960 if test "x$SSL_BUNDLE_EXISTS" = "xno" -a "x$SSL_CERT_LINK" = "xno" ; then
1961 AC_MSG_NOTICE([* * * No certificates found in "${certdir}".])
1962 AC_MSG_NOTICE([* * * This might indicate that CA certs did not get properly])
1963 AC_MSG_NOTICE([* * * installed. If you get certificate validation failures])
1964 AC_MSG_NOTICE([* * * in Alpine, this might be the reason for them.])
1967 if test -n "$alpine_SSLINCLUDE" ; then
1968 c_client_specials="${c_client_specials}SSLINCLUDE=$alpine_SSLINCLUDE "
1971 if test -n "$alpine_SSLLIB" ; then
1972 c_client_specials="${c_client_specials}SSLLIB=$alpine_SSLLIB "
1975 if test -n "$alpine_SSLDIR" ; then
1976 c_client_specials="${c_client_specials}SSLDIR=$alpine_SSLDIR "
1979 if test -n "$certdir" ; then
1980 c_client_specials="${c_client_specials}SSLCERTS=$certdir "
1983 if test -n "$alpine_SSLKEYS" ; then
1984 c_client_specials="${c_client_specials}SSLKEYS=$alpine_SSLKEYS "
1988 if test "x$alpine_GSSTYPE" != "xnone" ; then
1989 c_client_specials="${c_client_specials}EXTRAAUTHENTICATORS=gss "
1990 AC_MSG_NOTICE([* * * Including Kerberos5 functionality])
1993 if test -n "$CPPFLAGS" ; then
1994 alpine_c_client_cflags="$alpine_c_client_cflags ${CPPFLAGS}"
1996 if test -n "$CFLAGS" ; then
1997 alpine_c_client_cflags="$alpine_c_client_cflags ${CFLAGS}"
2000 if test -n "$alpine_c_client_cflags" ; then
2001 AC_SUBST(C_CLIENT_CFLAGS, EXTRACFLAGS=\"$alpine_c_client_cflags\")
2004 if test -n "$LDFLAGS" ; then
2005 alpine_c_client_ldflags="$alpine_c_client_ldflags ${LDFLAGS}"
2007 if test -n "$LIBS" ; then
2008 alpine_c_client_ldflags="$alpine_c_client_ldflags ${LIBS}"
2011 if test -n "$alpine_c_client_ldflags" ; then
2012 AC_SUBST(C_CLIENT_LDFLAGS, EXTRALDFLAGS=\"$alpine_c_client_ldflags\")
2015 if test -n "$alpine_c_client_gccoptlevel" ; then
2016 AC_SUBST(C_CLIENT_GCCOPTLEVEL, GCCOPTLEVEL=\"$alpine_c_client_gccoptlevel\")
2019 AC_SUBST([C_CLIENT_SPECIALS], $c_client_specials)
2021 dnl Deal with Web Alpine
2022 if test -z "$WEB_BUILD" ; then
2023 WEB_PUBCOOKIE_BUILD=
2024 AC_MSG_NOTICE([* * * TCL libraries could not be found.])
2025 AC_MSG_NOTICE([* * * WEB ALPINE COMPONENT WILL NOT BE BUILT.])
2027 if test -n "$WEB_PUBCOOKIE_BUILD" ; then
2028 if test "x$alpine_GSSTYPE" = "xnone" ; then
2029 WEB_PUBCOOKIE_BUILD=
2030 AC_MSG_NOTICE([* * * Kerberos5 support not found.])
2031 AC_MSG_NOTICE([* * * WEB ALPINE PUBCOOKIE COMPONENT WILL NOT BE BUILT.])
2032 elif test -z "$WEB_BINDIR" ; then
2033 WEB_PUBCOOKIE_BUILD=
2034 AC_MSG_NOTICE([* * * Web Alpine binary directory not provided.])
2035 AC_MSG_ERROR([* * * --with-pubcookie requires --with-web-bin=PATH.
2036 Please re-run configure with these options:
2037 --with-pubcookie --with-web-bin=/usr/local/libexec/alpine/bin])
2039 AC_DEFINE([PUBCOOKIE],[1],[Include support for UW Pubcookie Web Authentication])
2040 WEB_PUBCOOKIE_LIB=../pubcookie/libauthgssproxy.a
2041 WEB_PUBCOOKIE_LINK=gssapi_proxy.l
2046 AC_SUBST([REGEX_BUILD])
2048 AC_SUBST([WEB_BUILD])
2049 AC_SUBST([WEB_BINDIR])
2050 AC_SUBST([WEB_PUBCOOKIE_BUILD])
2051 AC_SUBST([WEB_PUBCOOKIE_LIB])
2052 AC_SUBST([WEB_PUBCOOKIE_LINK])
2054 AC_SUBST([AM_CFLAGS])
2055 AC_SUBST([AM_LDFLAGS])
2057 AC_CONFIG_FILES([m4/Makefile po/Makefile.in $REGEX_MAKEFILE \
2058 pith/osdep/Makefile pith/charconv/Makefile pith/Makefile \
2059 pico/osdep/Makefile pico/Makefile \
2060 alpine/osdep/Makefile alpine/Makefile \
2061 web/src/Makefile web/src/pubcookie/Makefile \
2062 web/src/alpined.d/Makefile \