AC_INIT([apt], [1.0.6+1], [pashev.igor@gmail.com]) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([subdir-objects]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES]) AC_CONFIG_HEADERS([config.h]) __apt_macros_h="apt-pkg/contrib/macros.h" ap_maj=`$AWK '/^\#define APT_PKG_MAJOR/ {print $3}' $srcdir/$__apt_macros_h` ap_min=`$AWK '/^\#define APT_PKG_MINOR/ {print $3}' $srcdir/$__apt_macros_h` ap_rel=`$AWK '/^\#define APT_PKG_RELEASE/ {print $3}' $srcdir/$__apt_macros_h` ai_maj=1 ai_min=5 ai_rel=0 AC_SUBST([LIBAPT_PKG_RELEASE], $ap_maj.$ap_min) AC_SUBST([LIBAPT_INST_RELEASE], $ai_maj.$ai_min) AC_DEFINE([COMMON_ARCH], [], [Dpkg architecture (such as i386, amd64, kfreebsd-amd64, etc)]) AC_MSG_CHECKING(debian architecture) archset="`dpkg-architecture -qDEB_HOST_ARCH`" if test "x$archset" = "x"; then AC_MSG_ERROR([failed: use --host= or output from dpkg-architecture]) fi AC_MSG_RESULT($archset) AC_DEFINE_UNQUOTED(COMMON_ARCH,"$archset") AC_PROG_CC_C99 gl_EARLY AC_PROG_CXX LT_INIT([disable-static]) AC_PATH_PROG(DOXYGEN, doxygen) AC_PATH_PROG(PO4A, po4a) AC_PATH_PROG(XSLTPROC, xsltproc) AM_CONDITIONAL([HAVE_DOXYGEN], [test "x$DOXYGEN" != "xno"]) AM_CONDITIONAL([HAVE_PO4A], [test "x$PO4A" != "xno"]) AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "xno"]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.16.1]) AM_ICONV AC_CONFIG_MACRO_DIR([m4]) AC_SEARCH_LIBS([dlopen], [dl]) AC_SEARCH_LIBS([gethostbyname], [nsl]) AC_SEARCH_LIBS([connect], [socket]) AC_SEARCH_LIBS([pthread_create], [pthread]) AC_SEARCH_LIBS([openpty], [util libutil]) AC_LANG_PUSH([C++]) AC_CHECK_HEADER(gtest/gtest.h,, AC_MSG_ERROR([failed: I need gtest to build tests]), ) AC_LANG_POP([C++]) have_curl="no" AC_CHECK_HEADER([curl/curl.h], [ AC_CHECK_LIB([curl], [curl_easy_init], [have_curl="yes"]) ], ) AM_CONDITIONAL([ENABLE_HTTPS], [test "x$have_curl" = xyes]) have_bdb="no" AC_CHECK_HEADER([db.h], [ AC_CHECK_LIB([db], [db_version], [have_bdb="yes"]) ], ) AM_CONDITIONAL([ENABLE_FTPARCHIVE], [test "x$have_bdb" = xyes]) have_zlib="no" AC_CHECK_HEADER([zlib.h], [ AC_CHECK_LIB([z], [gzread], [have_zlib="yes"]) ], ) if test "x$have_zlib" = "xyes"; then AC_DEFINE(HAVE_ZLIB, [1], [Define to 1 if have Zlib]) LIBZ="-lz" AC_SUBST([LIBZ]) fi have_bz2="no" AC_CHECK_HEADER([bzlib.h], [ AC_CHECK_LIB([bz2], [BZ2_bzopen], [have_bz2="yes"]) ], ) if test "x$have_bz2" = "xyes"; then AC_DEFINE(HAVE_BZ2, [1], [Define to 1 if have Bzip2 library]) LIBBZ2="-lbz2" AC_SUBST([LIBBZ2]) fi have_lzma="no" AC_CHECK_HEADER([lzma.h], [ AC_CHECK_LIB([lzma], [lzma_easy_encoder], [have_lzma="yes"]) ], ) if test "x$have_lzma" = "xyes"; then AC_DEFINE(HAVE_LZMA, [1], [Define to 1 if have lzma library]) LIBLZMA="-llzma" AC_SUBST([LIBLZMA]) fi dnl Solaris: AC_CHECK_HEADERS([sys/isa_defs.h sys/ttold.h]) AC_CHECK_MEMBERS([struct statfs.f_type],,, [$ac_includes_default #include ]) dnl We should use the real timegm function if we have it. AC_CHECK_FUNC(timegm,AC_DEFINE(HAVE_TIMEGM)) AC_SUBST(HAVE_TIMEGM) dnl Check the architecture AC_C_BIGENDIAN dnl Check for doxygen AC_PATH_PROG(DOXYGEN, doxygen) dnl Check for the XSLTProc tool needed to build man pages together with po4a AC_PATH_PROG(XSLTPROC,xsltproc) AC_PATH_PROG(W3M, w3m) AC_TYPE_UINT8_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_CHECK_TYPES([u_int8_t, u_int16_t, u_int32_t, u_int64_t]) AC_CHECK_FUNCS([timegm cfmakeraw]) gl_INIT AC_CONFIG_FILES([ Makefile doc/Makefile po/Makefile.in lib/Makefile ]) # TODO: --with-FOO: KEYRING_FILENAME=/usr/share/keyrings/debian-archive-keyring.gpg KEYRING_MASTER_FILENAME= KEYRING_REMOVED_FILENAME=/usr/share/keyrings/debian-archive-removed-keys.gpg KEYRING_URI= AC_SUBST(KEYRING_FILENAME) AC_SUBST(KEYRING_MASTER_FILENAME) AC_SUBST(KEYRING_REMOVED_FILENAME) AC_SUBST(KEYRING_URI) AC_CONFIG_FILES([cmdline/apt-key], [chmod 0755 cmdline/apt-key]) AC_OUTPUT