mesa: disable all dri drivers except for swrast for non-x86 (compile errors)
[openwrt/svn-archive/archive.git] / Xorg / lib / mesa / Makefile
1 #
2 # Copyright (C) 2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=Mesa
11 PKG_RELEASE:=2
12 PKG_VERSION:=7.2
13
14 PKG_SOURCE_URL:=@SF/mesa3d
15 PKG_SOURCE:=$(PKG_NAME)Lib-$(PKG_VERSION).tar.bz2
16 PKG_MD5SUM:=04d379292e023df0b0266825cb0dbde5
17 PKG_FIXUP:=libtool
18 PKG_BUILD_DEPENDS:=glproto
19
20 include $(INCLUDE_DIR)/package.mk
21
22 PKG_INSTALL:=1
23
24 define Package/libgl-mesa
25 SECTION:=xorg-lib
26 CATEGORY:=Xorg
27 SUBMENU:=libraries
28 DEPENDS:=+libX11 +libXext +libXfixes +libXdamage +libXxf86vm +libdrm +libexpat
29 TITLE:=Mesa OpenGL library
30 URL:=http://mesa3d.org
31 endef
32
33 define Package/libglu-mesa
34 SECTION:=xorg-lib
35 CATEGORY:=Xorg
36 SUBMENU:=libraries
37 DEPENDS:=+libgl-mesa
38 TITLE:=Mesa OpenGL utility library
39 URL:=http://mesa3d.org
40 endef
41
42 define Package/libgl-mesa-dri/Default
43 define Package/libgl-mesa-dri-$(1)
44 SECTION:=xorg-lib
45 CATEGORY:=Xorg
46 SUBMENU:=libraries
47 DEPENDS:=libgl-mesa @DISPLAY_SUPPORT $(if $(findstring swrast,$(1)),,@TARGET_x86)
48 TITLE:=mesa dri $(1)
49 URL:=http://mesa3d.org
50 endef
51 endef
52
53 DRIDRIVERS:=i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
54 savage sis tdfx trident unichrome ffb swrast
55
56 $(foreach dri,$(DRIDRIVERS),$(eval $(call Package/libgl-mesa-dri/Default,$(dri))))
57
58 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(call confvar,CONFIG_PACKAGE_libgl-mesa \
59 CONFIG_PACKAGE_libglu-mesa \
60 $(foreach dri,$(DRIDRIVERS),CONFIG_PACKAGE_libgl-mesa-dri-$(dri)))
61
62 define Build/Configure
63 $(call Build/Configure/Default, \
64 --disable-glw \
65 --with-driver=dri \
66 --with-dri-drivers="$(foreach dri,$(DRIDRIVERS),$(if $(CONFIG_PACKAGE_libgl-mesa-dri-$(dri)),$(dri)))" \
67 )
68 endef
69
70 define Build/InstallDev
71 $(INSTALL_DIR) $(1)/usr/{include/GL,lib/pkgconfig}
72 $(CP) \
73 $(PKG_INSTALL_DIR)/usr/include/GL/* \
74 $(1)/usr/include/GL
75
76 $(CP) \
77 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
78 $(1)/usr/lib
79
80 $(INSTALL_DATA) \
81 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
82 $(1)/usr/lib/pkgconfig
83 endef
84
85 define Package/libgl-mesa/install
86 $(INSTALL_DIR) $(1)/usr/lib
87 $(CP) \
88 $(PKG_INSTALL_DIR)/usr/lib/libGL.so* \
89 $(1)/usr/lib/
90 endef
91
92 define Package/libglu-mesa/install
93 $(INSTALL_DIR) $(1)/usr/lib
94 $(CP) \
95 $(PKG_INSTALL_DIR)/usr/lib/libGLU.so* \
96 $(1)/usr/lib/
97 endef
98
99 define Package/libgl-mesa-dri/install/Default
100 define Package/libgl-mesa-dri-$(1)/install
101 $(INSTALL_DIR) $$(1)/usr/lib/dri/
102 $(CP) \
103 $(PKG_INSTALL_DIR)/usr/lib/dri/$(1)_dri.so* \
104 $$(1)/usr/lib/dri
105 endef
106 endef
107
108 $(foreach dri,$(DRIDRIVERS),$(eval $(call Package/libgl-mesa-dri/install/Default,$(dri))))
109
110 $(eval $(call BuildPackage,libgl-mesa))
111 $(eval $(call BuildPackage,libglu-mesa))
112 $(foreach dri,$(DRIDRIVERS),$(eval $(call BuildPackage,libgl-mesa-dri-$(dri))))