summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2012-11-24 23:47:06 -0500
committerAnthony G. Basile <blueness@gentoo.org>2012-11-24 23:47:06 -0500
commit73e31d7ae73c257ef9892bc5d330c1d570ba5366 (patch)
treeea82745b36b2c90a9aae1fe8400a4658cb98d560
parent6cb86c3a330caedc323599cb11fbed4138958271 (diff)
Fix paths: test/udev-test.pl now works under sudo make distcheck
We move the test-udev.c and test-libudev.c from src/test to test. This corrects the a problem with hard coded relative paths finding the test/test/sys directory created by test/udev-test.pl. This commit draws heavily from nvinson patch in https://github.com/gentoo/eudev/pull/20 Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r--configure.ac30
-rw-r--r--hwdb/Makefile.am2
-rw-r--r--keymaps-force-release/Makefile.am2
-rw-r--r--keymaps/Makefile.am2
-rw-r--r--rules/Makefile.am2
-rw-r--r--src/Makefile.am3
-rw-r--r--src/accelerometer/Makefile.am2
-rw-r--r--src/ata_id/Makefile.am2
-rw-r--r--src/cdrom_id/Makefile.am2
-rw-r--r--src/collect/Makefile.am2
-rw-r--r--src/keymap/Makefile.am2
-rw-r--r--src/mtd_probe/Makefile.am2
-rw-r--r--src/scsi_id/Makefile.am2
-rw-r--r--src/test/Makefile.am39
-rw-r--r--src/udev/Makefile.am5
-rw-r--r--src/v4l_id/Makefile.am2
-rw-r--r--test/Makefile.am41
-rw-r--r--test/test-libudev.c (renamed from src/test/test-libudev.c)2
-rw-r--r--test/test-udev.c (renamed from src/test/test-udev.c)10
19 files changed, 77 insertions, 77 deletions
diff --git a/configure.ac b/configure.ac
index 17b0325d10..6b9130f8b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -348,12 +348,37 @@ AC_CONFIG_FILES([Makefile
src/libudev/libudev.pc
src/udev/Makefile
src/udev/udev.pc
- src/test/Makefile
test/Makefile])
-
AC_OUTPUT
+# ------------------------------------------------------------------------------
+
+AC_MSG_RESULT([
+ prefix: ${prefix}
+ exec_prefix: ${exec_prefix}
+ sysconf dir: ${sysconfdir}
+ datarootdir: ${datarootdir}
+ includedir: ${includedir}
+ libdir: ${libdir}
+
+ rootprefix: ${rootprefix}
+ rootlibdir: ${rootlibdir}
+ udevlibexecdir: ${udevlibexecdir}
+
+ udevconfdir: ${udevconfdir}
+ udevconffile: ${udevconffile}
+ udevhwdbdir: ${udevhwdbdir}
+ udevhwdbbin: ${udevhwdbbin}
+ udevkeymapdir: ${udevkeymapdir}
+ udevkeymapforceredir: ${udevkeymapforceredir}
+ udevrulesdir: ${udevrulesdir}
+
+ sharepkgconfigdir: ${sharepkgconfigdir}
+])
+
+# ------------------------------------------------------------------------------
+
dnl Set configured scripts executable
if test -f src/keymap/check-keymaps.sh; then
chmod +x src/keymap/check-keymaps.sh
@@ -362,3 +387,4 @@ fi
if test -f src/keymap/keyboard-force-release.sh; then
chmod +x src/keymap/keyboard-force-release.sh
fi
+
diff --git a/hwdb/Makefile.am b/hwdb/Makefile.am
index 076376dcb8..dd52ea6c7f 100644
--- a/hwdb/Makefile.am
+++ b/hwdb/Makefile.am
@@ -1,7 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-udevhwdbdir = @udevhwdbdir@
-
dist_udevhwdb_DATA = \
20-pci-vendor-product.hwdb \
20-pci-classes.hwdb \
diff --git a/keymaps-force-release/Makefile.am b/keymaps-force-release/Makefile.am
index 9f156bc126..1c4fb51499 100644
--- a/keymaps-force-release/Makefile.am
+++ b/keymaps-force-release/Makefile.am
@@ -1,7 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-udevkeymapforceredir = @udevkeymapforceredir@
-
dist_udevkeymapforcere_DATA = \
dell-touchpad \
dell-xps \
diff --git a/keymaps/Makefile.am b/keymaps/Makefile.am
index 98cc7e87d8..c809888062 100644
--- a/keymaps/Makefile.am
+++ b/keymaps/Makefile.am
@@ -1,7 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-udevkeymapdir = @udevkeymapdir@
-
KEYMAPS = \
acer \
acer-aspire_5720 \
diff --git a/rules/Makefile.am b/rules/Makefile.am
index c192c40ed4..6adbd6e469 100644
--- a/rules/Makefile.am
+++ b/rules/Makefile.am
@@ -1,7 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-udevrulesdir = @udevrulesdir@
-
dist_udevrules_DATA = \
42-usb-hid-pm.rules \
50-udev-default.rules \
diff --git a/src/Makefile.am b/src/Makefile.am
index 80097a31b3..abc6f40a06 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,8 +3,7 @@ ACLOCAL_AMFLAGS = -I m4
SUBDIRS = \
libudev \
udev \
- gudev \
- test
+ gudev
# Helper programs
SUBDIRS += \
diff --git a/src/accelerometer/Makefile.am b/src/accelerometer/Makefile.am
index 9c3e9903f8..0afa86f2cb 100644
--- a/src/accelerometer/Makefile.am
+++ b/src/accelerometer/Makefile.am
@@ -1,7 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-udevlibexecdir=@udevlibexecdir@
-
AM_CPPFLAGS = \
-I $(top_srcdir)/src/libudev \
-I $(top_srcdir)/src/udev
diff --git a/src/ata_id/Makefile.am b/src/ata_id/Makefile.am
index f57c90f2e9..d0c6a46e12 100644
--- a/src/ata_id/Makefile.am
+++ b/src/ata_id/Makefile.am
@@ -1,7 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-udevlibexecdir=@udevlibexecdir@
-
AM_CPPFLAGS = \
-I $(top_srcdir)/src/libudev \
-I $(top_srcdir)/src/udev
diff --git a/src/cdrom_id/Makefile.am b/src/cdrom_id/Makefile.am
index f4cd8b4d33..9466bd84a3 100644
--- a/src/cdrom_id/Makefile.am
+++ b/src/cdrom_id/Makefile.am
@@ -1,7 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-udevlibexecdir=@udevlibexecdir@
-
AM_CPPFLAGS = \
-I $(top_srcdir)/src/libudev \
-I $(top_srcdir)/src/udev
diff --git a/src/collect/Makefile.am b/src/collect/Makefile.am
index 37c502aec2..cdfe54d8a0 100644
--- a/src/collect/Makefile.am
+++ b/src/collect/Makefile.am
@@ -1,7 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-udevlibexecdir=@udevlibexecdir@
-
AM_CPPFLAGS = \
-I $(top_srcdir)/src/libudev \
-I $(top_srcdir)/src/udev
diff --git a/src/keymap/Makefile.am b/src/keymap/Makefile.am
index 3e3c90f854..b9a2010058 100644
--- a/src/keymap/Makefile.am
+++ b/src/keymap/Makefile.am
@@ -1,7 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-udevlibexecdir=@udevlibexecdir@
-
AM_CPPFLAGS = \
-I $(top_srcdir)/src/libudev \
-I $(top_srcdir)/src/udev \
diff --git a/src/mtd_probe/Makefile.am b/src/mtd_probe/Makefile.am
index a0af39e642..bf081d68ba 100644
--- a/src/mtd_probe/Makefile.am
+++ b/src/mtd_probe/Makefile.am
@@ -1,7 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-udevlibexecdir=@udevlibexecdir@
-
udevlibexec_PROGRAMS = \
mtd_probe
diff --git a/src/scsi_id/Makefile.am b/src/scsi_id/Makefile.am
index 058855ff3c..cb30e73e1a 100644
--- a/src/scsi_id/Makefile.am
+++ b/src/scsi_id/Makefile.am
@@ -1,7 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-udevlibexecdir=@udevlibexecdir@
-
AM_CPPFLAGS = \
-DVERSION \
-I $(top_srcdir)/src/libudev \
diff --git a/src/test/Makefile.am b/src/test/Makefile.am
deleted file mode 100644
index 642e7c2efe..0000000000
--- a/src/test/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-
-AM_CPPFLAGS = \
- -DVERSION \
- -DCLONE_NEWNS \
- -I $(top_srcdir)/src/libudev \
- -I $(top_srcdir)/src/udev
-
-noinst_PROGRAMS = \
- test-libudev \
- test-udev
-
-test_libudev_SOURCES = \
- test-libudev.c
-
-test_libudev_LDADD = \
- $(top_builddir)/src/libudev/libudev-private.la \
- $(top_builddir)/src/udev/libudev-core.la
-
-test_libudev_CPPFLAGS = \
- -I $(top_srcdir)/src/libudev \
- $(AM_CPPFLAGS)
-
-test_udev_SOURCES = \
- test-udev.c
-
-test_udev_LDADD = \
- $(top_builddir)/src/libudev/libudev-private.la \
- $(top_builddir)/src/udev/libudev-core.la \
- $(BLKID_LIBS) \
- $(SELINUX_LIBS)
-
-if HAVE_LIBKMOD
-test_udev_LDADD += $(KMOD_LIBS)
-endif
-
-test_udev_CPPFLAGS = \
- -I $(top_srcdir)/src/udev \
- $(AM_CPPFLAGS)
diff --git a/src/udev/Makefile.am b/src/udev/Makefile.am
index 6e85181ae2..6f2de14cff 100644
--- a/src/udev/Makefile.am
+++ b/src/udev/Makefile.am
@@ -1,8 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-rootprefix = @rootprefix@
-udevlibexecdir = @udevlibexecdir@
-
AM_CPPFLAGS = \
-include $(top_builddir)/config.h \
-DMODPROBE=\"$(MODPROBE)\" \
@@ -135,11 +132,9 @@ libudev_core_la_CPPFLAGS = \
#
# Extras
#
-udevconfdir = @udevconfdir@
dist_udevconf_DATA = \
udev.conf
-sharepkgconfigdir = @sharepkgconfigdir@
sharepkgconfig_DATA = \
udev.pc
diff --git a/src/v4l_id/Makefile.am b/src/v4l_id/Makefile.am
index 6542598259..074417f909 100644
--- a/src/v4l_id/Makefile.am
+++ b/src/v4l_id/Makefile.am
@@ -1,7 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
-udevlibexecdir=@udevlibexecdir@
-
udevlibexec_PROGRAMS = \
v4l_id
diff --git a/test/Makefile.am b/test/Makefile.am
index ab3b68e4a6..954b93bcfb 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,5 +1,44 @@
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
+
+AM_CPPFLAGS = \
+ -DVERSION=\"@VERSION@\" \
+ -I $(top_srcdir)/src/libudev \
+ -I $(top_srcdir)/src/udev
+
+noinst_PROGRAMS = \
+ test-libudev \
+ test-udev
+
+test_libudev_SOURCES = \
+ test-libudev.c
+
+test_libudev_LDADD = \
+ $(top_builddir)/src/libudev/libudev-private.la \
+ $(top_builddir)/src/udev/libudev-core.la
+
+test_libudev_CPPFLAGS = \
+ -I $(top_srcdir)/src/libudev \
+ $(AM_CPPFLAGS)
+
+test_udev_SOURCES = \
+ test-udev.c
+
+test_udev_LDADD = \
+ $(top_builddir)/src/libudev/libudev-private.la \
+ $(top_builddir)/src/udev/libudev-core.la \
+ $(BLKID_LIBS) \
+ $(SELINUX_LIBS)
+
+if HAVE_LIBKMOD
+test_udev_LDADD += $(KMOD_LIBS)
+endif
+
+test_udev_CPPFLAGS = \
+ -I $(top_srcdir)/src/udev \
+ $(AM_CPPFLAGS)
+
+
TESTS = \
udev-test.pl \
rules-test.sh
@@ -9,7 +48,7 @@ check_DATA = \
test/sys:
$(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)tar -C $(top_builddir)/test/ -xJf $(top_srcdir)/test/sys.tar.xz
+ $(AM_V_GEN)tar -C $(top_builddir)/test/test -xJf $(top_srcdir)/test/sys.tar.xz
test-sys-distclean:
-rm -rf $(top_builddir)/test/sys
diff --git a/src/test/test-libudev.c b/test/test-libudev.c
index 84254333d2..caa3b4d14c 100644
--- a/src/test/test-libudev.c
+++ b/test/test-libudev.c
@@ -489,7 +489,7 @@ int main(int argc, char *argv[])
printf("--debug --syspath= --subsystem= --help\n");
goto out;
case 'V':
- printf("%i\n", VERSION);
+ printf("%s\n", VERSION);
goto out;
default:
goto out;
diff --git a/src/test/test-udev.c b/test/test-udev.c
index 8f2aee4a47..26e173de63 100644
--- a/src/test/test-udev.c
+++ b/test/test-udev.c
@@ -40,6 +40,11 @@
static inline int unshare (int x) { return syscall(SYS_unshare, x); }
#endif
+#ifndef _USE_GNU
+/* Make sure CLONE_NEWNS macro is available */
+#include <linux/sched.h>
+#endif
+
void udev_main_log(struct udev *udev, int priority,
const char *file, int line, const char *fn,
const char *format, va_list args) {}
@@ -54,7 +59,6 @@ static int fake_filesystems(void) {
{ "test/dev", "/dev", "failed to mount test /dev" },
{ "test/run", "/run", "failed to mount test /run" },
{ "test/run", "/etc/udev/rules.d", "failed to mount empty /etc/udev/rules.d" },
- { "test/run", "/usr/lib/udev/rules.d", "failed to mount empty /usr/lib/udev/rules.d" },
};
unsigned int i;
int err;
@@ -73,7 +77,7 @@ static int fake_filesystems(void) {
}
for (i = 0; i < ELEMENTSOF(fakefss); i++) {
- err = mount(fakefss[i].src, fakefss[i].target, NULL, MS_BIND, NULL);
+ err = mount(fakefss[i].src, fakefss[i].target, "tmpfs", MS_BIND, NULL);
if (err < 0) {
err = -errno;
fprintf(stderr, "%s %m", fakefss[i].error);
@@ -104,7 +108,7 @@ int main(int argc, char *argv[])
udev = udev_new();
if (udev == NULL)
exit(EXIT_FAILURE);
- log_debug("version %i\n", VERSION);
+ log_debug("version %s\n", VERSION);
label_init("/dev");
sigprocmask(SIG_SETMASK, NULL, &sigmask_orig);