fixed compilation of XOrg ati video driver
[openwrt/svn-archive/archive.git] / XOrg / driver / common.mk
index 110dc441874ac13cd9979ec0223e143d371f772f..5ded67518343dfec73ef620e8db2b71b7b644398 100644 (file)
@@ -12,23 +12,31 @@ _CATEGORY:=driver
 _DEPEND+=+xorg-server-X11R7.2
 include ../../common.mk
 
-EXTRA_CFLAGS+= -I${STAGING_DIR}/usr/include/xorg -I${STAGING_DIR}/usr/include/X11/
+EXTRA_CPPFLAGS= -I$(STAGING_DIR)/usr/include/xorg \
+               -I$(STAGING_DIR)/usr/include/X11/ \
+               -I$(STAGING_DIR)/usr/include/ \
+               -I$(STAGING_DIR)/include/
 
-CONFIGURE_VARS+=DRI_CFLAGS="-I$(STAGING_DIR)/usr/include/X11/dri/"
+EXTRA_CFLAGS+= $(EXTRA_CPPFLAGS)
 
 acvar=$(subst -,_,$(subst .,_,$(subst /,_,$(1))))
 
-CONFIGURE_VARS += $(foreach a,dri.h sarea.h dristruct.h exa.h,ac_cv_file_$(call acvar,$(STAGING_DIR)/usr/include/xorg/$(a))=yes) \
-               ac_cv_file__usr_share_sgml_X11_defs_ent=yes
+CONFIGURE_VARS +=DRI_CFLAGS="-I$(STAGING_DIR)/usr/include/X11/dri/" ac_cv_file__usr_share_sgml_X11_defs_ent=yes \
+       sdkdir=$(STAGING_DIR) 
+       #i\
+       #ac_cv_header_exa_h=yes
 
 define Build/Configure
        (cd $(PKG_BUILD_DIR)/$(CONFIGURE_PATH); \
        if [ -x $(CONFIGURE_CMD) ]; then \
                $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ && \
+               $(foreach a,dri.h sarea.h dristruct.h exa.h,export ac_cv_file_$(call acvar,$(STAGING_DIR)/usr/include/xorg/$(a))=yes;) \
+               sed -i "s|sdkdir=.*|sdkdir=$(STAGING_DIR)/usr/include/xorg|g" $(PKG_BUILD_DIR)/configure ;\
                $(CONFIGURE_VARS) \
                $(CONFIGURE_CMD) \
                $(CONFIGURE_ARGS_XTRA) \
-               $(CONFIGURE_ARGS) ;\
+               $(CONFIGURE_ARGS) \
+               CPPFLAGS="$(EXTRA_CPPFLAGS)" ;\
        fi \
        )
 endef