cleanup Makefile and enable DRI/DRM
[openwrt/svn-archive/archive.git] / Xorg / xorg / xserver / xorg-server / Makefile
1 #
2 # Copyright (C) 2006 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # blogic@openwrt.org
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=xorg-server
12 PKG_RELEASE:=1
13 PKG_VERSION:=1.5.1
14 PKG_SOURCE_URL:=http://xorg.freedesktop.org/releases/X11R7.4/src/xserver/
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_BUILD_DIR=$(BUILD_DIR)/Xorg/xserver/xorg-server-$(PKG_VERSION)/
17 PKG_BUILD_DEPENDS:=randrproto renderproto fixesproto damageproto xcmiscproto \
18 xextproto xproto scrnsaverproto bigreqsproto resourceproto \
19 fontsproto inputproto kbproto videoproto resourceproto \
20 xf86dgaproto
21
22 include $(INCLUDE_DIR)/package.mk
23
24 EXTRA_CFLAGS+= \
25 -I$(STAGING_DIR)/usr/include/X11/GL \
26 -I$(STAGING_DIR)/usr/include/X11/dri/ \
27 -I$(STAGING_DIR)/usr/include/X11/ \
28 -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
29
30 CONFIGURE_ARGS+= \
31 --disable-aiglx \
32 --disable-glx-tls \
33 --disable-dga \
34 --disable-xdmcp \
35 --disable-xdm-auth-1 \
36 --disable-config-hal \
37 --disable-xf86misc \
38 --disable-xf86vidmode \
39 --disable-xf86bigfont \
40 --disable-xorgcfg \
41 --disable-xkb \
42 --disable-xnest \
43 --disable-xquartz \
44 --disable-xwin \
45 --disable-x11app \
46 --disable-xsdl \
47 --disable-xfake \
48 --disable-install-setuid \
49 --disable-kbd_mode \
50 --disable-xvfb \
51 --disable-xevie \
52 --disable-xprint \
53 --disable-xtrap \
54 --disable-dmx \
55 --disable-glx \
56 --enable-builtin-fonts \
57 --with-default-font-path=built-ins \
58
59 CONFIGURE_VARS+=ac_cv_file__usr_share_sgml_X11_defs_ent=yes
60
61 #FIXME: make full blowed xorg-xserver work
62
63 #DEPENDS_SERVER:=+calibrateproto \
64 # +compositeproto \
65 # +damageproto \
66 # +fixesproto \
67 # +recordproto \
68 # +resourceproto \
69 # +scrnsaverproto \
70 # +videoproto \
71 # +xextproto \
72 # +xproto \
73 # +libXext \
74 # +libXdmcp \
75 # +libXfont \
76 # +libXrandr \
77 # +xtrans \
78 # +libX11 \
79 # +glproto \
80 # +xf86driproto \
81 # +applewmproto \
82 # +dmxproto \
83 # +printproto \
84 # +windowswmproto \
85 # +xf86rushproto \
86 # +xproxymanagementprotocol \
87 # +libdrm \
88 # +xf86miscproto \
89 # +xf86vidmodeproto \
90 # +xf86dgaproto \
91 # +trapproto \
92 # +xineramaproto \
93 # +evieext \
94 # +libxkbfile \
95 # +libXt \
96 # +libSM \
97 # +libxkbui \
98 # +libXxf86misc \
99 # +libXxf86vm \
100 # +libXaw \
101 # +libXmu \
102 # +libXpm \
103 # +libnotimpl \
104 # +Mesa \
105 # +pixman \
106 # @DISPLAY_SUPPORT
107
108 define Package/xserver-common/config
109 source "$(SOURCE)/Config.in"
110 endef
111
112 X_CONFIG=generic
113 ifeq ($(CONFIG_TARGET_olpc),y)
114 X_CONFIG=olpc
115 endif
116 ifeq ($(CONFIG_TARGET_om_gta02),y)
117 X_CONFIG=om_gta02
118 endif
119
120 define Package/xorg/Default
121 PROVIDES:=xserver
122 SECTION:=xorg-server
123 CATEGORY:=Xorg
124 SUBMENU:=server
125 URL:=http://xorg.freedesktop.org/
126 endef
127
128 define Package/xserver/Default
129 $(call Package/xorg/Default)
130 DEPENDS:=+xserver-common \
131 +libpthread \
132 +xtrans \
133 +libxkbfile \
134 +libXfont \
135 +libXau \
136 +libXv \
137 +libfontenc \
138 +pixman \
139 +libopenssl \
140 +libpciaccess \
141 @DISPLAY_SUPPORT
142 endef
143
144 define Package/xserver-xorg
145 $(call Package/xserver/Default)
146 PROVIDES:=xserver
147 TITLE:=Xorg xserver
148 DEPENDS+=+libdrm \
149 +xf86driproto
150 endef
151
152 define Package/xserver-kdrive/Default
153 $(call Package/xserver/Default)
154 DEPENDS+=+X_TSLIB:tslib \
155 +X_DRI:xf86driproto \
156 +X_DRI:libdrm \
157 +X_XCALIBRATE:calibrateproto \
158 +X_COMPOSITE:compositeproto \
159 +X_XINERAMA:xineramaproto
160 endef
161
162 define Package/xserver-kdrive-xvesa
163 $(call Package/xserver-kdrive/Default)
164 TITLE:=Kdrive vesa xserver
165 DEPENDS+=@TARGET_x86
166 endef
167
168 define Package/xserver-kdrive-xfbdev
169 $(call Package/xserver-kdrive/Default)
170 TITLE:=Kdrive framebuffer xserver
171 endef
172
173 define Package/xserver-kdrive-xephyr
174 $(call Package/xserver-kdrive/Default)
175 TITLE:=Kdrive ephyr xserver
176 endef
177
178 define Package/xserver-xorg-config
179 $(call Package/xorg/Default)
180 TITLE:=Xorg server configuration tools
181 DEPENDS:=xserver-xorg
182 endef
183
184 define Package/xserver-common
185 $(call Package/xorg/Default)
186 TITLE:=meta-package
187 endef
188
189 define Build/Configure
190 $(call Build/Configure/Default, \
191 $(if $(CONFIG_PACKAGE_xserver-xorg),--enable-xorg --enable-dri,--disable-xorg --disable-dri) \
192 $(if $(CONFIG_PACKAGE_xserver-kdrive-xvesa), \
193 --enable-kdrive-vesa, \
194 --disable-kdrive-vesa) \
195 $(if $(CONFIG_PACKAGE_xserver-kdrive-xfbdev), \
196 --enable-xfbdev, \
197 --disable-xfbdev) \
198 $(if $(CONFIG_PACKAGE_xserver-kdrive-xephyr), \
199 --enable-xephyr, \
200 --disable-xephyr) \
201 $(if $(CONFIG_X_TSLIB),--enable-tslib,--disable-tslib) \
202 $(if $(CONFIG_X_COMPOSITE),--enable-composite,--disable-composite) \
203 $(if $(CONFIG_X_XINERAMA),--enable-xinerama,--disable-xinerama) \
204 $(if $(CONFIG_X_XCALIBRATE),--enable-xcalibrate,--disable-xcalibrate) \
205 )
206 endef
207
208 define Build/Compile
209 DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE) -C $(PKG_BUILD_DIR) install
210 endef
211
212 define Package/xserver-common/install
213 $(INSTALL_DIR) $(1)/etc/{init.d,config}
214 $(INSTALL_BIN) \
215 ./files/x.init \
216 $(1)/etc/init.d/x11
217 $(if $(X_CONFIG), \
218 $(INSTALL_DATA) \
219 ./files/config/$(X_CONFIG) \
220 $(1)/etc/config/x11 \
221 )
222
223 $(INSTALL_DIR) $(1)/usr/lib/xorg
224 $(INSTALL_DATA) \
225 $(PKG_INSTALL_DIR)/usr/lib/xorg/protocol.txt \
226 $(1)/usr/lib/xorg/
227 endef
228
229 define Package/xserver-kdrive-xfbdev/install
230 $(INSTALL_DIR) $(1)/usr/bin
231 $(INSTALL_BIN) \
232 $(PKG_INSTALL_DIR)/usr/bin/Xfbdev \
233 $(1)/usr/bin/
234 endef
235
236 define Package/xserver-kdrive-xvesa/install
237 $(INSTALL_DIR) $(1)/usr/bin
238 $(INSTALL_BIN) \
239 $(PKG_INSTALL_DIR)/usr/bin/Xvesa \
240 $(1)/usr/bin/
241 endef
242
243 define Package/xserver-kdrive-xephyr/install
244 $(INSTALL_DIR) $(1)/usr/bin
245 $(INSTALL_BIN) \
246 $(PKG_INSTALL_DIR)/usr/bin/Xephyr \
247 $(1)/usr/bin/
248 endef
249
250 define Package/xserver-xorg/install
251 $(INSTALL_DIR) $(1)/usr/bin
252 $(INSTALL_BIN) \
253 $(PKG_INSTALL_DIR)/usr/bin/Xorg \
254 $(1)/usr/bin/
255
256 $(INSTALL_DIR) $(1)/usr/lib/X11
257 $(INSTALL_DATA) \
258 $(PKG_INSTALL_DIR)/usr/lib/X11/* \
259 $(1)/usr/lib/X11/
260
261 $(INSTALL_DIR) $(1)/usr/lib/xorg/modules/{extensions,fonts,linux,multimedia}
262 $(INSTALL_DATA) \
263 $(PKG_INSTALL_DIR)/usr/lib/xorg/modules/*.so \
264 $(1)/usr/lib/xorg/modules/
265
266 $(for dir,extensions fonts linux multimedia, \
267 $(INSTALL_DATA) \
268 $(PKG_INSTALL_DIR)/usr/lib/xorg/modules/$(d)/*.so \
269 $(1)/usr/lib/xorg/modules/$(d) \
270 )
271 endef
272
273 define Packages/xorg-server-config/install
274 $(INSTALL_DIR) $(1)/usr/bin
275 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/xorgconfig $(1)/usr/bin/
276 endef
277
278 define Build/InstallDev
279 $(INSTALL_DIR) $(1)/usr/share/aclocal/
280 $(INSTALL_DATA) \
281 $(PKG_INSTALL_DIR)/usr/share/aclocal/* \
282 $(1)/usr/share/aclocal/
283
284 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
285 $(INSTALL_DATA) \
286 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
287 $(1)/usr/lib/pkgconfig/
288 $(if $(CONFIG_PACKAGE_xserver-xorg), \
289 $(INSTALL_DIR) $(1)/usr/include/xorg; \
290 $(INSTALL_DATA) \
291 $(PKG_INSTALL_DIR)/usr/include/xorg/*.h \
292 $(1)/usr/include/xorg/; \
293 )
294 endef
295
296 $(eval $(call BuildPackage,xserver-common))
297 $(eval $(call BuildPackage,xserver-xorg))
298 $(eval $(call BuildPackage,xserver-kdrive-xvesa))
299 $(eval $(call BuildPackage,xserver-kdrive-xfbdev))
300 $(eval $(call BuildPackage,xserver-kdrive-xephyr))
301 $(eval $(call BuildPackage,xserver-xorg-config))