File: configure.ac

package info (click to toggle)
mpop 1.0.27-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,824 kB
  • sloc: ansic: 11,729; sh: 4,590; python: 121; makefile: 72; sed: 16
file content (215 lines) | stat: -rw-r--r-- 7,470 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
dnl configure.ac
dnl Process this file with autoconf to produce a configure script.
#
# This file is part of mpop, a POP3 client.
#
# Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
# Christophe Nowicki
# Martin Lambers <marlam@marlam.de>
# Jay Soffian <jaysoffian@gmail.com> (Mac OS X keychain support)
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation; either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

dnl Autotools init stuff
AC_INIT([mpop], [1.0.27], [marlam@marlam.de], [mpop], [http://mpop.sourceforge.net/])
AC_CONFIG_SRCDIR([src/mpop.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config.h])
AC_CANONICAL_TARGET
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AM_INIT_AUTOMAKE([1.11.1 silent-rules no-texinfo.tex -Wall])
AM_SILENT_RULES([yes])
AC_PROG_CC
AC_PROG_INSTALL
AC_LANG([C])

dnl System
AC_DEFINE_UNQUOTED([PLATFORM], ["${target}"], [Platform triplet])
case "${target}" in *-*-mingw*) LIBS="$LIBS -lws2_32" ;; esac

dnl Gettext
AM_GNU_GETTEXT([external])

dnl Headers and functions
AC_CHECK_HEADERS([sysexits.h netdb.h arpa/inet.h sys/socket.h sys/wait.h])
AC_CHECK_FUNCS([fseeko fseeko64 getpass getservbyname link mkstemp sigaction strndup syslog vasprintf])
AC_SEARCH_LIBS([nanosleep], [rt posix4])
AC_SEARCH_LIBS([socket], [socket])

dnl pkg-config (required to detect libraries)
PKG_PROG_PKG_CONFIG([])
if test -z "$PKG_CONFIG"; then
    AC_MSG_ERROR([pkg-config not found])
fi

dnl TLS/SSL
have_tls="no"
tls_lib="none"
want_tls="yes"
want_gnutls="yes"
want_openssl="yes"
tls_CFLAGS=""
tls_LIBS=""
AC_ARG_WITH([ssl], [AS_HELP_STRING([--with-ssl=[gnutls|openssl|no]],
    [TLS/SSL support: GnuTLS (default), OpenSSL, or none.])],
    if test "$withval" = "gnutls"; then
	want_tls=yes
	want_gnutls=yes
	want_openssl=no
    elif test "$withval" = "openssl"; then
	want_tls=yes
	want_gnutls=no
	want_openssl=yes
    elif test "$withval" = "no"; then
	want_tls=no
	want_gnutls=no
	want_openssl=no
    else
	AC_MSG_ERROR([Use --with-ssl=gnutls or --with-ssl=openssl or --with-ssl=no])
    fi)
if test "$want_gnutls" = "yes"; then
    PKG_CHECK_MODULES([libgnutls], [gnutls >= 0.0], [HAVE_LIBGNUTLS=1], [HAVE_LIBGNUTLS=0])
    if test "$HAVE_LIBGNUTLS" != "1"; then
	AC_MSG_WARN([library libgnutls not found:])
	AC_MSG_WARN([$libgnutls_PKG_ERRORS])
	AC_MSG_WARN([libgnutls is provided by GnuTLS; Debian package: libgnutls-dev])
    else
	have_tls="yes"
	tls_lib="GnuTLS"
	tls_CFLAGS="$libgnutls_CFLAGS"
	tls_LIBS="$libgnutls_LIBS"
	AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define to 1 if libgnutls is available])
    fi
fi
if test "$want_openssl" = "yes" -a "$have_tls" = "no"; then
    PKG_CHECK_MODULES([libssl], [openssl >= 0.0], [HAVE_LIBSSL=1], [HAVE_LIBSSL=0])
    if test "$HAVE_LIBSSL" != "1"; then
	AC_MSG_WARN([library libssl not found:])
	AC_MSG_WARN([$libssl_PKG_ERRORS])
	AC_MSG_WARN([libssl is provided by OpenSSL; Debian package: libssl-dev])
    else
	have_tls="yes"
	tls_lib="OpenSSL"
	tls_CFLAGS="$libssl_CFLAGS"
	tls_LIBS="$libssl_LIBS"
	AC_DEFINE([HAVE_LIBSSL], [1], [Define to 1 if libssl is available])
    fi
fi
if test "$have_tls" = "yes"; then
    AC_DEFINE([HAVE_TLS], [1], [Define to 1 to build with TLS/SSL support])
elif test "$want_tls" = "yes"; then
    AC_MSG_WARN([Neither GnuTLS nor OpenSSL found, disabling TLS/SSL support])
fi
AM_CONDITIONAL([HAVE_TLS], [test "$have_tls" = "yes"])
AC_SUBST([tls_CFLAGS])
AC_SUBST([tls_LIBS])

dnl GNU SASL
AC_ARG_WITH([libgsasl], [AS_HELP_STRING([--with-libgsasl],
	[Use GNU SASL authentication library.])],
    [libgsasl=$withval], [libgsasl=yes])
if test "$libgsasl" != "no"; then
    PKG_CHECK_MODULES([libgsasl], [libgsasl >= 0.0], [HAVE_LIBGSASL=1], [HAVE_LIBGSASL=0])
    if test "$HAVE_LIBGSASL" != "1"; then
	AC_MSG_WARN([library libgsasl not found:])
	AC_MSG_WARN([$libgsasl_PKG_ERRORS])
	AC_MSG_WARN([libgsasl is provided by GNU SASL; Debian package: libgsasl7-dev])
	libgsasl="no"
    else
	libgsasl="yes"
	AC_DEFINE([HAVE_LIBGSASL], [1], [Define to 1 if libgsasl is available])
    fi
fi
AM_CONDITIONAL([HAVE_LIBGSASL], [test "$libgsasl" = "yes"])

dnl GNU Libidn
AC_ARG_WITH([libidn], [AS_HELP_STRING([--with-libidn],
	[Support IDN (needs GNU Libidn)])],
    [libidn=$withval], [libidn=yes])
if test "$libidn" != "no"; then
    PKG_CHECK_MODULES([libidn], [libidn >= 0.0], [HAVE_LIBIDN=1], [HAVE_LIBIDN=0])
    if test "$HAVE_LIBIDN" != "1"; then
	AC_MSG_WARN([library libidn not found:])
	AC_MSG_WARN([$libidn_PKG_ERRORS])
	AC_MSG_WARN([libidn is provided by GNU Libidn; Debian package: libidn11-dev])
	libidn="no"
    else
	libidn="yes"
	AC_DEFINE([HAVE_LIBIDN], [1], [Define to 1 if libidn is available])
    fi
fi

dnl gnome-keyring support (requires pkg-config).
AC_ARG_WITH([gnome-keyring], [AS_HELP_STRING([--with-gnome-keyring],
	[Support GNOME Keyring])],
    [gnome_keyring=$withval],[gnome_keyring=yes])
if test "$gnome_keyring" != "no"; then
    PKG_CHECK_MODULES([libgnome_keyring], [gnome-keyring-1], [HAVE_GNOME_KEYRING=1], [HAVE_GNOME_KEYRING=0])
    if test "$HAVE_GNOME_KEYRING" != "1"; then
	AC_MSG_WARN([library libgnome-keyring not found:])
	AC_MSG_WARN([$libgnome_keyring_PKG_ERRORS])
	AC_MSG_WARN([libgnome-keyring is provided by Gnome; Debian package: libgnome-keyring-dev])
	gnome_keyring="no"
    else
	gnome_keyring="yes"
	AC_DEFINE([HAVE_GNOME_KEYRING], [1], [Define to 1 if libgnome-keyring is available])
    fi
fi

dnl MacOS X Keychain Services (Security Framework)
AC_ARG_WITH([macosx-keyring], [AS_HELP_STRING([--with-macosx-keyring],
	[Support Mac OS X Keyring])],
    [macosx_keyring=$withval],[macosx_keyring=yes])
if test "$macosx_keyring" != "no"; then
    AC_CACHE_CHECK([for SecKeychainGetVersion],
	ac_cv_func_SecKeychainGetVersion,
	[ac_save_LIBS="$LIBS"
	 LIBS="$LIBS -Wl,-framework -Wl,Security"
	 AC_TRY_LINK([#include <Security/Security.h>],
	    [SecKeychainGetVersion(NULL);],
	    [ac_cv_func_SecKeychainGetVersion=yes],
	    [ac_cv_func_SecKeychainGetVersion=no])
	 LIBS="$ac_save_LIBS"])
    if test $ac_cv_func_SecKeychainGetVersion = yes; then
	macosx_keyring=yes
	AC_DEFINE([HAVE_MACOSXKEYRING], [1],
	    [Define to 1 if you have the MacOS X Keychain Services API.])
	LIBS="$LIBS -Wl,-framework -Wl,Security"
    else
	macosx_keyring=no
    fi
fi

dnl Global #defines for all source files
AH_VERBATIM([W32_NATIVE],
[/* Define to 1 if the native W32 API should be used. */
#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
#define W32_NATIVE 1
#endif])

dnl End.
AC_CONFIG_FILES([Makefile src/Makefile po/Makefile.in doc/Makefile scripts/Makefile])
AC_OUTPUT

echo
echo "Install prefix ......... : $prefix"
echo "TLS/SSL support ........ : $have_tls (Library: $tls_lib)"
echo "GNU SASL support ....... : $libgsasl"
echo "GNU Libidn support ..... : $libidn"
echo "NLS support ............ : $USE_NLS"
echo "GNOME Keyring support .. : $gnome_keyring"
echo "MacOS X Keychain support : $macosx_keyring"