2 AC_INIT(cryptsetup,1.1.0)
4 dnl library version from <major>.<minor>.<release>[-<suffix>]
5 LIBCRYPTSETUP_VERSION=$(echo $PACKAGE_VERSION | cut -f1 -d-)
6 LIBCRYPTSETUP_VERSION_INFO=1:0:0
8 AC_CONFIG_SRCDIR(src/cryptsetup.c)
9 AC_CONFIG_MACRO_DIR([m4])
11 AM_CONFIG_HEADER([config.h:config.h.in])
12 AM_INIT_AUTOMAKE(dist-bzip2)
14 if test "x$prefix" = "xNONE"; then
17 AC_PREFIX_DEFAULT(/usr)
31 AC_CHECK_HEADERS(fcntl.h malloc.h inttypes.h sys/ioctl.h sys/mman.h \
32 ctype.h unistd.h locale.h)
34 AC_CHECK_HEADERS(uuid/uuid.h,,[AC_MSG_ERROR('You need the uuid library')])
35 AC_CHECK_HEADER(libdevmapper.h,,[AC_MSG_ERROR('You need the device-mapper library')])
38 AC_CHECK_LIB(uuid, uuid_clear, ,[AC_MSG_ERROR('You need the uuid library')])
39 AC_SUBST(UUID_LIBS, $LIBS)
43 AM_PATH_LIBGCRYPT(1.1.42,,[AC_MSG_ERROR('You need the gcrypt library')])
45 AC_CHECK_FUNCS([setlocale, posix_memalign])
53 AC_PROG_GCC_TRADITIONAL
55 dnl ==========================================================================
57 AM_GNU_GETTEXT([external],[need-ngettext])
58 AM_GNU_GETTEXT_VERSION([0.15])
60 dnl ==========================================================================
63 AC_CHECK_LIB(popt, poptConfigFileToString,,
64 [AC_MSG_ERROR([You need popt 1.7 or newer to compile.])])
65 AC_SUBST(POPT_LIBS, $LIBS)
68 dnl ==========================================================================
70 AC_ARG_ENABLE(shared-library,
71 [ --disable-shared-library
72 disable building of shared cryptsetup library],,
73 enable_shared_library=yes)
74 AM_CONDITIONAL(STATIC_LIBRARY, test x$enable_shared_library = xno)
76 AC_ARG_ENABLE(selinux,
77 [ --disable-selinux disable selinux support [[default=auto]]],[], [])
80 AC_CHECK_LIB(devmapper, dm_task_set_name,,[AC_MSG_ERROR('You need the device-mapper library')])
81 AC_CHECK_LIB(devmapper, dm_task_set_message,,
82 [AC_MSG_ERROR([The device-mapper library on your system is too old.])])
85 if test "x$enable_selinux" != xno; then
86 AC_CHECK_LIB(sepol, sepol_bool_set)
87 AC_CHECK_LIB(selinux, is_selinux_enabled)
88 if test x$enable_static = xyes; then
89 SELINUX_STATIC_LIBS=$LIBS
90 # Check if we need -pthread with --enable-static and selinux
93 AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
94 [test "$ac_cv_search_pthread_mutex_lock" = "none required" || LIB_PTHREAD=-lpthread])
101 DEVMAPPER_LIBS="$DEVMAPPER_LIBS $LIB_PTHREAD"
102 AC_SUBST([DEVMAPPER_LIBS])
103 AC_SUBST([SELINUX_STATIC_LIBS])
104 AC_SUBST([LIBCRYPTSETUP_VERSION])
105 AC_SUBST([LIBCRYPTSETUP_VERSION_INFO])
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 ==========================================================================