Commit b30aad55 authored by Benjamin Gordon's avatar Benjamin Gordon Committed by Gurchetan Singh

configure.ac/meson.build: Add options for library suffixes

When building the Chrome OS Android container, we need to build copies
of mesa that don't conflict with the Android system-supplied libraries.
This adds options to create suffixed versions of EGL and GLES libraries:

libEGL.so -> libEGL${egl-lib-suffix}.so
libGLESv1_CM.so -> libGLESv1_CM${gles-lib-suffix}.so
libGLESv2.so -> libGLES${gles-lib-suffix}.so

This is similar to what happens when --enable-libglvnd is specified, but
without the side effects of linking against libglvnd.  To avoid
unexpected clashes with the suffixed appended by libglvnd, make it an
error to specify both --enable-libglvnd and --with-egl-lib-suffix.
Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@intel.com>
parent e426c3a6
Pipeline #25405 passed with stages
in 44 minutes and 12 seconds
......@@ -1557,6 +1557,23 @@ AC_ARG_WITH([osmesa-lib-name],
GL_LIB="$DEFAULT_GL_LIB_NAME"
OSMESA_LIB=OSMesa
AC_ARG_WITH([egl-lib-suffix],
[AS_HELP_STRING([--with-egl-lib-suffix@<:@=NAME@:>@],
[specify EGL library suffix @<:@default=none@:>@])],
[EGL_LIB_SUFFIX=$withval],
[EGL_LIB_SUFFIX=""])
AC_ARG_WITH([gles-lib-suffix],
[AS_HELP_STRING([--with-gles-lib-suffix@<:@=NAME@:>@],
[specify GLES library suffix @<:@default=none@:>@])],
[GLES_LIB_SUFFIX=$withval],
[GLES_LIB_SUFFIX=""])
AS_IF([test "x$EGL_LIB_SUFFIX" = xyes], [EGL_LIB_SUFFIX=""])
AS_IF([test "x$GLES_LIB_SUFFIX" = xyes], [GLES_LIB_SUFFIX=""])
if test "x$enable_libglvnd" = xyes -a "x$EGL_LIB_SUFFIX" != x; then
AC_MSG_ERROR([EGL lib suffix can't be used with libglvnd])
fi
dnl
dnl Mangled Mesa support
dnl
......@@ -1575,6 +1592,8 @@ if test "x${enable_mangling}" = "xyes" ; then
OSMESA_LIB="Mangled${OSMESA_LIB}"
fi
AC_SUBST([GL_LIB])
AC_SUBST([EGL_LIB_SUFFIX])
AC_SUBST([GLES_LIB_SUFFIX])
AC_SUBST([OSMESA_LIB])
dnl HACK when building glx + glvnd we ship gl.pc, despite that glvnd should do it
......
......@@ -375,6 +375,9 @@ if with_glvnd
elif with_glx == 'disabled' and not with_egl
error('glvnd requires DRI based GLX and/or EGL')
endif
if get_option('egl-lib-suffix') != ''
error('''EGL lib suffix can't be used with libglvnd''')
endif
endif
if with_vulkan_icd_dir == ''
......
......@@ -336,3 +336,14 @@ option(
value : false,
description : 'Allow work-in-progress freedreno vulkan driver to be enabled',
)
option('egl-lib-suffix',
type : 'string',
value : '',
description : 'Suffix to append to EGL library name. Default: none.'
)
option(
'gles-lib-suffix',
type : 'string',
value : '',
description : 'Suffix to append to GLES library names. Default: none.'
)
......@@ -190,12 +190,12 @@ libEGL_mesa_la_LDFLAGS = \
else # USE_LIBGLVND
lib_LTLIBRARIES = libEGL.la
libEGL_la_SOURCES =
libEGL_la_LIBADD = \
lib_LTLIBRARIES = libEGL@EGL_LIB_SUFFIX@.la
libEGL@EGL_LIB_SUFFIX@_la_SOURCES =
libEGL@EGL_LIB_SUFFIX@_la_LIBADD = \
libEGL_common.la \
$(top_builddir)/src/mapi/shared-glapi/libglapi.la
libEGL_la_LDFLAGS = \
libEGL@EGL_LIB_SUFFIX@_la_LDFLAGS = \
-no-undefined \
-version-number 1:0 \
$(BSYMBOLIC) \
......
......@@ -143,7 +143,7 @@ if cc.has_function('mincore')
endif
if not with_glvnd
egl_lib_name = 'EGL'
egl_lib_name = 'EGL' + get_option('egl-lib-suffix')
egl_lib_version = '1.0.0'
else
egl_lib_name = 'EGL_mesa'
......
......@@ -191,24 +191,24 @@ GLES_include_HEADERS = \
$(top_srcdir)/include/GLES/glext.h \
$(top_srcdir)/include/GLES/glplatform.h
lib_LTLIBRARIES += es1api/libGLESv1_CM.la
lib_LTLIBRARIES += es1api/libGLESv1_CM@GLES_LIB_SUFFIX@.la
es1api_libGLESv1_CM_la_SOURCES = entry.c es1api/glapi_mapi_tmp.h
es1api_libGLESv1_CM_la_CFLAGS = \
es1api_libGLESv1_CM@GLES_LIB_SUFFIX@_la_SOURCES = entry.c es1api/glapi_mapi_tmp.h
es1api_libGLESv1_CM@GLES_LIB_SUFFIX@_la_CFLAGS = \
$(AM_CFLAGS) \
$(VISIBILITY_CFLAGS)
es1api_libGLESv1_CM_la_CPPFLAGS = \
es1api_libGLESv1_CM@GLES_LIB_SUFFIX@_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DMAPI_MODE_BRIDGE \
-DMAPI_ABI_HEADER=\"es1api/glapi_mapi_tmp.h\"
es1api_libGLESv1_CM_la_LIBADD = $(GLESv1_CM_LIB_DEPS)
es1api_libGLESv1_CM_la_LDFLAGS = \
es1api_libGLESv1_CM@GLES_LIB_SUFFIX@_la_LIBADD = $(GLESv1_CM_LIB_DEPS)
es1api_libGLESv1_CM@GLES_LIB_SUFFIX@_la_LDFLAGS = \
-no-undefined \
-version-number 1:1 \
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
es1api_libGLESv1_CM_la_LIBADD += shared-glapi/libglapi.la
es1api_libGLESv1_CM@GLES_LIB_SUFFIX@_la_LIBADD += shared-glapi/libglapi.la
endif # HAVE_OPENGL_ES1
endif # USE_LIBGLVND
......@@ -238,24 +238,24 @@ GLES3_include_HEADERS = \
$(top_srcdir)/include/GLES3/gl3ext.h \
$(top_srcdir)/include/GLES3/gl3platform.h
lib_LTLIBRARIES += es2api/libGLESv2.la
lib_LTLIBRARIES += es2api/libGLESv2@GLES_LIB_SUFFIX@.la
es2api_libGLESv2_la_SOURCES = entry.c es2api/glapi_mapi_tmp.h
es2api_libGLESv2_la_CFLAGS = \
es2api_libGLESv2@GLES_LIB_SUFFIX@_la_SOURCES = entry.c es2api/glapi_mapi_tmp.h
es2api_libGLESv2@GLES_LIB_SUFFIX@_la_CFLAGS = \
$(AM_CFLAGS) \
$(VISIBILITY_CFLAGS)
es2api_libGLESv2_la_CPPFLAGS = \
es2api_libGLESv2@GLES_LIB_SUFFIX@_la_CPPFLAGS = \
$(AM_CPPFLAGS) \
-DMAPI_MODE_BRIDGE \
-DMAPI_ABI_HEADER=\"es2api/glapi_mapi_tmp.h\"
es2api_libGLESv2_la_LIBADD = $(GLESv2_LIB_DEPS)
es2api_libGLESv2_la_LDFLAGS = \
es2api_libGLESv2@GLES_LIB_SUFFIX@_la_LIBADD = $(GLESv2_LIB_DEPS)
es2api_libGLESv2@GLES_LIB_SUFFIX@_la_LDFLAGS = \
-no-undefined \
-version-number 2 \
$(GC_SECTIONS) \
$(LD_NO_UNDEFINED)
es2api_libGLESv2_la_LIBADD += shared-glapi/libglapi.la
es2api_libGLESv2@GLES_LIB_SUFFIX@_la_LIBADD += shared-glapi/libglapi.la
endif # HAVE_OPENGL_ES2
endif # USE_LIBGLVND
......
......@@ -28,7 +28,7 @@ es1_glapi_mapi_tmp_h = custom_target(
)
libglesv1_cm = shared_library(
'GLESv1_CM',
'GLESv1_CM' + get_option('gles-lib-suffix'),
['../entry.c', es1_glapi_mapi_tmp_h],
c_args : [
c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
......
......@@ -28,7 +28,7 @@ es2_glapi_mapi_tmp_h = custom_target(
)
libgles2 = shared_library(
'GLESv2',
'GLESv2' + get_option('gles-lib-suffix'),
['../entry.c', es2_glapi_mapi_tmp_h],
c_args : [
c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment