Usually when basedir is /usr, what we *really* want is for sysconfdir and localstatedir to be /etc and /var, *not* /usr/etc and /usr/var. This patch makes it that way. It can still be manually overridden (with "--sysconfdir /usr/etc --localstatedir /usr/var") if required. --- configure.ac | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac index 0d0a4c7..9fd8607 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,17 @@ AC_CHECK_HEADER([pthread.h], LIBS="-lpthread $LIBS" ])])
+dnl if --prefix is /usr, don't use /usr/var for localstatedir +dnl or /usr/etc for sysconfdir +dnl as this makes a lot of things break in testing situations + +if test "$prefix" = "/usr" && test "$localstatedir" = '${prefix}/var' ; then + localstatedir='/var' +fi +if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then + sysconfdir='/etc' +fi + AC_OUTPUT(Makefile \ gnulib/lib/Makefile \ gnulib/tests/Makefile \
On Fri, May 13, 2011 at 03:17:08AM -0400, Laine Stump wrote:
Usually when basedir is /usr, what we *really* want is for sysconfdir and localstatedir to be /etc and /var, *not* /usr/etc and /usr/var. This patch makes it that way. It can still be manually overridden (with "--sysconfdir /usr/etc --localstatedir /usr/var") if required.
configure.ac | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac index 0d0a4c7..9fd8607 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,17 @@ AC_CHECK_HEADER([pthread.h], LIBS="-lpthread $LIBS" ])])
+dnl if --prefix is /usr, don't use /usr/var for localstatedir +dnl or /usr/etc for sysconfdir +dnl as this makes a lot of things break in testing situations
+if test "$prefix" = "/usr" && test "$localstatedir" = '${prefix}/var' ; then
- localstatedir='/var'
+fi +if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then
- sysconfdir='/etc'
+fi
AC_OUTPUT(Makefile \ gnulib/lib/Makefile \ gnulib/tests/Makefile \
We have the same in libvirt, and yes that avoids a lot of confusion May I also suggest to put in the --system flag from libvirt autogen.sh in netcf' one too, the two are useful for the same scenario,
ACK
Daniel
Daniel Veillard writes:
We have the same in libvirt, and yes that avoids a lot of confusion May I also suggest to put in the --system flag from libvirt autogen.sh in netcf' one too, the two are useful for the same scenario,
You mean like this?
libvirt uses --system as handy shortcut to specify the standard system locations of prefix, libdir, sysconfdir, and localstatedir. It works so well there, we might as well have it in netcf's autogen.sh too. --- autogen.sh | 28 ++++++++++++++++++++++++++-- 1 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/autogen.sh b/autogen.sh index 425c7b1..fba12e3 100755 --- a/autogen.sh +++ b/autogen.sh @@ -30,7 +30,31 @@ srcdir=`dirname $0` test -z "$srcdir" && srcdir=.
THEDIR=`pwd` -cd $srcdir +cd "$srcdir" + +test -f src/netcf.c || { + echo "You must run this script in the top-level libvirt directory" + exit 1 +} + +EXTRA_ARGS= +if test "x$1" = "x--system"; then + shift + prefix=/usr + libdir=$prefix/lib + sysconfdir=/etc + localstatedir=/var + if [ -d /usr/lib64 ]; then + libdir=$prefix/lib64 + fi + EXTRA_ARGS="--prefix=$prefix --sysconfdir=$sysconfdir --localstatedir=$localstatedir --libdir=$libdir" + echo "Running ./configure with $EXTRA_ARGS $@" +else + if test -z "$*" && test ! -f "$THEDIR/config.status"; then + echo "I am going to run ./configure with no arguments - if you wish " + echo "to pass any to it, please specify them on the $0 command line." + fi +fi
# Split out options for bootstrap and for configure declare -a CF_ARGS @@ -99,7 +123,7 @@ if test x$OBJ_DIR != x; then cd "$OBJ_DIR" fi
-$srcdir/configure "${CF_ARGS[@]}" && { +"$srcdir/configure" $EXTRA_ARGS "${CF_ARGS[@]}" && { echo echo "Now type 'make' to compile $package." }
On Fri, May 13, 2011 at 08:10:41AM -0400, Laine Stump wrote:
Daniel Veillard writes:
We have the same in libvirt, and yes that avoids a lot of confusion May I also suggest to put in the --system flag from libvirt autogen.sh in netcf' one too, the two are useful for the same scenario,
You mean like this?
libvirt uses --system as handy shortcut to specify the standard system locations of prefix, libdir, sysconfdir, and localstatedir. It works so well there, we might as well have it in netcf's autogen.sh too.
Yup, exactly :-)
Daniel
On 05/13/2011 04:42 AM, Daniel Veillard wrote:
On Fri, May 13, 2011 at 03:17:08AM -0400, Laine Stump wrote:
Usually when basedir is /usr, what we *really* want is for sysconfdir and localstatedir to be /etc and /var, *not* /usr/etc and /usr/var. This patch makes it that way. It can still be manually overridden (with "--sysconfdir /usr/etc --localstatedir /usr/var") if required.
configure.ac | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac index 0d0a4c7..9fd8607 100644 --- a/configure.ac +++ b/configure.ac @@ -46,6 +46,17 @@ AC_CHECK_HEADER([pthread.h], LIBS="-lpthread $LIBS" ])])
+dnl if --prefix is /usr, don't use /usr/var for localstatedir +dnl or /usr/etc for sysconfdir +dnl as this makes a lot of things break in testing situations
+if test "$prefix" = "/usr"&& test "$localstatedir" = '${prefix}/var' ; then
- localstatedir='/var'
+fi +if test "$prefix" = "/usr"&& test "$sysconfdir" = '${prefix}/etc' ; then
- sysconfdir='/etc'
+fi
- AC_OUTPUT(Makefile \ gnulib/lib/Makefile \ gnulib/tests/Makefile \
We have the same in libvirt, and yes that avoids a lot of confusion May I also suggest to put in the --system flag from libvirt autogen.sh in netcf' one too, the two are useful for the same scenario,
ACK
Thanks. I've pushed this, as well as the patch to add --system to autogen.sh.
netcf-devel@lists.fedorahosted.org