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

udev is a hard dependency #30

Closed
wdlkmpx opened this issue Aug 12, 2019 · 2 comments
Closed

udev is a hard dependency #30

wdlkmpx opened this issue Aug 12, 2019 · 2 comments

Comments

@wdlkmpx
Copy link

wdlkmpx commented Aug 12, 2019

In slackware 14.0 (old distro), udev is not detected.

I get this error

checking for UDEV... no
configure: error: Package requirements (udev) were not met:

No package 'udev' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables UDEV_CFLAGS
and UDEV_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

udev is version 182... i can't disable udev. In NEWS i read:

  • Include udev rule file for automatic managing of packet writing devices

I don't need that udev rule, but this requirement is preventing ./configure from succeeding.. that's wrong.

This is how it should be:

the build system detects whether udev is installed, if it's not installed it should silently continue disabling udev-specific code .. --enable-udev/--disable-udev should be used to enforce or ignore udev.

@pali
Copy link
Owner

pali commented Aug 12, 2019

pkg-config is searching for udev package, not libudev. To check if you have really installed udev development files, search for file udev.pc (not libudev.pc).

But you are right that build system should work even when udev is not installed. Whole udftools works correctly without udev installed or running in system.

Could you try following patch if it allows you to build udftools without udev?

diff --git a/configure.ac b/configure.ac
index 63bef62..d71fee8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -25,7 +25,8 @@ AC_C_BIGENDIAN
 AC_SYS_LARGEFILE
 
 PKG_PROG_PKG_CONFIG
-PKG_CHECK_MODULES(UDEV, [udev], [ac_cv_udevdir=`$PKG_CONFIG --variable=udevdir udev`])
+PKG_CHECK_MODULES(UDEV, [udev], [ac_cv_udevdir=`$PKG_CONFIG --variable=udevdir udev`], [ac_cv_udevdir=""])
+AM_CONDITIONAL(UDEVDIR, [test "$ac_cv_udevdir" != ""])
 AC_SUBST(UDEVDIR, $ac_cv_udevdir)
 
 dnl Checks for library functions.
diff --git a/pktsetup/Makefile.am b/pktsetup/Makefile.am
index 0c5fd1c..2d0882f 100644
--- a/pktsetup/Makefile.am
+++ b/pktsetup/Makefile.am
@@ -2,9 +2,13 @@ sbin_PROGRAMS = pktsetup
 pktsetup_SOURCES = pktsetup.c
 EXTRA_DIST = pktsetup.rules
 
+if UDEVDIR
+
 install-data-local:
 	mkdir -p "$(DESTDIR)$(UDEVDIR)/rules.d"
 	$(INSTALL_DATA) "$(srcdir)/pktsetup.rules" "$(DESTDIR)$(UDEVDIR)/rules.d/80-pktsetup.rules"
 
 uninstall-local:
-	rm -f "$(DESTDIR)$(UDEVDIR)/rules.d/80-pktsetup.rules"
+	$(RM) "$(DESTDIR)$(UDEVDIR)/rules.d/80-pktsetup.rules"
+
+endif

@wdlkmpx
Copy link
Author

wdlkmpx commented Aug 12, 2019

Yes that fixes the issue. udftools compiles and works fine. Thanks

@pali pali closed this as completed in 2fbd6e8 Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants