summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgreg@kroah.com <greg@kroah.com>2004-02-03 00:51:51 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:32:25 -0700
commit977083c253a6c7ec282f1cf36c496ee280dbf069 (patch)
treed96c100588e6e646dc3dfd62af2472466b470466
parentc7e2a0bc082321bceea7ac86fa6e1a42bcc91072 (diff)
[PATCH] add KERNEL_DIR option so that the distros will be happy
Based on a patch from Svetoslav Slavtchev <svetljo@gmx.de>
-rw-r--r--Makefile13
-rw-r--r--README10
-rw-r--r--extras/multipath/Makefile4
-rw-r--r--extras/multipath/libdevmapper/Makefile2
-rw-r--r--klibc/MCONFIG2
5 files changed, 20 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index dd2f697591..e1846dd4c0 100644
--- 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 26032c35dc..c63912101a 100644
--- 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
+
diff --git a/extras/multipath/Makefile b/extras/multipath/Makefile
index 3f13532e16..0aac146a87 100644
--- a/extras/multipath/Makefile
+++ b/extras/multipath/Makefile
@@ -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)
diff --git a/extras/multipath/libdevmapper/Makefile b/extras/multipath/libdevmapper/Makefile
index b160075416..a05a31e85a 100644
--- a/extras/multipath/libdevmapper/Makefile
+++ b/extras/multipath/libdevmapper/Makefile
@@ -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
diff --git a/klibc/MCONFIG b/klibc/MCONFIG
index ed7755b382..8b5da4154b 100644
--- a/klibc/MCONFIG
+++ b/klibc/MCONFIG
@@ -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