Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./configure --prefix=/usr tries to install logs in /usr/var/log, fails installation ("missing operand") #35

Closed
lbeltrame opened this issue Sep 15, 2021 · 6 comments
Labels

Comments

@lbeltrame
Copy link

Describe the bug
When configuring with --prefix=/usr, the Makefile is set up in a way that will try to create the log directory in /usr/var/log rather than /var/log. It will also fail (see output).

To Reproduce
Steps to reproduce the behavior:

  1. ./configure --prefix=/usr
  2. make
  3. sudo make install

Expected behavior
Installation should finish and not try to create bogus directories.

Environment (please complete the following information):

  • openSUSE Tumbleweed

Additional context

# sudo make install
[...]
 /usr/bin/mkdir -p '/usr/bin'
  /bin/sh ./libtool   --mode=install /usr/bin/install -c x52cli x52test x52evtest x52d '/usr/bin'
libtool: install: /usr/bin/install -c .libs/x52cli /usr/bin/x52cli
libtool: install: /usr/bin/install -c .libs/x52test /usr/bin/x52test
libtool: install: /usr/bin/install -c .libs/x52evtest /usr/bin/x52evtest
libtool: install: /usr/bin/install -c .libs/x52d /usr/bin/x52d
make  install-exec-hook
make[3]: Entering directory '/home/lb/Download/Sources/x52pro-linux'
/usr/bin/mkdir -p /usr/var/log
/usr/bin/mkdir -p 
/usr/bin/mkdir: missing operand
Try '/usr/bin/mkdir --help' for more information.
@lbeltrame lbeltrame added the bug label Sep 15, 2021
@lbeltrame
Copy link
Author

The issue in Makefile (unfortunately I can't speak autotools):

install-exec-hook:
	$(MKDIR_P) $(DESTDIR)$(localstatedir)/log
	$(MKDIR_P) $(DESTDIR)$(runstatedir)

localstatedir is seen as a subdirectory of DESTDIR (but may not be), and runstatedir is undefined.

@lbeltrame
Copy link
Author

That's because in some autotools version, runstatedir is not defined, see troglobit/sysklogd#6 for context, for example.

nirenjan added a commit that referenced this issue Sep 15, 2021
`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`.
@nirenjan
Copy link
Owner

Thank you for the bug report. I've pushed a fix to the mouse-support branch, and should be able to get it into master once that branch is tested.

@nirenjan
Copy link
Owner

For what it's worth, autoconf defaults localstatedir to $(prefix)/var. I've also updated the build instructions to reflect that.

@lbeltrame
Copy link
Author

I confirm that the issue is no longer present in mouse-support as I've been obviously been able to test that.

@nirenjan
Copy link
Owner

Fix merged to master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants