Use $(localstatedir)/run instead of $(runstatedir)

`runstatedir` is only available in Autoconf 2.70, but unless the
distribution is a bleeding edge system, it most likely uses Autoconf
2.69. That said, several major distributions have backported runstatedir
support to the older versions, hiding the issue. See #35.

This change replaces all references to runstatedir to use
$localstatedir/run instead, which is what is recommended by the autoconf
manual.

This also updates the build instructions to add --localstatedir and
--sysconfdir. This is because the lack of the options would have them
default to `$(prefix)/var` and `$(prefix)/etc` respectively, and with
prefix set to `/usr`, these would be the bogus directories `/usr/var`
and `/usr/etc`.
reverse-scroll
nirenjan 2021-09-15 09:06:31 -07:00
parent 8deb6a1513
commit 16e53b897f
2 changed files with 6 additions and 3 deletions

View File

@ -46,10 +46,13 @@ You will also need the `cmocka` package to run the unit tests.
2. Run autogen.sh 2. Run autogen.sh
3. Run the following commands: 3. Run the following commands:
``` ```
./configure --prefix=/usr ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc
make && sudo make install make && sudo make install
``` ```
You may want to remove or edit the `--prefix=/usr` option, most users prefer
non-distro binaries in `/usr/local` (default without `--prefix`) or `/opt`.
## Configuration options ## Configuration options
### udev ### udev

View File

@ -26,7 +26,7 @@ x52d_CFLAGS = \
-DSYSCONFDIR=\"$(sysconfdir)\" \ -DSYSCONFDIR=\"$(sysconfdir)\" \
-DLOCALEDIR=\"$(localedir)\" \ -DLOCALEDIR=\"$(localedir)\" \
-DLOGDIR=\"$(localstatedir)/log\" \ -DLOGDIR=\"$(localstatedir)/log\" \
-DRUNDIR=\"$(runstatedir)\" \ -DRUNDIR=\"$(localstatedir)/run\" \
@PTHREAD_CFLAGS@ $(WARN_CFLAGS) @PTHREAD_CFLAGS@ $(WARN_CFLAGS)
x52d_LDFLAGS = @PTHREAD_LIBS@ $(WARN_LDFLAGS) x52d_LDFLAGS = @PTHREAD_LIBS@ $(WARN_LDFLAGS)
@ -51,7 +51,7 @@ x52dconf_DATA = daemon/x52d.conf
install-exec-hook: install-exec-hook:
$(MKDIR_P) $(DESTDIR)$(localstatedir)/log $(MKDIR_P) $(DESTDIR)$(localstatedir)/log
$(MKDIR_P) $(DESTDIR)$(runstatedir) $(MKDIR_P) $(DESTDIR)$(localstatedir)/run
EXTRA_DIST += \ EXTRA_DIST += \
daemon/daemon.dox \ daemon/daemon.dox \