lib/dpkg/tarfn.c: Kludge `tar_header_decode' to handle spurious `errno'.
[dpkg] / configure.ac
CommitLineData
1479465f
GJ
1# Process this file with autoconf to produce a configure script.
2
3m4_pattern_forbid([^_?DPKG_])
4
5AC_PREREQ(2.60)
6AC_INIT([dpkg], m4_esyscmd([./get-version]), [debian-dpkg@lists.debian.org])
7AC_SUBST([PACKAGE_COPYRIGHT_HOLDER], ['Dpkg Developers'])
8AC_CONFIG_SRCDIR([lib/dpkg/dpkg.h])
9AC_CONFIG_MACRO_DIR([m4])
10AC_CONFIG_AUX_DIR([build-aux])
11
12AC_USE_SYSTEM_EXTENSIONS
13
14AM_INIT_AUTOMAKE([1.11 -Wall foreign nostdinc no-dist-gzip dist-xz])
15AM_SILENT_RULES([yes])
16
17# Do not unconditionally use the following macro, as Debian jessie does not
18# have a recent enough gettext.
19m4_ifdef([
20 AM_GNU_GETTEXT_REQUIRE_VERSION
21], [
22 AM_GNU_GETTEXT_REQUIRE_VERSION([0.19])
23])
24# We cannot remove the following macro due to backwards compatibility reasons.
25# In the future when the gettext version is bumped, we have to set the above
26# macro unconditionally to the minimal version, and set the below to 0.19.6,
27# the first version introducing the AM_GNU_GETTEXT_REQUIRE_VERSION macro.
28AM_GNU_GETTEXT_VERSION([0.19])
29AM_GNU_GETTEXT([external])
30DPKG_DIST_CHECK([test "$GMSGFMT" = ":" && test "$USE_NLS" = "yes"],
31 [gettext required when NLS support enabled])
32
33# Shared libraries are disabled on purpose, currently there is no ABI stability
34# guarantee, and it will be broken at will. The infrastructure is in place just
35# to be able to test that its future activation will work.
36AM_PROG_AR
37LT_INIT([disable-shared])
38DPKG_BUILD_SHARED_LIBS
39DPKG_LINKER_AS_NEEDED
40DPKG_LINKER_VERSION_SCRIPT
41
42# Allow compilation without optional programs
43DPKG_BUILD_PROG([dselect])
44DPKG_BUILD_PROG([start-stop-daemon])
45DPKG_BUILD_PROG([update-alternatives])
46
47DPKG_BUILD_RELEASE_DATE
48DPKG_BUILD_DEVEL_DOCS
49
50# Allow alternate directories
51DPKG_WITH_DIR([devlibdir], [${libdir}],
52 [dpkg development library directory [LIBDIR]])
53DPKG_WITH_DIR([pkgconfdir], [${sysconfdir}/${PACKAGE_NAME}],
54 [dpkg configuration directory [SYSCONFDIR/dpkg]])
55DPKG_WITH_DIR([admindir], [${localstatedir}/lib/${PACKAGE_NAME}],
56 [dpkg database directory [LOCALSTATEDIR/lib/dpkg]])
57DPKG_WITH_DIR([logdir], [${localstatedir}/log],
58 [system logging directory [LOCALSTATEDIR/log]])
59
60# Set default dpkg-deb values
61DPKG_DEB_COMPRESSOR([xz])
62DPKG_DEB_PROG_TAR
63
64# Checks for programs.
65AC_PROG_CC
66DPKG_C_C99
67AC_PROG_CXX
68DPKG_CXX_CXX11
69DPKG_PROG_PATCH
70AC_CHECK_PROGS([DOXYGEN], [doxygen])
71AC_CHECK_PROG([HAVE_DOT], [dot], [YES], [NO])
72DPKG_PROG_PO4A
73DPKG_PROG_PERL
74DPKG_PROG_POD2MAN
75DPKG_CODE_COVERAGE
76
77# Checks for operating system services and capabilities.
78AC_SYS_LARGEFILE
79
80# Checks for libraries.
81DPKG_LIB_MD
82DPKG_LIB_Z
83DPKG_LIB_BZ2
84DPKG_LIB_LZMA
85DPKG_LIB_SELINUX
86AS_IF([test "x$build_dselect" = "xyes"], [
87 DPKG_LIB_CURSES
88])
89AS_IF([test "x$build_start_stop_daemon" = "xyes"], [
90 DPKG_LIB_PS
91 DPKG_LIB_KVM
92])
93
94# Checks for header files.
95AC_HEADER_STDC
96AC_CHECK_HEADERS([\
97 stddef.h \
98 error.h \
99 err.h \
100 locale.h \
101 libintl.h \
102 kvm.h \
103 sys/sysmacros.h \
104 sys/param.h \
105 sys/sysctl.h \
106 sys/syscall.h \
107 sys/user.h \
108 sys/procfs.h \
109 sys/pstat.h \
110 linux/fiemap.h \
111])
112AC_CHECK_HEADERS([sys/proc.h], [], [], [
113#ifdef HAVE_SYS_PARAM_H
114#include <sys/param.h>
115#endif
116])
117
118AS_IF([test "x$build_dselect" = "xyes"], [
119 AC_LANG_PUSH([C++])
120 AC_CHECK_HEADERS([cxxabi.h])
121 AC_LANG_POP([C++])
122])
123
124# Checks for typedefs, structures, and compiler characteristics.
125AC_C_BIGENDIAN
126AC_C_CONST
127AC_C_INLINE
128AC_C_VOLATILE
129AC_TYPE_MODE_T
130AC_TYPE_PID_T
131AC_TYPE_SIZE_T
132DPKG_TYPES_U_INT_T
133DPKG_TYPE_PTRDIFF_T
134AC_CHECK_SIZEOF([unsigned int])
135AC_CHECK_SIZEOF([unsigned long])
136DPKG_DECL_SYS_SIGLIST
137DPKG_DECL_SYS_ERRLIST
138
139# Checks for library functions.
140DPKG_FUNC_VA_COPY
141DPKG_FUNC_C99_SNPRINTF
142DPKG_CHECK_DECL([offsetof], [stddef.h])
143DPKG_CHECK_DECL([makedev], [sys/types.h])
144DPKG_CHECK_DECL([WCOREDUMP], [sys/wait.h])
145DPKG_CHECK_DECL([TIOCNOTTY], [sys/ioctl.h])
146DPKG_CHECK_DECL([O_NOFOLLOW], [fcntl.h])
147DPKG_CHECK_DECL([F_ALLOCSP64], [fcntl.h])
148DPKG_CHECK_DECL([F_PREALLOCATE], [fcntl.h])
149DPKG_CHECK_DECL([P_tmpdir], [stdio.h])
150DPKG_CHECK_PROGNAME
151DPKG_CHECK_COMPAT_FUNCS([\
152 getopt \
153 getopt_long \
154 obstack_free \
155 strnlen \
156 strndup \
157 strerror \
158 strsignal \
159 asprintf \
160 scandir \
161 alphasort \
162 unsetenv \
163])
164AC_CHECK_FUNCS([memcpy lchown],
165 [], [AC_MSG_ERROR([missing required function])])
166AC_CHECK_FUNCS([\
167 strtoimax \
168 isascii \
169 setsid \
170 getdtablesize \
171 getprogname \
172 getexecname \
173 lutimes \
174 fallocate \
175 posix_fallocate \
176 posix_fadvise \
177])
178
179AS_IF([test "x$build_dselect" = "xyes"], [
180 AC_LANG_PUSH([C++])
181 AC_CHECK_FUNCS([__cxa_pure_virtual])
182 AC_LANG_POP([C++])
183])
184
185DPKG_USE_MMAP
186DPKG_USE_DISK_PREALLOCATE
187
188# Checks for the build machinery.
189AC_DEFINE([LIBDPKG_VOLATILE_API], [1], [Acknowledge the volatility of the API.])
190DPKG_COMPILER_WARNINGS
191DPKG_COMPILER_OPTIMIZATIONS
192DPKG_LINKER_OPTIMIZATIONS
193DPKG_ARCHITECTURE
194AC_DEFINE([PACKAGE_RELEASE], [PACKAGE_VERSION " (" ARCHITECTURE ")"],
195 [Define the project release information, version and architecture])
196
197AC_CONFIG_TESTDIR([t-func])
198AM_MISSING_PROG([AUTOM4TE], [autom4te])
199
200AC_CONFIG_FILES([
201 Makefile
202 t-func/Makefile
203 t-func/atlocal
204 dpkg-deb/Makefile
205 dpkg-split/Makefile
206 dselect/Makefile
207 dselect/methods/Makefile
208 dselect/po/Makefile.in
209 lib/Makefile
210 lib/compat/Makefile
211 lib/dpkg/Makefile
212 lib/dpkg/libdpkg.pc
213 lib/dpkg/t/Makefile
214 doc/Doxyfile
215 man/Makefile
216 po/Makefile.in
217 scripts/Makefile
218 scripts/mk/Makefile
219 scripts/po/Makefile.in
220 src/Makefile
221 utils/Makefile
222])
223AC_CONFIG_HEADERS([config.h])
224AC_OUTPUT
225
226# Print the current configuration
227cat <<CONFIG
228
229Configuration:
230 Features:
231 native language support . . . : $USE_NLS
232 unicode support . . . . . . . : $USE_UNICODE
233 development documentation . . : $build_devel_docs
234 code coverage . . . . . . . . : $enable_coverage
235 build shared libraries . . . : $enable_shared
236 mmap loaders . . . . . . . . : $enable_mmap
237 disk pre-allocation . . . . . : $enable_disk_preallocate
238 default dpkg-deb compressor . : $with_dpkg_deb_compressor
239
240 Paths:
241 devlibdir . . . . . . . . . . : $devlibdir
242 pkgconfdir . . . . . . . . . : $pkgconfdir
243 admindir . . . . . . . . . . : $admindir
244 logdir . . . . . . . . . . . : $logdir
245 perl interpreter . . . . . . : $PERL
246 perl libdir . . . . . . . . . : $PERL_LIBDIR
247
248 Programs:
249 update-alternatives . . . . . : $build_update_alternatives
250 start-stop-daemon . . . . . . : $build_start_stop_daemon
251 dselect . . . . . . . . . . . : $build_dselect
252
253 System Libraries:
254 libps . . . . . . . . . . . . : ${have_libps:-no}
255 libkvm . . . . . . . . . . . : ${have_libkvm:-no}
256 libselinux . . . . . . . . . : $have_libselinux
257 libmd . . . . . . . . . . . . : $have_libmd
258 libz . . . . . . . . . . . . : $have_libz
259 liblzma . . . . . . . . . . . : $have_liblzma
260 libbz2 . . . . . . . . . . . : $have_libbz2
261 libcurses . . . . . . . . . . : ${have_libcurses:-no}
262CONFIG