2 AC_INIT(cryptsetup,1.1.0-rc3)
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')])
78 if test "x$enable_selinux" != xno; then
79 AC_CHECK_LIB(sepol, sepol_bool_set)
80 AC_CHECK_LIB(selinux, is_selinux_enabled)
81 if test x$enable_static = xyes; then
82 SELINUX_STATIC_LIBS=$LIBS
83 # Check if we need -pthread with --enable-static and selinux
86 AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
87 [test "$ac_cv_search_pthread_mutex_lock" = "none required" || LIB_PTHREAD=-lpthread])
92 if test x$enable_static = xyes; then
95 # Check if it there is still not some missing dependency like static selinux libs
96 AC_SEARCH_LIBS([dm_set_selinux_context], [devmapper],,
97 [AC_MSG_ERROR([Your system requires SElinux libraries for static compilation.])])
103 DEVMAPPER_LIBS="$DEVMAPPER_LIBS $LIB_PTHREAD"
104 AC_SUBST(DEVMAPPER_LIBS)
105 AC_SUBST(SELINUX_STATIC_LIBS)
107 dnl ==========================================================================
108 AC_DEFUN([CS_DEFINE],
109 [AC_DEFINE_UNQUOTED(DEFAULT_[]m4_translit([$1], [-a-z], [_A-Z]), [$2], [$3])
112 AC_DEFUN([CS_STR_WITH], [AC_ARG_WITH([$1],
113 [AS_HELP_STRING(--with-[$1], [default $2 [$3]])],
114 [CS_DEFINE([$1], ["$withval"], [$2])],
115 [CS_DEFINE([$1], ["$3"], [$2])]
118 AC_DEFUN([CS_NUM_WITH], [AC_ARG_WITH([$1],
119 [AS_HELP_STRING(--with-[$1], [default $2 [$3]])],
120 [CS_DEFINE([$1], [$withval], [$2])],
121 [CS_DEFINE([$1], [$3], [$2])]
124 CS_STR_WITH([plain-hash], [password hashing function for plain mode], [ripemd160])
125 CS_STR_WITH([plain-cipher], [cipher for plain mode], [aes])
126 CS_STR_WITH([plain-mode], [cipher mode for plain mode], [cbc-essiv:sha256])
127 CS_NUM_WITH([plain-keybits],[key length in bits for plain mode], [256])
129 CS_STR_WITH([luks1-hash], [hash function for LUKS1 header], [sha1])
130 CS_STR_WITH([luks1-cipher], [cipher for LUKS1], [aes])
131 CS_STR_WITH([luks1-mode], [cipher mode for LUKS1], [cbc-essiv:sha256])
132 CS_NUM_WITH([luks1-keybits],[key length in bits for LUKS1], [256])
134 dnl ==========================================================================
136 AM_CONDITIONAL(STATIC_CRYPTSETUP, test x$enable_static = xyes)
137 AM_CONDITIONAL(DYNAMIC_CRYPTSETUP, test x$enable_static = xno)
139 dnl ==========================================================================