01ce18de3264655c9c92d28ac6dadccca8215811
[openwrt/svn-archive/archive.git] / Xorg / xorg / driver / xf86-video-ati / Makefile
1 #
2 # Copyright (C) 2007-2009 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 include $(TOPDIR)/rules.mk
9
10 PKG_BASE_NAME:=xf86
11 PKG_NAME:=xf86-video-ati
12 PKG_RELEASE:=2
13 PKG_VERSION:=6.9.0
14 PKG_SOURCE_URL:=http://xorg.freedesktop.org/releases/X11R7.4/src/driver
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_BUILD_DIR=$(BUILD_DIR)/Xorg/$(_CATEGORY)/${PKG_NAME}-$(PKG_VERSION)/
17
18 include $(INCLUDE_DIR)/package.mk
19
20 define Package/xf86-video-ati
21 SECTION:=xorg-driver
22 CATEGORY:=Xorg
23 SUBMENU:=driver
24 DEPENDS:=+xserver-xorg @BROKEN
25 TITLE:=xf86-video-ati
26 URL:=http://xorg.freedesktop.org/
27 endef
28
29 define Build/InstallDev
30 DESTDIR="$(1)" $(MAKE) -C $(PKG_BUILD_DIR)/ $(MAKE_FLAGS) install
31 endef
32
33 EXTRA_CPPFLAGS= -I$(STAGING_DIR)/usr/include/xorg \
34 -I$(STAGING_DIR)/usr/include/X11/ \
35 $(TARGET_CPPFLAGS)
36
37 EXTRA_CFLAGS+= $(EXTRA_CPPFLAGS)
38
39 acvar=$(subst -,_,$(subst .,_,$(subst /,_,$(1))))
40
41 CONFIGURE_VARS +=DRI_CFLAGS="-I$(STAGING_DIR)/usr/include/X11/dri/" ac_cv_file__usr_share_sgml_X11_defs_ent=yes \
42 sdkdir=$(STAGING_DIR)
43
44 define Build/Configure
45 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH); \
46 if [ -x $(CONFIGURE_CMD) ]; then \
47 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ && \
48 $(foreach a,dri.h sarea.h dristruct.h exa.h damage.h,export ac_cv_file_$(call acvar,$(STAGING_DIR)/usr/include/xorg/$(a))=yes;) \
49 sed -i "s|sdkdir=.*|sdkdir=$(STAGING_DIR)/usr/include/xorg|g" $(PKG_BUILD_DIR)/configure ;\
50 $(CONFIGURE_VARS) \
51 $(CONFIGURE_CMD) \
52 $(CONFIGURE_ARGS_XTRA) \
53 $(CONFIGURE_ARGS) \
54 CPPFLAGS="$(EXTRA_CPPFLAGS)" ;\
55 fi \
56 )
57 endef
58
59 define Build/Compile
60 make -C $(PKG_BUILD_DIR)
61 DESTDIR=$(PKG_INSTALL_DIR) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) install
62 find $(PKG_INSTALL_DIR) -name *a | xargs rm -rf
63 endef
64
65 define Package/xf86-video-ati/install
66 $(INSTALL_DIR) $(1)/usr/lib/
67 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
68 endef
69
70 $(eval $(call BuildPackage,xf86-video-ati))