summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-12-14 06:23:08 +0100
committerAaron Griffin <aaron@archlinux.org>2006-12-14 06:23:08 +0100
commitb308f06a3a3d368c38b0d109b7e6c1c639127148 (patch)
treef37ea25991eac1bb7d4232db2973b6b2561843b2 /configure.ac
parentf45b3356f8edcd1c90048d2b59ccb4577d0dcf02 (diff)
downloadpacman-b308f06a3a3d368c38b0d109b7e6c1c639127148.tar.gz
pacman-b308f06a3a3d368c38b0d109b7e6c1c639127148.tar.xz
* Dan McGee's makepkg updates http://www.archlinux.org/pipermail/pacman-dev/2006-December/000792.html
* configure fixes (CFLAGS) * no-strict-aliasing hacks until full C99 compliance * --with-config-file configure option
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac26
1 files changed, 17 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 2c04978d..506204f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,5 @@
ENV_CFLAGS=$CFLAGS
+CFLAGS=""
AC_PREREQ(2.59)
dnl Update it right before the release since $pkgver_foo are all _post_ release snapshots
@@ -31,10 +32,6 @@ AC_SUBST(PM_MICRO_VERSION)
AC_SUBST(PM_VERSION)
AC_SUBST(PM_VERSION_INFO)
-dnl Define the default config file path for pacman.conf
-PACCONF=/etc/pacman.conf
-AC_DEFINE_UNQUOTED([PACCONF], ["$PACCONF"], [pacman.conf location])
-
dnl Put out version numbers to config.h
AC_DEFINE_UNQUOTED([PM_VERSION], ["$PM_VERSION"], [libalpm version number])
@@ -142,6 +139,11 @@ AC_SUBST(CARCHFLAGS)
AC_SUBST(MARCHFLAG)
AC_SUBST(CHOST)
+dnl Help line for config file
+AC_ARG_WITH(config-file,
+ AC_HELP_STRING([ --with-config-file=path], [Set the name and path for pacman's config file]),
+ [configfile=$withval], [configfile=/etc/pacman.conf])
+
dnl Help line for debug
AC_ARG_ENABLE(debug,
AC_HELP_STRING([ --enable-debug], [Enable debugging support]),
@@ -308,17 +310,25 @@ fi
dnl Check for libarchive
AC_CHECK_LIB([archive], [archive_read_data], [AC_CHECK_HEADER([archive.h], [LIBARCHIVE='-larchive'])])
if test -n "$LIBARCHIVE"; then
- CFLAGS="$CFLAGS"
LDFLAGS="$LDFLAGS $LIBARCHIVE"
else
AC_MSG_ERROR("libarchive is needed to compile pacman!");
fi
+dnl Set config location
+AC_MSG_CHECKING(for configuration file name)
+if test -n "$configfile"; then
+ CFLAGS="$CFLAGS -D'PACCONF=\"$configfile\"'"
+ AC_MSG_RESULT(["$configfile"])
+else
+ AC_MSG_ERROR(["pacman config file (--with-config-file is not set"])
+fi
+
dnl Enable or disable debug code
AC_MSG_CHECKING(for debug mode request)
if test x$debug = xyes ; then
AM_CONDITIONAL(PACMAN_DEBUG, test x$debug = xyes)
- CFLAGS="-g -Wall -Werror -std=c99 -DPACMAN_DEBUG"
+ CFLAGS="$CFLAGS -g -Wall -Werror -std=c99 -DPACMAN_DEBUG"
LDFLAGS="$LDFLAGS -lmcheck"
AC_MSG_RESULT(yes)
else
@@ -336,8 +346,6 @@ else
AC_MSG_RESULT(no)
fi
-CFLAGS="$CFLAGS"
-
dnl ==========================================================================
AC_OUTPUT([
@@ -371,7 +379,7 @@ pacman-$VERSION:
compiler flags : ${CFLAGS}
libalpm version : ${PM_VERSION}
- pacman.conf location : ${PACCONF}
+ pacman.conf location : ${configfile}
Architecture CARCH : ${CARCH}
Architecture used cflag : ${CARCHFLAGS}