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

Author: Emil Velikov <[email protected]>
Date:   Tue Mar 11 11:50:37 2014 +0000

automake: allow only shared builds

Static and shared builds were possible in the good old days
of static makefiles. Currently the build system does not
distinguish nor does anything special when one requests a
static build.

Print a warning message for the packager that static builds
are not supported and continue building shared libs.

Currently only Debian and derivatives use static build, and
they use it for building a Xlib powered libGL. This patch
will only change the warning message they are seeing but
the binaries produced will be identical.

Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Jon TURNEY <[email protected]>

---

 configure.ac                           |   56 ++++++++++----------------------
 src/gallium/targets/osmesa/Makefile.am |    4 ---
 src/mesa/drivers/osmesa/Makefile.am    |    2 --
 src/mesa/drivers/x11/Makefile.am       |    2 --
 4 files changed, 18 insertions(+), 46 deletions(-)

diff --git a/configure.ac b/configure.ac
index a8131cf..c5042f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -285,18 +285,15 @@ dnl Can't have static and shared libraries, default to 
static if user
 dnl explicitly requested. If both disabled, set to static since shared
 dnl was explicitly requested.
 case "x$enable_static$enable_shared" in
-xyesyes )
-    AC_MSG_WARN([Cannot build static and shared libraries, disabling shared])
-    enable_shared=no
+xnoyes )
     ;;
-xnono )
-    AC_MSG_WARN([Cannot disable both static and shared libraries, enabling 
static])
-    enable_static=yes
+* )
+    AC_MSG_WARN([Messa build supports only shared libraries, enabling shared])
+    enable_shared=yes
+    enable_static=no
     ;;
 esac
 
-AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
-
 dnl
 dnl other compiler options
 dnl
@@ -331,20 +328,16 @@ AM_CONDITIONAL(HAVE_COMPAT_SYMLINKS, test 
"x$HAVE_COMPAT_SYMLINKS" = xyes)
 dnl
 dnl library names
 dnl
-if test "$enable_static" = yes; then
-    LIB_EXT='a'
-else
-    case "$host_os" in
-    darwin* )
-        LIB_EXT='dylib' ;;
-    cygwin* )
-        LIB_EXT='dll' ;;
-    aix* )
-        LIB_EXT='a' ;;
-    * )
-        LIB_EXT='so' ;;
-    esac
-fi
+case "$host_os" in
+darwin* )
+    LIB_EXT='dylib' ;;
+cygwin* )
+    LIB_EXT='dll' ;;
+aix* )
+    LIB_EXT='a' ;;
+* )
+    LIB_EXT='so' ;;
+esac
 
 AC_SUBST([LIB_EXT])
 
@@ -781,11 +774,6 @@ PKG_CHECK_MODULES([LIBUDEV], [libudev >= 
$LIBUDEV_REQUIRED],
                   have_libudev=yes, have_libudev=no)
 
 if test "x$enable_dri" = xyes; then
-    # DRI must be shared, I think
-    if test "$enable_static" = yes; then
-        AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
-    fi
-
     # not a hard requirement as swrast does not depend on it
     if test "x$have_libdrm" = xyes; then
         DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
@@ -1117,12 +1105,7 @@ x16|x32)
 esac
 
 if test "x$enable_osmesa" = xyes -o "x$enable_gallium_osmesa" = xyes; then
-    # only link libraries with osmesa if shared
-    if test "$enable_static" = no; then
-        OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
-    else
-        OSMESA_LIB_DEPS=""
-    fi
+    OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
     OSMESA_MESA_DEPS=""
     OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
 fi
@@ -1171,11 +1154,8 @@ if test "x$enable_egl" = xyes; then
 
     AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
 
-    if test "$enable_static" != yes; then
-        if test "x$enable_dri" = xyes; then
-           HAVE_EGL_DRIVER_DRI2=1
-       fi
-
+    if test "x$enable_dri" = xyes; then
+        HAVE_EGL_DRIVER_DRI2=1
     fi
 fi
 AM_CONDITIONAL(HAVE_EGL, test "x$enable_egl" = xyes)
diff --git a/src/gallium/targets/osmesa/Makefile.am 
b/src/gallium/targets/osmesa/Makefile.am
index 66ddf93..48154e1 100644
--- a/src/gallium/targets/osmesa/Makefile.am
+++ b/src/gallium/targets/osmesa/Makefile.am
@@ -65,11 +65,7 @@ lib@OSMESA_LIB@_la_LDFLAGS += $(LLVM_LDFLAGS)
 lib@OSMESA_LIB@_la_LIBADD += 
$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la $(LLVM_LIBS)
 endif
 
-
-
-if BUILD_SHARED
 include $(top_srcdir)/install-gallium-links.mk
-endif
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = osmesa.pc
diff --git a/src/mesa/drivers/osmesa/Makefile.am 
b/src/mesa/drivers/osmesa/Makefile.am
index e18b735..bc1244f 100644
--- a/src/mesa/drivers/osmesa/Makefile.am
+++ b/src/mesa/drivers/osmesa/Makefile.am
@@ -47,9 +47,7 @@ lib@OSMESA_LIB@_la_LIBADD = \
        $(SHARED_GLAPI_LIB) \
        $(OSMESA_LIB_DEPS)
 
-if BUILD_SHARED
 include $(top_srcdir)/install-lib-links.mk
-endif
 
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = osmesa.pc
diff --git a/src/mesa/drivers/x11/Makefile.am b/src/mesa/drivers/x11/Makefile.am
index 3f3a24b..b10e86f 100644
--- a/src/mesa/drivers/x11/Makefile.am
+++ b/src/mesa/drivers/x11/Makefile.am
@@ -64,6 +64,4 @@ lib@GL_LIB@_la_LDFLAGS = \
        -no-undefined \
        $(GL_LIB_DEPS)
 
-if BUILD_SHARED
 include $(top_srcdir)/install-lib-links.mk
-endif

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to