chiark / gitweb /
[PATCH] add KERNEL_DIR option so that the distros will be happy
authorgreg@kroah.com <greg@kroah.com>
Tue, 3 Feb 2004 08:51:51 +0000 (00:51 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:32:25 +0000 (21:32 -0700)
Based on a patch from Svetoslav Slavtchev <svetljo@gmx.de>

Makefile
README
extras/multipath/Makefile
extras/multipath/libdevmapper/Makefile
klibc/MCONFIG

index dd2f697591dfcb452672c4e1ec8ff6cf36a08876..e1846dd4c06e50a0c3bba216d926ffed5a4bc36d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -41,6 +41,9 @@ LOCAL_CFG_DIR =       etc/udev
 HOTPLUG_EXEC = $(ROOT)
 
 DESTDIR =
+
+KERNEL_DIR = /lib/modules/${shell uname -r}/build
+
 # override this to make udev look in a different location for it's config files
 prefix =
 exec_prefix =  ${prefix}
@@ -135,7 +138,8 @@ ifeq ($(strip $(USE_KLIBC)),true)
        KLIBC_BASE      = $(PWD)/klibc
        KLIBC_DIR       = $(KLIBC_BASE)/klibc
        INCLUDE_DIR     := $(KLIBC_DIR)/include
-       LINUX_INCLUDE_DIR       := $(KLIBC_BASE)/linux/include
+       LINUX_INCLUDE_DIR       := $(KERNEL_DIR)/include
+#      LINUX_INCLUDE_DIR       := $(KLIBC_BASE)/linux/include
        include $(KLIBC_DIR)/arch/$(ARCH)/MCONFIG
        # arch specific objects
        ARCH_LIB_OBJS = \
@@ -169,7 +173,10 @@ CFLAGS += -I$(PWD)/libsysfs
 all: $(ROOT) $(SENDER) $(UDEVD) $(HELPER)
        @extras="$(EXTRAS)" ; for target in $$extras ; do \
                echo $$target ; \
-               $(MAKE) prefix=$(prefix) LD="$(LD)" SYSFS="$(SYSFS)" \
+               $(MAKE) prefix=$(prefix) \
+                       LD="$(LD)" \
+                       SYSFS="$(SYSFS)" \
+                       KERNEL_DIR="$(KERNEL_DIR)" \
                        -C $$target $@ ; \
        done ; \
 
@@ -178,7 +185,7 @@ $(ROOT): $(LIBC)
 $(ARCH_LIB_OBJS) : $(CRT0)
 
 $(CRT0):
-       $(MAKE) -C klibc
+       $(MAKE) -C klibc KERNEL_DIR=$(KERNEL_DIR)
 
 TDB =  tdb/tdb.o       \
        tdb/spinlock.o
diff --git a/README b/README
index 26032c35dcfe234cffb1d0e3ffacd9fd66840e5f..c63912101a403cfd91dc81adb84591220b56f0a2 100644 (file)
--- a/README
+++ b/README
@@ -52,15 +52,16 @@ To use:
        DEBUG
                if set to 'true', debugging messages will be sent to the syslog
                as udev is run.  Default value is 'false'.
+       KERNEL_DIR
+               If this is not set it will default to /lib/modules/`uname -r`/build
+               This is used if USE_KLIBC=true to find the kernel include
+               directory that klibc needs to build against.  This must be set
+               if you are not building udev while running a 2.6 kernel.
 
       So, if you want to build udev using klibc with debugging messages, you
       would do:
        make USE_KLIBC=true DEBUG=true
 
-      Note: If you want to use klibc, you will have to set up the "linux"
-            symlink properly.  See the file klibc/klibc/README and pay
-           attention to step "a)" there.
-
 - Install the project:
        make install
 
@@ -95,3 +96,4 @@ greg@kroah.com
 
 
 
+
index 3f13532e163510270f5bc2e98efcfce6e7581389..0aac146a8789781098c429a0f514f9162a27716e 100644 (file)
@@ -15,7 +15,7 @@ CC = gcc
 GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
 CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
          -I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \
-         -I$(GCCINCDIR) -I$(klibcdir)/linux/include -I$(sysfsdir) -I.
+         -I$(GCCINCDIR) -I$(KERNEL_DIR)/include -I$(sysfsdir) -I.
 
 OBJS = main.o
 CRT0 = ../../klibc/klibc/crt0.o
@@ -32,7 +32,7 @@ SUBDIRS = libdevmapper
 
 recurse:
        @for dir in $(SUBDIRS); do\
-       $(MAKE) -C $$dir ; \
+       $(MAKE) KERNEL_DIR=$(KERNEL_DIR) -C $$dir ; \
        done
        $(MAKE) $(EXEC)
 
index b1600754161035a3125c169a7a05e1e8e49ea194..a05a31e85af547845dd86d0cd6113a9358821a2d 100644 (file)
@@ -10,7 +10,7 @@ CC = gcc
 GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
 CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
          -I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \
-         -I$(GCCINCDIR) -I$(klibcdir)/linux/include -I. -Iioctl
+         -I$(GCCINCDIR) -I$(KERNEL_DIR)/include -I. -Iioctl
 
 OBJS = ioctl/libdevmapper.o libdm-common.o
 
index ed7755b3823264be00834879869be2a0f41baeec..8b5da4154ba6ac399621b3b0b599f5c1db3c49ed 100644 (file)
@@ -12,7 +12,7 @@ REQFLAGS = $(ARCHREQFLAGS) -nostdinc -iwithprefix include -I$(KLIBSRC) \
          -I$(KLIBSRC)/arch/$(ARCH)/include \
          -I$(KLIBSRC)/include/bits$(BITSIZE) \
          -D__KLIBC__ -DBITSIZE=$(BITSIZE) -I$(KLIBSRC)/include \
-         -I$(SRCROOT)/linux/include
+         -I$(KERNEL_DIR)/include
 LDFLAGS =
 AR      = $(CROSS)ar
 RANLIB  = $(CROSS)ranlib