* [patch] allow builds of extras programs under udev
@ 2003-12-05 23:33 Patrick Mansfield
0 siblings, 0 replies; only message in thread
From: Patrick Mansfield @ 2003-12-05 23:33 UTC (permalink / raw)
To: linux-hotplug
This patch against udev (bitkeeper version as of sometime Dec 4) enables
the building of the "extras" programs using the same build environment as
udev (i.e. build with udev's versions of klibc and sysfsutils).
It does not pass down clean, install, or uninstall targets to the extras
programs.
The current scsi_id under udev won't build with this patch, use the
scsi_id 0.2 I just posted.
Build scsi_id and udev via:
make EXTRAS=extras/scsi_id
Build scsi_id and udev with klibc via:
make KLIBC=true EXTRAS=extras/scsi_id
=== Makefile 1.47 vs edited ==--- 1.47/Makefile Thu Dec 4 11:21:04 2003
+++ edited/Makefile Fri Dec 5 15:30:28 2003
@@ -42,6 +42,9 @@
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
+# To build any of the extras programs, run with:
+# make EXTRAS="extras/a extras/b"
+EXTRAS
# place to put our device nodes
udevdir = ${prefix}/udev/
@@ -62,6 +65,8 @@
export CROSS CC AR STRIP RANLIB
+export CFLAGS LDFLAGS SYSFS LIB_OBJS ARCH_LIB_OBJS CRT0
+
# code taken from uClibc to determine the current arch
ARCH := ${shell $(CC) -dumpmachine | sed -e s'/-.*//' -e 's/i.86/i386/' -e 's/sparc.*/sparc/' \
-e 's/arm.*/arm/g' -e 's/m68k.*/m68k/' -e 's/powerpc/ppc/g'}
@@ -108,20 +113,20 @@
# If we are using our version of klibc, then we need to build and link it.
# Otherwise, use glibc and link statically.
ifeq ($(strip $(KLIBC)),true)
- KLIBC_DIR = klibc/klibc
+ KLIBC_BASE = $(PWD)/klibc
+ KLIBC_DIR = $(KLIBC_BASE)/klibc
INCLUDE_DIR := $(KLIBC_DIR)/include
+ LINUX_INCLUDE_DIR := $(KLIBC_BASE)/linux/include
include $(KLIBC_DIR)/arch/$(ARCH)/MCONFIG
# arch specific objects
- LIBGCC = $(shell $(CC) --print-libgcc)
ARCH_LIB_OBJS = \
- $(KLIBC_DIR)/libc.a \
- $(LIBGCC)
+ $(KLIBC_DIR)/libc.a
CRT0 = $(KLIBC_DIR)/crt0.o
LIBC = $(ARCH_LIB_OBJS) $(LIB_OBJS) $(CRT0)
CFLAGS += -nostdinc -I$(INCLUDE_DIR) -I$(KLIBC_DIR)/arch/$(ARCH)/include \
- -I$(INCLUDE_DIR)/bits$(BITSIZE) -I$(GCCINCDIR) -Iklibc/linux/include \
+ -I$(INCLUDE_DIR)/bits$(BITSIZE) -I$(GCCINCDIR) -I$(LINUX_INCLUDE_DIR) \
-D__KLIBC__
LIB_OBJS LDFLAGS = --static --nostdlib -nostartfiles -nodefaultlibs
@@ -133,7 +138,15 @@
LDFLAGS = --static
endif
-all: $(ROOT)
+CFLAGS += -I$(PWD)/libsysfs
+
+
+all: $(ROOT) $(EXTRAS)
+
+FORCE:
+
+$(EXTRAS): $(ROOT) FORCE
+ $(MAKE) LD=$(LD) SYSFS="$(SYSFS)" -C $@
$(ROOT): $(LIBC)
@@ -145,13 +158,13 @@
TDB = tdb/tdb.o \
tdb/spinlock.o
-SYSFS = libsysfs/sysfs_bus.o \
- libsysfs/sysfs_class.o \
- libsysfs/sysfs_device.o \
- libsysfs/sysfs_dir.o \
- libsysfs/sysfs_driver.o \
- libsysfs/sysfs_utils.o \
- libsysfs/dlist.o
+SYSFS = $(PWD)/libsysfs/sysfs_bus.o \
+ $(PWD)/libsysfs/sysfs_class.o \
+ $(PWD)/libsysfs/sysfs_device.o \
+ $(PWD)/libsysfs/sysfs_dir.o \
+ $(PWD)/libsysfs/sysfs_driver.o \
+ $(PWD)/libsysfs/sysfs_utils.o \
+ $(PWD)/libsysfs/dlist.o
OBJS = udev.o \
udev_config.o \
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-12-05 23:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-05 23:33 [patch] allow builds of extras programs under udev Patrick Mansfield
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).