[Mesa-dev] [PATCH 03/12] build: Get rid of CORE_DIRS

Matt Turner mattst88 at gmail.com
Thu Apr 11 16:29:51 PDT 2013


A step toward working make dist/distcheck.

Tested-by: Emil Velikov <emil.l.velikov at gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev at gmail.com>
---
 configure.ac         | 37 ++++++++-----------------------------
 src/Makefile.am      | 30 +++++++++++++++++++++++++++---
 src/mapi/Makefile.am | 42 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 77 insertions(+), 32 deletions(-)
 create mode 100644 src/mapi/Makefile.am

diff --git a/configure.ac b/configure.ac
index 55ebb07..c658047 100644
--- a/configure.ac
+++ b/configure.ac
@@ -690,6 +690,13 @@ if test "x$enable_gles2" = xyes; then
 fi
 AC_SUBST([API_DEFINES])
 
+AM_CONDITIONAL(HAVE_OPENGL, test "x$enable_opengl" = xyes)
+AM_CONDITIONAL(HAVE_OPENGL_ES1, test "x$enable_gles1" = xyes)
+AM_CONDITIONAL(HAVE_OPENGL_ES2, test "x$enable_gles2" = xyes)
+AM_CONDITIONAL(NEED_OPENGL_COMMON, test "x$enable_opengl" = xyes -o \
+                                        "x$enable_gles1" = xyes -o \
+                                        "x$enable_gles2" = xyes)
+
 if test "x$enable_glx" = xno; then
     AC_MSG_WARN([GLX disabled, disabling Xlib-GLX])
     enable_xlib_glx=no
@@ -737,7 +744,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"
-    CORE_DIRS="mapi/shared-glapi"
 fi
 AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
 
@@ -750,28 +756,6 @@ GALLIUM_WINSYS_DIRS="sw"
 GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
 GALLIUM_STATE_TRACKERS_DIRS=""
 
-# build glapi if OpenGL is enabled
-if test "x$enable_opengl" = xyes; then
-    CORE_DIRS="$CORE_DIRS mapi/glapi"
-fi
-
-# build es1api if OpenGL ES 1.x is enabled
-if test "x$enable_gles1" = xyes; then
-    CORE_DIRS="$CORE_DIRS mapi/es1api"
-fi
-
-# build es2api if OpenGL ES 2.x is enabled
-if test "x$enable_gles2" = xyes; then
-    CORE_DIRS="$CORE_DIRS mapi/es2api"
-fi
-
-# build glsl and mesa if OpenGL or OpenGL ES is enabled
-case "x$enable_opengl$enable_gles1$enable_gles2" in
-x*yes*)
-    CORE_DIRS="mapi/glapi/gen $CORE_DIRS gtest glsl mesa"
-    ;;
-esac
-
 case "x$enable_glx$enable_xlib_glx" in
 xyesyes)
     DRIVER_DIRS="$DRIVER_DIRS x11"
@@ -1341,7 +1325,6 @@ if test "x$enable_openvg" = xyes; then
 
     EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
     VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
-    CORE_DIRS="$CORE_DIRS mapi/vgapi"
     GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
     HAVE_ST_VEGA=yes
     VG_PC_LIB_PRIV="-lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS"
@@ -1455,10 +1438,8 @@ AC_SUBST([CLANG_RESOURCE_DIR])
 case "x$enable_opengl$enable_gles1$enable_gles2" in
 x*yes*)
     EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(GL_LIB)'
-    HAVE_OPENGL=yes
     ;;
 esac
-AM_CONDITIONAL(HAVE_OPENGL, test "x$HAVE_OPENGL" = xyes)
 
 AC_SUBST([VG_LIB_DEPS])
 AC_SUBST([EGL_CLIENT_APIS])
@@ -2022,9 +2003,6 @@ AC_SUBST([XA_MINOR], 0)
 AC_SUBST([XA_TINY], 0)
 AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY")
 
-dnl prepend CORE_DIRS to SRC_DIRS
-SRC_DIRS="$CORE_DIRS $SRC_DIRS"
-
 dnl Restore LDFLAGS and CPPFLAGS
 LDFLAGS="$_SAVE_LDFLAGS"
 CPPFLAGS="$_SAVE_CPPFLAGS"
@@ -2132,6 +2110,7 @@ AC_CONFIG_FILES([Makefile
 		src/glx/Makefile
 		src/glx/tests/Makefile
 		src/gtest/Makefile
+		src/mapi/Makefile
 		src/mapi/es1api/Makefile
 		src/mapi/es1api/glesv1_cm.pc
 		src/mapi/es2api/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index d6a7946..d096f29 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,28 @@
-SUBDIRS=$(SRC_DIRS)
+# Copyright © 2013 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.
 
-all-local:
-	$(MKDIR_P) $(top_builddir)/$(LIB_DIR)
+SUBDIRS = gtest mapi
+
+if NEED_OPENGL_COMMON
+SUBDIRS += glsl mesa
+endif
+
+SUBDIRS += $(SRC_DIRS)
diff --git a/src/mapi/Makefile.am b/src/mapi/Makefile.am
new file mode 100644
index 0000000..ef53803
--- /dev/null
+++ b/src/mapi/Makefile.am
@@ -0,0 +1,42 @@
+# Copyright © 2013 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.
+
+SUBDIRS = glapi/gen
+
+if HAVE_SHARED_GLAPI
+SUBDIRS += shared-glapi
+endif
+
+if HAVE_OPENGL
+SUBDIRS += glapi
+endif
+
+if HAVE_OPENGL_ES1
+SUBDIRS += es1api
+endif
+
+if HAVE_OPENGL_ES2
+SUBDIRS += es2api
+endif
+
+if HAVE_OPENVG
+SUBDIRS += vgapi
+endif
-- 
1.8.1.5



More information about the mesa-dev mailing list