Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac398
1 files changed, 266 insertions, 132 deletions
diff --git a/configure.ac b/configure.ac
index ecc13034..9a5f3b3e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,228 +1,362 @@
-ENV_CFLAGS=$CFLAGS
-CFLAGS=""
-
-AC_PREREQ(2.59)
-dnl Update it right before the release since $pkgver_foo are all _post_ release snapshots
-AC_INIT([Pacman package manager], 3.0.6, [pacman-dev@archlinux.org], [pacman])
-AC_LANG([C])
-AC_CONFIG_HEADERS(config.h)
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+# Minimum version of autoconf required
+AC_PREREQ(2.60)
+
+# UPDATING VERSION NUMBERS FOR RELEASES
+#
+# libalpm:
+# current
+# The most recent interface number that this library implements.
+# revision
+# The implementation number of the current interface.
+# age
+# The difference between the newest and oldest interfaces that this library
+# implements. In other words, the library implements all the interface
+# numbers in the range from number current - age to current.
+#
+# 1. Start with version information of `0:0:0' for each libtool library.
+# 2. Update the version information only immediately before a public release of
+# your software. More frequent updates are unnecessary, and only guarantee
+# that the current interface number gets larger faster.
+# 3. If the library source code has changed at all since the last update, then
+# increment revision (`c:r:a' becomes `c:r+1:a').
+# 4. If any interfaces have been added, removed, or changed since the last
+# update, increment current, and set revision to 0.
+# 5. If any interfaces have been added since the last public release, then
+# increment age.
+# 6. If any interfaces have been removed since the last public release, then
+# set age to 0.
+#
+# pacman:
+# Extreme huge major changes:
+# pacman_version_major += 1
+# pacman_version_minor = 0
+# pacman_version_micro = 0
+#
+# Real releases:
+# pacman_version_minor += 1
+# pacman_version_micro = 0
+#
+# 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], [2])
+m4_define([lib_revision], [0])
+m4_define([lib_age], [0])
+
+m4_define([pacman_version_major], [3])
+m4_define([pacman_version_minor], [1])
+m4_define([pacman_version_micro], [0])
+m4_define([pacman_version_suffix], [devel])
+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_CONFIG_SRCDIR([config.h.in])
+AC_CONFIG_HEADERS([config.h])
+
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE
-AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION(0.13.1)
-dnl Define the libalpm version number here
-LIB_MAJOR_VERSION=1
-LIB_MINOR_VERSION=0
-LIB_MICRO_VERSION=0
-LIB_VERSION=$LIB_MAJOR_VERSION.$LIB_MINOR_VERSION.$LIB_MICRO_VERSION
-dnl Needed for libtool to create proper shared lib version.
-dnl This is not completely correct- see
-dnl http://sourceware.org/autobook/autobook/autobook_91.html for details.
-LIB_VERSION_INFO=`expr $LIB_MAJOR_VERSION + $LIB_MINOR_VERSION`:$LIB_MICRO_VERSION:$LIB_MINOR_VERSION
-
-dnl Set subsitution values for version stuff in Makefiles and anywhere else
+LIB_VERSION=`expr lib_current.lib_age`.lib_revision
+LIB_VERSION_INFO="lib_current:lib_revision:lib_age"
+
+# Set subsitution values for version stuff in Makefiles and anywhere else,
+# and put LIB_VERSION in config.h
AC_SUBST(LIB_VERSION)
AC_SUBST(LIB_VERSION_INFO)
-
-dnl Put version number in config.h
AC_DEFINE_UNQUOTED([LIB_VERSION], ["$LIB_VERSION"], [libalpm version number])
-dnl Configuration files
-dnl AC_CONFIG_FILES([etc/makepkg.conf] [etc/pacman.conf])
+# 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]),
+ [ROOTDIR=$withval], [ROOTDIR=/])
-AC_PROG_CC
-AC_HEADER_STDC
-AC_PROG_INSTALL
-AC_CHECK_FUNCS([strverscmp])
-AM_PROG_LIBTOOL
-AM_CONDITIONAL(LINKSTATIC, test "$enable_static" = "yes")
+# Help line for package extension
+AC_ARG_WITH(pkg-ext,
+ AC_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]),
+ [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]),
+ [DBEXT=$withval], [DBEXT=.db.tar.gz])
-dnl Help line for doxygen
+# Help line for doxygen
AC_ARG_ENABLE(doxygen,
- AC_HELP_STRING([--disable-doxygen], [Build API docs via Doxygen]),
- [wantdoxygen=$enableval], [wantdoxygen=yes])
+ AC_HELP_STRING([--enable-doxygen], [build your own API docs via Doxygen]),
+ [wantdoxygen=$enableval], [wantdoxygen=no])
-dnl Help line for config file
-AC_ARG_WITH(config-file,
- AC_HELP_STRING([--with-config-file=path], [Set the location of pacman's config file]),
- [configfile=$withval], [configfile=/etc/pacman.conf])
+# Help line for asciidoc
+AC_ARG_ENABLE(asciidoc,
+ AC_HELP_STRING([--enable-asciidoc], [build your own manpages with Asciidoc]),
+ [wantasciidoc=$enableval], [wantasciidoc=no])
-dnl Help line for debug
+# Help line for debug
AC_ARG_ENABLE(debug,
- AC_HELP_STRING([--enable-debug], [Enable debugging support]),
- [debug=$enableval], [debug=no])
+ AC_HELP_STRING([--enable-debug], [enable debugging support]),
+ [debug=$enableval], [debug=no])
+
+# Help line for abs
+AC_ARG_ENABLE(abs,
+ AC_HELP_STRING([--disable-abs], [do not include Arch Linux Build System script]),
+ [includeabs=$enableval], [includeabs=yes])
+
+# Help line for pacman.static
+AC_ARG_ENABLE(pacman-static,
+ AC_HELP_STRING([--disable-pacman-static], [do not build static version of pacman]),
+ [pacmanstatic=$enableval], [pacmanstatic=yes])
+
+# Checks for programs.
+AC_PROG_AWK
+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])
+
+# find installed gettext
+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!]))
+
+# 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])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_INLINE
+AC_TYPE_MODE_T
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_TYPE_SIZE_T
+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([realpath regcomp strcasecmp strdup strerror strnlen \
+ strndup strrchr strsep strstr strverscmp uname geteuid])
-dnl Help line for fakeroot
-AC_ARG_ENABLE(fakeroot,
- AC_HELP_STRING([--disable-fakeroot], [Disable fakeroot proof support]),
- [fakeroot=$enableval], [fakeroot=yes])
+# Enable large file support if available
+AC_SYS_LARGEFILE
+
+# Check if we can use symbol visibility support in GCC
+GCC_VISIBILITY_CC
+# Check if we have -fgnu89-inline flag
+GCC_GNU89_INLINE_CC
-dnl Host-dependant flags
+# Host-dependant flags
case "${host}" in
*-*-cygwin*)
- ENV_CFLAGS="$ENV_CFLAGS -DCYGWIN"
+ CFLAGS="$CFLAGS -DCYGWIN"
;;
esac
-dnl Check for architecture
+# Check for architecture, used in default makepkg.conf
+# (Note single space left after CARCHFLAGS)
case "${host}" in
- i686-*)
+ i686-*)
CARCH="i686"
- CARCHFLAGS="i686"
- ARCHSWITCH="march"
+ CARCHFLAGS="-march=i686 "
;;
- x86_64-*)
+ x86_64-*)
CARCH="x86_64"
- CARCHFLAGS="x86-64"
- ARCHSWITCH="march"
+ CARCHFLAGS="-march=x86-64 "
;;
- ia64-*)
+ ia64-*)
CARCH="ia64"
- CARCHFLAGS="ia64"
- ARCHSWITCH="march"
+ CARCHFLAGS="-march=ia64 "
;;
- sparc-*)
+ sparc-*)
CARCH="sparc"
- CARCHFLAGS="v9"
- ARCHSWITCH="mcpu"
+ CARCHFLAGS="-mcpu=v9 "
;;
ppc-* | powerpc-*)
CARCH="ppc"
- CARCHFLAGS="750"
- ARCHSWITCH="mcpu"
+ CARCHFLAGS="-mcpu=750 "
;;
- i386-*)
+ i386-*)
CARCH="i386"
- CARCHFLAGS="i386"
- ARCHSWITCH="march"
+ CARCHFLAGS="-march=i386 "
+ ;;
+ arm-*)
+ CARCH="arm"
+ CARCHFLAGS="-march=armv4 "
;;
*)
- AC_MSG_ERROR([Your architecture is not supported])
+ AC_MSG_WARN([[Your architecture is unknown for makepkg.conf, consider adding it to configure.ac]])
+ CARCH="unknown"
+ CARCHFLAGS=""
;;
esac
-dnl Now do some things common to all architectures
+# Now do some things common to all architectures
CHOST="${host}"
AC_SUBST(CARCH)
AC_SUBST(CARCHFLAGS)
-AC_SUBST(ARCHSWITCH)
AC_SUBST(CHOST)
-dnl Humor lowers blood pressure
-AC_MSG_CHECKING(your blood pressure)
-AC_MSG_RESULT([a bit high, but we can proceed])
-
-dnl Check for doxygen support
-AC_MSG_CHECKING(for doxygen)
+# Check for doxygen support and status
+AC_MSG_CHECKING([for doxygen])
if test "x$wantdoxygen" = "xyes" ; then
- AC_CHECK_PROGS([DOXYGEN], [doxygen])
- if test $DOXYGEN ; then
- AC_MSG_RESULT(yes)
+ AC_CHECK_PROGS([DOXYGEN], [doxygen])
+ if test $DOXYGEN ; then
+ AC_MSG_RESULT([yes])
usedoxygen=yes
- else
- AC_MSG_RESULT(no, doxygen missing)
+ else
+ AC_MSG_RESULT([no, doxygen missing])
usedoxygen=no
- fi
+ fi
else
- AC_MSG_RESULT(no, disabled by configure)
+ AC_MSG_RESULT([no, disabled by configure])
usedoxygen=no
fi
-AM_CONDITIONAL(HAS_DOXYGEN, test "x$usedoxygen" = "xyes")
-
-dnl Check for math
-AC_CHECK_LIB([m], [sqrt], [AC_CHECK_HEADER([math.h], [LIBM='-lm'])])
-if test -z "$LIBM"; then
- AC_MSG_ERROR("math library needed to compile pacman!");
-fi
-
-dnl Check for libarchive
-AC_CHECK_LIB([archive], [archive_read_data], [AC_CHECK_HEADER([archive.h], [LIBARCHIVE='-larchive'])])
-if test -z "$LIBARCHIVE"; then
- AC_MSG_ERROR("libarchive is needed to compile pacman!");
-fi
-
-dnl Check for libdownload
-AC_CHECK_LIB([download], [downloadParseURL], [AC_CHECK_HEADER([download.h], [LIBDOWNLOAD='-ldownload'])])
-if test -z "$LIBDOWNLOAD"; then
- AC_MSG_ERROR("libdownload is needed to compile pacman!");
-fi
-
-# Enable large file support if available
-AC_SYS_LARGEFILE
+AM_CONDITIONAL(USE_DOXYGEN, test "x$usedoxygen" = "xyes")
-dnl Set config location
-AC_MSG_CHECKING(for configuration file name)
-if test -n "$configfile"; then
- AC_DEFINE_UNQUOTED([PACCONF], "$configfile", [Location of pacman conf file])
- AC_MSG_RESULT(["$configfile"])
+# Check for asciidoc support and status
+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
+ else
+ AC_MSG_RESULT([no, asciidoc missing])
+ useasciidoc=no
+ fi
else
- AC_MSG_ERROR(["pacman config file (--with-config-file is not set"])
+ AC_MSG_RESULT([no, disabled by configure])
+ useasciidoc=no
fi
+AM_CONDITIONAL(USE_ASCIIDOC, test "x$useasciidoc" = "xyes")
-dnl Enable or disable debug code
+# Enable or disable debug code
AC_MSG_CHECKING(for debug mode request)
if test "x$debug" = "xyes" ; then
+ AC_MSG_RESULT(yes)
AC_DEFINE([PACMAN_DEBUG], , [Enable debug code])
- CFLAGS="$CFLAGS -g -Wall -Werror -fstack-protector -std=c99"
- LDFLAGS="$LDFLAGS -lmcheck"
- AC_MSG_RESULT(yes)
+ # Check for mcheck
+ AC_CHECK_HEADERS([mcheck.h])
+ # Check for -fstack-protector availability
+ GCC_STACK_PROTECT_LIB
+ GCC_STACK_PROTECT_CC
+ CFLAGS="$CFLAGS -Wall -Werror"
else
- CFLAGS="$CFLAGS -Wall -std=c99"
- AC_MSG_RESULT(no)
+ AC_MSG_RESULT(no)
+ CFLAGS="$CFLAGS -Wall"
fi
-dnl Enable or disable fakeroot code
-AC_MSG_CHECKING(for fakeroot proof support)
-if test "x$fakeroot" = "xyes" ; then
+# Enable or disable inclusion of abs script
+AC_MSG_CHECKING(for inclusion of abs script)
+if test "x$includeabs" = "xyes" ; then
AC_MSG_RESULT(yes)
+ AC_DEFINE([INCLUDE_ABS], , [Include abs script])
else
- AC_DEFINE([FAKEROOT], , [Disable fakeroot-proof code])
AC_MSG_RESULT(no)
fi
+AM_CONDITIONAL(INCLUDE_ABS, test "x$includeabs" = "xyes")
-dnl Set CFLAGS to both $CFLAGS and ones from env ($ENV_CFLAGS)
-CFLAGS="$CFLAGS $ENV_CFLAGS"
+# Enable or disable inclusion of abs script
+AC_MSG_CHECKING(whether to build pacman.static)
+if test "x$pacmanstatic" = "xyes" ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([INCLUDE_PACMAN_STATIC], , [Build pacman.static])
+else
+ AC_MSG_RESULT(no)
+fi
+AM_CONDITIONAL(INCLUDE_PACMAN_STATIC, test "x$pacmanstatic" = "xyes")
-dnl ==========================================================================
+# Set root directory
+AC_SUBST(ROOTDIR)
+# Set package file extension
+AC_SUBST(PKGEXT)
+AC_DEFINE_UNQUOTED([PKGEXT], "$PKGEXT", [The file extension used by pacman packages])
+# Set source package file extension
+AC_SUBST(SRCEXT)
+AC_DEFINE_UNQUOTED([SRCEXT], "$SRCEXT", [The file extension used by pacman source packages])
+# Set database file extension
+AC_SUBST(DBEXT)
+AC_DEFINE_UNQUOTED([DBEXT], "$DBEXT", [The file extension used by pacman databases])
-AC_OUTPUT([
+# Configuration files
+AC_CONFIG_FILES([
lib/libalpm/Makefile
lib/libalpm/po/Makefile.in
src/pacman/Makefile
-src/pacman/po/Makefile.in
src/util/Makefile
scripts/Makefile
doc/Makefile
etc/Makefile
-etc/makepkg.conf
-etc/pacman.conf
etc/pacman.d/Makefile
-etc/pacman.d/mirrorlist
etc/abs/Makefile
+po/Makefile.in
pactest/Makefile
contrib/Makefile
Makefile
])
+AC_OUTPUT
echo "
-pacman-$VERSION:
+pacman_display_version:
- prefix : ${prefix}
+ Build information:
source code location : ${srcdir}
+ prefix : ${prefix}
+ sysconfdir : $(eval echo ${sysconfdir})
+ conf file : $(eval echo ${sysconfdir})/pacman.conf
+ localstatedir : $(eval echo ${localstatedir})
+ database dir : $(eval echo ${localstatedir})/lib/pacman/
+ cache dir : $(eval echo ${localstatedir})/cache/pacman/pkg/
compiler : ${CC}
compiler flags : ${CFLAGS}
defines : ${DEFS}
Architecture : ${CARCH}
- Architecture flags : -${ARCHSWITCH}=${CARCHFLAGS}
+ Architecture flags : ${CARCHFLAGS}
Host Type : ${CHOST}
libalpm version : ${LIB_VERSION}
pacman version : ${PACKAGE_VERSION}
- pacman.conf location : ${configfile}
+ Directory and file information:
+ root working directory : ${ROOTDIR}
+ package extension : ${PKGEXT}
+ source pkg extension : ${SRCEXT}
+ database extension : ${DBEXT}
+
+ Compilation options:
Doxygen support : ${usedoxygen}
+ Asciidoc support : ${useasciidoc}
debug support : ${debug}
- fakeroot-proof support : ${fakeroot}
+ include abs : ${includeabs}
+ build pacman.static : ${pacmanstatic}
"
+
+# vim:set ts=2 sw=2 noet: