[Mesa-dev] [PATCHv2] automake: Honor GL_LIB for mangled/custom lib names

Brad King brad.king at kitware.com
Mon Jul 16 06:10:02 PDT 2012


Commit 2d4b77c7 (automake: Convert src/mesa/drivers/x11/Makefile to
automake, 2012-06-12) dropped the old Makefile, which used GL_LIB, and
replaced it with a Makefile.am hard-coding the name "GL".  This broke
handling of --enable-mangling and --with-gl-lib-name options which
depend on GL_LIB to specify the GL library name.

Use "@GL_LIB@" in src/mesa/drivers/x11/Makefile.am to configure the
library name.  Also use this approach to simplify src/glx/Makefile.am
and drop the HAVE_MANGLED_GL conditional.  While at it, fix the
compatibility link we create in "lib" for the software-only driver to
use version GL_MAJOR instead of hard-coding "1".
---

On 07/11/2012 04:05 PM, Dan Nicholson wrote:
> On 7/11/12, Brad King <brad.king at kitware.com> wrote:
>> On 07/11/2012 11:24 AM, Eric Anholt wrote:
>>> For the OSMesa changes, Laurent Carlier used @OSMESA_LIB@, so if you did
>>> this patch using @GL_LIB@, it would at least be consistent with that.
>>
>> Great, thanks!  Here is a patch.
> 
> Looks good to me. I wonder if the HAVE_MANGLED_GL conditional can be
> dropped at this point? Anyway,
> 
> Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>

Additional changes have been made on master which conflict with
the previous patch, so here is another one rebased on 81de0431.
I also dropped the HAVE_MANGLED_GL conditional as it no longer
appears necessary.

-Brad

 configure.ac                     |    1 -
 src/glx/Makefile.am              |   27 +++++++--------------------
 src/mesa/drivers/x11/Makefile.am |   16 ++++++++--------
 3 files changed, 15 insertions(+), 29 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9227474..2fb8f74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -389,7 +389,6 @@ fi
 AC_SUBST([GL_LIB])
 AC_SUBST([GLU_LIB])
 AC_SUBST([OSMESA_LIB])
-AM_CONDITIONAL(HAVE_MANGLED_GL, test "x${enable_mangling}" = "xyes")
 
 dnl
 dnl potentially-infringing-but-nobody-knows-for-sure stuff
diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am
index 6ca85cd..482c4c5 100644
--- a/src/glx/Makefile.am
+++ b/src/glx/Makefile.am
@@ -47,15 +47,7 @@ AM_CFLAGS = \
 	$(GLPROTO_CFLAGS) \
 	$(X11_INCLUDES)
 
-if HAVE_MANGLED_GL
-MANGLED_GL_LIB = libMangledGL.la
-else
-NORMAL_GL_LIB = libGL.la
-endif
-
-lib_LTLIBRARIES = \
-	$(NORMAL_GL_LIB) \
-	$(MANGLED_GL_LIB)
+lib_LTLIBRARIES = lib at GL_LIB@.la
 
 noinst_LTLIBRARIES = libglx.la
 
@@ -109,21 +101,16 @@ GL_LDFLAGS = \
 	-Wl,-Bsymbolic \
 	-version-number 1:2 -no-undefined
 
-libGL_la_SOURCES =
-libMangledGL_la_SOURCES =
-libGL_la_LIBADD = $(GL_LIBS)
-libMangledGL_la_LIBADD = $(GL_LIBS)
-libGL_la_LDFLAGS = $(GL_LDFLAGS)
-libMangledGL_la_LDFLAGS = $(GL_LDFLAGS)
+lib at GL_LIB@_la_SOURCES =
+lib at GL_LIB@_la_LIBADD = $(GL_LIBS)
+lib at GL_LIB@_la_LDFLAGS = $(GL_LDFLAGS)
 
 # 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.
-if !HAVE_MANGLED_GL
-all-local: $(NORMAL_GL_LIB) $(MANGLED_GL_LIB)
+all-local: lib at GL_LIB@.la
 	$(MKDIR_P) $(top_builddir)/$(LIB_DIR);
-	ln -f .libs/libGL.so.1.2.0 $(top_builddir)/$(LIB_DIR)/libGL.so.1
-	ln -sf libGL.so.1 $(top_builddir)/$(LIB_DIR)/libGL.so
-endif
+	ln -f .libs/lib at GL_LIB@.so.1.2.0 $(top_builddir)/$(LIB_DIR)/lib at GL_LIB@.so.1
+	ln -sf lib at GL_LIB@.so.1 $(top_builddir)/$(LIB_DIR)/lib at GL_LIB@.so
 
 $(GLAPI_LIB):
 	@$(MAKE) -C $(TOP)/src/mapi/glapi
diff --git a/src/mesa/drivers/x11/Makefile.am b/src/mesa/drivers/x11/Makefile.am
index 52febbb..726a9c6 100644
--- a/src/mesa/drivers/x11/Makefile.am
+++ b/src/mesa/drivers/x11/Makefile.am
@@ -33,10 +33,10 @@ AM_CPPFLAGS = \
 	$(DEFINES)
 
 if HAVE_X11_DRIVER
-lib_LTLIBRARIES = libGL.la
+lib_LTLIBRARIES = lib at GL_LIB@.la
 endif
 
-libGL_la_SOURCES = \
+lib at GL_LIB@_la_SOURCES = \
 	glxapi.h \
 	glxheader.h \
 	xfonts.h \
@@ -55,20 +55,20 @@ GL_MAJOR = 1
 GL_MINOR = 6
 GL_PATCH = 0
 
-libGL_la_LIBADD = \
+lib at GL_LIB@_la_LIBADD = \
 	$(top_builddir)/src/mesa/libmesa.la \
 	$(top_builddir)/src/mapi/glapi/libglapi.la
-libGL_la_LDFLAGS = \
+lib at GL_LIB@_la_LDFLAGS = \
 	-version-number $(GL_MAJOR):$(GL_MINOR):$(GL_PATCH) \
 	$(GL_LIB_DEPS)
 
 if HAVE_SHARED_GLAPI
-libGL_la_LDFLAGS += -L$(top_builddir)/$(LIB_DIR) -l$(GLAPI_LIB)
+lib at GL_LIB@_la_LDFLAGS += -L$(top_builddir)/$(LIB_DIR) -l$(GLAPI_LIB)
 endif
 
 # 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: libGL.la
+all-local: lib at GL_LIB@.la
 	$(MKDIR_P) $(top_builddir)/$(LIB_DIR);
-	ln -f .libs/libGL.so.$(GL_MAJOR).$(GL_MINOR).$(GL_PATCH) $(top_builddir)/$(LIB_DIR)/libGL.so.1
-	ln -sf libGL.so.1 $(top_builddir)/$(LIB_DIR)/libGL.so
+	ln -f .libs/lib at GL_LIB@.so.$(GL_MAJOR).$(GL_MINOR).$(GL_PATCH) $(top_builddir)/$(LIB_DIR)/lib at GL_LIB@.so.$(GL_MAJOR)
+	ln -sf lib at GL_LIB@.so.$(GL_MAJOR) $(top_builddir)/$(LIB_DIR)/lib at GL_LIB@.so
-- 
1.7.10



More information about the mesa-dev mailing list