aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2013-07-04 16:01:55 -0300
committerLucas De Marchi <lucas.demarchi@intel.com>2013-07-04 16:08:10 -0300
commitb6adccd6ff819b8befc48ede41a13f2201dce443 (patch)
tree6709556fe6d0e908a54873592c48dcdfd8d922f9
parent3b38c7fcb58be4ddc34f90454c5f5dc3693d2d85 (diff)
downloadkmod-b6adccd6ff819b8befc48ede41a13f2201dce443.tar.gz
tools: Do not link dynamically with libkmod
Instead of linking dynamically with libkmod, use libkmod-private.la. We disallow creating a static libkmod because we can't hide symbols there and it cause problems with external programs. However this should not prevent users that are only interested in the tools we provide not being able to ship only them keeping the library alone. Other projects also do this to allow our tools to use certain functions that should not be used outside of the project.
-rw-r--r--Makefile.am13
-rw-r--r--testsuite/test-depmod.c2
-rw-r--r--testsuite/test-modinfo.c2
-rw-r--r--testsuite/test-modprobe.c14
4 files changed, 13 insertions, 18 deletions
diff --git a/Makefile.am b/Makefile.am
index c165868..6cff044 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -104,8 +104,8 @@ uninstall-hook:
if BUILD_TOOLS
bin_PROGRAMS = tools/kmod
-noinst_SCRIPTS = tools/test/insmod tools/test/rmmod tools/test/lsmod \
- tools/test/modprobe tools/test/modinfo tools/test/depmod
+noinst_SCRIPTS = tools/insmod tools/rmmod tools/lsmod \
+ tools/modprobe tools/modinfo tools/depmod
tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/lsmod.c \
tools/rmmod.c tools/insmod.c \
@@ -113,14 +113,9 @@ tools_kmod_SOURCES = tools/kmod.c tools/kmod.h tools/lsmod.c \
tools/depmod.c tools/log.h tools/log.c \
tools/static-nodes.c
tools_kmod_LDADD = libkmod/libkmod-util.la \
- libkmod/libkmod.la
+ libkmod/libkmod-private.la
-noinst_PROGRAMS = tools/test/kmod
-tools_test_kmod_SOURCES = $(tools_kmod_SOURCES)
-tools_test_kmod_LDADD = libkmod/libkmod-util.la \
- libkmod/libkmod-private.la
-
-${noinst_SCRIPTS}: tools/test/kmod
+${noinst_SCRIPTS}: tools/kmod
$(AM_V_GEN) ($(RM) $@; \
$(LN_S) $(notdir $<) $@)
endif
diff --git a/testsuite/test-depmod.c b/testsuite/test-depmod.c
index 64eb027..0ea8982 100644
--- a/testsuite/test-depmod.c
+++ b/testsuite/test-depmod.c
@@ -31,7 +31,7 @@
#define MODULES_ORDER_LIB_MODULES MODULES_ORDER_ROOTFS "/lib/modules/" MODULES_ORDER_UNAME
static __noreturn int depmod_modules_order_for_compressed(const struct test *t)
{
- const char *progname = ABS_TOP_BUILDDIR "/tools/test/depmod";
+ const char *progname = ABS_TOP_BUILDDIR "/tools/depmod";
const char *const args[] = {
progname,
NULL,
diff --git a/testsuite/test-modinfo.c b/testsuite/test-modinfo.c
index 430e7ad..c5934ea 100644
--- a/testsuite/test-modinfo.c
+++ b/testsuite/test-modinfo.c
@@ -28,7 +28,7 @@
static __noreturn int modinfo_jonsmodules(const struct test *t)
{
- const char *progname = ABS_TOP_BUILDDIR "/tools/test/modinfo";
+ const char *progname = ABS_TOP_BUILDDIR "/tools/modinfo";
const char *const args[] = {
progname,
"/ext4-i686.ko", "/ext4-ppc64.ko", "/ext4-s390x.ko",
diff --git a/testsuite/test-modprobe.c b/testsuite/test-modprobe.c
index e4a3243..cc90dae 100644
--- a/testsuite/test-modprobe.c
+++ b/testsuite/test-modprobe.c
@@ -28,7 +28,7 @@
static __noreturn int modprobe_show_depends(const struct test *t)
{
- const char *progname = ABS_TOP_BUILDDIR "/tools/test/modprobe";
+ const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
const char *const args[] = {
progname,
"--show-depends", "btusb",
@@ -50,7 +50,7 @@ static DEFINE_TEST(modprobe_show_depends,
static __noreturn int modprobe_show_depends2(const struct test *t)
{
- const char *progname = ABS_TOP_BUILDDIR "/tools/test/modprobe";
+ const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
const char *const args[] = {
progname,
"--show-depends", "psmouse",
@@ -73,7 +73,7 @@ static DEFINE_TEST(modprobe_show_depends2,
static __noreturn int modprobe_show_alias_to_none(const struct test *t)
{
- const char *progname = ABS_TOP_BUILDDIR "/tools/test/modprobe";
+ const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
const char *const args[] = {
progname,
"--show-depends", "--ignore-install", "--quiet", "psmouse",
@@ -96,7 +96,7 @@ static DEFINE_TEST(modprobe_show_alias_to_none,
static __noreturn int modprobe_builtin(const struct test *t)
{
- const char *progname = ABS_TOP_BUILDDIR "/tools/test/modprobe";
+ const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
const char *const args[] = {
progname,
"unix",
@@ -115,7 +115,7 @@ static DEFINE_TEST(modprobe_builtin,
static __noreturn int modprobe_softdep_loop(const struct test *t)
{
- const char *progname = ABS_TOP_BUILDDIR "/tools/test/modprobe";
+ const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
const char *const args[] = {
progname,
"bluetooth",
@@ -135,7 +135,7 @@ static DEFINE_TEST(modprobe_softdep_loop,
static __noreturn int modprobe_install_cmd_loop(const struct test *t)
{
- const char *progname = ABS_TOP_BUILDDIR "/tools/test/modprobe";
+ const char *progname = ABS_TOP_BUILDDIR "/tools/modprobe";
const char *const args[] = {
progname,
"snd-pcm",
@@ -153,7 +153,7 @@ static DEFINE_TEST(modprobe_install_cmd_loop,
[TC_INIT_MODULE_RETCODES] = "",
},
.env_vars = (const struct keyval[]) {
- { "MODPROBE", ABS_TOP_BUILDDIR "/tools/test/modprobe" },
+ { "MODPROBE", ABS_TOP_BUILDDIR "/tools/modprobe" },
{ }
},
);