Release 1.15.8
[dpkg.git] / configure.ac
blobb741769e44215a681ea028f595c7d9ce8ccc25ad
1 # Process this file with autoconf to produce a configure script.
3 AC_PREREQ(2.60)
4 AC_INIT([dpkg], m4_esyscmd([./get-version]), [debian-dpkg@lists.debian.org])
5 AC_CONFIG_SRCDIR([lib/dpkg/dpkg.h])
6 AC_CONFIG_MACRO_DIR([m4])
7 AC_CONFIG_AUX_DIR([build-aux])
9 AC_USE_SYSTEM_EXTENSIONS
10 DPKG_ARCHITECTURE
12 AM_INIT_AUTOMAKE([1.8 gnu nostdinc])
14 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
15                             [AC_SUBST([AM_DEFAULT_VERBOSITY], [1])])
17 AM_GNU_GETTEXT_VERSION([0.18])
18 AM_GNU_GETTEXT([external])
20 # Allow compilation without dselect
21 AC_ARG_WITH(dselect,
22         AS_HELP_STRING([--without-dselect],
23                        [do not build dselect package-management frontend]),
24         [build_dselect=$with_dselect],
25         [build_dselect=yes])
26 AM_CONDITIONAL(WITH_DSELECT, [test "x$build_dselect" = "xyes"])
28 # Allow compilation without start-stop-daemon
29 AC_ARG_WITH(start-stop-daemon,
30         AS_HELP_STRING([--without-start-stop-daemon],
31                        [do not build or use start-stop-daemon]),
32         [build_start_stop_daemon=$with_start_stop_daemon],
33         [build_start_stop_daemon=yes])
34 AM_CONDITIONAL(WITH_START_STOP_DAEMON,
35         [test "x$build_start_stop_daemon" = "xyes"])
36 if test "x$build_start_stop_daemon" = "xyes"; then
37    AC_DEFINE(WITH_START_STOP_DAEMON, 1,
38         [Define to 1 if start-stop-daemon is compiled.])
39 else
40    AC_DEFINE(WITH_START_STOP_DAEMON, 0)
43 # Allow compilation without update-alternatives
44 AC_ARG_WITH(update-alternatives,
45         AS_HELP_STRING([--without-update-alternatives],
46                        [do not build or use update-alternatives]),
47         [build_update_alternatives=$with_update_alternatives],
48         [build_update_alternatives=yes])
49 AM_CONDITIONAL(WITH_UPDATE_ALTERNATIVES,
50         [test "x$build_update_alternatives" = "xyes"])
52 # Allow compilation without install-info
53 AC_ARG_WITH(install-info,
54         AS_HELP_STRING([--without-install-info],
55                        [do not build or use install-info]),
56         [build_install_info=$with_install_info],
57         [build_install_info=yes])
58 AM_CONDITIONAL(WITH_INSTALL_INFO,
59         [test "x$build_install_info" = "xyes"])
61 # Allow alternate admin directory
62 admindir="${localstatedir}/lib/${PACKAGE_NAME}"
63 AC_ARG_WITH(admindir,
64         AS_HELP_STRING([--with-admindir=DIR],
65                        [dpkg database directory [[LOCALSTATEDIR/lib/dpkg]]]),
66 [case "$with_admindir" in
67       "") AC_MSG_ERROR([invalid admindir specified]) ;;
68       *) admindir="$with_admindir" ;;
69 esac])
70 AC_SUBST(admindir)
72 # Allow alternate log directory
73 logdir="${localstatedir}/log"
74 AC_ARG_WITH(logdir,
75         AS_HELP_STRING([--with-logdir=DIR],
76                        [system logging directory [[LOCALSTATEDIR/log]]]),
77 [case "$with_logdir" in
78       "") AC_MSG_ERROR([invalid logdir specified]) ;;
79       *) logdir="$with_logdir" ;;
80 esac])
81 AC_SUBST(logdir)
84 # Checks for programs.
85 AC_PROG_CC
86 AC_PROG_CXX
87 AC_PROG_LEX
88 AC_PROG_RANLIB
89 AC_CHECK_PROGS([DOXYGEN], [doxygen])
90 AC_CHECK_PROG([HAVE_DOT], [dot], [YES], [NO])
91 DPKG_PROG_PO4A
92 DPKG_PROG_PERL
93 DPKG_PROG_POD2MAN
94 DPKG_CODE_COVERAGE
96 # Checks for operating system services and capabilities.
97 AC_SYS_LARGEFILE
99 # Checks for libraries.
100 DPKG_LIB_ZLIB
101 DPKG_LIB_BZ2
102 DPKG_LIB_SELINUX
103 if test "x$build_dselect" = "xyes"; then
104    DPKG_LIB_CURSES
106 if test "x$build_start_stop_daemon" = "xyes"; then
107    DPKG_LIB_SSD
110 # Checks for header files.
111 AC_HEADER_STDC
112 AC_CHECK_HEADERS([stddef.h error.h locale.h libintl.h kvm.h \
113                   sys/cdefs.h sys/syscall.h linux/fiemap.h])
115 # Checks for typedefs, structures, and compiler characteristics.
116 AC_C_BIGENDIAN
117 AC_C_CONST
118 AC_C_INLINE
119 AC_C_VOLATILE
120 DPKG_C_C99
121 AC_TYPE_MODE_T
122 AC_TYPE_PID_T
123 AC_TYPE_SIZE_T
124 DPKG_TYPE_PTRDIFF_T
125 AC_CHECK_SIZEOF([unsigned int])
126 AC_CHECK_SIZEOF([unsigned long])
127 DPKG_DECL_SYS_SIGLIST
129 # Checks for library functions.
130 DPKG_FUNC_VA_COPY
131 DPKG_FUNC_C99_SNPRINTF
132 DPKG_FUNC_ASYNC_SYNC
133 DPKG_CHECK_DECL([offsetof], [stddef.h])
134 DPKG_CHECK_DECL([WCOREDUMP], [sys/wait.h])
135 DPKG_CHECK_DECL([TIOCNOTTY], [sys/ioctl.h])
136 DPKG_CHECK_COMPAT_FUNCS([getopt getopt_long obstack_free \
137                          strnlen strerror strsignal asprintf \
138                          scandir alphasort unsetenv])
139 AC_CHECK_FUNCS([strtoul isascii bcopy memcpy setsid getdtablesize \
140                 posix_fadvise])
142 DPKG_MMAP
144 AC_DEFINE(LIBDPKG_VOLATILE_API, 1, [Acknowledge the volatility of the API.])
145 DPKG_COMPILER_WARNINGS
146 DPKG_COMPILER_OPTIMISATIONS
147 DPKG_LINKER_OPTIMISATIONS
149 AC_CONFIG_FILES([ Makefile
150                   dpkg-deb/Makefile
151                   dpkg-split/Makefile
152                   dselect/Makefile
153                   dselect/methods/Makefile
154                   dselect/po/Makefile.in
155                   lib/Makefile
156                   lib/compat/Makefile
157                   lib/dpkg/Makefile
158                   lib/dpkg/libdpkg.pc
159                   lib/dpkg/test/Makefile
160                   doc/Doxyfile
161                   man/Makefile
162                   po/Makefile.in
163                   scripts/Makefile
164                   scripts/po/Makefile.in
165                   src/Makefile
166                   utils/Makefile ])
167 AC_CONFIG_HEADERS([config.h])
168 AC_OUTPUT