[Mesa-dev] [PATCH 06/21] Drop support for --enable-static / --disable-shared.
Johannes Obermayr
johannesobermayr at gmx.de
Wed Sep 11 15:32:44 PDT 2013
---
configure.ac | 100 ++++++++++-----------------
src/egl/main/Makefile.am | 3 +-
src/gallium/targets/egl-static/Makefile.am | 2 +-
src/gallium/targets/gbm/Makefile.am | 2 +-
src/gallium/targets/opencl/Makefile.am | 2 +
src/gallium/targets/osmesa/Makefile.am | 2 +-
src/gallium/targets/pipe-loader/Makefile.am | 16 ++---
src/gallium/targets/xvmc-nouveau/Makefile.am | 3 +-
src/gbm/Makefile.am | 6 +-
src/glx/Makefile.am | 3 +-
src/mapi/es1api/Makefile.am | 2 +-
src/mapi/es2api/Makefile.am | 2 +-
src/mapi/vgapi/Makefile.am | 2 +-
src/mesa/drivers/osmesa/Makefile.am | 2 +-
14 files changed, 62 insertions(+), 85 deletions(-)
diff --git a/configure.ac b/configure.ac
index 6224386..3407c3d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,6 +57,16 @@ AC_PROG_MKDIR_P
LT_PREREQ([2.2])
LT_INIT([disable-static])
+if test "x$enable_static" = xyes; then
+ AC_MSG_WARN([--enable-static is not supported. Disable building static ...])
+ enable_static=no
+fi
+
+if test "x$enable_shared" != xyes; then
+ AC_MSG_WARN([--disable-shared is not supported. Force building shared ...])
+ enable_shared=yes
+fi
+
AX_PROG_BISON([],
AS_IF([test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"],
[AC_MSG_ERROR([bison not found - unable to compile glcpp-parse.y])]))
@@ -272,22 +282,6 @@ if test "x$enable_64bit" = xyes; then
fi
fi
-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
- ;;
-xnono )
- AC_MSG_WARN([Cannot disable both static and shared libraries, enabling static])
- enable_static=yes
- ;;
-esac
-
-AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
-
dnl
dnl other compiler options
dnl
@@ -312,23 +306,20 @@ dnl library names
dnl
LIB_PREFIX_GLOB='lib'
LIB_VERSION_SEPARATOR='.'
-if test "$enable_static" = yes; then
- LIB_EXTENSION='a'
-else
- case "$host_os" in
- darwin* )
- LIB_EXTENSION='dylib' ;;
- cygwin* )
- dnl prefix can be 'cyg' or 'lib'
- LIB_PREFIX_GLOB='???'
- LIB_VERSION_SEPARATOR='-'
- LIB_EXTENSION='dll' ;;
- aix* )
- LIB_EXTENSION='a' ;;
- * )
- LIB_EXTENSION='so' ;;
- esac
-fi
+case "$host_os" in
+ darwin* )
+ LIB_EXTENSION='dylib' ;;
+ cygwin* )
+ dnl prefix can be 'cyg' or 'lib'
+ LIB_PREFIX_GLOB='???'
+ LIB_VERSION_SEPARATOR='-'
+ LIB_EXTENSION='dll' ;;
+ aix* )
+ LIB_EXTENSION='a' ;;
+ * )
+ LIB_EXTENSION='so' ;;
+esac
+
AC_ARG_WITH([gl-lib-name],
[AS_HELP_STRING([--with-gl-lib-name@<:@=NAME@:>@],
[specify GL library name @<:@default=GL@:>@])],
@@ -767,16 +758,9 @@ AC_SUBST([MESA_LLVM])
PKG_CHECK_MODULES([LIBDRM], [libdrm >= $LIBDRM_REQUIRED],
[have_libdrm=yes], [have_libdrm=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"
- fi
+# not a hard requirement as swrast does not depend on it
+if test "x$enable_dri" = xyes -a "x$have_libdrm" = xyes; then
+ DRI_PC_REQ_PRIV="libdrm >= $LIBDRM_REQUIRED"
fi
dnl Direct rendering or just indirect rendering
@@ -1123,12 +1107,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
@@ -1176,18 +1155,14 @@ if test "x$enable_egl" = xyes; then
AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
- if test "$enable_static" != yes; then
- # build egl_glx when libGL is built
- PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
- [have_libudev=yes],[have_libudev=no])
- if test "$have_libudev" = yes; then
- DEFINES="$DEFINES -DHAVE_LIBUDEV"
- fi
-
- if test "x$enable_dri" = xyes; then
- HAVE_EGL_DRIVER_DRI2=1
- fi
-
+ # build egl_glx when libGL is built
+ PKG_CHECK_MODULES([LIBUDEV], [libudev > 150],
+ [have_libudev=yes],[have_libudev=no])
+ if test "$have_libudev" = yes; then
+ DEFINES="$DEFINES -DHAVE_LIBUDEV"
+ fi
+ if test "x$enable_dri" = xyes; then
+ HAVE_EGL_DRIVER_DRI2=1
fi
fi
AM_CONDITIONAL(HAVE_EGL, test "x$enable_egl" = xyes)
@@ -2220,10 +2195,7 @@ else
fi
-dnl Libraries
echo ""
-echo " Shared libs: $enable_shared"
-echo " Static libs: $enable_static"
echo " Shared-glapi: $enable_shared_glapi"
dnl Compiler options
diff --git a/src/egl/main/Makefile.am b/src/egl/main/Makefile.am
index 2e43860..87bf999 100644
--- a/src/egl/main/Makefile.am
+++ b/src/egl/main/Makefile.am
@@ -73,7 +73,8 @@ libEGL_la_SOURCES = \
libEGL_la_LIBADD = \
$(EGL_LIB_DEPS)
-libEGL_la_LDFLAGS = -version-number 1:0 -no-undefined
+
+libEGL_la_LDFLAGS = -Wl,--no-undefined -shared -version-number 1:0
if HAVE_EGL_PLATFORM_X11
AM_CFLAGS += -DHAVE_X11_PLATFORM
diff --git a/src/gallium/targets/egl-static/Makefile.am b/src/gallium/targets/egl-static/Makefile.am
index 2c3a09e..74cb9de 100644
--- a/src/gallium/targets/egl-static/Makefile.am
+++ b/src/gallium/targets/egl-static/Makefile.am
@@ -64,7 +64,7 @@ egl_gallium_la_LIBADD = \
$(PTHREAD_LIBS) \
-lm
-egl_gallium_la_LDFLAGS = -Wl,--no-undefined -avoid-version -module
+egl_gallium_la_LDFLAGS = -Wl,--no-undefined -shared -module -avoid-version
if HAVE_EGL_PLATFORM_X11
AM_CPPFLAGS += $(LIBDRM_CFLAGS)
diff --git a/src/gallium/targets/gbm/Makefile.am b/src/gallium/targets/gbm/Makefile.am
index 4299d07..a3b0aae 100644
--- a/src/gallium/targets/gbm/Makefile.am
+++ b/src/gallium/targets/gbm/Makefile.am
@@ -51,7 +51,7 @@ gbm_gallium_drm_la_LIBADD = \
$(LIBDRM_LIBS) \
-lm
-gbm_gallium_drm_la_LDFLAGS = -no-undefined -avoid-version -module
+gbm_gallium_drm_la_LDFLAGS = -Wl,--no-undefined -shared -module -avoid-version
# FIXME: this shouldn't be needed
if HAVE_MESA_LLVM
diff --git a/src/gallium/targets/opencl/Makefile.am b/src/gallium/targets/opencl/Makefile.am
index 46bb29f..43fda3b 100644
--- a/src/gallium/targets/opencl/Makefile.am
+++ b/src/gallium/targets/opencl/Makefile.am
@@ -4,6 +4,8 @@ lib_LTLIBRARIES = libOpenCL.la
libOpenCL_la_LDFLAGS = \
$(LLVM_LDFLAGS) \
+ -Wl,--no-undefined \
+ -shared \
-version-number 1:0
libOpenCL_la_LIBADD = \
diff --git a/src/gallium/targets/osmesa/Makefile.am b/src/gallium/targets/osmesa/Makefile.am
index 8e6aff6..26bf2ab 100644
--- a/src/gallium/targets/osmesa/Makefile.am
+++ b/src/gallium/targets/osmesa/Makefile.am
@@ -38,7 +38,7 @@ lib_LTLIBRARIES = lib at OSMESA_LIB@.la
lib at OSMESA_LIB@_la_SOURCES = target.c
-lib at OSMESA_LIB@_la_LDFLAGS = -module -version-number @OSMESA_VERSION@ -no-undefined
+lib at OSMESA_LIB@_la_LDFLAGS = -Wl,--no-undefined -shared -version-number @OSMESA_VERSION@
GLAPI_LIB = $(top_builddir)/src/mapi/glapi/libglapi.la
if HAVE_SHARED_GLAPI
diff --git a/src/gallium/targets/pipe-loader/Makefile.am b/src/gallium/targets/pipe-loader/Makefile.am
index 3e8b8aa..3a4c305 100644
--- a/src/gallium/targets/pipe-loader/Makefile.am
+++ b/src/gallium/targets/pipe-loader/Makefile.am
@@ -54,7 +54,7 @@ pipe_i915_la_LIBADD = \
$(top_builddir)/src/gallium/drivers/i915/libi915.la \
$(LIBDRM_LIBS) \
$(INTEL_LIBS)
-pipe_i915_la_LDFLAGS = -no-undefined -avoid-version -module
+pipe_i915_la_LDFLAGS = -Wl,--no-undefined -shared -module -avoid-version
if HAVE_MESA_LLVM
nodist_EXTRA_pipe_i915_la_SOURCES = dummy.cpp
pipe_i915_la_LIBADD += $(LLVM_LIBS)
@@ -71,7 +71,7 @@ pipe_nouveau_la_LIBADD = \
$(top_builddir)/src/gallium/winsys/nouveau/drm/libnouveaudrm.la \
$(top_builddir)/src/gallium/drivers/nouveau/libnouveau.la \
$(NOUVEAU_LIBS)
-pipe_nouveau_la_LDFLAGS = -no-undefined -avoid-version -module
+pipe_nouveau_la_LDFLAGS = -Wl,--no-undefined -shared -module -avoid-version
if HAVE_MESA_LLVM
pipe_nouveau_la_LIBADD += $(LLVM_LIBS)
pipe_nouveau_la_LDFLAGS += $(LLVM_LDFLAGS)
@@ -89,7 +89,7 @@ pipe_r300_la_LIBADD = \
$(top_builddir)/src/gallium/drivers/r300/libr300.la \
$(LIBDRM_LIBS) \
$(RADEON_LIBS)
-pipe_r300_la_LDFLAGS = -no-undefined -avoid-version -module
+pipe_r300_la_LDFLAGS = -Wl,--no-undefined -shared -module -avoid-version
if HAVE_MESA_LLVM
pipe_r300_la_LIBADD += $(LLVM_LIBS)
pipe_r300_la_LDFLAGS += $(LLVM_LDFLAGS)
@@ -106,7 +106,7 @@ pipe_r600_la_LIBADD = \
$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
$(LIBDRM_LIBS) \
$(RADEON_LIBS)
-pipe_r600_la_LDFLAGS = -no-undefined -avoid-version -module
+pipe_r600_la_LDFLAGS = -Wl,--no-undefined -shared -module -avoid-version
if HAVE_MESA_LLVM
nodist_EXTRA_pipe_r600_la_SOURCES = dummy.cpp
pipe_r600_la_LIBADD += $(LLVM_LIBS)
@@ -125,7 +125,7 @@ pipe_radeonsi_la_LIBADD = \
$(top_builddir)/src/gallium/drivers/radeon/libradeon.la \
$(LIBDRM_LIBS) \
$(RADEON_LIBS)
-pipe_radeonsi_la_LDFLAGS = -no-undefined -avoid-version -module
+pipe_radeonsi_la_LDFLAGS = -Wl,--no-undefined -shared -module -avoid-version
if HAVE_MESA_LLVM
pipe_radeonsi_la_LIBADD += $(LLVM_LIBS)
pipe_radeonsi_la_LDFLAGS += $(LLVM_LDFLAGS)
@@ -140,7 +140,7 @@ pipe_vmwgfx_la_LIBADD = \
$(top_builddir)/src/gallium/winsys/svga/drm/libsvgadrm.la \
$(top_builddir)/src/gallium/drivers/svga/libsvga.la \
$(LIBDRM_LIBS)
-pipe_vmwgfx_la_LDFLAGS = -no-undefined -avoid-version -module
+pipe_vmwgfx_la_LDFLAGS = -Wl,--no-undefined -shared -module -avoid-version
if HAVE_MESA_LLVM
nodist_EXTRA_pipe_vmwgfx_la_SOURCES = dummy.cpp
pipe_vmwgfx_la_LIBADD += $(LLVM_LIBS)
@@ -156,7 +156,7 @@ pipe_swrast_la_LIBADD = \
$(PIPE_LIBS) \
$(top_builddir)/src/gallium/drivers/llvmpipe/libllvmpipe.la \
$(LLVM_LIBS)
-pipe_swrast_la_LDFLAGS = -no-undefined -avoid-version -module $(LLVM_LDFLAGS)
+pipe_swrast_la_LDFLAGS = -Wl,--no-undefined -shared -module -avoid-version
else
if HAVE_GALLIUM_SOFTPIPE
pipe_LTLIBRARIES += pipe_swrast.la
@@ -164,6 +164,6 @@ pipe_swrast_la_SOURCES = pipe_swrast.c
pipe_swrast_la_LIBADD = \
$(PIPE_LIBS) \
$(top_builddir)/src/gallium/drivers/softpipe/libsoftpipe.la
-pipe_swrast_la_LDFLAGS = -no-undefined -avoid-version -module
+pipe_swrast_la_LDFLAGS = -Wl,--no-undefined -shared -module -avoid-version
endif
endif
diff --git a/src/gallium/targets/xvmc-nouveau/Makefile.am b/src/gallium/targets/xvmc-nouveau/Makefile.am
index f3d6b1e..ab980d4 100644
--- a/src/gallium/targets/xvmc-nouveau/Makefile.am
+++ b/src/gallium/targets/xvmc-nouveau/Makefile.am
@@ -39,8 +39,7 @@ libXvMCnouveau_la_SOURCES = \
$(top_srcdir)/src/gallium/auxiliary/vl/vl_winsys_dri.c
libXvMCnouveau_la_LDFLAGS = \
- -module \
- -version-number $(XVMC_MAJOR):$(XVMC_MINOR)
+ -version-number $(XVMC_MAJOR):$(XVMC_MINOR) \
-shared \
-no-undefined
diff --git a/src/gbm/Makefile.am b/src/gbm/Makefile.am
index 1282b14..dea8ba8 100644
--- a/src/gbm/Makefile.am
+++ b/src/gbm/Makefile.am
@@ -18,7 +18,7 @@ libgbm_la_SOURCES = \
main/gbm.c \
main/backend.c \
main/common.c
-libgbm_la_LDFLAGS = -version-info 1:0
+libgbm_la_LDFLAGS = -Wl,--no-undefined -shared -version-info 1:0
libgbm_la_LIBADD = $(LIBUDEV_LIBS) $(LIBKMS_LIBS) $(DLOPEN_LIBS)
if HAVE_EGL_PLATFORM_WAYLAND
@@ -39,7 +39,9 @@ libgbm_dri_la_CFLAGS = \
$(LIBDRM_CFLAGS)
libgbm_la_LIBADD += \
- libgbm_dri.la $(top_builddir)/src/mapi/shared-glapi/libglapi.la $(LIBDRM_LIBS)
+ libgbm_dri.la \
+ $(top_builddir)/src/mapi/shared-glapi/libglapi.la \
+ $(LIBDRM_LIBS)
endif
all-local: libgbm.la
diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am
index f01709b..be634fb 100644
--- a/src/glx/Makefile.am
+++ b/src/glx/Makefile.am
@@ -102,7 +102,8 @@ GL_LIBS = \
GL_LDFLAGS = \
-Wl,-Bsymbolic \
- -version-number 1:2 -no-undefined
+ -version-number 1:2 -no-undefined \
+ -shared
lib at GL_LIB@_la_SOURCES =
lib at GL_LIB@_la_LIBADD = $(GL_LIBS)
diff --git a/src/mapi/es1api/Makefile.am b/src/mapi/es1api/Makefile.am
index eb98f16..15c87ad 100644
--- a/src/mapi/es1api/Makefile.am
+++ b/src/mapi/es1api/Makefile.am
@@ -44,7 +44,7 @@ lib_LTLIBRARIES = libGLESv1_CM.la
libGLESv1_CM_la_SOURCES = ../entry.c glapi_mapi_tmp.h
libGLESv1_CM_la_LIBADD = $(GLESv1_CM_LIB_DEPS)
-libGLESv1_CM_la_LDFLAGS = -version-number 1:1 -no-undefined
+libGLESv1_CM_la_LDFLAGS = -Wl,--no-undefined -shared -version-number 1:1
if HAVE_SHARED_GLAPI
libGLESv1_CM_la_LIBADD += ../shared-glapi/libglapi.la
diff --git a/src/mapi/es2api/Makefile.am b/src/mapi/es2api/Makefile.am
index c6b0ca4..a676380 100644
--- a/src/mapi/es2api/Makefile.am
+++ b/src/mapi/es2api/Makefile.am
@@ -48,7 +48,7 @@ lib_LTLIBRARIES = libGLESv2.la
libGLESv2_la_SOURCES = ../entry.c glapi_mapi_tmp.h
libGLESv2_la_LIBADD = $(GLESv2_LIB_DEPS)
-libGLESv2_la_LDFLAGS = -version-number 2 -no-undefined
+libGLESv2_la_LDFLAGS = -Wl,--no-undefined -shared -version-number 2
if HAVE_SHARED_GLAPI
libGLESv2_la_LIBADD += ../shared-glapi/libglapi.la
diff --git a/src/mapi/vgapi/Makefile.am b/src/mapi/vgapi/Makefile.am
index 0af7115..4e12918 100644
--- a/src/mapi/vgapi/Makefile.am
+++ b/src/mapi/vgapi/Makefile.am
@@ -43,7 +43,7 @@ TOP=$(top_srcdir)
include ../Makefile.sources
libOpenVG_la_SOURCES = $(MAPI_FILES) vgapi_tmp.h
libOpenVG_la_LIBADD = $(VG_LIB_DEPS)
-libOpenVG_la_LDFLAGS = -version-number 1 -no-undefined
+libOpenVG_la_LDFLAGS = -Wl,--no-undefined -shared -version-number 1
vgapi_tmp.h: $(srcdir)/vgapi.csv $(top_srcdir)/src/mapi/mapi_abi.py
$(AM_V_GEN) $(PYTHON2) $(PYTHON_FLAGS) $(top_srcdir)/src/mapi/mapi_abi.py \
diff --git a/src/mesa/drivers/osmesa/Makefile.am b/src/mesa/drivers/osmesa/Makefile.am
index d09c18e..d2baa82 100644
--- a/src/mesa/drivers/osmesa/Makefile.am
+++ b/src/mesa/drivers/osmesa/Makefile.am
@@ -37,7 +37,7 @@ lib_LTLIBRARIES = lib at OSMESA_LIB@.la
nodist_EXTRA_lib at OSMESA_LIB@_la_SOURCES = dummy.cpp
lib at OSMESA_LIB@_la_SOURCES = osmesa.c
-lib at OSMESA_LIB@_la_LDFLAGS = -module -version-number @OSMESA_VERSION@ -no-undefined
+lib at OSMESA_LIB@_la_LDFLAGS = -Wl,--no-undefined -shared -version-number @OSMESA_VERSION@
GLAPI_LIB = $(top_builddir)/src/mapi/glapi/libglapi.la
if HAVE_SHARED_GLAPI
--
1.8.1.4
More information about the mesa-dev
mailing list