android: adapt to the megadriver mechanism
authorAdrian Negreanu <adrian.m.negreanu@intel.com>
Fri, 6 Jun 2014 09:16:06 +0000 (12:16 +0300)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 9 Jun 2014 21:50:41 +0000 (22:50 +0100)
Fixes linker error:
  ld:
  .../libmesa_dri_common_intermediates/libmesa_dri_common.a(dri_util.o):
    in function globalDriverAPI:dri_util.c(.data.rel+0x0): error:
    undefined reference to 'driDriverAPI'

As an example, you can see that mesa_dri_drivers
also uses common/libmegadriver_stub (src/mesa/drivers/dri/Makefile.am)

The _stub part might be confusing, but
it actually provides the dri-driver shared lib constructor,
megadriver_stub_init, which will later on load the real
platform dependent part and call
l __driDriverGetExtensions_<platform>

Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Adrian Negreanu <adrian.m.negreanu@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
src/mesa/drivers/dri/Android.mk
src/mesa/drivers/dri/common/Android.mk

index 9adf0b38620fbebd94479592ab261f0e0889f212..e0cf51c58fdad6d76fdcab3aadde64e84d78a42a 100644 (file)
@@ -43,6 +43,7 @@ MESA_DRI_C_INCLUDES := \
 
 MESA_DRI_WHOLE_STATIC_LIBRARIES := \
        libmesa_glsl \
+       libmegadriver_stub \
        libmesa_dri_common \
        libmesa_dricore
 
index 0489a32de933986b2edb544681520665adcfa4b6..a172a0bc630b79b5d929c2b3a4879779b1ddacee 100644 (file)
@@ -86,3 +86,20 @@ $(intermediates)/xmlpool/options.h: $$(PRIVATE_SCRIPT) $$(PRIVATE_TEMPLATE_HEADE
 
 include $(MESA_COMMON_MK)
 include $(BUILD_STATIC_LIBRARY)
+
+#
+# Build libmegadriver_stub
+#
+
+include $(CLEAR_VARS)
+include $(LOCAL_PATH)/Makefile.sources
+
+LOCAL_MODULE := libmegadriver_stub
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+LOCAL_C_INCLUDES := \
+    $(MESA_DRI_C_INCLUDES)
+
+LOCAL_SRC_FILES := $(megadriver_stub_FILES)
+
+include $(MESA_COMMON_MK)
+include $(BUILD_STATIC_LIBRARY)