1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(aptitude, 0.4.11.11)
3 AC_CONFIG_SRCDIR([src/main.cc])
5 AM_CONFIG_HEADER(config.h)
10 dnl Checks for programs.
13 dnl Checks for programs.
14 AC_PATH_PROG(PO4A, po4a)
15 if test "x$PO4A" = "x" ; then
16 AM_CONDITIONAL(USE_PO4A, false)
18 AM_CONDITIONAL(USE_PO4A, true)
21 dnl C++ has const and inline!!!
25 dnl Checks for libraries.
26 AC_CHECK_LIB(ncursesw, initscr, ,
27 [AC_MSG_ERROR([Can't find libncursesw -- please install libncursesw5-dev])])
28 AC_CHECK_LIB(apt-pkg, main, , [AC_MSG_ERROR([Can't find the APT libraries -- please install libapt-pkg-dev])])
30 AC_MSG_CHECKING([whether apt includes the automatic dependency removal patch (required)])
32 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <apt-pkg/depcache.h>]],
33 [[extern pkgDepCache::ActionGroup d;]]),
35 AC_MSG_FAILURE([need libapt-pkg 0.7 or later]))
37 AC_CHECK_LIB(pthread, main,
39 , [AC_MSG_ERROR([Can't find the POSIX thread libraries])])
41 ALL_LINGUAS="ar bs ca cs da de dz el es eu fi fr gl hu it ja km ku lt mr nb ne nl nn pl pt pt_BR ro ru sk sv th tl tr uk vi zh_CN zh_TW"
42 AM_GNU_GETTEXT([external])
46 AS_HELP_STRING(--with-ept, [compile against the ept library (enables debtags and xapian-index support)]),
47 [if test x$withval = xyes
52 PKG_CHECK_MODULES(ept, libept, [], [HAVE_EPT=])
54 if test x$HAVE_EPT = x1
56 AC_DEFINE(HAVE_EPT, 1, [Define if the ept package information library is available.])
58 # Force the program not to link against ept.
63 PKG_CHECK_MODULES(SIGC, sigc++-2.0)
65 PKG_CHECK_MODULES(CWIDGET, cwidget)
67 CXXFLAGS="$CXXFLAGS $SIGC_CFLAGS $CWIDGET_CFLAGS $ept_CFLAGS"
68 LIBS="$LIBS $SIGC_LIBS $CWIDGET_LIBS $ept_LIBS"
69 AC_DEFINE_UNQUOTED(SIGC_VERSION, ["$(pkg-config --modversion sigc++-2.0)"], [The version of libsigc++ with which the program was compiled])
71 dnl Checks for header files.
74 AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h, , [AC_MSG_ERROR([Can't find needed header file.])])
76 AC_CHECK_HEADER(apt-pkg/init.h, , [AC_MSG_ERROR([Can't find the APT header files -- please install libapt-pkg-dev])])
78 AC_CHECK_HEADER(execinfo.h, [AC_DEFINE([HAVE_EXECINFO_H], [], [Define if the execinfo file (for self-backtracing) is available])])
80 AC_CHECK_HEADER(locale.h, [AC_DEFINE([HAVE_LOCALE_H], [], [Define if locale.h is available])])
82 AC_CHECK_DECL(setlocale, [AC_DEFINE([HAVE_SETLOCALE], [], [Define if setlocale is available in locale.h])], , [#include <locale.h>])
84 dnl All the hash-related stuff is commented out because g++ 4.3 will
85 dnl blow us up if we ever include hash_map -- yet it's present and I
86 dnl can't make the autoconf test fail. The replacement is
87 dnl unordered_map, which is not just a nonstandard header: it also
88 dnl requires language extensions in order to work. So, since aptitude
89 dnl has no real need for hashes anyway, I'm just removing all the
90 dnl hashes that it uses.
95 dnl AC_CHECK_HEADER(hash_map,
96 dnl [HASH_INC="hash_map"
97 dnl HASH_CLS="hash_map"
98 dnl AC_DEFINE(HAVE_HASH_MAP, ,
99 dnl [Define if the g++ extension hash_map is available])],
100 dnl [AC_CHECK_HEADER(ext/hash_map,
101 dnl [HASH_INC="ext/hash_map"
102 dnl HASH_CLS="hash_map"
103 dnl AC_DEFINE(HAVE_EXT_HASH_MAP, , [Define if the g++ extension ext/hash_map is available])])])
105 dnl AC_CHECK_HEADER(hash_set,
106 dnl [HASH_INC="hash_set"
107 dnl HASH_CLS="hash_set"
108 dnl AC_DEFINE(HAVE_HASH_SET, , [Define if the g++ extension hash_set is available])],
109 dnl [AC_CHECK_HEADER(ext/hash_set,
110 dnl [HASH_INC="ext/hash_set"
111 dnl HASH_CLS="hash_set"
112 dnl AC_DEFINE(HAVE_EXT_HASH_SET, , [Define if the g++ extension ext/hash_set is available])])])
114 AC_MSG_CHECKING([whether apt supports ddtp])
116 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <apt-pkg/pkgcache.h>]],
117 [[pkgCache::DescIterator d;]]),
119 AC_DEFINE([HAVE_DDTP], [], [Set to true if apt is DDTP-enabled]),
122 AC_MSG_CHECKING([whether apt supports the Homepage: field])
124 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <apt-pkg/pkgrecords.h>]],
125 [[ pkgRecords::Parser *p = NULL;]]
126 [[ if(0) p->Homepage();]]),
128 AC_DEFINE([APT_HAS_HOMEPAGE], [], [Set to true if apt supports the Homepage: field]),
131 AC_MSG_CHECKING([whether apt supports dpkg triggers])
133 AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include <apt-pkg/pkgcache.h>]],
134 [[pkgCache::State::TriggersAwaited;]]
135 [[pkgCache::State::TriggersPending;]]),
137 AC_DEFINE([APT_HAS_TRIGGERS], [], [Set to true if apt supports dpkg trigger states]),
140 # Try to guess what namespace the hash stuff is in (maybe I should just
141 # use rbltrees instead in most places?)
142 if test x$HASH_INC != x
144 AC_MSG_CHECKING([which namespace contains the hash extensions])
148 for NS in std __gnu_cxx
150 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <$HASH_INC>],
151 [${NS}::${HASH_CLS} < int, int > foo;])],
152 [HASH_NAMESPACE=$NS])
155 if test x$HASH_NAMESPACE = x
157 AC_MSG_ERROR([found hash classes, but they aren't in the std or GNU namespace.])
160 AC_MSG_RESULT($HASH_NAMESPACE)
162 # Use the std namespace if all else fails. (the code will fall back
163 # to using map instead of hash_map, set instead of hash_set)
167 AC_DEFINE_UNQUOTED(HASH_NAMESPACE, $HASH_NAMESPACE, [If a hash header is available, define to the namespace in which the hash class resides])
172 # Try to guess how to extend string traits
175 AC_MSG_CHECKING([for the name of the character traits template])
177 for T in char_traits string_char_traits
179 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <string>],
180 [std::basic_string<unsigned char,
181 std::$T < unsigned char > > s;])],
185 if test x$TRAITS_CLASS = xstring_char_traits
187 AC_MSG_WARN([Your compiler uses string_char_traits for its character traits. Some compilers (eg, g++ 2.95) which use this name for the character traits template are known to have hideously broken implementations of the standard string class, which cause aptitude to fail to compile. If you have a compiler with this problem, please upgrade it to a version that has a more compliant version of the STL (g++ >=3.0 is known to work). You can specify which compiler this script should use via the CXX environment variable.])
190 if test x$TRAITS_CLASS = x
192 AC_MSG_ERROR([can't find the name of the character traits template])
194 AC_DEFINE_UNQUOTED(TRAITS_CLASS, $TRAITS_CLASS, [The name of the class used by the STL to define character traits])
196 AC_MSG_RESULT([$TRAITS_CLASS])
202 if test x$HAVE_LIBPTHREAD = x1
204 AC_CHECK_HEADER(pthread.h,
205 CXXFLAGS="$CXXFLAGS -D_REENTRANT"
206 LIBS="$LIBS -lpthread"
207 [AC_DEFINE([HAVE_LIBPTHREAD], [] , [Define if pthread is available])]
209 [AC_MSG_ERROR([POSIX thread header not installed])])
214 AC_ARG_ENABLE(dynamic-backtrace,
215 AS_HELP_STRING([--enable-dynamic-backtrace], [Modify the executable so that it can generate a backtrace for uncaught exceptions. Will double the size of the stripped binary.]),
216 [if test x$enableval = xyes
218 AC_DEFINE([ENABLE_DYNAMIC_BACKTRACE], [], [Define to enable dynamic generation of backtraces if HAVE_EXECINFO_H is defined])
219 LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
222 AC_ARG_ENABLE(werror,
223 AS_HELP_STRING([--disable-werror], [do not compile with -Werror]),
224 if test x$enableval = xno
229 AC_ARG_ENABLE(period-beep,
230 AS_HELP_STRING([--enable-period-beep], [periodically (once a second) produce an annoying beep]),
231 if test x$enableval = xyes
233 [AC_DEFINE(WITH_PERIOD_BEEP, , [Define to produce an annoying beep periodically, for debugging])]
236 AC_ARG_ENABLE(reload-cache,
237 AS_HELP_STRING([--enable-reload-cache], [allow the user to reload the cache on demand. (debugging feature)]),
238 if test x$enableval = xyes
240 [AC_DEFINE(WITH_RELOAD_CACHE, , [Allow the cache to be reloaded on demand])]
244 AC_ARG_ENABLE(package-state-loc,
245 AS_HELP_STRING([--with-package-state-loc], [use the given location for storing state (default /var/lib/aptitude)]),
246 if test x$enableval = xyes
248 [AC_MSG_ERROR([--with-package-state-loc needs an argument])]
250 STATEDIR="$enableval"
252 STATEDIR="/var/lib/aptitude")
254 AC_ARG_ENABLE(lock-loc,
255 AS_HELP_STRING([--with-lock-loc], [use the given location for storing state (default /var/lock/aptitude)]),
256 if test x$enableval = xyes
258 [AC_MSG_ERROR([--with-lock-loc needs an argument])]
260 LOCKFILE="$enableval"
262 LOCKFILE="/var/lock/aptitude")
264 AC_ARG_ENABLE(aptitude,
265 AS_HELP_STRING([--disable-aptitude], [don't compile the program itself]),
266 if test x$enableval=xno
275 AS_HELP_STRING([--disable-docs], [don't generate the documentation]),
276 if test x$enableval=xno
284 CXXFLAGS="$CXXFLAGS -Wall $WERROR"
289 AC_DEFINE_UNQUOTED(STATEDIR, "$STATEDIR", [The location of aptitude's state files])
290 AC_DEFINE_UNQUOTED(LOCKFILE, "$LOCKFILE", [The location of the lock to prevent simultaneous aptitude instances])
295 dnl Checks for library functions.
296 AC_CHECK_FUNCS(strdup)
298 CPPFLAGS="$CPPFLAGS -DHELPDIR=\\\"\$(datadir)/aptitude\\\""
299 CPPFLAGS="$CPPFLAGS -DPKGDATADIR=\\\"\$(datadir)/aptitude\\\""
300 dnl FC_EXPAND_DIR(HELPDIR, [$datadir/aptitude])
301 dnl AC_DEFINE_UNQUOTED(HELPDIR, "$HELPDIR", [The location in which the online help data is placed])
303 dnl FC_EXPAND_DIR(PKGDATADIR, [$datadir/aptitude])
304 dnl AC_DEFINE_UNQUOTED(PKGDATADIR, "$PKGDATADIR", [The location in which the program data is placed])
311 doc/cs/images/Makefile
314 doc/en/images/Makefile
316 doc/fi/images/Makefile
318 doc/fr/images/Makefile
320 doc/ja/images/Makefile
323 doc/po4a/add_fr/Makefile
329 src/generic/apt/Makefile
330 src/generic/problemresolver/Makefile
331 src/generic/util/Makefile