public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Define vardbdir relative to prefix
@ 2011-07-01 10:42 Andreas Schwab
  2011-07-01 23:29 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Schwab @ 2011-07-01 10:42 UTC (permalink / raw)
  To: libc-hacker

2011-07-01  Andreas Schwab  <schwab@redhat.com>

	* configure.in (libc_cv_rootsbindir): Substitute.
	* configure: Regenerate.
	* config.make.in (localstatedir): Define.
	* Makeconfig (localstatedir): Define.
	(vardbdir): Use $(localstatedir).
	* sysdeps/unix/sysv/linux/configure.in (libc_cv_localstatedir):
	Set to /var by default.
	* sysdeps/unix/sysv/linux/configure: Regenerate.
---
 Makeconfig                           |    9 ++++++++-
 config.make.in                       |    1 +
 configure                            |    3 +++
 configure.in                         |    2 ++
 sysdeps/unix/sysv/linux/configure    |    5 +++++
 sysdeps/unix/sysv/linux/configure.in |    5 +++++
 6 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/Makeconfig b/Makeconfig
index 1110811..8a6cd8b 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -291,9 +291,16 @@ sysconfdir = $(prefix)/etc
 endif
 inst_sysconfdir = $(install_root)$(sysconfdir)
 
+# Where to install data files which the programs modify
+# while they run, and that pertain to one specific machine.
+ifndef localstatedir
+localstatedir = $(prefix)/var
+endif
+inst_localstatedir = $(install_root)$(localstatedir)
+
 # Directory for the database files and Makefile for nss_db.
 ifndef vardbdir
-vardbdir = /var/db
+vardbdir = $(localstatedir)/db
 endif
 inst_vardbdir = $(install_root)$(vardbdir)
 
diff --git a/config.make.in b/config.make.in
index 0656b1b..1606b17 100644
--- a/config.make.in
+++ b/config.make.in
@@ -18,6 +18,7 @@ rootsbindir = @libc_cv_rootsbindir@
 infodir = @infodir@
 includedir = @includedir@
 datarootdir = @datarootdir@
+localstatedir = @libc_cv_localstatedir@
 
 # Should we use and build ldconfig?
 use-ldconfig = @use_ldconfig@
diff --git a/configure b/configure
index 20e7340..9e5c47b 100755
--- a/configure
+++ b/configure
@@ -627,6 +627,7 @@ libc_cv_cc_avx
 libc_cv_cc_sse4
 libc_cv_cpp_asm_debuginfo
 libc_cv_forced_unwind
+libc_cv_localstatedir
 libc_cv_rootsbindir
 libc_cv_sysconfdir
 libc_cv_localedir
@@ -7646,6 +7647,7 @@ sizeof_long_double=$ac_cv_sizeof_long_double
 use_ldconfig=no
 ldd_rewrite_script=no
 libc_cv_sysconfdir=$sysconfdir
+libc_cv_localstatedir=$localstatedir
 libc_cv_gcc_unwind_find_fde=no
 libc_cv_idn=no
 
@@ -7708,6 +7710,7 @@ fi
 
 
 
+
 if test $elf = yes; then
   $as_echo "#define HAVE_ELF 1" >>confdefs.h
 
diff --git a/configure.in b/configure.in
index f2b3921..127161c 100644
--- a/configure.in
+++ b/configure.in
@@ -2175,6 +2175,7 @@ AC_SUBST(sizeof_long_double)
 use_ldconfig=no
 ldd_rewrite_script=no
 libc_cv_sysconfdir=$sysconfdir
+libc_cv_localstatedir=$localstatedir
 libc_cv_gcc_unwind_find_fde=no
 libc_cv_idn=no
 
@@ -2219,6 +2220,7 @@ AC_SUBST(libc_cv_slibdir)
 AC_SUBST(libc_cv_localedir)
 AC_SUBST(libc_cv_sysconfdir)
 AC_SUBST(libc_cv_rootsbindir)
+AC_SUBST(libc_cv_localstatedir)
 AC_SUBST(libc_cv_forced_unwind)
 
 dnl sysdeps/CPU/configure.in checks set this via arch-specific asm tests
diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index d05bd13..7ed7489 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -430,6 +430,11 @@ case "$prefix" in
   else
     libc_cv_sysconfdir=$sysconfdir
    fi
+  if test $localstatedir = '${prefix}/var'; then
+    libc_cv_localstatedir=/var
+  else
+    libc_cv_localstatedir=$localstatedir
+  fi
   libc_cv_rootsbindir="/sbin"
   ;;
 esac
diff --git a/sysdeps/unix/sysv/linux/configure.in b/sysdeps/unix/sysv/linux/configure.in
index 8f00407..8bb8508 100644
--- a/sysdeps/unix/sysv/linux/configure.in
+++ b/sysdeps/unix/sysv/linux/configure.in
@@ -169,6 +169,11 @@ case "$prefix" in
   else
     libc_cv_sysconfdir=$sysconfdir
    fi
+  if test $localstatedir = '${prefix}/var'; then
+    libc_cv_localstatedir=/var
+  else
+    libc_cv_localstatedir=$localstatedir
+  fi
   libc_cv_rootsbindir="/sbin"
   ;;
 esac
-- 
1.7.6


-- 
Andreas Schwab, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84  5EC7 45C6 250E 6F00 984E
"And now for something completely different."

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Define vardbdir relative to prefix
  2011-07-01 10:42 [PATCH] Define vardbdir relative to prefix Andreas Schwab
@ 2011-07-01 23:29 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2011-07-01 23:29 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: libc-hacker

On Fri, Jul 1, 2011 at 06:42, Andreas Schwab <schwab@redhat.com> wrote:
> +# Where to install data files which the programs modify
> +# while they run, and that pertain to one specific machine.
> +ifndef localstatedir
> +localstatedir = $(prefix)/var
> +endif
> +inst_localstatedir = $(install_root)$(localstatedir)
> +
>  # Directory for the database files and Makefile for nss_db.
>  ifndef vardbdir
> -vardbdir = /var/db
> +vardbdir = $(localstatedir)/db

This doesn't work because the db files are always searched for in
/var/db.  This is why the Makefiles are as they are now.

What is the reason for this proposed change?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-01 23:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-01 10:42 [PATCH] Define vardbdir relative to prefix Andreas Schwab
2011-07-01 23:29 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).