Skip to contentSkip to conversation

patch udev: static linking and DESTDIR

PATCH Vassilis Virvilis 2 participants 2 messages May 20, 2005 – May 22, 2005 Kbuild

lore
Share & tools
lore
#0 lore raw

This patch does two things

1)
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).

2)
I am building hotplug (and udev) for an initramfs image. I have specified DESTDIR to be ~/src/embed/root-initramfs and the defines as they are now are pointing to DESTDIR which is wrong since that directory will be the root upon boot and udev cannot find the ~/src/embed/root-initramfs/sbin/udev staff.

Note the klibc works around this by introducing INSTALLROOT and INSTALLDIR Makefile variables. Maybe something like this is a good idea?

Also note that the INSTALL_DIR variable in udev makefile is useless as it is not referenced anywhere. Would you accept a patch to clean it up as it is distracting...

.bill

Makefile renamed from udev-057/Makefile +3 -3
diff -ur orig/udev-057/Makefile udev-057/Makefile
@@ -178,7 +178,7 @@
 	KLCC		= $(KLIBC_INSTALL)/bin/klcc
 	CC		= $(KLCC)
 	LD		= $(KLCC)
-	LDFLAGS		+= -static
+	#LDFLAGS		+= -static
 else
 	CFLAGS		+= -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
 endif
@@ -250,8 +250,8 @@
 	@echo \#define UDEV_CONFIG_DIR		\"$(configdir)\" >> $@
 	@echo \#define UDEV_CONFIG_FILE		\"$(configdir)/udev.conf\" >> $@
 	@echo \#define UDEV_RULES_FILE		\"$(configdir)/rules.d\" >> $@
-	@echo \#define UDEV_BIN			\"$(DESTDIR)$(sbindir)/udev\" >> $@
-	@echo \#define UDEVD_BIN		\"$(DESTDIR)$(sbindir)/udevd\" >> $@
+	@echo \#define UDEV_BIN			\"$(sbindir)/udev\" >> $@
+	@echo \#define UDEVD_BIN		\"$(sbindir)/udevd\" >> $@
 
 # Rules on how to create the generated config files
 $(LOCAL_CFG_DIR)/udev.conf:
#1 lore raw
Quoted 7 lines · Vassilis Virvilis

This patch does two things

1)
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 -static prevented a static build?
Anyway, removed!

Quoted 6 lines

2)
I am building hotplug (and udev) for an initramfs image. I have specified DESTDIR to be ~/src/embed/root-initramfs and the defines as they are now are pointing to DESTDIR which is wrong since that directory will be the root upon boot and udev cannot find the ~/src/embed/root-initramfs/sbin/udev staff.

Yes, that seems wrong. Fixed!
Using DESTDIR only on the install target works. :)

Quoted 2 lines

Note the klibc works around this by introducing INSTALLROOT and INSTALLDIR Makefile variables. Maybe something like this is a good idea?

Does "prefix" not work for that?

Quoted 3 lines

Also note that the INSTALL_DIR variable in udev makefile is useless as it is not referenced anywhere. Would you accept a patch to clean it up as it is distracting...

Removed!

Thanks,
Kay

-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel