aboutsummaryrefslogtreecommitdiff
path: root/package/libevent/libevent.mk
blob: e31c0709d93abbcba8dc54fcb3b16140f9c6675b (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
#############################################################
#
# libevent
#
#############################################################
LIBEVENT_VERSION:=1.2
LIBEVENT_SOURCE:=libevent-$(LIBEVENT_VERSION).tar.gz
LIBEVENT_SITE:=http://monkey.org/~provos/
LIBEVENT_DIR:=$(BUILD_DIR)/libevent-$(LIBEVENT_VERSION)
LIBEVENT_CAT:=$(ZCAT)
LIBEVENT_BINARY:=libevent.la
LIBEVENT_TARGET_BINARY:=usr/lib/libevent.so

$(DL_DIR)/$(LIBEVENT_SOURCE):
	$(WGET) -P $(DL_DIR) $(LIBEVENT_SITE)/$(LIBEVENT_SOURCE)

libevent-source: $(DL_DIR)/$(LIBEVENT_SOURCE)

libevent-unpacked: $(LIBEVENT_DIR)/.unpacked
$(LIBEVENT_DIR)/.unpacked: $(DL_DIR)/$(LIBEVENT_SOURCE)
	$(LIBEVENT_CAT) $(DL_DIR)/$(LIBEVENT_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(LIBEVENT_DIR) package/libevent/ \*.patch
	touch $@

$(LIBEVENT_DIR)/.configured: $(LIBEVENT_DIR)/.unpacked
	(cd $(LIBEVENT_DIR); rm -rf config.cache; \
		$(TARGET_CONFIGURE_OPTS) \
		$(TARGET_CONFIGURE_ARGS) \
		./configure \
		--target=$(GNU_TARGET_NAME) \
		--host=$(GNU_TARGET_NAME) \
		--build=$(GNU_HOST_NAME) \
		--prefix=/usr \
		--mandir=/usr/share/man \
		--disable-static \
		--with-gnu-ld \
	)
	touch $@

$(LIBEVENT_DIR)/$(LIBEVENT_BINARY): $(LIBEVENT_DIR)/.configured
	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(LIBEVENT_DIR)

$(STAGING_DIR)/$(LIBEVENT_TARGET_BINARY): $(LIBEVENT_DIR)/$(LIBEVENT_BINARY)
	$(MAKE) -C $(LIBEVENT_DIR) DESTDIR=$(STAGING_DIR) install

$(TARGET_DIR)/$(LIBEVENT_TARGET_BINARY): $(STAGING_DIR)/$(LIBEVENT_TARGET_BINARY)
	$(MAKE) -C $(LIBEVENT_DIR) DESTDIR=$(TARGET_DIR) install
	rm -f $(addprefix $(TARGET_DIR)/usr/,lib/libevent*.la \
					     include/ev*)
ifneq ($(BR2_HAVE_MANPAGES),y)
	rm -fr $(TARGET_DIR)/usr/share/man
endif

libevent: uclibc $(TARGET_DIR)/$(LIBEVENT_TARGET_BINARY)

libevent-clean:
	rm -f $(TARGET_DIR)/$(LIBEVENT_TARGET_BINARY)*
	-$(MAKE) -C $(LIBEVENT_DIR) clean

libevent-dirclean:
	rm -rf $(LIBEVENT_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_LIBEVENT),y)
TARGETS+=libevent
endif