From: Kay Sievers Date: Mon, 23 Jan 2006 02:24:16 +0000 (+0100) Subject: Makefile: remove dynamic config file generation X-Git-Tag: 174~2392 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=d8a57e7c2624bf19ad2f4f91a6d9149d5228402f;ds=sidebyside Makefile: remove dynamic config file generation Signed-off-by: Kay Sievers --- diff --git a/Makefile b/Makefile index bb4f6d423..cb097dde5 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ USE_STATIC = false # make EXTRAS="extras/ extras/" EXTRAS = -# make the build silent. Set this to something else to make it noisy again. +# make the build silent. V = false PROGRAMS = \ @@ -89,10 +89,6 @@ MAN_PAGES = \ udevinfo.8 \ udevstart.8 -# config files automatically generated -GEN_CONFIGS = \ - $(LOCAL_CFG_DIR)/udev.conf - GEN_HEADERS = \ udev_version.h @@ -105,12 +101,11 @@ libudevdir = ${prefix}/lib/udev mandir = ${prefix}/usr/share/man configdir = ${etcdir}/udev udevdir = /dev -LOCAL_CFG_DIR = etc/udev DESTDIR = INSTALL = /usr/bin/install -c INSTALL_PROGRAM = ${INSTALL} -INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} PWD = $(shell pwd) @@ -149,7 +144,6 @@ ifeq ($(strip $(USE_GCOV)),true) LDFLAGS += -fprofile-arcs endif -# if our own version of klibc is used, we need to build it ifeq ($(strip $(USE_KLIBC)),true) KLCC = /usr/bin/$(CROSS)klcc CC = $(KLCC) @@ -211,14 +205,9 @@ $(LIBUDEV): $(HOST_PROGS) $(HEADERS) $(GEN_HEADERS) $(UDEV_OBJS) $(QUIET) $(AR) cq $@ $(UDEV_OBJS) $(QUIET) $(RANLIB) $@ -# generate config files -$(GEN_CONFIGS): - sed -e "s:@udevdir@:$(udevdir):" -e "s:@configdir@:$(configdir):" < $@.in > $@ - -# generate config header file udev_version.h: - @echo "Creating udev_version.h" - @echo \#define UDEV_VERSION \"$(VERSION)\" > $@ + @echo "/* Generated by make. */" > $@ + @echo \#define UDEV_VERSION \"$(VERSION)\" >> $@ @echo \#define UDEV_ROOT \"$(udevdir)\" >> $@ @echo \#define UDEV_CONFIG_FILE \"$(configdir)/udev.conf\" >> $@ @echo \#define UDEV_RULES_FILE \"$(configdir)/rules.d\" >> $@ @@ -239,8 +228,9 @@ clean: - find -name "*.gcda" -print0 | xargs -0rt rm -f - find -name "*.gcov" -print0 | xargs -0rt rm -f - rm -f udev_gcov.txt - - rm -f core $(PROGRAMS) $(GEN_HEADERS) $(GEN_CONFIGS) + - rm -f core $(PROGRAMS) $(GEN_HEADERS) - rm -f udev-$(VERSION).tar.gz + - rm -f udev-$(VERSION).tar.bz2 @extras="$(EXTRAS)"; for target in $$extras; do \ echo $$target; \ $(MAKE) -C $$target $@ || exit 1; \ @@ -249,14 +239,13 @@ clean: release: git-tar-tree HEAD udev-$(VERSION) | gzip -9v > udev-$(VERSION).tar.gz - @echo "udev-$(VERSION).tar.gz created" + git-tar-tree HEAD udev-$(VERSION) | bzip2 -9v > udev-$(VERSION).tar.bz2 .PHONY: release -install-config: $(GEN_CONFIGS) +install-config: $(INSTALL) -d $(DESTDIR)$(configdir)/rules.d @if [ ! -r $(DESTDIR)$(configdir)/udev.conf ]; then \ - echo $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.conf $(DESTDIR)$(configdir); \ - $(INSTALL_DATA) $(LOCAL_CFG_DIR)/udev.conf $(DESTDIR)$(configdir); \ + $(INSTALL_DATA) etc/udev/udev.conf $(DESTDIR)$(configdir); \ fi @if [ ! -r $(DESTDIR)$(configdir)/rules.d/50-udev.rules ]; then \ echo; \ @@ -327,8 +316,8 @@ uninstall-bin: - rm -f $(DESTDIR)$(sbindir)/udevcontrol - rm -f $(DESTDIR)$(sbindir)/udevstart - rm -f $(DESTDIR)$(usrsbindir)/udevmonitor - - rm -f $(usrbindir)/udevinfo - - rm -f $(DESTDIR)$(DESTDIR)$(usrbindir)/udevtest + - rm -f $(DESTDIR)$(usrbindir)/udevinfo + - rm -f $(DESTDIR)$(usrbindir)/udevtest ifndef DESTDIR - killall udevd - rm -rf /dev/.udev @@ -387,4 +376,3 @@ udev_gcov.txt: $(wildcard *.gcda) $(wildcard *.gcno) echo >> $@; \ done; \ echo "view $@ for the result" - diff --git a/etc/udev/udev.conf.in b/etc/udev/udev.conf similarity index 100% rename from etc/udev/udev.conf.in rename to etc/udev/udev.conf diff --git a/udev_sysfs.c b/udev_sysfs.c index d1e43a60e..8de523dad 100644 --- a/udev_sysfs.c +++ b/udev_sysfs.c @@ -275,7 +275,7 @@ struct sysfs_device *sysfs_device_get_parent(struct sysfs_device *dev) if (strncmp(parent_devpath, "/class", 6) == 0) { pos = strrchr(parent_devpath, '/'); if (pos == &parent_devpath[6] || pos == parent_devpath) { - dbg("class top level, look for device link"); + dbg("/class top level, look for device link"); goto device_link; } } diff --git a/udev_utils_run.c b/udev_utils_run.c index c6af90658..31363588c 100644 --- a/udev_utils_run.c +++ b/udev_utils_run.c @@ -30,7 +30,6 @@ #include #include #include -#include #include "udev.h" @@ -51,7 +50,7 @@ int pass_env_to_socket(const char *sockname, const char *devpath, const char *ac sock = socket(AF_LOCAL, SOCK_DGRAM, 0); memset(&saddr, 0x00, sizeof(struct sockaddr_un)); saddr.sun_family = AF_LOCAL; - /* only abstract namespace is supported */ + /* abstract namespace only */ strcpy(&saddr.sun_path[1], sockname); addrlen = offsetof(struct sockaddr_un, sun_path) + strlen(saddr.sun_path+1) + 1;