2005-10-17 14:52:43 -04:00
|
|
|
AC_PREREQ(2.59)
|
2006-10-15 15:38:02 -04:00
|
|
|
dnl Update it right before the release since $pkgver_foo are all _post_ release snapshots
|
2007-04-04 01:30:14 -04:00
|
|
|
AC_INIT([Pacman package manager], 3.0.1, [pacman-dev@archlinux.org], [pacman])
|
2007-02-22 16:34:51 -05:00
|
|
|
AC_LANG([C])
|
|
|
|
AC_CONFIG_HEADERS(config.h)
|
|
|
|
AC_CANONICAL_HOST
|
2005-10-17 14:52:43 -04:00
|
|
|
AM_INIT_AUTOMAKE
|
2006-06-28 01:37:15 -04:00
|
|
|
AM_GNU_GETTEXT([external])
|
|
|
|
AM_GNU_GETTEXT_VERSION(0.13.1)
|
2005-10-17 14:52:43 -04:00
|
|
|
|
2007-02-22 16:34:51 -05:00
|
|
|
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
|
2005-10-17 14:52:43 -04:00
|
|
|
|
2007-02-22 16:34:51 -05:00
|
|
|
dnl Set subsitution values for version stuff in Makefiles and anywhere else
|
|
|
|
AC_SUBST(LIB_VERSION)
|
|
|
|
AC_SUBST(LIB_VERSION_INFO)
|
2005-10-17 14:52:43 -04:00
|
|
|
|
2007-02-22 16:34:51 -05:00
|
|
|
dnl Put version number in config.h
|
|
|
|
AC_DEFINE_UNQUOTED([LIB_VERSION], ["$LIB_VERSION"], [libalpm version number])
|
2005-10-17 14:52:43 -04:00
|
|
|
|
2006-10-15 15:38:02 -04:00
|
|
|
dnl Configuration files
|
2006-11-20 04:10:23 -05:00
|
|
|
dnl AC_CONFIG_FILES([etc/makepkg.conf] [etc/pacman.conf])
|
2006-10-15 15:38:02 -04:00
|
|
|
|
2005-10-17 14:52:43 -04:00
|
|
|
AC_PROG_CC
|
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_CHECK_FUNCS([strverscmp])
|
|
|
|
AM_PROG_LIBTOOL
|
2006-12-28 11:54:35 -05:00
|
|
|
AM_CONDITIONAL(LINKSTATIC, test "$enable_static" = "yes")
|
2005-10-17 14:52:43 -04:00
|
|
|
|
2007-03-29 03:47:34 -04:00
|
|
|
dnl 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=/])
|
|
|
|
|
|
|
|
dnl Help line for database path
|
|
|
|
AC_ARG_WITH(db-path,
|
|
|
|
AC_HELP_STRING([--with-db-path=path], [Set the location of pacman's database]),
|
|
|
|
[dbpath=$withval], [dbpath=var/lib/pacman/])
|
|
|
|
|
|
|
|
dnl Help line for cache directory
|
|
|
|
AC_ARG_WITH(cache-dir,
|
|
|
|
AC_HELP_STRING([--with-cache-dir=path], [Set the location of pacman's cache directory]),
|
|
|
|
[cachedir=$withval], [cachedir=var/cache/pacman/pkg/])
|
|
|
|
|
|
|
|
dnl Help line for lock file
|
|
|
|
AC_ARG_WITH(lock-file,
|
|
|
|
AC_HELP_STRING([--with-lock-file=path], [Set the location of pacman's lock file]),
|
|
|
|
[lockfile=$withval], [lockfile=var/run/pacman.lck])
|
2006-10-15 15:38:02 -04:00
|
|
|
|
2007-02-21 23:36:02 -05:00
|
|
|
dnl Help line for config file
|
|
|
|
AC_ARG_WITH(config-file,
|
2007-02-22 16:34:51 -05:00
|
|
|
AC_HELP_STRING([--with-config-file=path], [Set the location of pacman's config file]),
|
2007-03-29 03:47:34 -04:00
|
|
|
[configfile=$withval], [configfile=etc/pacman.conf])
|
|
|
|
|
|
|
|
dnl 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])
|
|
|
|
|
|
|
|
dnl 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
|
|
|
|
AC_ARG_ENABLE(doxygen,
|
|
|
|
AC_HELP_STRING([--disable-doxygen], [Build API docs via Doxygen]),
|
|
|
|
[wantdoxygen=$enableval], [wantdoxygen=yes])
|
2007-02-21 23:36:02 -05:00
|
|
|
|
|
|
|
dnl Help line for debug
|
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
AC_HELP_STRING([--enable-debug], [Enable debugging support]),
|
|
|
|
[debug=$enableval], [debug=no])
|
|
|
|
|
2007-02-22 16:34:51 -05:00
|
|
|
dnl Host-dependant flags
|
2007-02-21 23:36:02 -05:00
|
|
|
case "${host}" in
|
|
|
|
*-*-cygwin*)
|
2007-03-29 02:46:36 -04:00
|
|
|
CFLAGS="$CFLAGS -DCYGWIN"
|
2007-02-21 23:36:02 -05:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2006-10-15 15:38:02 -04:00
|
|
|
dnl Check for architecture
|
2007-02-21 23:36:02 -05:00
|
|
|
case "${host}" in
|
|
|
|
i686-*)
|
2006-10-15 15:38:02 -04:00
|
|
|
CARCH="i686"
|
|
|
|
CARCHFLAGS="i686"
|
2007-02-12 20:25:26 -05:00
|
|
|
ARCHSWITCH="march"
|
2006-10-15 15:38:02 -04:00
|
|
|
;;
|
2007-02-21 23:36:02 -05:00
|
|
|
x86_64-*)
|
2006-10-15 15:38:02 -04:00
|
|
|
CARCH="x86_64"
|
2007-02-12 19:57:08 -05:00
|
|
|
CARCHFLAGS="x86-64"
|
2007-02-12 20:25:26 -05:00
|
|
|
ARCHSWITCH="march"
|
2006-10-15 15:38:02 -04:00
|
|
|
;;
|
2007-02-21 23:36:02 -05:00
|
|
|
ia64-*)
|
2006-10-15 15:38:02 -04:00
|
|
|
CARCH="ia64"
|
|
|
|
CARCHFLAGS="ia64"
|
2007-02-12 20:25:26 -05:00
|
|
|
ARCHSWITCH="march"
|
2006-10-15 15:38:02 -04:00
|
|
|
;;
|
2007-02-21 23:36:02 -05:00
|
|
|
sparc-*)
|
2006-10-15 15:38:02 -04:00
|
|
|
CARCH="sparc"
|
|
|
|
CARCHFLAGS="v9"
|
2007-02-12 20:25:26 -05:00
|
|
|
ARCHSWITCH="mcpu"
|
2006-10-15 15:38:02 -04:00
|
|
|
;;
|
|
|
|
ppc-* | powerpc-*)
|
|
|
|
CARCH="ppc"
|
|
|
|
CARCHFLAGS="750"
|
2007-02-12 20:25:26 -05:00
|
|
|
ARCHSWITCH="mcpu"
|
2006-10-15 15:38:02 -04:00
|
|
|
;;
|
2007-02-21 23:36:02 -05:00
|
|
|
i386-*)
|
2006-10-15 15:38:02 -04:00
|
|
|
CARCH="i386"
|
|
|
|
CARCHFLAGS="i386"
|
2007-02-12 20:25:26 -05:00
|
|
|
ARCHSWITCH="march"
|
2006-10-15 15:38:02 -04:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_ERROR([Your architecture is not supported])
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2007-02-21 23:36:02 -05:00
|
|
|
dnl Now do some things common to all architectures
|
|
|
|
CHOST="${host}"
|
2006-10-15 15:38:02 -04:00
|
|
|
AC_SUBST(CARCH)
|
|
|
|
AC_SUBST(CARCHFLAGS)
|
2007-02-12 20:25:26 -05:00
|
|
|
AC_SUBST(ARCHSWITCH)
|
2006-10-15 15:38:02 -04:00
|
|
|
AC_SUBST(CHOST)
|
2005-10-17 14:52:43 -04:00
|
|
|
|
2007-02-22 16:34:51 -05:00
|
|
|
dnl Humor lowers blood pressure
|
|
|
|
AC_MSG_CHECKING(your blood pressure)
|
|
|
|
AC_MSG_RESULT([a bit high, but we can proceed])
|
|
|
|
|
2006-02-17 15:48:45 -05:00
|
|
|
dnl Check for doxygen support
|
2007-02-21 23:36:02 -05:00
|
|
|
AC_MSG_CHECKING(for doxygen)
|
|
|
|
if test "x$wantdoxygen" = "xyes" ; then
|
2006-10-15 19:36:29 -04:00
|
|
|
AC_CHECK_PROGS([DOXYGEN], [doxygen])
|
2006-02-17 15:48:45 -05:00
|
|
|
if test $DOXYGEN ; then
|
2007-02-21 23:36:02 -05:00
|
|
|
AC_MSG_RESULT(yes)
|
2007-02-22 16:34:51 -05:00
|
|
|
usedoxygen=yes
|
2006-02-17 15:48:45 -05:00
|
|
|
else
|
2007-02-21 23:36:02 -05:00
|
|
|
AC_MSG_RESULT(no, doxygen missing)
|
2007-02-22 16:34:51 -05:00
|
|
|
usedoxygen=no
|
2006-02-17 15:48:45 -05:00
|
|
|
fi
|
|
|
|
else
|
2007-02-21 23:36:02 -05:00
|
|
|
AC_MSG_RESULT(no, disabled by configure)
|
2007-02-22 16:34:51 -05:00
|
|
|
usedoxygen=no
|
2005-10-17 14:52:43 -04:00
|
|
|
fi
|
2007-02-22 16:34:51 -05:00
|
|
|
AM_CONDITIONAL(HAS_DOXYGEN, test "x$usedoxygen" = "xyes")
|
2005-10-17 14:52:43 -04:00
|
|
|
|
2006-10-15 15:38:02 -04:00
|
|
|
dnl Check for math
|
2007-01-25 21:13:16 -05:00
|
|
|
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!");
|
2006-09-28 16:51:33 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
dnl Check for libarchive
|
|
|
|
AC_CHECK_LIB([archive], [archive_read_data], [AC_CHECK_HEADER([archive.h], [LIBARCHIVE='-larchive'])])
|
2007-01-25 21:13:16 -05:00
|
|
|
if test -z "$LIBARCHIVE"; then
|
2006-10-15 15:38:02 -04:00
|
|
|
AC_MSG_ERROR("libarchive is needed to compile pacman!");
|
|
|
|
fi
|
|
|
|
|
2006-12-28 11:54:35 -05:00
|
|
|
dnl Check for libdownload
|
|
|
|
AC_CHECK_LIB([download], [downloadParseURL], [AC_CHECK_HEADER([download.h], [LIBDOWNLOAD='-ldownload'])])
|
2007-01-25 21:13:16 -05:00
|
|
|
if test -z "$LIBDOWNLOAD"; then
|
2006-12-28 11:54:35 -05:00
|
|
|
AC_MSG_ERROR("libdownload is needed to compile pacman!");
|
|
|
|
fi
|
|
|
|
|
2006-10-15 15:38:02 -04:00
|
|
|
dnl Enable or disable debug code
|
|
|
|
AC_MSG_CHECKING(for debug mode request)
|
2007-02-22 16:34:51 -05:00
|
|
|
if test "x$debug" = "xyes" ; then
|
|
|
|
AC_DEFINE([PACMAN_DEBUG], , [Enable debug code])
|
2007-02-24 15:25:45 -05:00
|
|
|
CFLAGS="$CFLAGS -g -Wall -Werror -fstack-protector -std=c99"
|
2006-11-07 11:32:48 -05:00
|
|
|
LDFLAGS="$LDFLAGS -lmcheck"
|
2006-10-15 15:38:02 -04:00
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
else
|
2006-10-31 11:00:30 -05:00
|
|
|
CFLAGS="$CFLAGS -Wall -std=c99"
|
2006-10-15 15:38:02 -04:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
|
2007-03-29 03:47:34 -04:00
|
|
|
dnl Set root directory
|
|
|
|
AC_DEFINE_UNQUOTED([PM_ROOT], "$rootdir", [Location of pacman's default root directory])
|
|
|
|
|
|
|
|
dnl Set database path
|
|
|
|
AC_DEFINE_UNQUOTED([PM_DBPATH], "$dbpath", [Location of pacman database])
|
|
|
|
|
|
|
|
dnl Set cache directory
|
|
|
|
AC_DEFINE_UNQUOTED([PM_CACHEDIR], "$cachedir", [Location of pacman's package cache])
|
|
|
|
|
|
|
|
dnl Set lock file location
|
|
|
|
AC_DEFINE_UNQUOTED([PM_LOCK], "$lockfile", [Location of pacman lock file])
|
|
|
|
|
|
|
|
dnl Set configuration file location
|
|
|
|
AC_DEFINE_UNQUOTED([PM_CONF], "$configfile", [Location of pacman configuration file])
|
|
|
|
|
|
|
|
dnl Set package file extension
|
|
|
|
AC_DEFINE_UNQUOTED([PM_EXT_PKG], "$pkgext", [The file extension used by pacman packages])
|
|
|
|
|
|
|
|
dnl Set database file extension
|
|
|
|
AC_DEFINE_UNQUOTED([PM_EXT_DB], "$dbext", [The file extension used by pacman databases])
|
|
|
|
|
2007-03-31 20:07:37 -04:00
|
|
|
dnl Set up localedir substitution, double eval to get full path
|
|
|
|
localedir="$(eval echo ${localedir})"
|
|
|
|
LOCALEDIR="$(eval echo ${localedir})"
|
|
|
|
AC_SUBST(LOCALEDIR)
|
|
|
|
|
2005-10-17 14:52:43 -04:00
|
|
|
dnl ==========================================================================
|
|
|
|
|
|
|
|
AC_OUTPUT([
|
|
|
|
lib/libalpm/Makefile
|
2006-06-28 01:37:15 -04:00
|
|
|
lib/libalpm/po/Makefile.in
|
2005-10-17 14:52:43 -04:00
|
|
|
src/pacman/Makefile
|
2006-06-28 01:37:15 -04:00
|
|
|
src/pacman/po/Makefile.in
|
2005-10-17 14:52:43 -04:00
|
|
|
src/util/Makefile
|
|
|
|
scripts/Makefile
|
2007-03-28 17:46:14 -04:00
|
|
|
scripts/makepkg
|
2005-10-17 14:52:43 -04:00
|
|
|
doc/Makefile
|
2006-10-15 15:38:02 -04:00
|
|
|
etc/Makefile
|
2006-11-20 04:10:23 -05:00
|
|
|
etc/makepkg.conf
|
|
|
|
etc/pacman.conf
|
2006-10-15 15:38:02 -04:00
|
|
|
etc/pacman.d/Makefile
|
2006-12-28 11:54:35 -05:00
|
|
|
etc/pacman.d/mirrorlist
|
2006-12-19 02:49:51 -05:00
|
|
|
etc/abs/Makefile
|
2007-02-22 16:34:51 -05:00
|
|
|
pactest/Makefile
|
2007-02-22 21:00:30 -05:00
|
|
|
contrib/Makefile
|
2005-10-17 14:52:43 -04:00
|
|
|
Makefile
|
|
|
|
])
|
|
|
|
|
|
|
|
echo "
|
|
|
|
pacman-$VERSION:
|
2006-10-15 15:38:02 -04:00
|
|
|
|
2007-02-22 16:34:51 -05:00
|
|
|
prefix : ${prefix}
|
|
|
|
source code location : ${srcdir}
|
|
|
|
compiler : ${CC}
|
|
|
|
compiler flags : ${CFLAGS}
|
|
|
|
defines : ${DEFS}
|
2006-10-15 15:38:02 -04:00
|
|
|
|
2007-02-22 16:34:51 -05:00
|
|
|
Architecture : ${CARCH}
|
|
|
|
Architecture flags : -${ARCHSWITCH}=${CARCHFLAGS}
|
|
|
|
Host Type : ${CHOST}
|
2006-02-17 15:48:45 -05:00
|
|
|
|
2007-02-22 16:34:51 -05:00
|
|
|
libalpm version : ${LIB_VERSION}
|
|
|
|
pacman version : ${PACKAGE_VERSION}
|
2006-10-15 15:38:02 -04:00
|
|
|
|
2007-03-29 03:47:34 -04:00
|
|
|
Directory and file information:
|
|
|
|
root directory : ${rootdir}
|
|
|
|
database path : ${rootdir}${dbpath}
|
|
|
|
cache directory : ${rootdir}${cachedir}
|
|
|
|
lock file location : ${rootdir}${lockfile}
|
|
|
|
conf file location : ${rootdir}${configfile}
|
|
|
|
package extension : ${pkgext}
|
|
|
|
database extension : ${dbext}
|
|
|
|
|
|
|
|
Compilation options:
|
2007-02-22 16:34:51 -05:00
|
|
|
Doxygen support : ${usedoxygen}
|
|
|
|
debug support : ${debug}
|
2005-10-17 14:52:43 -04:00
|
|
|
"
|