2 AC_INIT(cryptsetup,1.1.0)
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_SUBST(UUID_LIBS, $LIBS)
38 AM_PATH_LIBGCRYPT(1.1.42,,[AC_MSG_ERROR('You need the gcrypt library')])
40 AC_CHECK_FUNCS([setlocale, posix_memalign])
48 AC_PROG_GCC_TRADITIONAL
50 dnl ==========================================================================
52 AM_GNU_GETTEXT([external],[need-ngettext])
53 AM_GNU_GETTEXT_VERSION([0.15])
55 dnl ==========================================================================
58 AC_CHECK_LIB(popt, poptConfigFileToString,,
59 [AC_MSG_ERROR([You need popt 1.7 or newer to compile.])])
60 AC_SUBST(POPT_LIBS, $LIBS)
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(selinux,
72 [ --disable-selinux disable selinux support [[default=auto]]],[], [])
75 AC_CHECK_LIB(devmapper, dm_task_set_name,,[AC_MSG_ERROR('You need the device-mapper library')])
76 AC_CHECK_LIB(devmapper, dm_task_set_message,,
77 [AC_MSG_ERROR([The device-mapper library on your system is too old.])])
80 if test "x$enable_selinux" != xno; then
81 AC_CHECK_LIB(sepol, sepol_bool_set)
82 AC_CHECK_LIB(selinux, is_selinux_enabled)
83 if test x$enable_static = xyes; then
84 SELINUX_STATIC_LIBS=$LIBS
85 # Check if we need -pthread with --enable-static and selinux
88 AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
89 [test "$ac_cv_search_pthread_mutex_lock" = "none required" || LIB_PTHREAD=-lpthread])
96 DEVMAPPER_LIBS="$DEVMAPPER_LIBS $LIB_PTHREAD"
97 AC_SUBST(DEVMAPPER_LIBS)
98 AC_SUBST(SELINUX_STATIC_LIBS)
100 dnl ==========================================================================
101 AC_DEFUN([CS_DEFINE],
102 [AC_DEFINE_UNQUOTED(DEFAULT_[]m4_translit([$1], [-a-z], [_A-Z]), [$2], [$3])
105 AC_DEFUN([CS_STR_WITH], [AC_ARG_WITH([$1],
106 [AS_HELP_STRING(--with-[$1], [default $2 [$3]])],
107 [CS_DEFINE([$1], ["$withval"], [$2])],
108 [CS_DEFINE([$1], ["$3"], [$2])]
111 AC_DEFUN([CS_NUM_WITH], [AC_ARG_WITH([$1],
112 [AS_HELP_STRING(--with-[$1], [default $2 [$3]])],
113 [CS_DEFINE([$1], [$withval], [$2])],
114 [CS_DEFINE([$1], [$3], [$2])]
117 CS_STR_WITH([plain-hash], [password hashing function for plain mode], [ripemd160])
118 CS_STR_WITH([plain-cipher], [cipher for plain mode], [aes])
119 CS_STR_WITH([plain-mode], [cipher mode for plain mode], [cbc-essiv:sha256])
120 CS_NUM_WITH([plain-keybits],[key length in bits for plain mode], [256])
122 CS_STR_WITH([luks1-hash], [hash function for LUKS1 header], [sha1])
123 CS_STR_WITH([luks1-cipher], [cipher for LUKS1], [aes])
124 CS_STR_WITH([luks1-mode], [cipher mode for LUKS1], [cbc-essiv:sha256])
125 CS_NUM_WITH([luks1-keybits],[key length in bits for LUKS1], [256])
127 dnl ==========================================================================
129 AM_CONDITIONAL(STATIC_CRYPTSETUP, test x$enable_static = xyes)
130 AM_CONDITIONAL(DYNAMIC_CRYPTSETUP, test x$enable_static = xno)
132 dnl ==========================================================================