From ed9ba607b47feae1a435126c5fa05ac2a3690099 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 26 Jul 2013 14:12:29 +0200 Subject: make autoconf happy by "mv configure.{in,ac}" Git-Dch: Ignore --- configure.ac | 194 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 configure.ac (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac new file mode 100644 index 000000000..129be5c12 --- /dev/null +++ b/configure.ac @@ -0,0 +1,194 @@ +ad +dnl Process this file with autoconf to produce a configure script. +dnl The ONLY thing this is used for is to configure for different +dnl linux architectures and configurations, it is not used to make the +dnl code more portable + +dnl You MUST have an environment that has all the POSIX functions and +dnl some of the more populare bsd/sysv ones (like select). You'll also +dnl need a C++ compiler that is semi-standard conformant, exceptions are +dnl not used but STL is. + +dnl 'make -f Makefile startup' will generate the configure file from +dnl configure.ac correctly and can be run at any time + +AC_PREREQ(2.50) +AC_INIT(configure.ac) +AC_CONFIG_AUX_DIR(buildlib) +AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) + +PACKAGE="apt" +PACKAGE_VERSION="0.9.7.6ubuntu2" +PACKAGE_MAIL="APT Development Team " +AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") +AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"$PACKAGE_VERSION") +AC_DEFINE_UNQUOTED(PACKAGE_MAIL,"$PACKAGE_MAIL") +AC_SUBST(PACKAGE) +AC_SUBST(PACKAGE_VERSION) +AC_SUBST(PACKAGE_MAIL) + +dnl Check the archs, we want the target type. +AC_CANONICAL_SYSTEM + +dnl Check our C compiler +AC_CHECK_TOOL_PREFIX +AC_PROG_CC +AC_ISC_POSIX + +dnl check for large file support and enable it if possible +dnl do this early as other stuff might depend on it +AC_SYS_LARGEFILE + +dnl Check for other programs +AC_PROG_CXX +AC_PROG_CPP +AC_PROG_RANLIB +AC_CHECK_TOOL(AR,ar,"ar") + +dnl Checks for sockets +SAVE_LIBS="$LIBS" +LIBS="" +AC_SEARCH_LIBS(gethostbyname,nsl) +AC_SEARCH_LIBS(connect,socket) +SOCKETLIBS="$LIBS" +AC_SUBST(SOCKETLIBS) +LIBS="$SAVE_LIBS" + +dnl Checks for pthread -- disabled due to glibc bugs jgg +dnl AC_CHECK_LIB(pthread, pthread_create,[AC_DEFINE(HAVE_PTHREAD) PTHREADLIB="-lpthread"]) +AC_SUBST(PTHREADLIB) +dnl if test "$PTHREADLIB" != "-lpthread"; then +dnl AC_MSG_ERROR(failed: I need posix threads, pthread) +dnl fi + +dnl Check for BDB +saveLIBS="$LIBS" +LIBS="$LIBS -ldb" + +AC_CHECK_HEADER(db.h, + [AC_MSG_CHECKING(if we can link against BerkeleyDB) + AC_LINK_IFELSE( + [AC_LANG_PROGRAM( + [#include ], + [int r, s, t; db_version(&r, &s, &t);] + )], + [AC_DEFINE(HAVE_BDB) + BDBLIB="-ldb" + AC_MSG_RESULT(yes)], + [BDBLIB="" + AC_MSG_RESULT(no)] + )] +) + +LIBS="$saveLIBS" + +AC_CHECK_LIB(curl, curl_easy_init, + [AC_CHECK_HEADER(curl/curl.h, + curl_ok=yes, + curl_ok=no)], + AC_MSG_ERROR([failed: I need CURL due https support]), +) + +AC_SUBST(BDBLIB) + +HAVE_ZLIB=no +AC_CHECK_LIB(z, gzopen, + [AC_CHECK_HEADER(zlib.h, [HAVE_ZLIB=yes], AC_MSG_ERROR([failed: zlib.h not found]))], + AC_MSG_ERROR([failed: Need libz])) +AC_SUBST(HAVE_ZLIB) +if test "x$HAVE_ZLIB" = "xyes"; then + AC_DEFINE(HAVE_ZLIB) +fi + +HAVE_BZ2=no +AC_CHECK_LIB(bz2, BZ2_bzopen,[AC_CHECK_HEADER(bzlib.h, [HAVE_BZ2=yes], [])], []) +AC_SUBST(HAVE_BZ2) +if test "x$HAVE_BZ2" = "xyes"; then + AC_DEFINE(HAVE_BZ2) +fi + +dnl Converts the ARCH to be something singular for this general CPU family +dnl This is often the dpkg architecture string. +dnl First check against the full canonical canoncial-system-type in $target +dnl and if that fails, just look for the cpu +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") + +dnl Single Unix Spec statvfs +AC_CHECK_FUNC(statvfs,[HAVE_STATVFS=yes]) +AC_SUBST(HAVE_STATVFS) + +dnl Arg, linux and bsd put their statfs function in different places +if test x"$HAVE_STATVFS" != x"yes"; then + AC_EGREP_HEADER(statfs,sys/vfs.h,[AC_DEFINE(HAVE_VFS_H)],[ + AC_EGREP_HEADER(statfs,sys/mount.h,[AC_DEFINE(HAVE_MOUNT_H)],[AC_MSG_ERROR(failed: Need statvfs)]) + ]) +fi + +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 HP-UX sux.. +AC_MSG_CHECKING(for missing socklen_t) +AC_EGREP_HEADER(socklen_t, sys/socket.h,[AC_MSG_RESULT(no)],[ + AC_DEFINE(NEED_SOCKLEN_T_DEFINE) + NEED_SOCKLEN_T_DEFINE=yes + AC_MSG_RESULT(missing.)]) +AC_SUBST(NEED_SOCKLEN_T_DEFINE) + +dnl HP-UX needs -d_XOPEN_SOURCE_EXTENDED for h_errno +AC_MSG_CHECKING(for h_errno) +AC_EGREP_HEADER(h_errno, netdb.h, [AC_MSG_RESULT(normal)], + [CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" + AC_EGREP_HEADER(h_errno, netdb.h, + [AC_MSG_RESULT(needs _XOPEN_SOURCE_EXTENDED)], + [AC_MSG_ERROR("not found.")]) + ]) + +dnl Check for debiandoc +AC_PATH_PROG(DEBIANDOC_HTML,debiandoc2html) +AC_PATH_PROG(DEBIANDOC_TEXT,debiandoc2text) + +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) + +dnl Check for the po4a tool needed to build man pages +AC_PATH_PROG(PO4A,po4a) + +dnl Check for graphviz +AC_CHECK_PROG([HAVE_DOT], [dot], [YES], [NO]) +AC_PATH_PROG([DOT], [dot], []) +DOTDIR=$(dirname $DOT) +AC_SUBST(DOTDIR) + +ah_NUM_PROCS +ah_GCC3DEP + +dnl It used to be that the user could select translations and that could get +dnl passed to the makefiles, but now that can only work if you use special +dnl gettext approved makefiles, so this feature is unsupported by this. +ALL_LINGUAS="bg bs ca cs cy da de dz el es eu fi fr gl hu it ja ko ku nb nl nn pl pt_BR pt ro ru sk sl sv th tl uk vi zn_CN zh_TW" +AM_GNU_GETTEXT(external) +if test x"$USE_NLS" = "xyes"; then + AC_DEFINE(USE_NLS) +fi +AC_SUBST(USE_NLS) +AC_PATH_PROG(BASH, bash) + +AC_OUTPUT(environment.mak:buildlib/environment.mak.in makefile:buildlib/makefile.in doc/Doxyfile:doc/Doxyfile.in,make -s dirs) -- cgit v1.2.3 From df82c8b72a26ef56c0f4eb45874aad9fed8d2e6f Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Fri, 26 Jul 2013 14:38:18 +0200 Subject: remove ALL_LINGUAS as it is overruled by po/LINGUAS The list shows that it is ignored as some translations which are shipped are not included here, so remove this source of possible confusion. Git-Dch: Ignore --- configure.ac | 4 ---- 1 file changed, 4 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 129be5c12..28d77bb36 100644 --- a/configure.ac +++ b/configure.ac @@ -180,10 +180,6 @@ AC_SUBST(DOTDIR) ah_NUM_PROCS ah_GCC3DEP -dnl It used to be that the user could select translations and that could get -dnl passed to the makefiles, but now that can only work if you use special -dnl gettext approved makefiles, so this feature is unsupported by this. -ALL_LINGUAS="bg bs ca cs cy da de dz el es eu fi fr gl hu it ja ko ku nb nl nn pl pt_BR pt ro ru sk sl sv th tl uk vi zn_CN zh_TW" AM_GNU_GETTEXT(external) if test x"$USE_NLS" = "xyes"; then AC_DEFINE(USE_NLS) -- cgit v1.2.3 From 55732492ddea83e7d97b2e0c3e6799948fc5f152 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 1 Aug 2013 12:58:20 +0200 Subject: unset LANGUAGE for showing [Y/n] answer hints nl_langinfo is used to acquire the YESEXPR of the language used, but it will return the one from LC_MESSAGES, which might be different from the language chosen for display of the question (based on LANGUAGE) so this commit removes the [Y/n] help text from the questions itself and moves it to the prompt creation in which the usage of LC_MESSAGES is forced for it, so that the helptext shown actually represents the characters accepted as input for the question. There is still room for problems of course starting with an untranslated "[Y/n]" but a translated YESEXPR or the problem that the question is asked in a completely different language which might have a conflicting definition of [Y/n] input or the user simple ignores the helptext and assumes that an answer matching the question language is accepted, but the mayority of users will never have this problem to begin with, so we should be fine (or at least a bit finer than before). Closes nothing really, but should at least help a bit with bugs like deb:194614, deb:471102, lp:1205578, and countless others. --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 28d77bb36..9fb20b95f 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib) AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in) PACKAGE="apt" -PACKAGE_VERSION="0.9.7.6ubuntu2" +PACKAGE_VERSION="0.9.9.4" PACKAGE_MAIL="APT Development Team " AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE") AC_DEFINE_UNQUOTED(PACKAGE_VERSION,"$PACKAGE_VERSION") -- cgit v1.2.3