Permalink
Browse files

build-sys: change --localstatedir to /run

Enable user to define where run state files are wrote.  Default for
these files is /run.  See reference for rationale why /var/run is no
longer the default.

Reference: http://lists.fedoraproject.org/pipermail/devel/2011-March/150031.html
CC: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
  • Loading branch information...
1 parent faebdd9 commit 07a16b9d1e5a48550a0d19abb9a900853433ffa2 @kerolasa kerolasa committed with Jun 23, 2012
Showing with 17 additions and 2 deletions.
  1. +2 −2 Makefile.am
  2. +15 −0 configure.ac
View
4 Makefile.am
@@ -1,8 +1,8 @@
-
AM_CPPFLAGS = \
-include config.h \
-I$(top_srcdir)/include \
- -DLOCALEDIR=\"$(localedir)\"
+ -DLOCALEDIR=\"$(localedir)\" \
+ -D_PATH_LOCALSTATEDIR=\"${localstatedir}\"
AM_CFLAGS = -fsigned-char $(WARN_CFLAGS)
AM_LDFLAGS =
View
15 configure.ac
@@ -60,6 +60,21 @@ NONE:NONE | NONE:/usr | /usr:*)
esac ;;
esac
+case $prefix:$localstatedir in
+ NONE:'${prefix}/var')
+ localstatedir=/run
+ AC_MSG_NOTICE([ --localstatedir defaults to /run])
+ ;;
+ *:'${prefix}/var')
+ localstatedir=${prefix}/run
+ ;;
+ NONE:*)
+ ;;
+ *:*)
+ localstatedir=${prefix}/${localstatedir}
+ ;;
+esac
+
libdirname=`basename "$libdir"`
AC_SUBST([libdirname])

0 comments on commit 07a16b9

Please sign in to comment.