diff mbox

[3/3] configure: make full config dir path configurable

Message ID 1332168446-9322-4-git-send-email-ehabkost@redhat.com
State New
Headers show

Commit Message

Eduardo Habkost March 19, 2012, 2:47 p.m. UTC
Instead of hardcoding $sysconfdir/qemu, let the user choose the full
path.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 configure |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

Comments

Anthony Liguori March 19, 2012, 3:13 p.m. UTC | #1
On 03/19/2012 09:47 AM, Eduardo Habkost wrote:
> Instead of hardcoding $sysconfdir/qemu, let the user choose the full
> path.
>
> Signed-off-by: Eduardo Habkost<ehabkost@redhat.com>
> ---
>   configure |   15 ++++++++++-----
>   1 files changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/configure b/configure
> index 8b4e3c1..98027c1 100755
> --- a/configure
> +++ b/configure
> @@ -162,6 +162,7 @@ libdir="\${prefix}/lib"
>   includedir="\${prefix}/include"
>   sysconfdir="\${prefix}/etc"
>   confsuffix="/qemu"
> +fullconfdir=""
>   slirp="yes"
>   fmod_lib=""
>   fmod_inc=""
> @@ -595,6 +596,8 @@ for opt do
>     ;;
>     --sysconfdir=*) sysconfdir="$optarg"
>     ;;
> +  --confdir=*) fullconfdir="$optarg"
> +  ;;
>     --sbindir=*|--libexecdir=*|--sharedstatedir=*|--localstatedir=*|\
>     --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\
>     --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*)
> @@ -1010,7 +1013,8 @@ echo "  --mandir=PATH            install man pages in PATH"
>   echo "  --datadir=PATH           install firmware in PATH"
>   echo "  --docdir=PATH            install documentation in PATH"
>   echo "  --bindir=PATH            install binaries in PATH"
> -echo "  --sysconfdir=PATH        install config in PATH/qemu"
> +echo "  --sysconfdir=PATH        install config in PATH$confsuffix"
> +echo "  --confdir=PATH           install config in PATH (overrides --sysconfdir)"

These semantics seem odd to me, is this similar to what autotools does?  I think 
that's what we're trying to match here.

Regards,

Anthony Liguori
Paolo Bonzini March 19, 2012, 3:40 p.m. UTC | #2
Il 19/03/2012 16:13, Anthony Liguori ha scritto:
>>
>> -echo "  --sysconfdir=PATH        install config in PATH/qemu"
>> +echo "  --sysconfdir=PATH        install config in PATH$confsuffix"
>> +echo "  --confdir=PATH           install config in PATH (overrides
>> --sysconfdir)"
> 
> These semantics seem odd to me, is this similar to what autotools does? 

No, autotools don't have confdir at all.

This stuff is outside the scope of autotools.  The latest fad is to look
for files in /usr/share/PACKAGE/foo (or /usr/lib, depending on whether
they depend on the host arch---for QEMU they shouldn't),
/etc/PACKAGE/foo and ~/.local/share/PACKAGE/foo.  That's likely what we
should do here (except perhaps ~/.local): start with --datadir and
--sysconfdir, tack /qemu at the end and look in the two resulting
directories.

Paolo
diff mbox

Patch

diff --git a/configure b/configure
index 8b4e3c1..98027c1 100755
--- a/configure
+++ b/configure
@@ -162,6 +162,7 @@  libdir="\${prefix}/lib"
 includedir="\${prefix}/include"
 sysconfdir="\${prefix}/etc"
 confsuffix="/qemu"
+fullconfdir=""
 slirp="yes"
 fmod_lib=""
 fmod_inc=""
@@ -595,6 +596,8 @@  for opt do
   ;;
   --sysconfdir=*) sysconfdir="$optarg"
   ;;
+  --confdir=*) fullconfdir="$optarg"
+  ;;
   --sbindir=*|--libexecdir=*|--sharedstatedir=*|--localstatedir=*|\
   --oldincludedir=*|--datarootdir=*|--infodir=*|--localedir=*|\
   --htmldir=*|--dvidir=*|--pdfdir=*|--psdir=*)
@@ -1010,7 +1013,8 @@  echo "  --mandir=PATH            install man pages in PATH"
 echo "  --datadir=PATH           install firmware in PATH"
 echo "  --docdir=PATH            install documentation in PATH"
 echo "  --bindir=PATH            install binaries in PATH"
-echo "  --sysconfdir=PATH        install config in PATH/qemu"
+echo "  --sysconfdir=PATH        install config in PATH$confsuffix"
+echo "  --confdir=PATH           install config in PATH (overrides --sysconfdir)"
 echo "  --enable-debug-tcg       enable TCG debugging"
 echo "  --disable-debug-tcg      disable TCG debugging (default)"
 echo "  --enable-debug           enable common debug build options"
@@ -2830,7 +2834,9 @@  if test "$mingw32" = "yes" ; then
     done
 fi
 
-confdir=$sysconfdir$confsuffix
+if [ -z "$fullconfdir" ];then
+	fullconfdir=$sysconfdir$confsuffix
+fi
 
 tools=
 if test "$softmmu" = yes ; then
@@ -2869,7 +2875,7 @@  echo "BIOS directory    `eval echo $datadir`"
 echo "binary directory  `eval echo $bindir`"
 echo "library directory `eval echo $libdir`"
 echo "include directory `eval echo $includedir`"
-echo "config directory  `eval echo $sysconfdir`"
+echo "config directory  `eval echo $fullconfdir`"
 if test "$mingw32" = "no" ; then
 echo "Manual directory  `eval echo $mandir`"
 echo "ELF interp prefix $interp_prefix"
@@ -2974,9 +2980,8 @@  echo "libdir=$libdir" >> $config_host_mak
 echo "includedir=$includedir" >> $config_host_mak
 echo "mandir=$mandir" >> $config_host_mak
 echo "datadir=$datadir" >> $config_host_mak
-echo "sysconfdir=$sysconfdir" >> $config_host_mak
 echo "docdir=$docdir" >> $config_host_mak
-echo "confdir=$confdir" >> $config_host_mak
+echo "confdir=$fullconfdir" >> $config_host_mak
 echo "libexecdir=\${prefix}/libexec" >> $config_host_mak
 echo "CONFIG_QEMU_SHAREDIR=\"$prefix$datasuffix\"" >> $config_host_mak
 echo "CONFIG_QEMU_HELPERDIR=\"$prefix/libexec\"" >> $config_host_mak