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')])
30 AC_CHECK_HEADER(libdevmapper.h,,[AC_MSG_ERROR('You need the device-mapper library')])
33 AC_CHECK_LIB(uuid, uuid_clear, ,[AC_MSG_ERROR('You need the uuid library')])
34 AC_CHECK_LIB(devmapper, dm_task_set_name,,[AC_MSG_ERROR('You need the device-mapper library')])
39 AC_CHECK_FUNCS([setlocale, posix_memalign])
47 AC_PROG_GCC_TRADITIONAL
49 dnl ==========================================================================
51 AM_GNU_GETTEXT([external],[need-ngettext])
52 AM_GNU_GETTEXT_VERSION([0.15])
54 dnl ==========================================================================
57 AC_CHECK_LIB(popt, poptConfigFileToString,,
58 AC_MSG_ERROR([You need popt 1.7 or newer to compile.]))
63 dnl ==========================================================================
65 AC_ARG_ENABLE(shared-library,
66 [ --disable-shared-library
67 disable building of shared cryptsetup library],,
68 enable_shared_library=yes)
69 AM_CONDITIONAL(STATIC_LIBRARY, test x$enable_shared_library = xno)
71 AC_ARG_ENABLE(plugins,
72 [ --enable-plugins disable shared library plugins],,enable_plugins=no)
73 if test "x$enable_plugins" = xyes; then
74 AC_DEFINE(USE_PLUGINS, 1, [Define if you wish to use the plugin loader])
79 --with-MODULE[[=shared]] builds the module MODULE as a shared library plugin
83 [ --disable-all disable all modules built by default],,enable_all=default)
85 MODULE_HELPER(libgcrypt,
86 [ --enable-libgcrypt enable libgcrypt crypto functions [[default=auto]]],auto,[
87 AM_PATH_LIBGCRYPT(1.1.42,have_module=yes)
89 AM_CONDITIONAL(BUILD_LIBGCRYPT, test x$build_static = xyes)
90 AM_CONDITIONAL(SHARED_LIBGCRYPT, test x$build_shared = xyes)
92 AC_ARG_ENABLE(selinux,
93 [ --disable-selinux disable selinux support [[default=auto]]],[], [])
96 if test "x$enable_selinux" != xno; then
97 AC_CHECK_LIB(sepol, sepol_bool_set)
98 AC_CHECK_LIB(selinux, is_selinux_enabled)
99 # Check if we need -pthread with --enable-static and selinux
100 if test x$build_static = xyes; then
103 AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
104 [test "$ac_cv_search_pthread_mutex_lock" = "none required" || LIB_PTHREAD=-lpthread])
106 SELINUX_STATIC_LIBS="-lselinux -lsepol"
109 AC_SUBST(SELINUX_STATIC_LIBS)
110 LIBDEVMAPPER_LIBS="$LIBS $LIB_PTHREAD"
112 AC_SUBST(LIBDEVMAPPER_LIBS)
113 AC_SUBST(LIBDEVMAPPER_CFLAGS)
115 AM_CONDITIONAL(BUILD_LIBDEVMAPPER, test x$build_static = xyes)
116 AM_CONDITIONAL(SHARED_LIBDEVMAPPER, test x$build_shared = xyes)
118 dnl ==========================================================================
120 AM_CONDITIONAL(STATIC_CRYPTSETUP, test x$enable_static = xyes)
121 AM_CONDITIONAL(DYNAMIC_CRYPTSETUP, test x$enable_static = xno)
123 dnl ==========================================================================