17ff63fd0b28b3c5eeda7241618936f865e9e2f9
[openwrt/svn-archive/archive.git] / Xorg / xorg / driver / xf86-video-ati / Makefile
1 #
2 # Copyright (C) 2007 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 -I$(STAGING_DIR)/usr/include/ \
36 -I$(STAGING_DIR)/include/
37
38 EXTRA_CFLAGS+= $(EXTRA_CPPFLAGS)
39
40 acvar=$(subst -,_,$(subst .,_,$(subst /,_,$(1))))
41
42 CONFIGURE_VARS +=DRI_CFLAGS="-I$(STAGING_DIR)/usr/include/X11/dri/" ac_cv_file__usr_share_sgml_X11_defs_ent=yes \
43 sdkdir=$(STAGING_DIR)
44
45 define Build/Configure
46 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH); \
47 if [ -x $(CONFIGURE_CMD) ]; then \
48 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ && \
49 $(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;) \
50 sed -i "s|sdkdir=.*|sdkdir=$(STAGING_DIR)/usr/include/xorg|g" $(PKG_BUILD_DIR)/configure ;\
51 $(CONFIGURE_VARS) \
52 $(CONFIGURE_CMD) \
53 $(CONFIGURE_ARGS_XTRA) \
54 $(CONFIGURE_ARGS) \
55 CPPFLAGS="$(EXTRA_CPPFLAGS)" ;\
56 fi \
57 )
58 endef
59
60 define Build/Compile
61 make -C $(PKG_BUILD_DIR)
62 DESTDIR=$(PKG_INSTALL_DIR) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) install
63 find $(PKG_INSTALL_DIR) -name *a | xargs rm -rf
64 endef
65
66 define Package/xf86-video-ati/install
67 $(INSTALL_DIR) $(1)/usr/lib/
68 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
69 endef
70
71 $(eval $(call BuildPackage,xf86-video-ati))