[Mesa-dev] [PATCH] Revert "shared-glapi: Convert to automake"
Chad Versace
chad.versace at linux.intel.com
Tue Apr 10 13:13:13 PDT 2012
This reverts commit ca760181b4420696c7e86aa2951d7203522ad1e8.
That commit broke the Android build. The guilty change in that commit was
twofold. It first changed the pattern of some variable definitions, then
made a illegal change in Android.mk
src/mapi/mapi/sources.mak
- FOO_FILE := bar.c
+ FOO_FILE := $(TOP)/src/mapi/mapi/bar.c
src/mapi/Android.mk
-LOCAL_SRC_FILES := $(MAPI_GLAPI_FILES)
+LOCAL_SRC_FILES := $(addprefix mapi/, $(MAPI_GLAPI_SOURCES))
Source filepaths in Android makefiles must be relative to the makefile.
CC: Kristian Høgsberg <krh at bitplanet.net>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
configure.ac | 2 -
src/egl/main/Makefile.am | 1 +
src/gbm/Makefile.am | 4 +-
src/glx/Makefile.am | 2 +-
src/mapi/Android.mk | 4 +-
src/mapi/es1api/Makefile | 4 +-
src/mapi/glapi/Makefile | 8 ++--
src/mapi/mapi/sources.mak | 42 ++++++++++++------------
src/mapi/shared-glapi/Makefile | 65 +++++++++++++++++++++++++++++++++++++
src/mapi/shared-glapi/Makefile.am | 27 ---------------
src/mapi/vgapi/Makefile | 4 +-
11 files changed, 100 insertions(+), 63 deletions(-)
create mode 100644 src/mapi/shared-glapi/Makefile
delete mode 100644 src/mapi/shared-glapi/Makefile.am
diff --git a/configure.ac b/configure.ac
index 21e4308..49b067d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -702,7 +702,6 @@ if test "x$enable_shared_glapi" = xyes; then
# libGL will use libglapi for function lookups (IN_DRI_DRIVER means to use
# the remap table)
DEFINES="$DEFINES -DIN_DRI_DRIVER"
- SRC_DIRS="$SRC_DIRS mapi/shared-glapi"
fi
AC_SUBST([SHARED_GLAPI])
AM_CONDITIONAL(HAVE_SHARED_GLAPI, test $SHARED_GLAPI = 1)
@@ -1998,7 +1997,6 @@ AC_CONFIG_FILES([configs/autoconf
src/egl/wayland/wayland-egl/wayland-egl.pc
src/egl/wayland/wayland-drm/Makefile
src/glx/Makefile
- src/mapi/shared-glapi/Makefile
src/mesa/drivers/dri/dri.pc
src/mesa/drivers/dri/Makefile
src/mesa/drivers/dri/common/Makefile
diff --git a/src/egl/main/Makefile.am b/src/egl/main/Makefile.am
index 9c3935b..a8072c1 100644
--- a/src/egl/main/Makefile.am
+++ b/src/egl/main/Makefile.am
@@ -93,6 +93,7 @@ endif
if HAVE_EGL_PLATFORM_DRM
AM_CFLAGS += -DHAVE_DRM_PLATFORM
libEGL_la_LIBADD += ../../gbm/libgbm.la
+libEGL_la_LIBADD += ../../gbm/libgbm.la
endif
if HAVE_EGL_PLATFORM_FBDEV
diff --git a/src/gbm/Makefile.am b/src/gbm/Makefile.am
index dede5bc..1dbc9d1 100644
--- a/src/gbm/Makefile.am
+++ b/src/gbm/Makefile.am
@@ -31,8 +31,8 @@ libgbm_dri_la_CFLAGS = \
-DDEFAULT_DRIVER_DIR='"$(DRI_DRIVER_SEARCH_DIR)"' \
$(LIBDRM_CFLAGS)
-libgbm_la_LIBADD += \
- libgbm_dri.la $(top_builddir)/src/mapi/shared-glapi/libglapi.la
+libgbm_la_LDFLAGS += -L$(top_builddir)/$(LIB_DIR)
+libgbm_la_LIBADD += libgbm_dri.la -lglapi
endif
all-local: libgbm.la
diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am
index ec62faa..062ed9e 100644
--- a/src/glx/Makefile.am
+++ b/src/glx/Makefile.am
@@ -21,7 +21,7 @@
if HAVE_SHARED_GLAPI
SHARED_GLAPI_CFLAGS = -DGLX_SHARED_GLAPI
-SHARED_GLAPI_LIBS = $(top_builddir)/src/mapi/shared-glapi/libglapi.la
+SHARED_GLAPI_LIBS = -L$(top_builddir)/$(LIB_DIR) -lglapi
endif
GLAPI_LIB = ../mapi/glapi/libglapi.a
diff --git a/src/mapi/Android.mk b/src/mapi/Android.mk
index b75361f..fe9e40e 100644
--- a/src/mapi/Android.mk
+++ b/src/mapi/Android.mk
@@ -25,7 +25,7 @@
LOCAL_PATH := $(call my-dir)
-# get MAPI_GLAPI_FILES
+# get MAPI_GLAPI_SOURCES
include $(LOCAL_PATH)/mapi/sources.mak
mapi_abi_headers :=
@@ -38,7 +38,7 @@ include $(CLEAR_VARS)
abi_header := shared-glapi/glapi_mapi_tmp.h
-LOCAL_SRC_FILES := $(MAPI_GLAPI_FILES)
+LOCAL_SRC_FILES := $(addprefix mapi/, $(MAPI_GLAPI_SOURCES))
LOCAL_CFLAGS := \
-DMAPI_MODE_GLAPI \
diff --git a/src/mapi/es1api/Makefile b/src/mapi/es1api/Makefile
index a9c9123..0a0449b 100644
--- a/src/mapi/es1api/Makefile
+++ b/src/mapi/es1api/Makefile
@@ -41,8 +41,8 @@ esapi_CPPFLAGS := \
-DMAPI_ABI_HEADER=\"$(ESAPI)/glapi_mapi_tmp.h\"
include $(MAPI)/sources.mak
-esapi_SOURCES := $(MAPI_BRIDGE_FILES)
-esapi_OBJECTS := $(notdir $(MAPI_BRIDGE_FILES:.c=.o))
+esapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_BRIDGE_SOURCES))
+esapi_OBJECTS := $(MAPI_BRIDGE_SOURCES:.c=.o)
esapi_CPPFLAGS += -DMAPI_MODE_BRIDGE
esapi_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(esapi_LIB_DEPS)
diff --git a/src/mapi/glapi/Makefile b/src/mapi/glapi/Makefile
index 211f384..bb4ed65 100644
--- a/src/mapi/glapi/Makefile
+++ b/src/mapi/glapi/Makefile
@@ -19,18 +19,18 @@ ifeq ($(SHARED_GLAPI),1)
glapi_CPPFLAGS += \
-DMAPI_MODE_BRIDGE \
-DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\"
-glapi_SOURCES := $(MAPI_BRIDGE_FILES)
+glapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_BRIDGE_SOURCES))
glapi_GLAPI_OBJECTS :=
glapi_ASM_OBJECTS :=
-glapi_MAPI_OBJECTS := $(notdir $(MAPI_BRIDGE_FILES:.c=.o))
+glapi_MAPI_OBJECTS := $(MAPI_BRIDGE_SOURCES:.c=.o)
else
glapi_CPPFLAGS += -DMAPI_MODE_UTIL
-glapi_SOURCES := $(GLAPI_SOURCES) $(MAPI_UTIL_FILES)
+glapi_SOURCES := $(GLAPI_SOURCES) $(addprefix $(MAPI)/, $(MAPI_UTIL_SOURCES))
glapi_GLAPI_OBJECTS := $(GLAPI_SOURCES:.c=.o)
glapi_ASM_OBJECTS := $(GLAPI_ASM_SOURCES:.S=.o)
-glapi_MAPI_OBJECTS := $(notdir $(MAPI_UTIL_FILES:.c=.o))
+glapi_MAPI_OBJECTS := $(MAPI_UTIL_SOURCES:.c=.o)
endif # SHARED_GLAPI
glapi_OBJECTS := \
diff --git a/src/mapi/mapi/sources.mak b/src/mapi/mapi/sources.mak
index 56f4afd..2814186 100644
--- a/src/mapi/mapi/sources.mak
+++ b/src/mapi/mapi/sources.mak
@@ -3,34 +3,34 @@
# mapi may be used in several ways
#
# - In default mode, mapi implements the interface defined by mapi.h. To use
-# this mode, compile MAPI_FILES.
+# this mode, compile MAPI_SOURCES.
#
# - In util mode, mapi provides utility functions for use with glapi. To use
-# this mode, compile MAPI_UTIL_FILES with MAPI_MODE_UTIL defined.
+# this mode, compile MAPI_UTIL_SOURCES with MAPI_MODE_UTIL defined.
#
# - In glapi mode, mapi implements the interface defined by glapi.h. To use
-# this mode, compile MAPI_GLAPI_FILES with MAPI_MODE_GLAPI defined.
+# this mode, compile MAPI_GLAPI_SOURCES with MAPI_MODE_GLAPI defined.
#
# - In bridge mode, mapi provides entry points calling into glapi. To use
-# this mode, compile MAPI_BRIDGE_FILES with MAPI_MODE_BRIDGE defined.
+# this mode, compile MAPI_BRIDGE_SOURCES with MAPI_MODE_BRIDGE defined.
-MAPI_UTIL_FILES = \
- $(TOP)/src/mapi/mapi/u_current.c \
- $(TOP)/src/mapi/mapi/u_execmem.c
+MAPI_UTIL_SOURCES = \
+ u_current.c \
+ u_execmem.c
-MAPI_FILES = \
- $(TOP)/src/mapi/mapi/entry.c \
- $(TOP)/src/mapi/mapi/mapi.c \
- $(TOP)/src/mapi/mapi/stub.c \
- $(TOP)/src/mapi/mapi/table.c \
- $(MAPI_UTIL_FILES)
+MAPI_SOURCES = \
+ entry.c \
+ mapi.c \
+ stub.c \
+ table.c \
+ $(MAPI_UTIL_SOURCES)
-MAPI_GLAPI_FILES = \
- $(TOP)/src/mapi/mapi/entry.c \
- $(TOP)/src/mapi/mapi/mapi_glapi.c \
- $(TOP)/src/mapi/mapi/stub.c \
- $(TOP)/src/mapi/mapi/table.c \
- $(MAPI_UTIL_FILES)
+MAPI_GLAPI_SOURCES = \
+ entry.c \
+ mapi_glapi.c \
+ stub.c \
+ table.c \
+ $(MAPI_UTIL_SOURCES)
-MAPI_BRIDGE_FILES = \
- $(TOP)/src/mapi/mapi/entry.c
+MAPI_BRIDGE_SOURCES = \
+ entry.c
diff --git a/src/mapi/shared-glapi/Makefile b/src/mapi/shared-glapi/Makefile
new file mode 100644
index 0000000..3de864d
--- /dev/null
+++ b/src/mapi/shared-glapi/Makefile
@@ -0,0 +1,65 @@
+# src/mapi/shared-glapi/Makefile
+#
+# Used by OpenGL ES or when --enable-shared-glapi is specified
+#
+
+TOP := ../../..
+include $(TOP)/configs/current
+
+GLAPI := $(TOP)/src/mapi/glapi
+MAPI := $(TOP)/src/mapi/mapi
+
+glapi_CPPFLAGS := \
+ -I$(TOP)/include \
+ -I$(TOP)/src/mapi \
+ -DMAPI_MODE_GLAPI \
+ -DMAPI_ABI_HEADER=\"shared-glapi/glapi_mapi_tmp.h\"
+
+include $(MAPI)/sources.mak
+glapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_GLAPI_SOURCES))
+glapi_OBJECTS := $(MAPI_GLAPI_SOURCES:.c=.o)
+
+.PHONY: default
+default: depend $(TOP)/$(LIB_DIR)/$(GLAPI_LIB_NAME)
+
+$(TOP)/$(LIB_DIR)/$(GLAPI_LIB_NAME): $(glapi_OBJECTS)
+ $(MKLIB) -o $(GLAPI_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
+ -major 0 -minor 0 -patch 0 \
+ -id $(INSTALL_LIB_DIR)/lib$(GLAPI_LIB).0.dylib \
+ $(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
+ $(glapi_OBJECTS) $(GLAPI_LIB_DEPS)
+
+$(glapi_OBJECTS): %.o: $(MAPI)/%.c
+ $(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@
+
+$(glapi_SOURCES): glapi_mapi_tmp.h
+
+include $(GLAPI)/gen/glapi_gen.mk
+glapi_mapi_tmp.h: $(GLAPI)/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
+ $(call glapi_gen_mapi,$<,shared-glapi)
+
+.PHONY: clean
+clean:
+ -rm -f $(TOP)/$(LIB_DIR)/$(GLAPI_LIB_NAME)
+ -rm -f $(glapi_OBJECTS)
+ -rm -f depend depend.bak
+ -rm -f glapi_mapi_tmp.h
+
+install:
+ $(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
+ $(MINSTALL) $(TOP)/$(LIB_DIR)/$(GLAPI_LIB_GLOB) \
+ $(DESTDIR)$(INSTALL_LIB_DIR)
+
+# workaround a bug in makedepend
+makedepend_CPPFLAGS := \
+ $(filter-out -DMAPI_ABI_HEADER=%, $(glapi_CPPFLAGS))
+$(glapi_OBJECTS): glapi_mapi_tmp.h
+
+depend: $(glapi_SOURCES)
+ @echo "running $(MKDEP)"
+ @touch depend
+ @$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(makedepend_CPPFLAGS) \
+ $(glapi_SOURCES) 2>/dev/null | sed -e 's,^$(MAPI)/,,' \
+ > depend
+
+-include depend
diff --git a/src/mapi/shared-glapi/Makefile.am b/src/mapi/shared-glapi/Makefile.am
deleted file mode 100644
index a80ba1f..0000000
--- a/src/mapi/shared-glapi/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-# Used by OpenGL ES or when --enable-shared-glapi is specified
-
-TOP = $(top_srcdir)
-GLAPI = $(top_srcdir)/src/mapi/glapi
-include $(top_srcdir)/src/mapi/mapi/sources.mak
-
-lib_LTLIBRARIES = libglapi.la
-libglapi_la_SOURCES = $(MAPI_GLAPI_FILES)
-libglapi_la_LDFLAGS = -no-undefined
-
-include $(GLAPI)/gen/glapi_gen.mk
-glapi_mapi_tmp.h : $(GLAPI)/gen/gl_and_es_API.xml $(glapi_gen_mapi_deps)
- $(call glapi_gen_mapi,$<,shared-glapi)
-
-BUILT_SOURCES = glapi_mapi_tmp.h
-
-AM_CPPFLAGS = \
- $(DEFINES) \
- -I$(top_srcdir)/include \
- -I$(top_srcdir)/src/mapi \
- -I$(top_builddir)/src/mapi \
- -DMAPI_MODE_GLAPI \
- -DMAPI_ABI_HEADER=\"shared-glapi/glapi_mapi_tmp.h\"
-
-all-local: libglapi.la
- $(MKDIR_P) $(top_builddir)/$(LIB_DIR)
- ln -f .libs/libglapi.so.0.0.0 $(top_builddir)/$(LIB_DIR)/libglapi.so
diff --git a/src/mapi/vgapi/Makefile b/src/mapi/vgapi/Makefile
index 91766f0..68cf26e 100644
--- a/src/mapi/vgapi/Makefile
+++ b/src/mapi/vgapi/Makefile
@@ -10,8 +10,8 @@ VG_LIB_PATCH = 0
MAPI := $(TOP)/src/mapi/mapi
include $(MAPI)/sources.mak
-VGAPI_SOURCES := $(MAPI_FILES)
-VGAPI_OBJECTS := $(notdir $(MAPI_FILES:.c=.o))
+VGAPI_SOURCES := $(addprefix $(MAPI)/, $(MAPI_SOURCES))
+VGAPI_OBJECTS := $(MAPI_SOURCES:.c=.o)
VGAPI_CPPFLAGS := -DMAPI_ABI_HEADER=\"vgapi/vgapi_tmp.h\"
--
1.7.7.6
More information about the mesa-dev
mailing list