Support --sysconfdir in configure to specify path to configuration files
The default value is ${prefix}/etc/qemu. --sysconfdir can be used to override
the default to an absolute path. The expectation is that when installed to
/usr, --sysconfdir=/etc/qemu will be used.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
diff --git a/configure b/configure
index 5631bbb..379b536 100755
--- a/configure
+++ b/configure
@@ -32,6 +32,7 @@
prefix=""
interp_prefix="/usr/gnemul/qemu-%M"
static="no"
+sysconfdir=""
sparc_cpu=""
cross_prefix=""
cc="gcc"
@@ -453,6 +454,8 @@
;;
--static) static="yes"
;;
+ --sysconfdir) sysconfdir="$optarg"
+ ;;
--disable-sdl) sdl="no"
;;
--enable-sdl) sdl="yes"
@@ -686,6 +689,7 @@
echo " --make=MAKE use specified make [$make]"
echo " --install=INSTALL use specified install [$install]"
echo " --static enable static build [$static]"
+echo " --sysconfdir=PATH install config in PATH"
echo " --enable-debug-tcg enable TCG debugging"
echo " --disable-debug-tcg disable TCG debugging (default)"
echo " --enable-debug enable common debug build options"
@@ -1828,8 +1832,12 @@
fi
mansuffix=""
datasuffix=""
+ confsuffix=""
docsuffix=""
binsuffix=""
+ if test -z "$sysconfdir" ; then
+ sysconfdir="${prefix}"
+ fi
else
if test -z "$prefix" ; then
prefix="/usr/local"
@@ -1838,6 +1846,9 @@
datasuffix="/share/qemu"
docsuffix="/share/doc/qemu"
binsuffix="/bin"
+ if test -z "$sysconfdir" ; then
+ sysconfdir="${prefix}/etc"
+ fi
fi
echo "Install prefix $prefix"
@@ -1914,6 +1925,11 @@
echo >> $config_host_mak
echo "CONFIG_QEMU_SHAREDIR=\"$prefix$datasuffix\"" >> $config_host_mak
+if test "$mingw32" = "yes" ; then
+ echo "CONFIG_QEMU_CONFDIR=\"$sysconfdir\"" >> $config_host_mak
+else
+ echo "CONFIG_QEMU_CONFDIR=\"${sysconfdir}/qemu\"" >> $config_host_mak
+fi
case "$cpu" in
i386|x86_64|alpha|cris|hppa|ia64|m68k|microblaze|mips|mips64|ppc|ppc64|s390|s390x|sparc|sparc64)
@@ -2159,6 +2175,7 @@
echo "bindir=\${prefix}$binsuffix" >> $config_host_mak
echo "mandir=\${prefix}$mansuffix" >> $config_host_mak
echo "datadir=\${prefix}$datasuffix" >> $config_host_mak
+echo "sysconfdir=$sysconfdir" >> $config_host_mak
echo "docdir=\${prefix}$docsuffix" >> $config_host_mak
echo "MAKE=$make" >> $config_host_mak
echo "INSTALL=$install" >> $config_host_mak