2 AC_INIT(cryptsetup,1.0.7)
3 AC_CONFIG_SRCDIR(src/cryptsetup.c)
4 AC_CONFIG_MACRO_DIR([m4])
6 AM_CONFIG_HEADER([config.h:config.h.in])
7 AM_INIT_AUTOMAKE(dist-bzip2)
9 if test "x$prefix" = "xNONE"; then
12 AC_PREFIX_DEFAULT(/usr)
26 AC_CHECK_HEADERS(fcntl.h malloc.h inttypes.h sys/ioctl.h sys/mman.h \
27 ctype.h unistd.h locale.h)
29 AC_CHECK_HEADERS(uuid/uuid.h,,[AC_MSG_ERROR('You need the uuid library (from e2fsprogs)')])
32 AC_CHECK_LIB(uuid, uuid_clear, ,[AC_MSG_ERROR('You need the uuid library (from e2fsprogs)')])
37 AC_CHECK_FUNCS(setlocale)
46 AC_PROG_GCC_TRADITIONAL
48 dnl ==========================================================================
50 AM_GNU_GETTEXT([external],[need-ngettext])
51 AM_GNU_GETTEXT_VERSION([0.15])
53 dnl ==========================================================================
56 AC_CHECK_LIB(popt, poptConfigFileToString,,
57 AC_MSG_ERROR([You need popt 1.7 or newer to compile.]))
62 dnl ==========================================================================
64 AC_ARG_ENABLE(shared-library,
65 [ --disable-shared-library
66 disable building of shared cryptsetup library],,
67 enable_shared_library=yes)
68 AM_CONDITIONAL(STATIC_LIBRARY, test x$enable_shared_library = xno)
70 AC_ARG_ENABLE(plugins,
71 [ --enable-plugins disable shared library plugins],,enable_plugins=no)
72 if test "x$enable_plugins" = xyes; then
73 AC_DEFINE(USE_PLUGINS, 1, [Define if you wish to use the plugin loader])
78 --with-MODULE[[=shared]] builds the module MODULE as a shared library plugin
82 [ --disable-all disable all modules built by default],,enable_all=default)
84 MODULE_HELPER(libgcrypt,
85 [ --enable-libgcrypt enable libgcrypt crypto functions [[default=auto]]],auto,[
86 AM_PATH_LIBGCRYPT(1.1.42,have_module=yes)
88 AM_CONDITIONAL(BUILD_LIBGCRYPT, test x$build_static = xyes)
89 AM_CONDITIONAL(SHARED_LIBGCRYPT, test x$build_shared = xyes)
91 AC_ARG_ENABLE(selinux,
92 [ --disable-selinux disable selinux support [[default=auto]]],[], [])
94 MODULE_HELPER(libdevmapper,
95 [ --enable-libdevmapper enable dm-crypt backend through libdevmapper
96 [[default=auto]]],auto,[
99 if test "x$enable_selinux" != xno; then
100 AC_CHECK_LIB(sepol, sepol_bool_set)
101 AC_CHECK_LIB(selinux, is_selinux_enabled)
102 # Check if we need -pthread with --enable-static and selinux
103 if test x$build_static = xyes; then
106 AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
107 [test "$ac_cv_search_pthread_mutex_lock" = "none required" || LIB_PTHREAD=-lpthread])
111 AC_CHECK_LIB(devmapper, dm_task_set_name,,unset have_module)
112 AC_CHECK_HEADER(libdevmapper.h,,unset have_module)
113 LIBDEVMAPPER_LIBS="$LIBS $LIB_PTHREAD"
115 AC_SUBST(LIBDEVMAPPER_LIBS)
116 AC_SUBST(LIBDEVMAPPER_CFLAGS)
118 AM_CONDITIONAL(BUILD_LIBDEVMAPPER, test x$build_static = xyes)
119 AM_CONDITIONAL(SHARED_LIBDEVMAPPER, test x$build_shared = xyes)
121 AC_CHECK_FUNCS([posix_memalign])
122 dnl ==========================================================================
124 AM_CONDITIONAL(STATIC_CRYPTSETUP, test x$enable_static = xyes)
125 AM_CONDITIONAL(DYNAMIC_CRYPTSETUP, test x$enable_static = xno)
127 dnl ==========================================================================