summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac99
1 files changed, 67 insertions, 32 deletions
diff --git a/configure.ac b/configure.ac
index eabb4a4e..ab5a3744 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,11 +40,6 @@ AC_PREREQ(2.60)
#
# Bugfix releases:
# pacman_version_micro += 1
-#
-# pacman_version_suffix should be similar to one of the following:
-# For beta releases: [beta2]
-# For code under development: [devel]
-# For production releases: []
m4_define([lib_current], [5])
m4_define([lib_revision], [1])
@@ -53,16 +48,11 @@ m4_define([lib_age], [3])
m4_define([pacman_version_major], [3])
m4_define([pacman_version_minor], [1])
m4_define([pacman_version_micro], [4])
-m4_define([pacman_version_suffix], [])
m4_define([pacman_version],
[pacman_version_major.pacman_version_minor.pacman_version_micro])
-m4_define([pacman_display_version],
- pacman_version[]m4_ifdef([pacman_version_suffix],[pacman_version_suffix]))
# Autoconf initialization
-# AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
-AC_INIT([Pacman Package Manager], [pacman_display_version],
- [pacman-dev@archlinux.org], [pacman])
+AC_INIT([pacman], [pacman_version], [pacman-dev@archlinux.org])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
@@ -80,47 +70,58 @@ AC_DEFINE_UNQUOTED([LIB_VERSION], ["$LIB_VERSION"], [libalpm version number])
# Help line for root directory
AC_ARG_WITH(root-dir,
- AC_HELP_STRING([--with-root-dir=path], [set the location of pacman's root operating directory]),
+ AS_HELP_STRING([--with-root-dir=path], [set the location of pacman's root operating directory]),
[ROOTDIR=$withval], [ROOTDIR=/])
# Help line for package extension
AC_ARG_WITH(pkg-ext,
- AC_HELP_STRING([--with-pkg-ext=ext], [set the file extension used by packages]),
+ AS_HELP_STRING([--with-pkg-ext=ext], [set the file extension used by packages]),
[PKGEXT=$withval], [PKGEXT=.pkg.tar.gz])
# Help line for source package directory
AC_ARG_WITH(src-ext,
- AC_HELP_STRING([--with-src-ext=ext], [set the file extension used by source packages]),
+ AS_HELP_STRING([--with-src-ext=ext], [set the file extension used by source packages]),
[SRCEXT=$withval], [SRCEXT=.src.tar.gz])
# Help line for database extension
AC_ARG_WITH(db-ext,
- AC_HELP_STRING([--with-db-ext=ext], [set the file extension used by the database]),
+ AS_HELP_STRING([--with-db-ext=ext], [set the file extension used by the database]),
[DBEXT=$withval], [DBEXT=.db.tar.gz])
+# Help line for libdownload/libfetch
+AC_ARG_ENABLE(internal-download,
+ AS_HELP_STRING([--disable-internal-download], [do not build with libdownload/libfetch support]),
+ [internaldownload=$enableval], [internaldownload=yes])
+
# Help line for documentation
AC_ARG_ENABLE(doc,
- AC_HELP_STRING([--disable-doc], [prevent make from looking at doc/ dir]),
+ AS_HELP_STRING([--disable-doc], [prevent make from looking at doc/ dir]),
[wantdoc=$enableval], [wantdoc=yes])
# Help line for doxygen
AC_ARG_ENABLE(doxygen,
- AC_HELP_STRING([--enable-doxygen], [build your own API docs via Doxygen]),
+ AS_HELP_STRING([--enable-doxygen], [build your own API docs via Doxygen]),
[wantdoxygen=$enableval], [wantdoxygen=no])
# Help line for asciidoc
AC_ARG_ENABLE(asciidoc,
- AC_HELP_STRING([--enable-asciidoc], [build your own manpages with Asciidoc]),
+ AS_HELP_STRING([--enable-asciidoc], [build your own manpages with Asciidoc]),
[wantasciidoc=$enableval], [wantasciidoc=no])
# Help line for debug
AC_ARG_ENABLE(debug,
- AC_HELP_STRING([--enable-debug], [enable debugging support]),
+ AS_HELP_STRING([--enable-debug], [enable debugging support]),
[debug=$enableval], [debug=no])
+# Help line for using git version in pacman version string
+AC_ARG_ENABLE(git-version,
+ AS_HELP_STRING([--enable-git-version],
+ [enable use of git version in version string if available]),
+ [wantgitver=$enableval], [wantgitver=no])
+
# Help line for pacman.static
AC_ARG_ENABLE(pacman-static,
- AC_HELP_STRING([--disable-pacman-static], [do not build static version of pacman]),
+ AS_HELP_STRING([--disable-pacman-static], [do not build static version of pacman]),
[pacmanstatic=$enableval], [pacmanstatic=yes])
# Checks for programs.
@@ -129,7 +130,6 @@ AC_PROG_CC_C99
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
-AC_PROG_RANLIB
AC_PROG_LIBTOOL
AC_CHECK_PROGS([PYTHON], [python2.5 python2.4 python], [false])
@@ -138,13 +138,27 @@ AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.13.1)
# Check for libarchive
-AC_CHECK_LIB([archive], [archive_read_data], , AC_MSG_ERROR([libarchive is needed to compile pacman!]))
-
-# Check for libdownload
-AC_CHECK_LIB([download], [downloadParseURL], , AC_MSG_ERROR([libdownload is needed to compile pacman!]))
+AC_CHECK_LIB([archive], [archive_read_data], ,
+ AC_MSG_ERROR([libarchive is needed to compile pacman!]))
+
+# Enable or disable usage of libdownload/libfetch
+# - this is a nested check- first see if we need a library, if we do then
+# check for libdownload first, then fallback to libfetch, then die
+AC_MSG_CHECKING(whether to link with download library)
+if test "x$internaldownload" = "xyes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([INTERNAL_DOWNLOAD], , [Use internal download library])
+ # Check for a download library if it was actually requested
+ AC_CHECK_LIB([download], [downloadParseURL], ,
+ AC_CHECK_LIB([fetch], [fetchParseURL], ,
+ AC_MSG_ERROR([libdownload or libfetch are needed to compile with internal download support])) )
+else
+ AC_MSG_RESULT(no)
+fi
+AM_CONDITIONAL(INTERNAL_DOWNLOAD, test "x$internaldownload" = "xyes")
# Checks for header files.
-AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h string.h strings.h sys/ioctl.h sys/statvfs.h sys/time.h syslog.h wchar.h])
+AC_CHECK_HEADERS([fcntl.h libintl.h limits.h locale.h string.h strings.h sys/ioctl.h sys/param.h sys/statvfs.h sys/syslimits.h sys/time.h syslog.h wchar.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
@@ -156,13 +170,13 @@ AC_STRUCT_TM
AC_TYPE_UID_T
# Checks for library functions.
-AC_FUNC_CLOSEDIR_VOID
AC_FUNC_FORK
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MKTIME
AC_TYPE_SIGNAL
-AC_CHECK_FUNCS([geteuid realpath regcomp strcasecmp strdup strerror \
- strndup strrchr strsep strstr strverscmp swprintf uname])
+AC_CHECK_FUNCS([geteuid realpath regcomp strcasecmp \
+ strndup strrchr strsep strverscmp swprintf \
+ wcwidth uname])
# Enable large file support if available
AC_SYS_LARGEFILE
@@ -242,9 +256,9 @@ fi
AM_CONDITIONAL(WANT_DOC, test "x$wantdoc" = "xyes")
# Check for doxygen support and status
+AC_CHECK_PROGS([DOXYGEN], [doxygen])
AC_MSG_CHECKING([for doxygen])
if test "x$wantdoxygen" = "xyes" ; then
- AC_CHECK_PROGS([DOXYGEN], [doxygen])
if test $DOXYGEN ; then
AC_MSG_RESULT([yes])
usedoxygen=yes
@@ -259,9 +273,9 @@ fi
AM_CONDITIONAL(USE_DOXYGEN, test "x$usedoxygen" = "xyes")
# Check for asciidoc support and status
+AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
AC_MSG_CHECKING([for asciidoc])
if test "x$wantasciidoc" = "xyes" ; then
- AC_CHECK_PROGS([ASCIIDOC], [asciidoc])
if test $ASCIIDOC ; then
AC_MSG_RESULT([yes])
useasciidoc=yes
@@ -291,6 +305,25 @@ else
CFLAGS="$CFLAGS -Wall"
fi
+# Enable or disable use of git version in pacman version string
+AC_CHECK_PROGS([GIT], [git])
+AC_CHECK_FILE([.git/], hasgitdir=yes)
+AC_MSG_CHECKING(whether to use git version if available)
+if test "x$wantgitver" = "xyes" ; then
+ if test $GIT -a "x$hasgitdir" = "xyes"; then
+ AC_MSG_RESULT([yes])
+ usegitver=yes
+ AC_DEFINE([USE_GIT_VERSION], , [Use GIT version in version string])
+ else
+ AC_MSG_RESULT([no, git or .git dir missing])
+ usegitver=no
+ fi
+else
+ AC_MSG_RESULT([no, disabled by configure])
+ usegitver=no
+fi
+AM_CONDITIONAL(USE_GIT_VERSION, test "x$usegitver" = "xyes")
+
# Enable or disable inclusion of pacman.static
AC_MSG_CHECKING(whether to build pacman.static)
if test "x$pacmanstatic" = "xyes" ; then
@@ -330,7 +363,7 @@ Makefile
AC_OUTPUT
echo "
-pacman_display_version:
+${PACKAGE_NAME}:
Build information:
source code location : ${srcdir}
@@ -351,6 +384,7 @@ pacman_display_version:
libalpm version : ${LIB_VERSION}
libalpm version info : ${LIB_VERSION_INFO}
pacman version : ${PACKAGE_VERSION}
+ using git version : ${usegitver}
Directory and file information:
root working directory : ${ROOTDIR}
@@ -360,6 +394,7 @@ pacman_display_version:
Compilation options:
Run make in doc/ dir : ${wantdoc}
+ Use download library : ${internaldownload}
Doxygen support : ${usedoxygen}
Asciidoc support : ${useasciidoc}
debug support : ${debug}