Mesa (master): Add an autoconf option for mangling Mesa.

Thomas Fogal tfogal at kemper.freedesktop.org
Mon Oct 17 16:16:27 UTC 2011


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

Author: Tom Fogal <tfogal at alumni.unh.edu>
Date:   Mon Oct 10 10:33:18 2011 -0600

Add an autoconf option for mangling Mesa.

In addition to setting up the flags correctly, this renames the
generated libraries to ensure they get 'Mangled' in the name.
This is very useful for distros and the like, where mangled Mesa
and non-mangled GL libraries typically need to be installed
side-by-side.

Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>

---

 configs/autoconf.in |    4 ++--
 configure.ac        |   27 ++++++++++++++++++++++++---
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/configs/autoconf.in b/configs/autoconf.in
index 9bbafc9..96fe5da 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -64,8 +64,8 @@ FLEX = @FLEX@
 BISON = @BISON@
 
 # Library names (base name)
-GL_LIB = GL
-GLU_LIB = GLU
+GL_LIB = @GL_LIB@
+GLU_LIB = @GLU_LIB@
 GLW_LIB = GLw
 OSMESA_LIB = @OSMESA_LIB@
 GLESv1_CM_LIB = GLESv1_CM
diff --git a/configure.ac b/configure.ac
index ae7b36b..3f951ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -350,6 +350,28 @@ else
 fi
 
 dnl
+dnl Mangled Mesa support
+dnl
+AC_ARG_ENABLE([mangling],
+  [AS_HELP_STRING([--enable-mangling],
+    [enable mangled symbols and library name @<:@default=disabled@:>@])],
+  [enable_mangling="${enableval}"],
+  [enable_mangling=no]
+)
+GL_LIB="GL"
+GLU_LIB="GLU"
+OSMESA_LIB="OSMesa"
+if test "x${enable_mangling}" = "xyes" ; then
+  DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
+  GL_LIB="MangledGL"
+  GLU_LIB="MangledGLU"
+  OSMESA_LIB="MangledOSMesa"
+fi
+AC_SUBST([GL_LIB])
+AC_SUBST([GLU_LIB])
+AC_SUBST([OSMESA_LIB])
+
+dnl
 dnl potentially-infringing-but-nobody-knows-for-sure stuff
 dnl
 AC_ARG_ENABLE([texture-float],
@@ -1288,17 +1310,16 @@ if test "x$osmesa_bits" != x8; then
 fi
 case "x$osmesa_bits" in
 x8)
-    OSMESA_LIB=OSMesa
+    OSMESA_LIB="${OSMESA_LIB}"
     ;;
 x16|x32)
-    OSMESA_LIB="OSMesa$osmesa_bits"
+    OSMESA_LIB="${OSMESA_LIB}$osmesa_bits"
     DEFINES="$DEFINES -DCHAN_BITS=$osmesa_bits -DDEFAULT_SOFTWARE_DEPTH_BITS=31"
     ;;
 *)
     AC_MSG_ERROR([OSMesa bits '$osmesa_bits' is not a valid option])
     ;;
 esac
-AC_SUBST([OSMESA_LIB])
 
 if test "x$enable_osmesa" = xyes; then
     # only link libraries with osmesa if shared




More information about the mesa-commit mailing list