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