[PATCH] add KERNEL_DIR option so that the distros will be happy

Based on a patch from Svetoslav Slavtchev <svetljo@gmx.de>
This commit is contained in:
greg@kroah.com 2004-02-03 00:51:51 -08:00 committed by Greg KH
parent c7e2a0bc08
commit 977083c253
5 changed files with 20 additions and 11 deletions

View file

@ -41,6 +41,9 @@ LOCAL_CFG_DIR = etc/udev
HOTPLUG_EXEC = $(ROOT) HOTPLUG_EXEC = $(ROOT)
DESTDIR = DESTDIR =
KERNEL_DIR = /lib/modules/${shell uname -r}/build
# override this to make udev look in a different location for it's config files # override this to make udev look in a different location for it's config files
prefix = prefix =
exec_prefix = ${prefix} exec_prefix = ${prefix}
@ -135,7 +138,8 @@ ifeq ($(strip $(USE_KLIBC)),true)
KLIBC_BASE = $(PWD)/klibc KLIBC_BASE = $(PWD)/klibc
KLIBC_DIR = $(KLIBC_BASE)/klibc KLIBC_DIR = $(KLIBC_BASE)/klibc
INCLUDE_DIR := $(KLIBC_DIR)/include 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 include $(KLIBC_DIR)/arch/$(ARCH)/MCONFIG
# arch specific objects # arch specific objects
ARCH_LIB_OBJS = \ ARCH_LIB_OBJS = \
@ -169,7 +173,10 @@ CFLAGS += -I$(PWD)/libsysfs
all: $(ROOT) $(SENDER) $(UDEVD) $(HELPER) all: $(ROOT) $(SENDER) $(UDEVD) $(HELPER)
@extras="$(EXTRAS)" ; for target in $$extras ; do \ @extras="$(EXTRAS)" ; for target in $$extras ; do \
echo $$target ; \ echo $$target ; \
$(MAKE) prefix=$(prefix) LD="$(LD)" SYSFS="$(SYSFS)" \ $(MAKE) prefix=$(prefix) \
LD="$(LD)" \
SYSFS="$(SYSFS)" \
KERNEL_DIR="$(KERNEL_DIR)" \
-C $$target $@ ; \ -C $$target $@ ; \
done ; \ done ; \
@ -178,7 +185,7 @@ $(ROOT): $(LIBC)
$(ARCH_LIB_OBJS) : $(CRT0) $(ARCH_LIB_OBJS) : $(CRT0)
$(CRT0): $(CRT0):
$(MAKE) -C klibc $(MAKE) -C klibc KERNEL_DIR=$(KERNEL_DIR)
TDB = tdb/tdb.o \ TDB = tdb/tdb.o \
tdb/spinlock.o tdb/spinlock.o

10
README
View file

@ -52,15 +52,16 @@ To use:
DEBUG DEBUG
if set to 'true', debugging messages will be sent to the syslog if set to 'true', debugging messages will be sent to the syslog
as udev is run. Default value is 'false'. 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 So, if you want to build udev using klibc with debugging messages, you
would do: would do:
make USE_KLIBC=true DEBUG=true 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: - Install the project:
make install make install
@ -95,3 +96,4 @@ greg@kroah.com

View file

@ -15,7 +15,7 @@ CC = gcc
GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"} GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \ CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
-I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \ -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 OBJS = main.o
CRT0 = ../../klibc/klibc/crt0.o CRT0 = ../../klibc/klibc/crt0.o
@ -32,7 +32,7 @@ SUBDIRS = libdevmapper
recurse: recurse:
@for dir in $(SUBDIRS); do\ @for dir in $(SUBDIRS); do\
$(MAKE) -C $$dir ; \ $(MAKE) KERNEL_DIR=$(KERNEL_DIR) -C $$dir ; \
done done
$(MAKE) $(EXEC) $(MAKE) $(EXEC)

View file

@ -10,7 +10,7 @@ CC = gcc
GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"} GCCINCDIR := ${shell $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \ CFLAGS = -pipe -g -O2 -Wall -Wunused -Wstrict-prototypes -nostdinc \
-I$(klibcdir)/klibc/include -I$(klibcdir)/klibc/include/bits32 \ -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 OBJS = ioctl/libdevmapper.o libdm-common.o

View file

@ -12,7 +12,7 @@ REQFLAGS = $(ARCHREQFLAGS) -nostdinc -iwithprefix include -I$(KLIBSRC) \
-I$(KLIBSRC)/arch/$(ARCH)/include \ -I$(KLIBSRC)/arch/$(ARCH)/include \
-I$(KLIBSRC)/include/bits$(BITSIZE) \ -I$(KLIBSRC)/include/bits$(BITSIZE) \
-D__KLIBC__ -DBITSIZE=$(BITSIZE) -I$(KLIBSRC)/include \ -D__KLIBC__ -DBITSIZE=$(BITSIZE) -I$(KLIBSRC)/include \
-I$(SRCROOT)/linux/include -I$(KERNEL_DIR)/include
LDFLAGS = LDFLAGS =
AR = $(CROSS)ar AR = $(CROSS)ar
RANLIB = $(CROSS)ranlib RANLIB = $(CROSS)ranlib