1 dnl Process this file with autoconf to produce a configure script.
3 dnl /* ========================================================================
4 dnl * Copyright 2013 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:2 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
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(SED, sed, sed)
55 AC_PATH_PROG(MAKE, make)
57 dnl COMPILE-TIME OPTIONS
59 AM_GNU_GETTEXT_VERSION([0.16.1])
60 AM_GNU_GETTEXT([external])
62 dnl enable dmalloc per http://dmalloc.com
63 dnl NOTE: does not check c-client
64 AC_MSG_CHECKING([option: dmalloc enabled])
65 AC_ARG_ENABLE(dmalloc, AS_HELP_STRING([--enable-dmalloc],[Enable dmalloc debugging]))
66 if test x$enable_dmalloc = "xyes" ; then
72 AC_ARG_WITH(dmalloc-dir,
73 AS_HELP_STRING([--with-dmalloc-dir=DIR],[Root of dmalloc lib/include path]),
75 if test "x$withval" != "xno" ; then
76 enable_dmalloc = "yes"
77 CPPFLAGS="$CPPCFLAGS -I${withval}"
78 LDFLAGS="$LDFLAGS -L${withval}"
82 if test x$enable_dmalloc = "xyes" ; then
83 AC_DEFINE(ENABLE_DMALLOC, 1, [Define enable dmalloc debugging])
86 localedir="\${datadir}/locale"
87 AC_ARG_WITH(localedir,
88 AS_HELP_STRING([--with-localedir=DIR],[Name of gettext locale directory]),
100 AC_SUBST(localedir, "[$localedir]")
102 # Setup OS-Specific features
105 dnl OS X Universal Binary Support
106 AC_ARG_ENABLE(osx-universal-binaries,
107 AS_HELP_STRING([--enable-osx-universal-binaries],[Produce universal binaries under OS X [[default=no]]]))
108 if test "x$enable_osx_universal_binaries" = "xyes" ; then
109 if test "x$enable_dependency_tracking" != xno ; then
110 AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
111 Please re-run configure with these options:
112 --disable-dependency-tracking --enable-osx-universal-binary])
114 if [test -d /Developer/SDKs/MacOSX10.5.sdk] ; then
115 alpine_sysroot=/Developer/SDKs/MacOSX10.5.sdk
116 elif [test -d /Developer/SDKs/MacOSX10.4u.sdk] ; then
117 alpine_sysroot=/Developer/SDKs/MacOSX10.4u.sdk
119 AC_MSG_ERROR([No suitable MacOSX SDK found. Make sure Xcode tools are installed])
121 ub_cflags="-isysroot $alpine_sysroot -arch ppc -arch i386"
122 ub_ldflags="-Wl,-syslibroot,$alpine_sysroot -arch ppc -arch i386"
123 AM_CFLAGS="$AM_CFLAGS $ub_cflags"
124 AM_LDFLAGS="$AM_LDFLAGS $ub_ldflags"
125 alpine_c_client_cflags="$alpine_c_client_cflags $ub_cflags"
126 alpine_c_client_ldflags="$alpine_c_client_ldflags $ub_ldflags"
131 AC_ARG_WITH(include-path,
132 AS_HELP_STRING([--with-include-path=PATHS],[Colon-separated list of directories used for include file search]),
140 new_cppflags="-I`echo ${withval} | ${SED} 's/:/ -I/g'`"
141 CPPFLAGS="$CPPFLAGS ${new_cppflags}"
142 alpine_c_client_cflags="$alpine_c_client_cflags ${new_cppflags}"
147 AC_ARG_WITH(lib-path,
148 AS_HELP_STRING([--with-lib-path=PATHS],[Colon-separated list of directories used for library search]),
156 new_ldflags="-L`echo ${withval} | ${SED} 's/:/ -L/g'`"
157 LDFLAGS="$LDFLAGS $new_ldflags"
158 alpine_c_client_ldflags="$alpine_c_client_ldflags ${new_ldflags}"
163 AC_ARG_WITH(pubcookie,
164 AS_HELP_STRING([--with-pubcookie],[Include support for UW-Pubcookie Web Authentication]),
166 if test "x$withval" != "xno" ; then
167 WEB_PUBCOOKIE_BUILD=web/src/pubcookie
173 AS_HELP_STRING([--with-web-bin=PATH],[Directory to hold Web Alpine component binary files]),
186 dnl disable debug, turned on by default
187 AC_MSG_CHECKING([option: debugging is enabled])
188 AC_ARG_ENABLE(debug, AS_HELP_STRING([--disable-debug],[Exclude debug messages from source]))
189 if test x$enable_debug != "xno" ; then
190 AM_CFLAGS="$AM_CFLAGS -g"
191 AC_DEFINE([DEBUG], [1], [Compile in debugging])
192 AC_DEFINE([DEBUGJOURNAL], [1], [Display debug messages in journal])
195 dnl ??? set AM_CFLAGS to optimize ???
199 dnl disable optimization, on by default
200 AC_MSG_CHECKING([option: optimization is enabled])
201 AC_ARG_ENABLE(optimization, AS_HELP_STRING([--disable-optimization],[Exclude optimizing compiler flags]))
202 if test x$enable_optimization != "xno" ; then
205 CFLAGS="`echo $AM_CFLAGS | ${SED} 's/-O2//'`"
206 alpine_c_client_gccoptlevel="-O0"
210 dnl disable mouse support
211 AC_MSG_CHECKING([option: mouse support enabled])
212 AC_ARG_ENABLE(mouse, AS_HELP_STRING([--disable-mouse],[Disable mouse support]))
213 if test x$enable_mouse != "xno" ; then
214 AC_DEFINE([MOUSE], [], [Compile in mouse support])
221 AC_MSG_CHECKING([option: quotas enabled])
222 AC_ARG_ENABLE(quotas, AS_HELP_STRING([--enable-quotas],[Enable disk quota checking on startup]))
223 if test x$enable_quotas = "xyes" ; then
224 AC_DEFINE([USE_QUOTAS], [], [Compile in quota check on startup])
230 AC_MSG_CHECKING([option: From changing enabled])
231 AC_ARG_ENABLE(from_changing, AS_HELP_STRING([--disable-from-changing],[Disallow users changing From addresss]))
232 if test x$enable_from_changing != "xno" ; then
235 AC_DEFINE([NEVER_ALLOW_CHANGING_FROM], [], [Disallow users changing their From address])
239 dnl enable background posting support
240 AC_MSG_CHECKING([option: background post enabled])
241 AC_ARG_ENABLE(background-post, AS_HELP_STRING([--disable-background-post],[Disable background posting]))
242 if test x$enable_background_post != "xno" ; then
243 AC_DEFINE([BACKGROUND_POST], [], [Enable background posting support])
249 dnl enable keyboard locking support
250 AC_MSG_CHECKING([option: keyboard lock enabled])
251 AC_ARG_ENABLE(keyboard-lock, AS_HELP_STRING([--disable-keyboard-lock],[Disable keyboard locking]))
252 if test x$enable_keyboard_lock != "xno" ; then
253 AC_DEFINE([KEYBOARD_LOCK], [], [Enable keyboard lock support])
259 dnl enable from encoding support
260 AC_MSG_CHECKING([option: from encoding enabled])
261 AC_ARG_ENABLE(from-encoding, AS_HELP_STRING([--enable-from-encoding],[Enable From encoding in sent messages]))
262 if test x$enable_from_encoding = "xyes" ; then
263 AC_DEFINE([ENCODE_FROMS], [], [Enable From address encoding in sent messages])
269 dnl OPTION: name of local submission agent
270 dnl Might not be sendmail, but it MUST speak SMTP on stdin/stdout
271 AC_ARG_WITH(smtp-msa,
272 AS_HELP_STRING([--with-smtp-msa=PATH],[Local Mail Submission Agent (sendmail)]),
278 AC_PATH_PROG(SENDMAIL, sendmail, "", $PATH:/usr/sbin:/usr/lib)
286 AC_PATH_PROG(SENDMAIL, sendmail, "", $PATH:/usr/sbin:/usr/lib)
288 if test -n "$SENDMAIL" ; then
289 AC_DEFINE_UNQUOTED([SENDMAIL], "$SENDMAIL", [Local mail submission agent])
292 dnl OPTION: local msa arguments
293 smtp_msa_flags="-bs -odb -oem"
294 AC_ARG_WITH(smtp-msa-flags,
295 AS_HELP_STRING([--with-smtp-msa-flags=FLAGS],[MSA flags for SMTP on stdin/stdout (-bs -odb -oem)]),
297 if test "x$withval" != "xno" ; then
298 smtp_msa_flags=$withval
301 AC_DEFINE_UNQUOTED([SENDMAILFLAGS], "$smtp_msa_flags", [Local MSA flags for SMTP on stdin/stdout])
303 dnl OPTION: name of local news posting agent and flags
306 AS_HELP_STRING([--with-npa=PATH],[Posting agent when no nntp-servers defined (inews)]),
312 AC_PATH_PROG(NPA_PROG, inews, "", $PATH:/usr/sbin:/usr/lib)
320 AC_PATH_PROG(NPA_PROG, inews, "", $PATH:/usr/sbin:/usr/lib)
324 AC_ARG_WITH(npa-flags,
325 AS_HELP_STRING([--with-npa-flags=FLAGS],[Flags to allow posting via local agent (-h)]),
327 if test "x$withval" != "xno" ; then
331 if test -n "$NPA_PROG" ; then
332 AC_DEFINE_UNQUOTED([SENDNEWS], "$NPA_PROG $npa_flags", [Posting agent to use when no nntp-servers defined])
335 dnl OPTION: password changing program
336 AC_ARG_WITH(password-prog,
337 AS_HELP_STRING([--with-password-prog=PATH],[Password change program (/bin/passwd)]),
343 AC_PATH_PROG(PWPROG, passwd, "", $PATH:/usr/sbin:/usr/lib)
346 AC_PATH_PROG(PWPROG, $withval, "", $PATH:/usr/sbin:/usr/lib)
351 AC_PATH_PROG(PWPROG, passwd, "", $PATH:/usr/sbin:/usr/lib)
353 if test -n "$PWPROG" ; then
354 AC_DEFINE_UNQUOTED([PASSWD_PROG], "$PWPROG", [Program users use to change their password])
357 dnl OPTION: basic spell checking program
358 AC_ARG_WITH(simple-spellcheck,
359 AS_HELP_STRING([--with-simple-spellcheck=PROG],[Spellcheck program reads stdin, emits misspellings on stdout]),
361 if test "x$withval" != "xno" ; then
366 AC_CHECK_PROG([SPELLPROG], [hunspell], [hunspell], [])
367 if test -z "$SPELLPROG" ; then
368 AC_CHECK_PROG([SPELLPROG], [aspell], [aspell], [])
369 if test -z "$SPELLPROG" ; then
370 AC_CHECK_PROG([SPELLPROG], [ispell], [ispell], [])
371 if test -z "$SPELLPROG" ; then
378 if test "x$SPELLPROG" != "xno" ; then
379 AC_PATH_PROG(alpine_simple_spellcheck, $SPELLPROG)
380 if test -n "$alpine_simple_spellcheck" ; then
383 alpine_simple_spellcheck="$alpine_simple_spellcheck -l"
386 alpine_simple_spellcheck="$alpine_simple_spellcheck --dont-backup --mode=email list"
389 alpine_simple_spellcheck="$alpine_simple_spellcheck -l"
397 dnl OPTION: interactive spell checking program
398 AC_ARG_WITH(interactive-spellcheck,
399 AS_HELP_STRING([--with-interactive-spellcheck=PROG],[Interactive, filewise spell checker]),
401 if test "x$withval" != "xno" ; then
406 AC_CHECK_PROG([ISPELLPROG], [hunspell], [hunspell], [])
407 if test -z "$ISPELLPROG" ; then
408 AC_CHECK_PROG([ISPELLPROG], [aspell], [aspell], [])
409 if test -z "$SPELLPROG" ; then
415 if test "x$ISPELLPROG" != "xno" ; then
416 AC_PATH_PROG(alpine_interactive_spellcheck, $ISPELLPROG)
417 if test -n "$alpine_interactive_spellcheck" ; then
418 case "$ISPELLPROG" in
420 alpine_interactive_spellcheck="$alpine_interactive_spellcheck --dont-backup --mode=email check"
428 if test -n "$alpine_interactive_spellcheck" ; then
429 AC_DEFINE_UNQUOTED([DF_VAR_SPELLER], "$alpine_interactive_spellcheck", [Interactive, filewise spell checker])
432 if test -z "$alpine_simple_spellcheck" -a -n "$alpine_interactive_spellcheck" ; then
433 alpine_simple_spellcheck=test
435 AC_DEFINE_UNQUOTED([SPELLER], "$alpine_simple_spellcheck", [Simple spell checker: reads stdin, emits misspellings on stdout])
437 dnl OPTION: system-pinerc
438 dnl NOTE: historically we used /lib for the config dir.
439 dnl don't ask, it was a long time ago. but, we can't
440 dnl change it now without breaking compatibility
442 NONE) dpv=/usr/local/lib/pine.conf ;;
443 *) dpv=${prefix}/lib/pine.conf ;;
445 AC_ARG_WITH(system-pinerc,
446 AS_HELP_STRING([--with-system-pinerc=VALUE],[System pinerc (/usr/local/lib/pine.conf)]),
458 AC_DEFINE_UNQUOTED(SYSTEM_PINERC, "$dpv", [System pinerc])
460 dnl OPTION: system-fixed-pinerc
461 dnl NOTE: historically we used /lib for the config dir.
462 dnl don't ask, it was a long time ago. but, we can't
463 dnl change it now without breaking compatibility
465 NONE) dpv=/usr/local/lib/pine.conf.fixed ;;
466 *) dpv=${prefix}/lib/pine.conf.fixed ;;
468 AC_ARG_WITH(system-fixed-pinerc,
469 AS_HELP_STRING([--with-system-fixed-pinerc=VALUE],[System fixed pinerc (/usr/local/lib/pine.conf.fixed)]),
481 AC_DEFINE_UNQUOTED(SYSTEM_PINERC_FIXED, "$dpv", [System fixed pinerc])
483 dnl OPTION: local support information, file that contains information on
484 dnl how to contact local support for Alpine.
485 dnl NOTE: historically we used /lib for the config dir.
486 dnl don't ask, it was a long time ago. but, we can't
487 dnl change it now without breaking compatibility
489 NONE) dpv=/usr/local/lib/pine.info ;;
490 *) dpv=${prefix}/lib/pine.info ;;
492 AC_ARG_WITH(local-support-info,
493 AS_HELP_STRING([--with-local-support-info=VALUE],[Local Support Info File (/usr/local/lib/pine.info)]),
505 AC_DEFINE_UNQUOTED(SYSTEM_PINE_INFO_PATH, "$dpv", [Local Support Info File])
507 dnl Function to simplify setting alpine/pico defaults
508 dnl usage: PINEVAR(configure-name, definition-name, definition-value, help)
513 AS_HELP_STRING([--with-$1=VALUE],[$4 ($3)]),
515 if test "x$withval" != "xno" ; then
519 AC_DEFINE_UNQUOTED($2, "$dpv", [Default configuration value])
522 dnl Function to simplify setting pine/pico defaults
523 dnl usage: PINEVAR_UNQUOTED(configure-name, definition-name, definition-value, help)
524 AC_DEFUN([PINEVAR_UNQUOTED],
528 AS_HELP_STRING([--with-$1=VALUE],[$4 ($3)]),
530 if test "x$withval" != "xno" ; then
534 AC_DEFINE_UNQUOTED($2, $dpv, [Default configuration value])
537 PINEVAR(mailcheck-interval, DF_MAILCHECK, 150, [Specify default mail-check-interval])
538 PINEVAR_UNQUOTED(checkpoint-interval, CHECK_POINT_TIME, 420, [Specify default checkpoint-interval])
539 PINEVAR_UNQUOTED(checkpoint-frequency, CHECK_POINT_FREQ, 12, [State change count before checkpoint])
540 PINEVAR_UNQUOTED(display-rows, DEFAULT_LINES_ON_TERMINAL, 24, [Initial rows on display])
541 PINEVAR_UNQUOTED(display-columns, DEFAULT_COLUMNS_ON_TERMINAL, 80, [Initial columns on display])
542 PINEVAR_UNQUOTED(max-display-rows, MAX_SCREEN_ROWS, 200, [Maximum display rows])
543 PINEVAR_UNQUOTED(max-display-columns, MAX_SCREEN_COLS, 500, [Maximum display columns])
544 PINEVAR(fill-column, DF_FILLCOL, 74, [Default fill column])
545 PINEVAR_UNQUOTED(max_fill-column, MAX_FILLCOL, 80, [Maximum fill column])
546 PINEVAR_UNQUOTED(debug-level, DEFAULT_DEBUG, 2, [Specify default debug verbosity level])
547 PINEVAR_UNQUOTED(debug-files, NUMDEBUGFILES, 4, [Specify number of debug files])
548 PINEVAR(debug-file, DEBUGFILE, [.pine-debug], [Specify debug file name])
549 PINEVAR(forwarded-keyword, FORWARDED_FLAG, ["\$Forwarded"], [IMAP (c-client) keyword to store forwarded status])
550 PINEVAR(display-overlap, DF_OVERLAP, [2], [Lines preserved while paging])
551 PINEVAR(display-margin, DF_MARGIN, [0], [Lines visible while scrolling])
552 PINEVAR(default-fcc, DF_DEFAULT_FCC, [sent-mail], [Default sent mail folder])
553 PINEVAR(default-save-folder, DEFAULT_SAVE, [saved-messages], [Default save folder])
554 PINEVAR(default-legacy-postponed-folder, POSTPONED_MAIL, [postponed-mail], [Pre Pine 3.90 postponed folder])
555 PINEVAR(default-postponed-folder, POSTPONED_MSGS, [postponed-msgs], [Default postponed folder])
556 PINEVAR(default-trash-folder, TRASH_FOLDER, [Trash], [Default Trash folder for Web Alpine])
557 PINEVAR(default-interrupted-mail, INTERRUPTED_MAIL, [.pine-interrupted-mail], [Default folder for interrupted mail])
558 PINEVAR(default-dead-letter-folder, DEADLETTER, [dead.letter], [Default dead letter folder])
559 PINEVAR(default-mail-directory, DF_MAIL_DIRECTORY, [mail], [Default mail directory])
560 PINEVAR(default-inbox-name, INBOX_NAME, [INBOX], [Default inbox name])
561 PINEVAR(default-signature-file, DF_SIGNATURE_FILE, [.signature], [Default signature file])
562 PINEVAR(default-elm-style-save, DF_ELM_STYLE_SAVE, [no], [Default to Elm style save])
563 PINEVAR(default-header-in-reply, DF_HEADER_IN_REPLY, [no], [Include header in reply])
564 PINEVAR(default-old-style-reply, DF_OLD_STYLE_REPLY, [no], [Default to old style reply])
565 PINEVAR(default-use-only-domain-name, DF_USE_ONLY_DOMAIN_NAME, [no], [Default to using only the domain name])
566 PINEVAR(default-save-by-sender, DF_SAVE_BY_SENDER, [no], [Default to save by sender])
567 PINEVAR(default-sort-key, DF_SORT_KEY, [arrival], [Default sort key])
568 PINEVAR(default-addressbook-sort-rule, DF_AB_SORT_RULE, [fullname-with-lists-last], [Default addressbook sort rule])
569 PINEVAR(default-folder-sort-rule, DF_FLD_SORT_RULE, [alphabetical], [Default folder sort rule])
570 PINEVAR(default-saved-message-name-rule, DF_SAVED_MSG_NAME_RULE, [default-folder], [Default saved message name rule])
571 PINEVAR(default-fcc-rule, DF_FCC_RULE, [default-fcc], [Default fcc rule])
572 PINEVAR(default-standard-printer, DF_STANDARD_PRINTER, [lpr], [Default standard printern])
573 PINEVAR(default-ansi-printer, ANSI_PRINTER, [attached-to-ansi], [ANSI printer definition])
574 PINEVAR(default-addressbook, DF_ADDRESSBOOK, [.addressbook], [Default addressbook name])
575 PINEVAR(default-local-fullname, DF_LOCAL_FULLNAME, ["Local Support"], [Default local support fullname])
576 PINEVAR(default-local-address, DF_LOCAL_ADDRESS, [postmaster], [Default local support address])
577 PINEVAR(default-keyboard-lock-count, DF_KBLOCK_PASSWD_COUNT, [1], [Default keyboard lock count])
578 PINEVAR(default-remote-addressbook-history, DF_REMOTE_ABOOK_HISTORY, [3], [Default address book history count])
579 PINEVAR(smime-public-cert-directory, DF_PUBLICCERT_DIR, [.alpine-smime/public], [Default Public Cert Directory])
580 PINEVAR(smime-private-key-directory, DF_PRIVATEKEY_DIR, [.alpine-smime/private], [Default Private Key Directory])
581 PINEVAR(smime-cacert-directory, DF_CACERT_DIR, [.alpine-smime/ca], [Default Cert Authority Directory])
582 PINEVAR_UNQUOTED(default-printer, DF_DEFAULT_PRINTER, [ANSI_PRINTER], [Default printer])
585 AC_ARG_WITH(passfile,
586 AS_HELP_STRING([--with-passfile=FILENAME],[Password cache file (NOT secure, NOT recommended)]),
594 alpine_PASSFILE=$withval
599 dnl os-specific credential cache?
600 AC_ARG_WITH(local-password-cache,
601 AS_HELP_STRING([--without-local-password-cache],[Disable OS-specific password cache, if supported]),
603 alpine_os_credential_cache=$withval
606 dnl Particular os-specific credential cache?
607 AC_ARG_WITH(local-password-cache-method,
608 AS_HELP_STRING([--with-local-password-cache-method],[OS-specific credential cache (OSX=APPLEKEYCHAIN, Windows=WINCRED)]),
610 alpine_os_credential_cache_method=$withval
613 if test -n "$alpine_PASSFILE" ; then
614 case $alpine_os_credential_cache in
618 alpine_os_credential_cache="no"
619 AC_MSG_NOTICE([--with-passfile definition overrides OS-Specific password caching])
622 AC_DEFINE_UNQUOTED([PASSFILE], "$alpine_PASSFILE", [Password cache file (NOT secure. NOT recommended)])
626 AC_ARG_WITH(default-sshpath,
627 AS_HELP_STRING([--with-default-sshpath=FILENAME],[set default value of ssh command path (defining should cause ssh to be preferred to rsh)]),
635 AC_DEFINE_UNQUOTED([DF_SSHPATH], "$withval", [set default value of ssh command path (defining should cause ssh to be preferred to rsh)])
641 AC_ARG_WITH(default-sshcmd,
642 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")]),
650 AC_DEFINE_UNQUOTED([DF_SSHCMD], "$withval", [set default value of ssh command string (usually "%s %s -l %s exec /etc/r%sd")])
656 dnl Set SSLDIR for c-client make
658 AS_HELP_STRING([--without-ssl],[Disable SSL support (OpenSSL)]),
659 [ with_ssl=$withval ])
661 if test "x$with_ssl" = "xno" ; then
662 alpine_SSLTYPE="none"
664 dnl preload c-client default locations/options
667 if test -f /etc/fedora-release -o -f /etc/redhat-release -o -f /etc/redhat_version ; then
668 alpine_SSLTYPE="nopwd"
669 if test -d /etc/pki/tls ; then
670 alpine_SSLDIR="/etc/pki/tls"
672 alpine_SSLDIR="/usr/share/ssl"
674 elif test -f /etc/SuSE-release ; then
675 alpine_SSLTYPE="nopwd"
676 alpine_SSLDIR="/usr/share/ssl"
677 alpine_SSLCERTS="/etc/ssl/certs"
678 elif test -d /etc/osso-af-init ; then
679 alpine_SSLTYPE="nopwd"
681 alpine_SSLCERTS="/usr/share/certs"
683 alpine_SSLTYPE="nopwd"
685 alpine_SSLCERTS="/etc/ssl/certs"
689 alpine_SSLTYPE="nopwd"
690 alpine_SSLCERTS="/System/Library/OpenSSL/certs"
693 alpine_SSLTYPE="nopwd"
695 alpine_SSLCERTS="/etc/ssl/certs"
697 *-sco-sysv* | *-sysv*UnixWare | *-sysv*OpenUNIX)
698 alpine_SSLTYPE="sco.nopwd"
699 alpine_SSLDIR=/usr/local/ssl
702 if test -d /usr/sfw/include/openssl ; then
703 alpine_SSLDIR="/usr/sfw"
704 elif test -d /opt/csw/include/openssl ; then
705 alpine_SSLDIR="/opt/csw"
706 if test -d /opt/csw/ssl/certs ; then
707 alpine_SSLCERTS="/opt/csw/ssl/certs"
710 if test -z "$alpine_SSLCERTS" -a -d /etc/certs ; then
711 alpine_SSLCERTS="/etc/certs"
715 alpine_SSLTYPE="nopwd"
716 alpine_SSLDIR=/usr/local/ssl
721 AS_HELP_STRING([--with-ssl-dir=DIR],[Root of SSL lib/include path]),
723 if test "x$withval" != "xno" ; then
724 alpine_SSLDIR=$withval
728 AC_ARG_WITH(ssl-certs-dir,
729 AS_HELP_STRING([--with-ssl-certs-dir=DIR],[Path to SSL certificate directory]),
731 if test "x$withval" != "xno" ; then
732 alpine_SSLCERTS=$withval
736 AC_ARG_WITH(ssl-include-dir,
737 AS_HELP_STRING([--with-ssl-include-dir=DIR],[SSL include file path]),
739 if test "x$withval" != "xno" ; then
740 alpine_SSLINCLUDE=$withval
744 AC_ARG_WITH(ssl-lib-dir,
745 AS_HELP_STRING([--with-ssl-lib-dir=DIR],[SSL library path]),
747 if test "x$withval" != "xno" ; then
748 alpine_SSLLIB=$withval
751 dnl setup globals so tests below work
752 if test -n "$alpine_SSLINCLUDE" ; then
753 CPPCFLAGS="-I$alpine_SSLINCLUDE $CPPFLAGS"
754 elif test -n "$alpine_SSLDIR" ; then
755 CPPFLAGS="-I${alpine_SSLDIR}/include $CPPFLAGS"
757 if test -n "$alpine_SSLLIB" ; then
758 LDFLAGS="-L$alpine_SSLLIB $LDFLAGS"
759 elif test -n "$alpine_SSLDIR" ; then
760 LDFLAGS="-L${alpine_SSLDIR}/lib $LDFLAGS"
764 dnl Include Kerberos?
765 dnl Set GSSDIR for c-client make
767 AS_HELP_STRING([--without-krb5],[Disable Kerberos support]),
768 [ with_krb5=$withval ])
770 if test "x$with_krb5" = "xno" ; then
771 alpine_GSSTYPE="none"
775 AC_ARG_WITH(krb5-dir,
776 AS_HELP_STRING([--with-krb5-dir=DIR],[Root of Kerberos lib/include path]),
778 if test "x$withval" != "xno" ; then
779 CPPFLAGS="$CPPFLAGS -I${withval}/include"
780 LDFLAGS="$LDFLAGS -L${withval}/lib"
784 AC_ARG_WITH(krb5-include-dir,
785 AS_HELP_STRING([--with-krb5-include-dir=DIR],[Kerberos include file path]),
787 if test "x$withval" != "xno" ; then
788 CPPFLAGS="$CPPFLAGS -I$withval"
792 AC_ARG_WITH(krb5-lib-dir,
793 AS_HELP_STRING([--with-krb5-lib-dir=DIR],[Kerberos library path]),
795 if test "x$withval" != "xno" ; then
796 LDFLAGS="$LDFLAGS -L$withval"
803 AS_HELP_STRING([--without-ldap],[Disable LDAP query support]),
804 [ with_ldap=$withval ])
806 if test "x$with_ldap" = "xno" ; then
808 AC_MSG_NOTICE([Excluding LDAP Support])
810 dnl Do stuff to figure out where OpenLDAP is
813 AC_ARG_WITH(ldap-dir,
814 AS_HELP_STRING([--with-ldap-dir=DIR],[Root of LDAP lib/include path]),
816 if test "x$withval" != "xno" ; then
817 CPPFLAGS="$CPPFLAGS -I${withval}/include"
818 LDFLAGS="$LDFLAGS -L${withval}/lib"
822 AC_ARG_WITH(ldap-include-dir,
823 AS_HELP_STRING([--with-ldap-include-dir=DIR],[Directory containing LDAP include files]),
825 if test "x$withval" != "xno" ; then
826 CPPFLAGS="$CPPFLAGS -I$withval"
830 AC_ARG_WITH(ldap-lib-dir,
831 AS_HELP_STRING([--with-ldap-lib-dir=DIR],[LDAP library path]),
833 if test "x$withval" != "xno" ; then
834 LDFLAGS="$LDFLAGS -L$withval"
841 AS_HELP_STRING([--without-smime],[Disable S/MIME]),
842 [ with_smime=$withval ])
846 AS_HELP_STRING([--without-tcl],[Disable TCL, thus Web Alpine support]),
847 [ with_tcl=$withval ])
849 if test "x$with_tcl" = "xno" ; then
851 AC_MSG_NOTICE([Excluding TCL Support, and thus Web Alpine Support])
854 AS_HELP_STRING([--with-tcl-lib=LIBRARY],[Specific TCL Library, like \"tcl8.5\"]),
856 if test "x$withval" != "xno" ; then
857 alpine_TCLLIB=$withval
860 AC_ARG_WITH(tcl-include,
861 AS_HELP_STRING([--with-tcl-include=DIR],[Directory containing TCL include files]),
863 if test "x$withval" != "xno" ; then
864 CPPFLAGS="$CPPFLAGS -I$withval"
865 alpine_TCLINC=$withval
870 AC_ARG_WITH(supplied-regex,
871 AS_HELP_STRING([--with-supplied-regex],[Use regex library supplied with alpine]),
872 [ alpine_REGEX=$withval ])
875 AS_HELP_STRING([--without-pthread],[Do NOT test for nor build with POSIX thread support]),
876 [ with_pthread=$withval ])
878 AC_ARG_WITH(system-mail-directory,
879 AS_HELP_STRING([--with-system-mail-directory=DIR],[Directory where local mail is delivered]),
881 if test "x$withval" != "xno" ; then
882 alpine_with_local_maildir="$withval"
886 AC_ARG_WITH(c-client-target,
887 AS_HELP_STRING([--with-c-client-target=TARGET],[IMAP build target (see imap/Makefile)]),
889 if test "x$withval" != "xno" ;then
890 alpine_with_c_client_target="$withval"
897 AS_HELP_STRING([--without-ipv6],[Disable IPv6, primarily to work around resolver problems]),
898 [ with_ipv6=$withval ])
900 if test "x$with_ipv6" = "xno" ; then
901 AC_MSG_NOTICE([Excluding IPv6 Support])
902 c_client_specials="${c_client_specials}IP6=4 "
905 c_client_ip6="touch imap/ip6"
911 if test x$enable_dmalloc = "xyes" ; then
912 if test "x$with_pthread" = "xyes" ; then
913 dmalloc_lib=dmallocth
918 AC_CHECK_LIB($dmalloc_lib,dmalloc_shutdown,,
920 AC_MSG_ERROR($dmalloc_lib requested, but -ldmalloc not found)
924 dnl which terminal cabability database
925 AC_CHECK_LIB(tinfo, setupterm,
931 AC_CHECK_LIB(ncurses, setupterm,
934 LIBS="$LIBS -lncurses"
937 AC_CHECK_LIB(curses, setupterm,
940 LIBS="$LIBS -lcurses"
943 AC_CHECK_LIB(termlib, tgetent,
946 LIBS="$LIBS -ltermlib"
949 AC_CHECK_LIB(termcap, tgetent,
952 LIBS="$LIBS -ltermcap"
955 AC_MSG_ERROR(Terminfo/termcap not found)
961 case $alpine_termdata in
963 AC_DEFINE(HAS_TERMINFO, [1], [Define if systems uses terminfo terminal database])
966 AC_DEFINE(HAS_TERMCAP, [1], [Define if systems uses termcap terminal database])
970 dnl provide LDAP support?
971 if test "$alpine_with_ldap" = "yes" ; then
973 AC_CHECK_LIB(lber, ber_alloc,
977 AC_SEARCH_LIBS(ldap_init,ldap,
982 AC_SEARCH_LIBS(ldap_open,ldap,
988 if test "$alpine_has_ldap" = "yes" ; then
989 AC_MSG_NOTICE([Including LDAP Support])
990 AC_DEFINE([ENABLE_LDAP], [], [Enable LDAP query support])
992 dnl we use deprecated functions (ldap_get_values)
993 dnl OpenLDAP 2.3.x doesn't define LDAP_DEPRECATED by default like 2.2.x
994 AC_MSG_CHECKING([if we should define LDAP_DEPRECATED])
1002 if (LDAP_VENDOR_VERSION >= 20300)
1010 AC_DEFINE(LDAP_DEPRECATED, 1,
1011 [Define if you use OpenLDAP 2.3.x deprecated functions])
1018 AC_MSG_WARN([cross compiling: not checking])
1023 AC_MSG_NOTICE([Cannot find LDAP functions! Excluding LDAP support.])
1027 dnl provide SSL support?
1028 if test "x$alpine_SSLTYPE" != "xnone" ; then
1029 AC_SEARCH_LIBS(SSL_library_init,ssl,
1033 AC_MSG_CHECKING([Openssl library version >= 1.0.0c])
1037 #include <openssl/ssl.h>
1040 if (OPENSSL_VERSION_NUMBER >= 0x1000003f)
1050 AC_MSG_ERROR(Install openssl version >= 1.0.1c)
1054 AC_MSG_WARN([cross compiling: not checking])
1058 [alpine_SSLTYPE="none"])
1059 if test "x$alpine_SSLTYPE" = "xnone" ; then
1060 AC_MSG_NOTICE([OpenSSL libraries NOT found])
1062 AC_MSG_NOTICE([OpenSSL libraries FOUND])
1066 dnl Crypto support is needed
1067 if test "x$alpine_SSLTYPE" != "xnone" ; then
1068 AC_SEARCH_LIBS(SSLeay,crypto,
1070 LIBS="$LIBS -lcrypto"
1073 alpine_CRYPTO = "none"
1075 if test "x$alpine_CRYPTO" = "xnone" ; then
1076 AC_MSG_ERROR(crypto library NOT found)
1078 AC_MSG_NOTICE([crypto library found])
1082 dnl PAM support is needed to build c-client, and hence Alpine.
1083 if test "x$alpine_PAM" != "xnone" ; then
1084 AC_SEARCH_LIBS(pam_start,pam,
1087 AC_CHECK_HEADER([security/pam_appl.h],,
1090 alpine_pam_none_reason="header files not found"
1095 alpine_pam_none_reason="library files not found"
1097 if test -n "$alpine_pam_none_reason" ; then
1098 AC_MSG_ERROR(No PAM support: $alpine_pam_none_reason)
1103 dnl provide KRB5 support?
1104 if test "x$alpine_GSSTYPE" != "xnone" ; then
1105 AC_SEARCH_LIBS(gss_init_sec_context,gss gssapi gssapi_krb5,
1109 AC_CHECK_HEADER([gssapi/gssapi_generic.h],,
1111 if test ! -d /usr/kerberos/include ; then
1112 alpine_GSSTYPE="none"
1113 alpine_gss_none_reason="header files not found"
1118 alpine_GSSTYPE="none"
1119 alpine_gss_none_reason="libraries not found"
1121 if test -n "$alpine_gss_none_reason" ; then
1122 AC_MSG_NOTICE([NOT including Kerberos Support: $alpine_gss_none_reason])
1126 dnl check for tcl libraries for Web Alpine (HACKY)
1127 if test -n "$WEB_BUILD" ; then
1128 AC_SEARCH_LIBS([Tcl_Eval],[$alpine_TCLLIB tcl8.5 tcl8.4 tcl8.3 tcl84 tcl83 tcl],,
1133 dnl look for header file
1134 if test -n "$alpine_TCLINC" ; then
1135 AC_CHECK_HEADER($alpine_TCLINC,,
1139 if test -z "$WEB_BUILD" ; then
1140 AC_MSG_NOTICE([Tcl Include file NOT found])
1143 AC_CHECK_HEADER(tcl.h,,
1145 for dir in tcl8.5 tcl8.4 tcl8.3 tcl84 tcl83 ; do
1146 AC_CHECK_FILE([/usr/include/$dir/tcl.h],
1150 if test "$found" = "yes" ; then
1151 CPPFLAGS="$CPPFLAGS -I/usr/include/$dir"
1155 if test "$found" != "yes" ; then
1157 AC_MSG_NOTICE([header file tcl.h NOT found: Web Alpine will not be built])
1163 dnl Local or supplied regex?
1164 if test x$alpine_REGEX != "xyes" ; then
1165 AC_SEARCH_LIBS([regcomp],posix regexp regex re,,
1167 if test x$alpine_REGEX = "xno" ; then
1168 AC_MSG_ERROR(Unable to find system regex library)
1174 if test x$alpine_REGEX != "xyes" ; then
1175 AC_CHECK_HEADER([regex.h],,
1177 if test x$alpine_REGEX = "xno" ; then
1178 AC_MSG_ERROR(Unable to find system regex include file)
1184 AC_DEFINE(HAVE_REGEX_H,1,[Regular expression header file exists])
1185 if test x$alpine_REGEX = "xyes" ; then
1186 CPPFLAGS="$CPPFLAGS -I${top_builddir}/regex"
1187 LDFLAGS="$LDFLAGS -L${top_builddir}/regex -lregex"
1191 if test "x$with_pthread" != "xno" ; then
1192 AC_MSG_CHECKING([for pthread support])
1195 AC_MSG_RESULT([yes])
1198 AC_MSG_NOTICE([WARNING: pthread support on OpenBSD is unstable!])
1199 AM_CFLAGS="$AM_CFLAGS -pthread"
1202 LIBS="$PTHREAD_LIBS $LIBS"
1203 AM_CFLAGS="$AM_CFLAGS $PTHREAD_CFLAGS"
1205 AC_DEFINE([HAVE_PTHREAD], [1], [System has pthread support])
1211 AC_SEARCH_LIBS([nanosleep], [rt posix4],
1213 AC_DEFINE([HAVE_NANOSLEEP], [1], [Define if system supports subsecond, non-alarm sleep])
1226 AC_HEADER_TIOCGWINSZ
1228 AC_CHECK_HEADERS([unistd.h])
1230 AC_CHECK_HEADERS([errno.h \
1255 dnl terminal line discipline?
1256 AC_CHECK_HEADER([termios.h],
1257 AC_DEFINE(HAS_TERMIOS, [1], [Define if systems uses termios terminal control]),
1259 AC_CHECK_HEADER([termio.h],
1260 AC_DEFINE(HAS_TERMIO, [1], [Define if systems uses termio terminal control]),
1262 AC_CHECK_HEADER([sgtty.h],
1263 AC_DEFINE(HAS_SGTTY, [1], [Define if systems uses old BSD-style terminal control]),
1265 AC_MSG_ERROR(Unable to figure out terminal control method)
1273 AC_DIAGNOSE([obsolete],[your code may safely assume C89 semantics that RETSIGTYPE is void.
1274 Remove this warning and the `AC_CACHE_CHECK' when you adjust the code.])dnl
1275 AC_CACHE_CHECK([return type of signal handlers],[ac_cv_type_signal],[AC_COMPILE_IFELSE(
1276 [AC_LANG_PROGRAM([#include <sys/types.h>
1279 [return *(signal (0, 0)) (0) == 1;])],
1280 [ac_cv_type_signal=int],
1281 [ac_cv_type_signal=void])])
1282 AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers
1283 (`int' or `void').])
1291 AC_CHECK_TYPES([union wait])
1293 AC_CHECK_HEADERS([stdint.h], [uint16=uint16_t], [
1294 AC_CHECK_HEADERS([inttypes.h], [uint16=uint16_t], [
1295 AC_CHECK_HEADERS([sys/types.h], [uint16=u_int16_t], [
1296 AC_CHECK_SIZEOF(unsigned short)
1297 if test $ac_cv_sizeof_unsigned_short -eq 2 ; then
1298 uint16="unsigned short"
1300 AC_CHECK_SIZEOF(unsigned int)
1301 if $ac_cv_sizeof_unsigned_int -eq 2 ; then
1302 uint16="unsigned int"
1304 AC_MSG_ERROR(Unable to determine 16 bit integer type)
1310 AC_DEFINE_UNQUOTED([UINT16], $uint16, [System defined unsigned 16 bit integer])
1312 AC_CHECK_HEADERS([stdint.h], [uint32=uint32_t], [
1313 AC_CHECK_HEADERS([inttypes.h], [uint32=uint32_t], [
1314 AC_CHECK_HEADERS([sys/types.h], [uint32=u_int32_t], [
1315 AC_CHECK_SIZEOF(unsigned int)
1316 if test $ac_cv_sizeof_unsigned_int -eq 4 ; then
1317 uint32="unsigned int"
1319 AC_CHECK_SIZEOF(unsigned long)
1320 if $ac_cv_sizeof_unsigned_long -eq 4 ; then
1321 uint32="unsigned long"
1323 AC_MSG_ERROR(Unable to determine 32 bit integer type)
1329 AC_DEFINE_UNQUOTED([UINT32], $uint32, [System defined unsigned 32 bit integer])
1331 AC_CACHE_CHECK(argument pointer type of qsort compare function and base,
1332 ac_cv_func_qsort_argtype,
1333 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1339 extern sortf(const void *, const void *);
1342 const void *b; { return 0; }
1344 qsort(base, 2, sizeof(char *), sortf);
1345 ]])],[ac_cv_func_qsort_argtype=void],[ac_cv_func_qsort_argtype=char])
1347 AC_DEFINE_UNQUOTED([qsort_t], $ac_cv_func_qsort_argtype, [qsort compare function argument type])
1349 dnl check for "struct passwd" ?
1351 AC_FUNC_SELECT_ARGTYPES
1355 dnl CHECK FOR LIBRARY FUNCTIONS
1358 AC_CHECK_FUNCS([strchr \
1391 AC_SEARCH_LIBS([gethostname],[nsl])
1393 AC_SEARCH_LIBS([socket],[socket],,
1398 AC_SEARCH_LIBS([bind],[bind],,
1403 dnl check for POSIX signal interface
1404 AC_CHECK_FUNCS([sigaction sigemptyset sigaddset sigprocmask],
1406 AC_DEFINE([POSIX_SIGNALS], [], [Define if system supports POSIX signal interface])
1409 AC_CHECK_FUNCS([sigset sigrelse],
1411 AC_DEFINE([SYSV_SIGNALS], [], [Define if system supports SYSV signal interface])
1415 AC_SEARCH_LIBS([syslog], [bsd socket inet],
1417 AC_DEFINE([HAVE_SYSLOG], [1], [Define if system supplies syslog() logging])
1421 dnl HOST-OS SPECIFIC DEFINITIONS
1422 dnl Tests and assignments below are mostly to coax the appropriate
1423 dnl build from c-client. Most of this will go away when c-client
1424 dnl adopts configure
1426 *-linux-gnu*|*-k*bsd*-gnu*)
1427 alpine_path_delim="/"
1428 alpine_mode_readonly="(0600)"
1429 if test -f /etc/fedora-release ; then
1431 if test -d /etc/pki/tls ; then
1432 alpine_c_client_target="lfd"
1434 alpine_c_client_target="lrh"
1436 elif test -f /etc/mandrake-release ; then
1438 alpine_c_client_target="lmd"
1439 elif test -f /etc/redhat-release -o -f /etc/redhat_version ; then
1441 if test -d /etc/pki/tls ; then
1442 alpine_c_client_target="lr5"
1444 alpine_c_client_target="lrh"
1446 elif test -f /etc/debian_release -o -f /etc/debian_version ; then
1447 if test -d /etc/osso-af-init ; then
1449 alpine_c_client_target="ln8"
1452 alpine_c_client_target="ldb"
1454 elif test -f /etc/SuSE-release ; then
1456 alpine_c_client_target="lsu"
1459 AC_CHECK_LIB(pam, pam_start,
1461 alpine_c_client_target="lnp"
1464 if test -f /etc/shadow ; then
1465 alpine_c_client_target="slx"
1467 alpine_c_client_target="lnx"
1474 alpine_path_delim="/"
1475 alpine_mode_readonly="(0600)"
1476 LIBS="$LIBS -framework Carbon -framework ApplicationServices -framework Security"
1477 AM_CFLAGS="$AM_CFLAGS -Dbsd"
1478 dnl SEE include/system.h
1479 AC_DEFINE([OSX_TARGET],[1],[OSX TARGET])
1480 case "$alpine_os_credential_cache" in
1484 AC_DEFINE([APPLEKEYCHAIN], [1], [Use Apple OS X key chain for credential caching])
1487 AC_CHECK_LIB(pam, pam_start,
1489 alpine_c_client_target="oxp"
1492 alpine_c_client_target="osx"
1496 if test x$GCC = "xyes" ; then
1498 alpine_c_client_target="gso"
1501 alpine_c_client_target="soc"
1502 AC_DEFINE([__EXTENSIONS__], [1], [Enable extended pthread features on Solaris])
1504 alpine_path_delim="/"
1505 alpine_mode_readonly="(0600)"
1506 dnl possible other OS's need this.
1507 dnl Use autoconf 2.61's AC_USE_SYSTEM_EXTENSIONS at some point
1511 alpine_path_delim="/"
1512 alpine_mode_readonly="(0600)"
1513 alpine_c_client_target="s40"
1516 if test x$GCC = "xyes" ; then
1518 alpine_c_client_target="go5"
1521 alpine_c_client_target="sc5"
1523 alpine_path_delim="/"
1524 alpine_mode_readonly="(0600)"
1525 dnl possible other OS's need this.
1526 dnl Use autoconf 2.61's AC_USE_SYSTEM_EXTENSIONS at some point
1530 alpine_path_delim="/"
1531 alpine_mode_readonly="(0600)"
1532 alpine_c_client_target="nx3"
1536 alpine_path_delim="/"
1537 alpine_mode_readonly="(0600)"
1538 alpine_c_client_target="neb"
1542 alpine_path_delim="/"
1543 alpine_mode_readonly="(0600)"
1544 alpine_c_client_target="neb"
1548 alpine_path_delim="/"
1549 alpine_mode_readonly="(0600)"
1550 alpine_c_client_target="bsi"
1554 alpine_path_delim="/"
1555 alpine_mode_readonly="(0600)"
1556 alpine_c_client_target="bsf"
1557 LIBS="$LIBS $LIBINTL"
1561 alpine_path_delim="/"
1562 alpine_mode_readonly="(0600)"
1563 alpine_c_client_target="bso"
1564 LIBS="$LIBS $LIBINTL"
1568 alpine_path_delim="/"
1569 alpine_mode_readonly="(0600)"
1570 alpine_c_client_target="a52"
1574 alpine_path_delim="/"
1575 alpine_mode_readonly="(0600)"
1576 alpine_c_client_target="a41"
1580 alpine_path_delim="/"
1581 alpine_mode_readonly="(0600)"
1582 alpine_c_client_target="a32"
1584 *-*UNIX_SV | *-*-sysv5UnixWare7* | *-*OpenUNIX*)
1586 alpine_path_delim="/"
1587 alpine_mode_readonly="(0600)"
1588 alpine_c_client_target="uw2"
1592 alpine_path_delim="/"
1593 alpine_mode_readonly="(0600)"
1594 alpine_c_client_target="osf"
1598 alpine_path_delim="/"
1599 alpine_mode_readonly="(S_IREAD | S_IWRITE)"
1600 alpine_c_client_target="cyg"
1601 LIBS="$LIBS $LIBINTL"
1603 windows* | *-*-pw32*)
1605 alpine_path_delim="\\"
1606 alpine_mode_readonly="(S_IREAD | S_IWRITE)"
1607 alpine_c_client_target="wnt"
1608 AC_DEFINE([_WINDOWS], [1], [Windows is just too different])
1611 AC_MSG_ERROR(Unrecognized system: $host)
1615 dnl set pico newmail check directory
1616 if test -n "$alpine_with_local_maildir" ; then
1617 alpine_local_maildir=$alpine_with_local_maildir
1618 elif test -d /var/spool/mail ; then
1619 alpine_local_maildir="/var/spool/mail"
1620 elif test -d /var/mail ; then
1621 alpine_local_maildir="/var/mail"
1623 alpine_local_maildir="/usr/spool/mail"
1626 dnl set c-client make target
1627 if test -n "$alpine_with_c_client_target" ; then
1628 alpine_c_client_target=$alpine_with_c_client_target
1631 AC_DEFINE_UNQUOTED([SYSTYPE], "$systype", [Pine-Centric Host Specifier])
1632 AC_DEFINE_UNQUOTED([C_FILESEP],'$alpine_path_delim',[File name separator as character constant])
1633 AC_DEFINE_UNQUOTED([S_FILESEP],"$alpine_path_delim",[File name separator as string constant])
1634 AC_DEFINE_UNQUOTED([MAILDIR],"$alpine_local_maildir",[Path to local inboxes for pico newmail check])
1635 AC_DEFINE_UNQUOTED([MODE_READONLY], $alpine_mode_readonly, [File mode used to set readonly access])
1637 dnl c-client make particulars
1638 AC_SUBST([C_CLIENT_TARGET], $alpine_c_client_target)
1639 AC_SUBST([C_CLIENT_WITH_IPV6], $c_client_ip6)
1640 if test "x$alpine_SSLTYPE" = "xnone" ; then
1641 AC_MSG_NOTICE([* * * NOT Including SSL Support])
1642 c_client_specials="${c_client_specials}SSLTYPE=none "
1644 dnl issue any warnings for common OpenSSL issues
1646 if test -n "$alpine_SSLCERTS" -a -d "$alpine_SSLCERTS" ; then
1647 certdir="$alpine_SSLCERTS"
1648 elif test -n "$alpine_SSLDIR" -a -d "${alpine_SSLDIR}/certs" ; then
1649 certdir="${alpine_SSLDIR}/certs"
1651 AC_MSG_NOTICE([SSL Problem: certificate directory not found])
1654 if test "x$with_smime" != "xno" ; then
1655 if test -n "$certdir" ; then
1656 AC_DEFINE([SMIME], [], [Enable S/MIME code])
1657 AC_DEFINE_UNQUOTED([SMIME_SSLCERTS],"$certdir",[Directory where S/MIME CACerts are located])
1661 if test ! -f ${certdir}/factory.pem ; then
1662 AC_MSG_NOTICE([* * * SSL file "${certdir}/factory.pem" is missing.])
1663 AC_MSG_NOTICE([* * * This might indicate that CA certs did not get properly])
1664 AC_MSG_NOTICE([* * * installed. If you get certificate validation failures])
1665 AC_MSG_NOTICE([* * * in Alpine, this might be the reason for them.])
1668 if test -z "`ls ${certdir} | $EGREP '^@<:@0-9A-Fa-f@:>@{8}\.@<:@0-9@:>@'`" ; then
1669 AC_MSG_NOTICE([* * * No 8-hexdigit symlinks in certificate directory "${certdir}".])
1670 AC_MSG_NOTICE([* * * This might indicate that CA certs did not get properly])
1671 AC_MSG_NOTICE([* * * installed. If you get certificate validation failures])
1672 AC_MSG_NOTICE([* * * in Alpine, this might be the reason for them.])
1675 if test -n "$alpine_SSLDIR" ; then
1676 c_client_specials="${c_client_specials}SSLDIR=$alpine_SSLDIR "
1679 if test -n "$alpine_SSLCERTS" ; then
1680 c_client_specials="${c_client_specials}SSLCERTS=$alpine_SSLCERTS "
1683 if test -n "$alpine_SSLINCLUDE" ; then
1684 c_client_specials="${c_client_specials}SSLINCLUDE=$alpine_SSLINCLUDE "
1687 if test -n "$alpine_SSLLIB" ; then
1688 c_client_specials="${c_client_specials}SSLLIB=$alpine_SSLLIB "
1693 if test "x$alpine_GSSTYPE" != "xnone" ; then
1694 c_client_specials="${c_client_specials}EXTRAAUTHENTICATORS=gss "
1695 AC_MSG_NOTICE([* * * Including Kerberos5 functionality])
1698 if test -n "$CPPFLAGS" ; then
1699 alpine_c_client_cflags="$alpine_c_client_cflags ${CPPFLAGS}"
1701 if test -n "$CFLAGS" ; then
1702 alpine_c_client_cflags="$alpine_c_client_cflags ${CFLAGS}"
1705 if test -n "$alpine_c_client_cflags" ; then
1706 AC_SUBST(C_CLIENT_CFLAGS, EXTRACFLAGS=\"$alpine_c_client_cflags\")
1709 if test -n "$LDFLAGS" ; then
1710 alpine_c_client_ldflags="$alpine_c_client_ldflags ${LDFLAGS}"
1712 if test -n "$LIBS" ; then
1713 alpine_c_client_ldflags="$alpine_c_client_ldflags ${LIBS}"
1716 if test -n "$alpine_c_client_ldflags" ; then
1717 AC_SUBST(C_CLIENT_LDFLAGS, EXTRALDFLAGS=\"$alpine_c_client_ldflags\")
1720 if test -n "$alpine_c_client_gccoptlevel" ; then
1721 AC_SUBST(C_CLIENT_GCCOPTLEVEL, GCCOPTLEVEL=\"$alpine_c_client_gccoptlevel\")
1724 AC_SUBST([C_CLIENT_SPECIALS], $c_client_specials)
1726 dnl Deal with Web Alpine
1727 if test -z "$WEB_BUILD" ; then
1728 WEB_PUBCOOKIE_BUILD=
1729 AC_MSG_NOTICE([* * * TCL libraries could not be found.])
1730 AC_MSG_NOTICE([* * * WEB ALPINE COMPONENT WILL NOT BE BUILT.])
1732 if test -n "$WEB_PUBCOOKIE_BUILD" ; then
1733 if test "x$alpine_GSSTYPE" = "xnone" ; then
1734 WEB_PUBCOOKIE_BUILD=
1735 AC_MSG_NOTICE([* * * Kerberos5 support not found.])
1736 AC_MSG_NOTICE([* * * WEB ALPINE PUBCOOKIE COMPONENT WILL NOT BE BUILT.])
1737 elif test -z "$WEB_BINDIR" ; then
1738 WEB_PUBCOOKIE_BUILD=
1739 AC_MSG_NOTICE([* * * Web Alpine binary directory not provided.])
1740 AC_MSG_ERROR([* * * --with-pubcookie requires --with-web-bin=PATH.
1741 Please re-run configure with these options:
1742 --with-pubcookie --with-web-bin=/usr/local/libexec/alpine/bin])
1744 AC_DEFINE([PUBCOOKIE],[1],[Include support for UW Pubcookie Web Authentication])
1745 WEB_PUBCOOKIE_LIB=../pubcookie/libauthgssproxy.a
1746 WEB_PUBCOOKIE_LINK=gssapi_proxy.l
1751 AC_SUBST([REGEX_BUILD])
1753 AC_SUBST([WEB_BUILD])
1754 AC_SUBST([WEB_BINDIR])
1755 AC_SUBST([WEB_PUBCOOKIE_BUILD])
1756 AC_SUBST([WEB_PUBCOOKIE_LIB])
1757 AC_SUBST([WEB_PUBCOOKIE_LINK])
1759 AC_SUBST([AM_CFLAGS])
1760 AC_SUBST([AM_LDFLAGS])
1762 AC_CONFIG_FILES([m4/Makefile po/Makefile.in regex/Makefile \
1763 pith/osdep/Makefile pith/charconv/Makefile pith/Makefile \
1764 pico/osdep/Makefile pico/Makefile \
1765 alpine/osdep/Makefile alpine/Makefile \
1766 web/src/Makefile web/src/pubcookie/Makefile \
1767 web/src/alpined.d/Makefile \