patch hotplug klibc build and DESTDIR
Halo,
I am building hotplug with the newest klibc (I have symlinked the klib dir to the klibc-1.0.8) and the built was unsuccessfull so I change the relevant path with the one that comes from the udev package.
Note: klcc builds statically by default so I don't see the reason to explicitly state it. However if somebody changes the default behavior of klcc (like me) it will lost considerable time trying to find out why hotplug (and udev) doesn't build statically (like me).
The second part of the patch makes hotplug installation to respect DESTDIR. Before you say no please consider the following scenario. I am building hotplug (and udev) for an initramfs image. I have specified DESTDIR to be ~/src/embed/root-initramfs and the soft linking as it is right now links to /sbin dir. However since I don't install to the real root /, cpio cannot find the link when building the initramfs.
If this patch is rejected will you consider a changing the soft linking to hard linking since if IRC initramfs handles correctly hard links.
.bill
Makefile renamed from hotplug-ng-002/Makefile +11 -30
@@ -121,34 +121,15 @@ endif # If we are using our version of klibc, then we need to build, link it, and then -# link udev against it statically. -# Otherwise, use glibc and link dynamically. +# link udev against it statically. Otherwise, use glibc and link dynamically. ifeq ($(strip $(USE_KLIBC)),true) - KLIBC_BASE = $(PWD)/klibc - KLIBC_DIR = $(KLIBC_BASE)/klibc - INCLUDE_DIR := $(KLIBC_BASE)/include - LINUX_INCLUDE_DIR := $(KERNEL_DIR)/include - include $(KLIBC_DIR)/arch/$(ARCH)/MCONFIG - ARCH_LIB_OBJS = $(KLIBC_DIR)/libc.a - CRT0 = $(KLIBC_DIR)/crt0.o - LIBC = $(ARCH_LIB_OBJS) $(LIB_OBJS) $(CRT0) - CFLAGS += $(WARNINGS) -nostdinc \ - $(OPTFLAGS) $(REQFLAGS) \ - -D__KLIBC__ -fno-builtin-printf \ - -I$(INCLUDE_DIR) \ - -I$(INCLUDE_DIR)/arch/$(ARCH) \ - -I$(INCLUDE_DIR)/bits$(BITSIZE) \ - -I$(GCCINCDIR) \ - -I$(LINUX_INCLUDE_DIR) - LIB_OBJS = - LDFLAGS = --static --nostdlib -nostartfiles -nodefaultlibs + KLIBC_INSTALL = $(PWD)/klibc/.install + KLCC = $(KLIBC_INSTALL)/bin/klcc + CC = $(KLCC) + LD = $(KLCC) + #LDFLAGS += -static else - WARNINGS += -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations - CRT0 = - LIBC = - CFLAGS += $(WARNINGS) -I$(GCCINCDIR) - LIB_OBJS = -lc - LDFLAGS = + CFLAGS += -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations endif ifeq ($(strip $(USE_SELINUX)),true)
@@ -292,10 +273,10 @@ $(INSTALL_PROGRAM) -D $(MODULE_USB) $(DESTDIR)$(sbindir)/$(MODULE_USB) $(INSTALL_PROGRAM) -D $(MODULE_PCI) $(DESTDIR)$(sbindir)/$(MODULE_PCI) $(INSTALL_PROGRAM) -D $(MODULE_SCSI) $(DESTDIR)$(sbindir)/$(MODULE_SCSI) - - ln -f -s $(sbindir)/$(MODULE_IEEE1394) $(DESTDIR)$(hotplugdir)/ieee1394/$(MODULE_IEEE1394).hotplug - - ln -f -s $(sbindir)/$(MODULE_USB) $(DESTDIR)$(hotplugdir)/usb/$(MODULE_USB).hotplug - - ln -f -s $(sbindir)/$(MODULE_PCI) $(DESTDIR)$(hotplugdir)/pci/$(MODULE_PCI).hotplug - - ln -f -s $(sbindir)/$(MODULE_SCSI) $(DESTDIR)$(hotplugdir)/scsi/$(MODULE_SCSI).hotplug + - ln -f -s $(DESTDIR)$(sbindir)/$(MODULE_IEEE1394) $(DESTDIR)$(hotplugdir)/ieee1394/$(MODULE_IEEE1394).hotplug + - ln -f -s $(DESTDIR)$(sbindir)/$(MODULE_USB) $(DESTDIR)$(hotplugdir)/usb/$(MODULE_USB).hotplug + - ln -f -s $(DESTDIR)$(sbindir)/$(MODULE_PCI) $(DESTDIR)$(hotplugdir)/pci/$(MODULE_PCI).hotplug + - ln -f -s $(DESTDIR)$(sbindir)/$(MODULE_SCSI) $(DESTDIR)$(hotplugdir)/scsi/$(MODULE_SCSI).hotplug uninstall: uninstall-man - rm $(sbindir)/$(ROOT)