]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
build-sys: do not create symlinks by default
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Sat, 21 Jan 2012 17:38:25 +0000 (15:38 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Sat, 21 Jan 2012 20:01:00 +0000 (18:01 -0200)
Distro packagers should create them instead. It's too much trouble to
create them in the build system and every distro wants a different path
for them.

Makefile.am
tools/.gitignore
tools/shortest-relpath.c [deleted file]

index 932d1ae3a041455b00403920262185411d76427e..0dd48ff19d581b6ef240a89880b30a0421d56a47 100644 (file)
@@ -97,18 +97,6 @@ install-exec-hook:
                ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \
                mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \
        fi
-if BUILD_TOOLS
-       ln -sf kmod $(DESTDIR)$(bindir)/insmod
-       ln -sf kmod $(DESTDIR)$(bindir)/rmmod
-       ln -sf kmod $(DESTDIR)$(bindir)/lsmod
-       ln -sf kmod $(DESTDIR)$(bindir)/modprobe
-       ln -sf kmod $(DESTDIR)$(bindir)/modinfo
-       ln -sf kmod $(DESTDIR)$(bindir)/depmod
-       $(MKDIR_P) $(DESTDIR)$(sbindir) && \
-               relpath=$$(tools/shortest-relpath $(DESTDIR)$(bindir)/kmod $(DESTDIR)$(sbindir)) && \
-               cd $(DESTDIR)$(sbindir) && \
-               ln -sf $$relpath modprobe
-endif
 
 uninstall-hook:
        rm -f $(DESTDIR)$(rootlibdir)/libkmod.so*
@@ -128,15 +116,13 @@ tools_kmod_CFLAGS = $(AM_CFLAGS)
 tools_kmod_LDADD = libkmod/libkmod-util.la \
                   libkmod/libkmod.la
 
-noinst_PROGRAMS = tools/kmod-nolib tools/shortest-relpath
+noinst_PROGRAMS = tools/kmod-nolib
 tools_kmod_nolib_SOURCES = $(tools_kmod_SOURCES)
 tools_kmod_nolib_CPPFLAGS = $(tools_kmod_CPPFLAGS)
 tools_kmod_nolib_CFLAGS = $(tools_kmod_CFLAGS)
 tools_kmod_nolib_LDADD = libkmod/libkmod-util.la \
                         libkmod/libkmod-private.la
 
-tools_shortest_relpath_SOURCES = tools/shortest-relpath.c
-
 ${noinst_SCRIPTS}: tools/kmod-nolib
        $(AM_V_GEN) ($(RM) $@; \
                $(LN_S) $(notdir $<) $@)
index a3a5795f66d95a8ac46a632b57f1e157bd9a4c65..041d7b22fabd9ee3e5c1b285079955865dc4f439 100644 (file)
@@ -7,4 +7,3 @@ modinfo
 depmod
 kmod
 kmod-nolib
-shortest-relpath
diff --git a/tools/shortest-relpath.c b/tools/shortest-relpath.c
deleted file mode 100644 (file)
index 5c960bb..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-#include <stdio.h>
-#include <limits.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-
-static void usage(const char *progname)
-{
-       printf("%s <path> <relative-to-path>\n", progname);
-}
-
-/*
- * path must be absolute path, as the result of calling realpath()
- */
-static void split_path(const char *path, char d[PATH_MAX], size_t *dlen,
-                                               char n[NAME_MAX], size_t *nlen)
-{
-       size_t dirnamelen, namelen;
-       char *p;
-
-       p = strrchr(path, '/'); /* p is never NULL since path is abs */
-       dirnamelen = p - path;
-       if (dirnamelen > 0)
-               memcpy(d, path, dirnamelen);
-       d[dirnamelen] = '\0';
-
-       namelen = strlen(p + 1);
-       if (namelen > 0)
-               memcpy(n, p + 1, namelen + 1);
-
-       if (dlen)
-               *dlen = dirnamelen;
-       if (nlen)
-               *nlen = namelen;
-}
-
-int main(int argc, char *argv[])
-{
-       size_t sympathlen, namelen, pathlen, i, j;
-       char name[NAME_MAX], path[PATH_MAX];
-       char sympath[PATH_MAX];
-       char buf[PATH_MAX];
-       char *p;
-
-       if (argc < 3) {
-               usage(basename(argv[0]));
-               return EXIT_FAILURE;
-       }
-
-       p = realpath(argv[1], buf);
-       if (p == NULL) {
-               fprintf(stderr, "could not get realpath of %s: %m\n", argv[1]);
-               return EXIT_FAILURE;
-       }
-       split_path(buf, path, &pathlen, name, &namelen);
-
-       p = realpath(argv[2], sympath);
-       if (p == NULL) {
-               fprintf(stderr, "could not get realpath of %s: %m\n", argv[2]);
-               return EXIT_FAILURE;
-       }
-       sympathlen = strlen(sympath);
-
-       for (i = 1; i < sympathlen && i < pathlen; i++) {
-               if (sympath[i] == path[i])
-                       continue;
-               break;
-       }
-
-       if (i < sympathlen) {
-               while (sympath[i - 1] != '/')
-                       i--;
-       }
-
-       p = &path[i];
-
-       j = 0;
-       if (i < sympathlen) {
-               memcpy(buf + j, "../", 3);
-               j += 3;
-       }
-
-       for (; i < sympathlen; i++) {
-               if (sympath[i] != '/')
-                       continue;
-
-               memcpy(buf + j, "../", 3);
-               j += 3;
-       }
-
-       if (p != path + pathlen) {
-               memcpy(buf + j, p, path + pathlen - p);
-               j += path + pathlen - p;;
-               buf[j++] = '/';
-       }
-       memcpy(buf + j, name, namelen + 1);
-
-       printf("%s\n", buf);
-       return 0;
-}