aboutsummaryrefslogtreecommitdiff
path: root/package/directfb/directfb.mk
blob: 03c74dec6de16826577321e5d082a7b4b08e2768 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#############################################################
#
# directfb
#
#############################################################
#DIRECTFB_VERSION:=0.9.25.1
#DIRECTFB_SITE:=http://www.directfb.org/downloads/Old
DIRECTFB_VERSION_MAJOR:=1.2
DIRECTFB_VERSION:=1.2.6
#DIRECTFB_VERSION:=1.3.0	is a development version
#DIRECTFB_VERSION_MAJOR:=1.3
DIRECTFB_SITE:=http://www.directfb.org/downloads/Core
DIRECTFB_SOURCE:=DirectFB-$(DIRECTFB_VERSION).tar.gz
DIRECTFB_CAT:=$(ZCAT)
DIRECTFB_DIR:=$(BUILD_DIR)/DirectFB-$(DIRECTFB_VERSION)
DIRECTFB_STAGING:=directfb-$(DIRECTFB_VERSION_MAJOR)-0
DIRECTFB_BIN:=usr/lib/libdirectfb-$(DIRECTFB_VERSION_MAJOR).so.0
DIRECTFB_DEP:=zlib

ifeq ($(BR2_PACKAGE_DIRECTFB_MULTI),y)
DIRECTFB_MULTI:=--enable-multi --enable-fusion
DIRECTFB_FUSION:=linux-fusion
else
DIRECTFB_MULTI:=
DIRECTFB_FUSION:=
endif
ifeq ($(BR2_PACKAGE_XSERVER),y)
DIRECTFB_X:=--enable-x11
else
DIRECTFB_X:=--disable-x11
endif

ifeq ($(BR2_PACKAGE_DIRECTFB_UNIQUE),y)
DIRECTFB_UNIQUE:=--enable-unique
else
DIRECTFB_UNIQUE:=--disable-unique
endif

DIRECTFB_GFX:=
ifeq ($(BR2_PACKAGE_DIRECTFB_ATI128),y)
DIRECTFB_GFX+= ati128
endif
ifeq ($(BR2_PACKAGE_DIRECTFB_CLE266),y)
DIRECTFB_GFX+= cle266
endif
ifeq ($(BR2_PACKAGE_DIRECTFB_CYBER5K),y)
DIRECTFB_GFX+= cyber5k
endif
ifeq ($(BR2_PACKAGE_DIRECTFB_MATROX),y)
DIRECTFB_GFX+= matrox
endif
ifeq ($(BR2_PACKAGE_DIRECTFB_UNICHROME),y)
DIRECTFB_GFX+= unichrome
endif
ifeq ($(DIRECTFB_GFX),)
DIRECTFB_GFX:=none
else
comma:=,
empty:=
space:=$(empty) $(empty)
DIRECTFB_GFX:=$(subst $(space),$(comma),$(strip $(DIRECTFB_GFX)))
endif

DIRECTFB_INPUT:=
ifeq ($(BR2_PACKAGE_DIRECTFB_KEYBOARD),y)
DIRECTFB_INPUT+= keyboard
endif
ifeq ($(BR2_PACKAGE_DIRECTFB_PS2MOUSE),y)
DIRECTFB_INPUT+= ps2mouse
endif
ifeq ($(BR2_PACKAGE_DIRECTFB_SERIALMOUSE),y)
DIRECTFB_INPUT+= serialmouse
endif
ifeq ($(BR2_PACKAGE_DIRECTFB_TSLIB),y)
DIRECTFB_INPUT+= tslib
DIRECTFB_DEP+= tslib
endif
ifeq ($(DIRECTFB_INPUT),)
DIRECTFB_INPUT:=none
else
comma:=,
empty:=
space:=$(empty) $(empty)
DIRECTFB_INPUT:=$(subst $(space),$(comma),$(strip $(DIRECTFB_INPUT)))
endif

ifeq ($(BR2_PACKAGE_DIRECTFB_GIF),y)
DIRECTFB_GIF:=--enable-gif
DIRECTFB_DEP+= libungif
else
DIRECTFB_GIF:=--disable-gif
endif

ifeq ($(BR2_PACKAGE_DIRECTFB_PNG),y)
DIRECTFB_PNG:=--enable-png
DIRECTFB_DEP+= libpng
else
DIRECTFB_PNG:=--disable-png
endif

ifeq ($(BR2_PACKAGE_DIRECTFB_JPEG),y)
DIRECTFB_JPEG:=--enable-jpeg
DIRECTFB_DEP+= jpeg
else
DIRECTFB_JPEG:=--disable-jpeg
endif

$(DL_DIR)/$(DIRECTFB_SOURCE):
	$(call DOWNLOAD,$(DIRECTFB_SITE),$(DIRECTFB_SOURCE))

directfb-source: $(DL_DIR)/$(DIRECTFB_SOURCE)

$(DIRECTFB_DIR)/.unpacked: $(DL_DIR)/$(DIRECTFB_SOURCE)
	$(DIRECTFB_CAT) $(DL_DIR)/$(DIRECTFB_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
	toolchain/patch-kernel.sh $(DIRECTFB_DIR) package/directfb/ DirectFB-$(DIRECTFB_VERSION)\*.patch
	touch $@

$(DIRECTFB_DIR)/.configured: $(DIRECTFB_DIR)/.unpacked
	(cd $(DIRECTFB_DIR); rm -f config.cache; \
	ac_cv_header_linux_wm97xx_h=no \
	ac_cv_header_linux_sisfb_h=no \
	ac_cv_header_asm_page_h=no \
	$(AUTO_CONFIGURE_TARGET) \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--with-gfxdrivers=$(DIRECTFB_GFX) \
		--with-inputdrivers=$(DIRECTFB_INPUT) \
		--enable-static \
		--enable-shared \
		$(DIRECTFB_MULTI) \
		$(DIRECTFB_X) \
		$(DIRECTFB_JPEG) \
		$(DIRECTFB_PNG) \
		$(DIRECTFB_GIF) \
		$(DIRECTFB_UNIQUE) \
		--enable-linux-input \
		--enable-zlib \
		--enable-freetype \
		--enable-fbdev \
		--disable-sysfs \
		--disable-sdl \
		--disable-vnc \
		--disable-video4linux \
		--disable-video4linux2 )
	touch $@

$(DIRECTFB_DIR)/.compiled: $(DIRECTFB_DIR)/.configured
	$(MAKE) PATH=$(STAGING_DIR)/usr/lib:$(PATH) \
		$(TARGET_CONFIGURE_OPTS) \
		-C $(DIRECTFB_DIR)
	touch $(DIRECTFB_DIR)/.compiled

$(STAGING_DIR)/$(DIRECTFB_BIN): $(DIRECTFB_DIR)/.compiled
	$(MAKE) DESTDIR=$(STAGING_DIR) -C $(DIRECTFB_DIR) install
	$(SED) "s, /usr/lib, $(STAGING_DIR)/usr/lib,g" \
		$(STAGING_DIR)/usr/lib/libdirect.la \
		$(STAGING_DIR)/usr/lib/libdirectfb.la \
		$(STAGING_DIR)/usr/lib/libfusion.la \
		`find $(STAGING_DIR)/usr/lib/directfb-$(DIRECTFB_VERSION_MAJOR)-0/ -name '*.la'`
	$(SED) "s,^prefix=.*,prefix=\'$(STAGING_DIR)/usr\',g" \
		$(STAGING_DIR)/usr/bin/*directfb-config

$(TARGET_DIR)/$(DIRECTFB_BIN): $(STAGING_DIR)/$(DIRECTFB_BIN)
	cd $(STAGING_DIR)/usr/lib/; find $(DIRECTFB_STAGING) -type f -name '*.so' \
		| xargs -IREPL install -Dm644 REPL $(TARGET_DIR)/usr/lib/REPL
	mkdir -p $(TARGET_DIR)/usr/lib/directfb-$(DIRECTFB_VERSION_MAJOR)-0/gfxdrivers
	cp -dpf $(STAGING_DIR)/usr/lib/libfusion*.so.* $(TARGET_DIR)/usr/lib/
ifeq ($(BR2_PACKAGE_DIRECTFB_UNIQUE),y)
	cp -dpf $(STAGING_DIR)/usr/lib/libuniquewm*.so.* $(TARGET_DIR)/usr/lib/
endif
	cp -dpf $(STAGING_DIR)/usr/lib/libdirect*.so.* $(TARGET_DIR)/usr/lib/
	$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) \
		$(TARGET_DIR)/usr/lib/libdirect*.so.* \
		$(TARGET_DIR)/usr/lib/libfusion*.so.*
ifeq ($(BR2_PACKAGE_DIRECTFB_UNIQUE),y)
	$(STRIPCMD) $(STRIP_STRIP_UNNEEDED) \
		$(TARGET_DIR)/usr/lib/libuniquewm*.so.*
endif

directfb: uclibc $(DIRECTFB_DEP) freetype $(DIRECTFB_FUSION) $(TARGET_DIR)/$(DIRECTFB_BIN)

directfb-unpacked: $(DIRECTFB_DIR)/.unpacked

directfb-clean:
	-$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(DIRECTFB_DIR) uninstall
	-$(MAKE) -C $(DIRECTFB_DIR) clean
	rm -f $(DIRECTFB_DIR)/.configured $(DIRECTFB_DIR)/.compiled

directfb-dirclean:
	rm -rf $(DIRECTFB_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_PACKAGE_DIRECTFB),y)
TARGETS+=directfb
endif