summaryrefslogtreecommitdiffstats
path: root/package/libdaemon/libdaemon.mk
blob: 06689527f3e6385b52b91ecdb29b952c29867928 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#############################################################
#
# libdaemon (UNIX daemon library)
#
#############################################################
# Copyright 2003-2005 Lennart Poettering <mzqnrzba@0pointer.de>
#
# This library is free software; you can redistribute it
# and/or modify it under the terms of the GNU Lesser General
# Public License as published by the Free Software Foundation
# either version 2.1 of the License, or (at your option) any
# later version.

LIBDAEMON_VERSION:=0.12
LIBDAEMON_NAME:=libdaemon-$(LIBDAEMON_VERSION)
LIBDAEMON_DIR:=$(BUILD_DIR)/$(LIBDAEMON_NAME)
LIBDAEMON_SITE:=http://0pointer.de/lennart/projects/libdaemon/
LIBDAEMON_SOURCE:=$(LIBDAEMON_NAME).tar.gz
LIBDAEMON_CAT:=$(ZCAT)

$(DL_DIR)/$(LIBDAEMON_SOURCE):
	 $(WGET) -P $(DL_DIR) $(LIBDAEMON_SITE)/$(LIBDAEMON_SOURCE)

libdaemon-source: $(DL_DIR)/$(LIBDAEMON_SOURCE)

$(LIBDAEMON_DIR)/.unpacked: $(DL_DIR)/$(LIBDAEMON_SOURCE)
	$(LIBDAEMON_CAT) $(DL_DIR)/$(LIBDAEMON_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(LIBDAEMON_DIR) package/libdaemon/ \*.patch
# Ulf, what was this supposed to fix? Your patch is broken
# (hardcoded for /home/ulf/..)
#	mkdir -p $(PROJECT_BUILD_DIR)/patches
#	$(BZCAT) package/libdaemon/$(LIBDAEMON_NAME).patch.bz2 \
#		> $(PROJECT_BUILD_DIR)/patches/$(LIBDAEMON_NAME).patch
#	toolchain/patch-kernel.sh $(LIBDAEMON_DIR) $(PROJECT_BUILD_DIR)/patches/ $(LIBDAEMON_NAME)\*.patch
#	$(CONFIG_UPDATE) $(LIBDAEMON_DIR)
	touch $(LIBDAEMON_DIR)/.unpacked

$(LIBDAEMON_DIR)/.configured: $(LIBDAEMON_DIR)/.unpacked
	(cd $(LIBDAEMON_DIR) && rm -rf config.cache && autoconf)
	( cd $(LIBDAEMON_DIR) && \
		$(TARGET_CONFIGURE_OPTS) \
		$(TARGET_CONFIGURE_ARGS) \
		./configure \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		--prefix=/usr \
		--exec-prefix=/usr \
		--bindir=/usr/bin \
		--sbindir=/usr/sbin \
		--libdir=/lib \
		--libexecdir=/usr/lib \
		--sysconfdir=/etc \
		--datadir=/usr/share \
		--localstatedir=/var \
		--includedir=/include \
		--mandir=/usr/man \
		--infodir=/usr/info \
		$(DISABLE_NLS) \
		$(DISABLE_LARGEFILE) \
		--disable-lynx \
		--disable-shared \
	)
	touch $(LIBDAEMON_DIR)/.configured

$(LIBDAEMON_DIR)/.compiled: $(LIBDAEMON_DIR)/.configured
	$(MAKE) LIBTOOL=$(LIBDAEMON_DIR)/libtool -C $(LIBDAEMON_DIR)
	touch $(LIBDAEMON_DIR)/.compiled

$(STAGING_DIR)/lib/libdaemon.a: $(LIBDAEMON_DIR)/.compiled
	$(MAKE) DESTDIR=$(STAGING_DIR) -C $(LIBDAEMON_DIR) install
	touch -c $(STAGING_DIR)/lib/libdaemon.a

#$(TARGET_DIR)/usr/lib/libdaemon.a: $(STAGING_DIR)/lib/libdaemon.a
# -$(STRIP) $(STRIP_STRIP_UNNEEDED) $(TARGET_DIR)/usr/lib/libdaemon.a

libdaemon: uclibc pkgconfig $(STAGING_DIR)/lib/libdaemon.a

libdaemon-unpacked: $(LIBDAEMON_DIR)/.unpacked

libdaemon-clean:
	-$(MAKE) -C $(LIBDAEMON_DIR) clean

libdaemon-patch-prep: libdaemon-dirclean libdaemon-unpacked
	cp -af $(LIBDAEMON_DIR) $(LIBDAEMON_DIR)-0rig

libdaemon-patch:
	(cd $(BUILD_DIR); \
	diff -urN $(LIBDAEMON_NAME)-0rig $(LIBDAEMON_NAME) > ../../$(LIBDAEMON_NAME)-$(DATE).patch || echo)

libdaemon-dirclean:
	rm -rf $(LIBDAEMON_DIR)
	rm -rf $(LIBDAEMON_DIR)-0rig

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(strip $(BR2_PACKAGE_LIBDAEMON)),y)
TARGETS+=libdaemon
endif