summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-03-29 09:47:34 +0200
committerDan McGee <dan@archlinux.org>2007-03-30 21:55:58 +0200
commitc3ad8bd75fbec09d60e2c681781034a1178999cc (patch)
tree45d41b625c9ddaac119080edc1ddb319b90065ee /configure.ac
parente9ee9045ff4e9dd2355cb0fea781d7e166f9b345 (diff)
downloadpacman-c3ad8bd75fbec09d60e2c681781034a1178999cc.tar.gz
pacman-c3ad8bd75fbec09d60e2c681781034a1178999cc.tar.xz
Make all paths and file locations configurable
Several important paths, file locations, and extensions were #define-d in the source code instead of being configurable. This moves all of these to the configure script where they can be picked upon running ./configure. We may later want to make some of these even more visible and move them to pacman.conf. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac81
1 files changed, 66 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac
index 81fce19b..5c16fbfe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,15 +35,45 @@ AC_CHECK_FUNCS([strverscmp])
AM_PROG_LIBTOOL
AM_CONDITIONAL(LINKSTATIC, test "$enable_static" = "yes")
-dnl Help line for doxygen
-AC_ARG_ENABLE(doxygen,
- AC_HELP_STRING([--disable-doxygen], [Build API docs via Doxygen]),
- [wantdoxygen=$enableval], [wantdoxygen=yes])
+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])
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])
+ [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])
dnl Help line for debug
AC_ARG_ENABLE(debug,
@@ -145,15 +175,6 @@ if test -z "$LIBDOWNLOAD"; then
AC_MSG_ERROR("libdownload is needed to compile pacman!");
fi
-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"])
-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
@@ -175,6 +196,27 @@ else
AC_MSG_RESULT(no)
fi
+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])
+
dnl ==========================================================================
AC_OUTPUT([
@@ -211,8 +253,17 @@ pacman-$VERSION:
libalpm version : ${LIB_VERSION}
pacman version : ${PACKAGE_VERSION}
- pacman.conf location : ${configfile}
+ 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:
Doxygen support : ${usedoxygen}
debug support : ${debug}
fakeroot-proof support : ${fakeroot}