add target dependencies to xf86 video drivers
[openwrt/svn-archive/archive.git] / Xorg / xorg / driver / xf86-video-intel / 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-intel
12 PKG_RELEASE:=3
13 PKG_VERSION:=2.4.2
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 PKG_MD5SUM:=5cd6b3ed57c7e78ab51e9d9266e73fb6
18 PKG_BUILD_DEPENDS:=xf86driproto glproto
19
20 include $(INCLUDE_DIR)/package.mk
21
22 define Package/xf86-video-intel
23 SECTION:=xorg-driver
24 CATEGORY:=Xorg
25 SUBMENU:=driver
26 DEPENDS:=+xserver-xorg @TARGET_i386
27 TITLE:=xf86-video-intel
28 URL:=http://xorg.freedesktop.org/
29 endef
30
31 define Build/InstallDev
32 DESTDIR="$(1)" $(MAKE) -C $(PKG_BUILD_DIR)/ $(MAKE_FLAGS) install
33 endef
34
35 EXTRA_CPPFLAGS= -I$(STAGING_DIR)/usr/include/xorg \
36 -I$(STAGING_DIR)/usr/include/X11/ \
37 -I$(STAGING_DIR)/usr/include/drm \
38 $(TARGET_CPPFLAGS)
39
40 EXTRA_CFLAGS+= $(EXTRA_CPPFLAGS)
41
42 acvar=$(subst -,_,$(subst .,_,$(subst /,_,$(1))))
43
44 CONFIGURE_VARS +=DRI_CFLAGS="-I$(STAGING_DIR)/usr/include/X11/dri/" ac_cv_file__usr_share_sgml_X11_defs_ent=yes \
45 sdkdir=$(STAGING_DIR)
46
47 define Build/Configure
48 (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH); \
49 if [ -x $(CONFIGURE_CMD) ]; then \
50 $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ && \
51 $(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;) \
52 sed -i "s|sdkdir=.*|sdkdir=$(STAGING_DIR)/usr/include/xorg|g" $(PKG_BUILD_DIR)/configure ;\
53 $(CONFIGURE_VARS) \
54 $(CONFIGURE_CMD) \
55 $(CONFIGURE_ARGS_XTRA) \
56 $(CONFIGURE_ARGS) \
57 CPPFLAGS="$(EXTRA_CPPFLAGS)" ;\
58 fi \
59 )
60 endef
61
62 define Build/Compile
63 make -C $(PKG_BUILD_DIR)
64 DESTDIR=$(PKG_INSTALL_DIR) $(MAKE) -C $(PKG_BUILD_DIR) $(MAKE_FLAGS) install
65 find $(PKG_INSTALL_DIR) -name *a | xargs rm -rf
66 endef
67
68 define Package/xf86-video-intel/install
69 $(INSTALL_DIR) $(1)/usr/lib/
70 $(CP) $(PKG_INSTALL_DIR)/usr/lib/* $(1)/usr/lib/
71 endef
72
73 $(eval $(call BuildPackage,xf86-video-intel))