Mesa (master): automake: convert es1api

Matt Turner mattst88 at kemper.freedesktop.org
Thu Aug 23 16:56:37 UTC 2012


Module: Mesa
Branch: master
Commit: a6b8b709cdc280d3dc77cd9f78654726132d22bb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a6b8b709cdc280d3dc77cd9f78654726132d22bb

Author: Matt Turner <mattst88 at gmail.com>
Date:   Tue Aug 21 14:36:44 2012 -0700

automake: convert es1api

---

 configure.ac                    |    2 +
 src/mapi/es1api/.gitignore      |    1 +
 src/mapi/es1api/Makefile        |  137 ---------------------------------------
 src/mapi/es1api/Makefile.am     |   60 +++++++++++++++++
 src/mapi/es1api/glesv1_cm.pc.in |   12 ++--
 5 files changed, 69 insertions(+), 143 deletions(-)

diff --git a/configure.ac b/configure.ac
index eafbd65..e9d4e79 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2024,6 +2024,8 @@ AC_CONFIG_FILES([configs/current
 		src/glsl/tests/Makefile
 		src/glx/Makefile
 		src/glx/tests/Makefile
+		src/mapi/es1api/Makefile
+		src/mapi/es1api/glesv1_cm.pc
 		src/mapi/es2api/Makefile
 		src/mapi/es2api/glesv2.pc
 		src/mapi/glapi/Makefile
diff --git a/src/mapi/es1api/.gitignore b/src/mapi/es1api/.gitignore
index dfe4656..39b0e7c 100644
--- a/src/mapi/es1api/.gitignore
+++ b/src/mapi/es1api/.gitignore
@@ -1 +1,2 @@
 glapi_mapi_tmp.h
+Makefile
diff --git a/src/mapi/es1api/Makefile b/src/mapi/es1api/Makefile
deleted file mode 100644
index 6f4c35a..0000000
--- a/src/mapi/es1api/Makefile
+++ /dev/null
@@ -1,137 +0,0 @@
-# src/mapi/es1api/Makefile
-
-TOP := ../../..
-include $(TOP)/configs/current
-
-# this Makefile can build both OpenGL ES 1.1 and 2.0
-ifeq ($(ES),)
-ES := es1
-
-esapi_HEADER := GLES
-esapi_PC := glesv1_cm.pc
-
-esapi_LIB := $(GLESv1_CM_LIB)
-esapi_LIB_NAME := $(GLESv1_CM_LIB_NAME)
-esapi_LIB_GLOB := $(GLESv1_CM_LIB_GLOB)
-esapi_LIB_DEPS := $(GLESv1_CM_LIB_DEPS)
-esapi_LIB_MAJOR := 1
-esapi_LIB_MINOR := 1
-esapi_LIB_PATCH := 0
-else
-esapi_HEADER := GLES2
-esapi_PC := glesv2.pc
-
-esapi_LIB := $(GLESv2_LIB)
-esapi_LIB_NAME := $(GLESv2_LIB_NAME)
-esapi_LIB_GLOB := $(GLESv2_LIB_GLOB)
-esapi_LIB_DEPS := $(GLESv2_LIB_DEPS)
-esapi_LIB_MAJOR := 2
-esapi_LIB_MINOR := 0
-esapi_LIB_PATCH := 0
-endif
-
-ESAPI = $(ES)api
-
-GLAPI := $(TOP)/src/mapi/glapi
-MAPI := $(TOP)/src/mapi/mapi
-
-esapi_CPPFLAGS := \
-	-I$(TOP)/include \
-	-I$(TOP)/src/mapi \
-	-DMAPI_ABI_HEADER=\"$(ESAPI)/glapi_mapi_tmp.h\"
-
-
-# This is a lie when doing out-of-tree builds, but it's no worse than the
-# current situation, and can be dropped should this get automakified
-top_srcdir = $(TOP)
-include $(MAPI)/sources.mak
-esapi_SOURCES := $(MAPI_BRIDGE_FILES)
-esapi_OBJECTS := $(notdir $(MAPI_BRIDGE_FILES:.c=.o))
-esapi_CPPFLAGS += -DMAPI_MODE_BRIDGE
-
-esapi_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(esapi_LIB_DEPS)
-
-.PHONY: default
-default: depend $(TOP)/$(LIB_DIR)/$(esapi_LIB_NAME)
-
-$(TOP)/$(LIB_DIR)/$(esapi_LIB_NAME): $(esapi_OBJECTS)
-	$(MKLIB) -o $(esapi_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-		-major $(esapi_LIB_MAJOR) \
-		-minor $(esapi_LIB_MINOR) \
-		-patch $(esapi_LIB_PATCH) \
-		-id $(INSTALL_LIB_DIR)/lib$(esapi_LIB).$(esapi_LIB_MAJOR).dylib \
-		$(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
-		$(esapi_OBJECTS) $(esapi_LIB_DEPS)
-
-# not used, but kept for completeness
-lib$(ESAPI).a: $(esapi_OBJECTS)
-	@$(MKLIB) -o $(ESAPI) -static $(esapi_OBJECTS)
-
-$(esapi_OBJECTS): %.o: $(MAPI)/%.c
-	$(CC) -c $(esapi_CPPFLAGS) $(CFLAGS) $< -o $@
-
-$(esapi_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,$<,$(ESAPI))
-
-.PHONY: clean
-clean:
-	-rm -f $(esapi_PC)
-	-rm -f $(TOP)/$(LIB_DIR)/$(esapi_LIB_NAME)
-	-rm -f lib$(ESAPI).a
-	-rm -f $(esapi_OBJECTS)
-	-rm -f depend depend.bak
-	-rm -f glapi_mapi_tmp.h
-
-pcedit = \
-	-e 's, at INSTALL_DIR@,$(INSTALL_DIR),' \
-	-e 's, at INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
-	-e 's, at INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
-	-e 's, at VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
-
-pcedit-es1 = \
-	$(pcedit) \
-	-e 's, at GLESv1_CM_PC_REQ_PRIV@,$(GLESv1_CM_PC_REQ_PRIV),' \
-	-e 's, at GLESv1_CM_PC_LIB_PRIV@,$(GLESv1_CM_PC_LIB_PRIV),' \
-	-e 's, at GLESv1_CM_PC_CFLAGS@,$(GLESv1_CM_PC_CFLAGS),' \
-	-e 's, at GLESv1_CM_LIB@,$(GLESv1_CM_LIB),'
-
-pcedit-es2 = \
-	$(pcedit) \
-	-e 's, at GLESv2_PC_REQ_PRIV@,$(GLESv2_PC_REQ_PRIV),' \
-	-e 's, at GLESv2_PC_LIB_PRIV@,$(GLESv2_PC_LIB_PRIV),' \
-	-e 's, at GLESv2_PC_CFLAGS@,$(GLESv2_PC_CFLAGS),' \
-	-e 's, at GLESv2_LIB@,$(GLESv2_LIB),'
-
-$(esapi_PC): $(esapi_PC).in
-	@sed $(pcedit-$(ES)) $< > $@
-
-install-headers:
-	$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/$(esapi_HEADER)
-	$(INSTALL) -m 644 $(TOP)/include/$(esapi_HEADER)/*.h \
-		$(DESTDIR)$(INSTALL_INC_DIR)/$(esapi_HEADER)
-
-install-pc: $(esapi_PC)
-	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
-	$(INSTALL) -m 644 $(esapi_PC) $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
-
-install: default install-headers install-pc
-	$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
-	$(MINSTALL) $(TOP)/$(LIB_DIR)/$(esapi_LIB_GLOB) \
-		$(DESTDIR)$(INSTALL_LIB_DIR)
-
-# workaround a bug in makedepend
-makedepend_CPPFLAGS := \
-	$(filter-out -DMAPI_ABI_HEADER=%, $(esapi_CPPFLAGS))
-$(esapi_OBJECTS): glapi_mapi_tmp.h
-
-depend: $(esapi_SOURCES)
-	@echo "running $(MKDEP)"
-	@touch depend
-	@$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(makedepend_CPPFLAGS) \
-		$(esapi_SOURCES) 2>/dev/null | \
-		sed -e 's,^$(GLAPI)/,,' -e 's,^$(MAPI)/,,' > depend
-
--include depend
diff --git a/src/mapi/es1api/Makefile.am b/src/mapi/es1api/Makefile.am
new file mode 100644
index 0000000..5c7258f
--- /dev/null
+++ b/src/mapi/es1api/Makefile.am
@@ -0,0 +1,60 @@
+# Copyright © 2012 Intel Corporation
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+# IN THE SOFTWARE.
+
+AM_CPPFLAGS = \
+	$(DEFINES) \
+	-I$(top_srcdir)/include \
+	-I$(top_srcdir)/src/mapi \
+	-DMAPI_MODE_BRIDGE \
+	-DMAPI_ABI_HEADER=\"glapi_mapi_tmp.h\"
+
+AM_CFLAGS = $(VISIBILITY_CFLAGS)
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = glesv1_cm.pc
+
+GLES_includedir = $(includedir)/GLES
+GLES_include_HEADERS = \
+	$(top_srcdir)/include/GLES/egl.h \
+	$(top_srcdir)/include/GLES/gl.h \
+	$(top_srcdir)/include/GLES/glext.h \
+	$(top_srcdir)/include/GLES/glplatform.h
+
+lib_LTLIBRARIES = libGLESv1_CM.la
+
+libGLESv1_CM_la_SOURCES = ../mapi/entry.c glapi_mapi_tmp.h
+libGLESv1_CM_la_LIBADD = $(GLESv1_CM_LIB_DEPS)
+libGLESv1_CM_la_LDFLAGS = -version-number 1:1 -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,$<,es1api)
+
+BUILT_SOURCES = glapi_mapi_tmp.h
+CLEANFILES = $(BUILT_SOURCES)
+
+# Provide compatibility with scripts for the old Mesa build system for
+# a while by putting a link to the driver into /lib of the build tree.
+all-local: libGLESv1_CM.la
+	$(MKDIR_P) $(top_builddir)/$(LIB_DIR);
+	ln -f .libs/libGLESv1_CM.so $(top_builddir)/$(LIB_DIR)/libGLESv1_CM.so
+	ln -f .libs/libGLESv1_CM.so.1 $(top_builddir)/$(LIB_DIR)/libGLESv1_CM.so.1
+	ln -f .libs/libGLESv1_CM.so.1.1.0 $(top_builddir)/$(LIB_DIR)/libGLESv1_CM.so.1.1.0
diff --git a/src/mapi/es1api/glesv1_cm.pc.in b/src/mapi/es1api/glesv1_cm.pc.in
index 291f5ab..0c2fed7 100644
--- a/src/mapi/es1api/glesv1_cm.pc.in
+++ b/src/mapi/es1api/glesv1_cm.pc.in
@@ -1,12 +1,12 @@
-prefix=@INSTALL_DIR@
+prefix=@prefix@
 exec_prefix=${prefix}
-libdir=@INSTALL_LIB_DIR@
-includedir=@INSTALL_INC_DIR@
+libdir=@libdir@
+includedir=@includedir@
 
 Name: glesv1_cm
 Description: Mesa OpenGL ES 1.1 CM library
-Requires.private: @GLESv1_CM_PC_REQ_PRIV@
+Requires.private:
 Version: @VERSION@
-Libs: -L${libdir} -l at GLESv1_CM_LIB@
+Libs: -L${libdir} -lGLESv1_CM
 Libs.private: @GLESv1_CM_PC_LIB_PRIV@
-Cflags: -I${includedir} @GLESv1_CM_PC_CFLAGS@
+Cflags: -I${includedir}




More information about the mesa-commit mailing list