Remove ltmain.sh and m4, and strip the former LUKS branch tag of the gettext package...
[platform/upstream/cryptsetup.git] / configure.in
1 AC_PREREQ(2.57)
2 AC_INIT(cryptsetup,1.0.6)
3 AC_CONFIG_SRCDIR(src/cryptsetup.c)
4
5 AM_CONFIG_HEADER([config.h:config.h.in])
6 AM_INIT_AUTOMAKE(dist-bzip2)
7
8 if test "x$prefix" = "xNONE"; then
9         sysconfdir=/etc
10 fi
11 AC_PREFIX_DEFAULT(/usr)
12
13 AC_CANONICAL_HOST
14 AC_GNU_SOURCE
15 AC_PROG_CC
16 AC_PROG_CPP
17 AC_PROG_INSTALL
18 AC_PROG_MAKE_SET
19 AC_ENABLE_STATIC(no)
20 AM_PROG_LIBTOOL
21
22 AC_HEADER_DIRENT
23 AC_HEADER_STDC
24 AC_CHECK_HEADERS(fcntl.h malloc.h inttypes.h sys/ioctl.h sys/mman.h \
25         ctype.h unistd.h locale.h)
26
27 AC_CHECK_HEADERS(uuid/uuid.h,,[AC_MSG_ERROR('You need the uuid library (from e2fsprogs)')])
28
29 saved_LIBS="$LIBS"
30 AC_CHECK_LIB(uuid, uuid_clear, ,[AC_MSG_ERROR('You need the uuid library (from e2fsprogs)')])
31 UUID_LIBS="$LIBS"
32 LIBS="$saved_LIBS"
33 AC_SUBST(UUID_LIBS)
34
35 AC_CHECK_FUNCS(setlocale)
36
37
38 AC_C_CONST
39 AC_C_BIGENDIAN
40 AC_TYPE_OFF_T
41 AC_STRUCT_ST_RDEV
42 AC_SYS_LARGEFILE
43
44 AC_PROG_GCC_TRADITIONAL
45
46 dnl ==========================================================================
47
48 GETTEXT_PACKAGE=cryptsetup
49 AC_SUBST(GETTEXT_PACKAGE)
50 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",
51         [Definition for the gettext package name])
52
53 AM_GNU_GETTEXT([external],[need-ngettext])
54 AM_GNU_GETTEXT_VERSION([0.15])
55
56 dnl ==========================================================================
57                                                                                                                    
58 saved_LIBS="$LIBS"
59 AC_CHECK_LIB(popt, poptConfigFileToString,,
60         AC_MSG_ERROR([You need popt 1.7 or newer to compile.]))
61 POPT_LIBS="$LIBS"
62 LIBS="$saved_LIBS"
63 AC_SUBST(POPT_LIBS)
64
65 dnl ==========================================================================
66
67 AC_ARG_ENABLE(shared-library,
68 [  --disable-shared-library
69                           disable building of shared cryptsetup library],,
70 enable_shared_library=yes)
71 AM_CONDITIONAL(STATIC_LIBRARY, test x$enable_shared_library = xno)
72
73 AC_ARG_ENABLE(plugins,
74 [  --enable-plugins        disable shared library plugins],,enable_plugins=no)
75 if test "x$enable_plugins" = xyes; then
76         AC_DEFINE(USE_PLUGINS, 1, [Define if you wish to use the plugin loader])
77 fi
78
79 AC_ARG_ENABLE(, [
80 Modules:
81   --with-MODULE[[=shared]]  builds the module MODULE as a shared library plugin
82 ],,)
83
84 AC_ARG_ENABLE(all,
85 [  --disable-all           disable all modules built by default],,enable_all=default)
86
87 MODULE_HELPER(libgcrypt,
88 [  --enable-libgcrypt      enable libgcrypt crypto functions [[default=auto]]],auto,[
89         AM_PATH_LIBGCRYPT(1.1.42,have_module=yes)
90 ])
91 AM_CONDITIONAL(BUILD_LIBGCRYPT, test x$build_static = xyes)
92 AM_CONDITIONAL(SHARED_LIBGCRYPT, test x$build_shared = xyes)
93
94 MODULE_HELPER(libdevmapper,
95 [  --enable-libdevmapper   enable dm-crypt backend through libdevmapper
96                           [[default=auto]]],auto,[
97         have_module=yes
98         saved_LIBS="$LIBS"
99         AC_CHECK_LIB(sepol, sepol_bool_set)
100         AC_CHECK_LIB(selinux, is_selinux_enabled)
101         AC_CHECK_LIB(devmapper, dm_task_set_name,,unset have_module)
102         AC_CHECK_HEADER(libdevmapper.h,,unset have_module)
103         LIBDEVMAPPER_LIBS="$LIBS"
104         LIBS="$saved_LIBS"
105         AC_SUBST(LIBDEVMAPPER_LIBS)
106         AC_SUBST(LIBDEVMAPPER_CFLAGS)
107 ])
108 AM_CONDITIONAL(BUILD_LIBDEVMAPPER, test x$build_static = xyes)
109 AM_CONDITIONAL(SHARED_LIBDEVMAPPER, test x$build_shared = xyes)
110
111 dnl ==========================================================================
112
113 AM_CONDITIONAL(STATIC_CRYPTSETUP, test x$enable_static = xyes)
114 AM_CONDITIONAL(DYNAMIC_CRYPTSETUP, test x$enable_static = xno)
115
116 dnl ==========================================================================
117
118 AC_OUTPUT([ m4/Makefile
119 Makefile
120 lib/Makefile
121 src/Makefile
122 po/Makefile.in
123 luks/Makefile
124 man/Makefile
125 ])