1 # Copyright (C) 2006-2007 International Business Machines Corp.
3 # This file is free software; as a special exception the author gives
4 # unlimited permission to copy and/or distribute it, with or without
5 # modifications, as long as this notice is preserved.
7 # This program is distributed in the hope that it will be useful, but
8 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
9 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 AC_INIT([ecryptfs-utils],[105])
16 AM_INIT_AUTOMAKE([${PACKAGE_NAME}], [${PACKAGE_VERSION}])
17 AC_CONFIG_SRCDIR([src/libecryptfs])
18 AC_CONFIG_HEADERS([config.h])
19 AC_SUBST(AM_CPPFLAGS, '-include $(top_builddir)/config.h')
20 AC_CONFIG_MACRO_DIR([m4])
24 # libecryptfs versioning instructions
26 # Update the version information only once per public release of
27 # ecryptfs-utils. More frequent updates are unnecessary, and only guarantee
28 # that the current interface number gets larger faster.
30 # 1. If the library source code has changed at all since the last update, then
31 # increment LIBECRYPTFS_LT_REVISION.
32 # 2. If any interfaces have been added, removed, or changed since the last
33 # update, increment LIBECRYPTFS_LT_CURRENT, and set LIBECRYPTFS_LT_REVISION to 0.
34 # 3. If any interfaces have been added since the last public release, then
35 # increment LIBECRYPTFS_LT_AGE.
36 # 4. If any interfaces have been removed or changed since the last public
37 # release, then set LIBECRYPTFS_LT_AGE to 0.
40 # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
41 LIBECRYPTFS_LT_CURRENT="1"
42 LIBECRYPTFS_LT_REVISION="0"
43 LIBECRYPTFS_LT_AGE="0"
44 AC_SUBST([LIBECRYPTFS_LT_CURRENT])
45 AC_SUBST([LIBECRYPTFS_LT_REVISION])
46 AC_SUBST([LIBECRYPTFS_LT_AGE])
50 [AS_HELP_STRING([--disable-nss],[Build against gcrypt rather than NSS])],
57 [AS_HELP_STRING([--disable-pywrap],[Disable build of libecryptfs Python wrappers])],
59 [enable_pywrap="detect"]
64 [AS_HELP_STRING([--disable-openssl],[Disable build of OpenSSL key module])],
66 [enable_openssl="detect"]
71 [AS_HELP_STRING([--enable-pkcs11-helper],[Build pkcs11-helper key module])],
73 enable_pkcs11_helper="no"
78 [AS_HELP_STRING([--enable-tspi],[Build TrouSerS key module])],
85 [AS_HELP_STRING([--enable-gpg],[Build GnuPG key module])],
92 [AS_HELP_STRING([--disable-pam],[Disable build of PAM module])],
99 [AS_HELP_STRING([--enable-gui],[Enable building of GUI components])],
106 [AS_HELP_STRING([--enable-docs],[Enable installing document])],
113 [AS_HELP_STRING([--enable-docs-gen],[Enable generating documents])],
115 [enable_docs_gen="no"]
117 test "${enable_docs_gen}" = "yes" && enable_docs="yes"
121 [AS_HELP_STRING([--enable-tests],[Enable system specific tests])],
128 [AS_HELP_STRING([--enable-mudflap],[Build with -fmudflap gcc option])],
130 if "${enableval}" = "yes"; then
131 CFLAGS="$CFLAGS -fmudflap"
132 LDFLAGS="$LDFLAGS -lmudflap"
139 [AS_HELP_STRING([--with-gpgme-prefix=PATH],[Specify the directory where gpgme install, default /usr])],
141 [with_gpgme_prefix="/usr"]
146 [AS_HELP_STRING([--with-pamdir=PATH],[Specify the directory where PAM modules are stored])],
147 [pamdir="${withval}"],
149 if test "${prefix}" = "/usr"; then
150 pamdir="/lib${libdir##*/lib}/security"
152 pamdir="\$(libdir)/security"
159 [AS_HELP_STRING([--with-ecryptfskeymoddir=PATH],[Specify the directory where key modules are stored])],
161 ecryptfskeymoddir="${withval}"
162 full_ecryptfskeymoddir="${ecryptfskeymoddir}"
165 full_ecryptfskeymoddir=`eval eval eval eval eval echo "${libdir}/ecryptfs" | sed "s#NONE#${prefix}#" | sed "s#NONE#${ac_default_prefix}#"`
166 ecryptfskeymoddir="\$(libdir)/ecryptfs"
169 AC_DEFINE_UNQUOTED([ECRYPTFS_DEFAULT_KEY_MOD_DIR], ["$full_ecryptfskeymoddir"], "Location of key modules")
187 AC_PATH_PROGS([POD2MAN], [pod2man])
188 test -z "${POD2MAN}" && AC_MSG_ERROR([I couldn't find pod2man; make sure it's installed and in your path])
190 AC_PATH_PROGS([TAR], [tar])
191 AC_PATH_PROGS([PS2PDF], [ps2pdf])
192 AC_PATH_PROGS([DVIPS], [dvips])
193 AC_PATH_PROGS([LATEX2HTML], [latex2html])
194 AC_PATH_PROGS([LATEX], [latex])
195 if test "${enable_docs_gen}" = "yes"; then
196 test -z "${TAR}" && AC_MSG_ERROR([Couldn't find tar])
197 test -z "${PS2PDF}" && AC_MSG_ERROR([Couldn't find ps2pdf])
198 test -z "${DVIPS}" && AC_MSG_ERROR([Couldn't find dvips])
199 test -z "${LATEX2HTML}" && AC_MSG_ERROR([Couldn't find latex2html])
200 test -z "${LATEX}" && AC_MSG_ERROR([Couldn't find latex])
205 AC_CHECK_LIB([dl], [dlopen])
207 # Verify keyutils version 1.0 or higher
208 if test -z "${KEYUTILS_LIBS}"; then
209 AC_ARG_VAR([KEYUTILS_CFLAGS], [C compiler flags for keyutils])
210 AC_ARG_VAR([KEYUTILS_LIBS], [linker flags for keyutils])
214 [KEYUTILS_LIBS="-lkeyutils"],
215 [AC_MSG_ERROR([eCryptfs userspace tools require Keyutils version 1.0 or higher.
216 You might find the package at:
217 http://people.redhat.com/~dhowells/keyutils/
223 if test -z "${OPENSSL_LIBS}"; then
226 [libcrypto >= 0.9.7],
227 [have_openssl="yes"],
231 [have_openssl="yes"],
237 OPENSSL_LIBS="-lcrypto"
252 NSS_CFLAGS="${NSS_CFLAGS} -DENABLE_NSS"],
255 if test "${enable_nss}" = "detect" ; then
256 if test "$have_nss" == "yes" ; then
263 OLD_CFLAGS="${CFLAGS}"
264 CFLAGS="${CFLAGS} ${OPENSSL_CFLAGS}"
265 AC_CHECK_HEADER([openssl/rsa.h],, [have_openssl="no"])
266 CFLAGS="${OLD_CFLAGS}"
268 if test "${enable_pywrap}" != "no" ; then
269 AM_PATH_PYTHON(2.5, [have_python="yes"], [have_python="no"])
274 if test "x${SWIG}" != "x" ; then
280 if test "${enable_pywrap}" = "detect" ; then
281 if test "${have_python}" = "yes" ; then
282 if test "${have_swig}" = "yes" ; then
288 if test "${enable_pywrap}" = "yes" ; then
289 test "${have_python}" != "yes" && AC_MSG_ERROR([Python not found])
290 test "${have_swig}" != "yes" && AC_MSG_ERROR([SWIG not found])
293 test "${enable_openssl}" = "detect" && enable_openssl="${have_openssl}"
295 if test "${enable_openssl}" = "yes" ; then
296 test "${have_openssl}" != "yes" && AC_MSG_ERROR([OpenSSL not found])
299 if test "${enable_pkcs11_helper}" = "yes" ; then
300 test "${have_openssl}" != "yes" && AC_MSG_ERROR([OpenSSL not found])
301 PKG_CHECK_MODULES([PKCS11_HELPER], [libpkcs11-helper-1 >= 1.04],, [AC_MSG_ERROR([Cannot locate pkcs11-helper])])
304 if test "${enable_tspi}" = "yes" ; then
305 if test -z "${TSPI_LIBS}"; then
306 AC_ARG_VAR([TSPI_CFLAGS], [C compiler flags for tspi])
307 AC_ARG_VAR([TSPI_LIBS], [linker flags for tspi])
310 [Tspi_Context_Create],
311 [TSPI_LIBS="-ltspi"],
312 [AC_MSG_ERROR([Cannot find tspi])]
317 if test "${enable_gpg}" = "yes" ; then
318 AC_MSG_CHECKING([for gpgme])
319 if ! test -x "${with_gpgme_prefix}/bin/gpgme-config"; then
320 AC_MSG_ERROR([Cannot locate gpgme])
322 AC_MSG_RESULT([found])
323 GPGME_CFLAGS="`\"${with_gpgme_prefix}/bin/gpgme-config\" --cflags`"
324 GPGME_LIBS="`\"${with_gpgme_prefix}/bin/gpgme-config\" --libs`"
328 if test "${enable_pam}" = "yes" ; then
329 if test -z "${PAM_LIBS}"; then
330 AC_ARG_VAR([PAM_CFLAGS], [C compiler flags for pam])
331 AC_ARG_VAR([PAM_LIBS], [linker flags for pam])
336 [AC_MSG_ERROR([Cannot find pam])]
341 [PAM_LIBS="${PAM_LIBS} ${TSPI_LIBS} -lpam_misc"],
342 [AC_MSG_ERROR([Cannot find pam_misc])]
347 if test "${enable_gui}" = "yes"; then
355 AC_MSG_ERROR([Cannot locate gtk+])
360 pkgconfigdir="\$(libdir)/pkgconfig"
361 if test "${prefix}" = "/usr"; then
364 rootsbindir="\$(sbindir)"
367 GETTEXT_PACKAGE=ecryptfs-utils
368 AC_SUBST(GETTEXT_PACKAGE)
369 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
370 [the gettext translation domain])
374 IT_PROG_INTLTOOL([0.41.0])
376 LOCALEDIR='${prefix}/${datadir}/locale'
380 CRYPTO_CFLAGS=${NSS_CFLAGS}
381 CRYPTO_LIBS=${NSS_LIBS}
384 AC_SUBST([pamlibdir])
385 AC_SUBST([pkgconfigdir])
386 AC_SUBST([rootsbindir])
387 AC_SUBST([ecryptfskeymoddir])
388 AC_SUBST([GPGME_CFLAGS])
389 AC_SUBST([GPGME_LIBS])
390 AC_SUBST([CRYPTO_CFLAGS])
391 AC_SUBST([CRYPTO_LIBS])
392 AM_CONDITIONAL([BUILD_OPENSSL], [test "${enable_openssl}" = "yes"])
393 AM_CONDITIONAL([BUILD_PKCS11_HELPER], [test "${enable_pkcs11_helper}" = "yes"])
394 AM_CONDITIONAL([BUILD_TSPI], [test "${enable_tspi}" = "yes"])
395 AM_CONDITIONAL([BUILD_GPG], [test "${enable_gpg}" = "yes"])
396 AM_CONDITIONAL([BUILD_PAM], [test "${enable_pam}" = "yes"])
397 AM_CONDITIONAL([BUILD_PYWRAP], [test "${enable_pywrap}" = "yes"])
398 AM_CONDITIONAL([BUILD_NSS], [test "${enable_nss}" = "yes"])
399 AM_CONDITIONAL([BUILD_GUI], [test "${enable_gui}" = "yes"])
400 AM_CONDITIONAL([BUILD_DOCS], [test "${enable_docs}" = "yes"])
401 AM_CONDITIONAL([BUILD_DOCS_GEN], [test "${enable_docs_gen}" = "yes"])
402 AM_CONDITIONAL([ENABLE_TESTS], [test "${enable_tests}" = "yes"])
404 # workaround for <autoconf-2.60
405 if test -z "${docdir}"; then
406 docdir="\$(datarootdir)/doc/\$(PACKAGE_NAME)"
409 if test -z "${htmldir}"; then
414 # workaround for <automake-1.10
415 if test -z "${MKDIR_P}"; then
416 MKDIR_P="\$(mkdir_p)"
425 src/libecryptfs/Makefile
430 src/desktop/ecryptfs-mount-private.desktop
431 src/desktop/ecryptfs-setup-private.desktop
434 src/pam_ecryptfs/Makefile
435 src/libecryptfs/libecryptfs.pc
436 src/libecryptfs-swig/Makefile
439 tests/kernel/Makefile
440 tests/userspace/Makefile
445 if test "${prefix}" != "/usr"; then
447 echo "Warning: install prefix is $prefix"
449 echo "Most mount applications expect the mount helper to install to"
450 echo "/sbin. You can install the mount helper to that location by "
451 echo "running the configure script again with --prefix=/usr:"
453 echo "./configure --prefix=/usr"