X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=configure.ac;h=d6f21ea8760bdb6e4861fe2fcc9c5e028d63f4a1;hb=ed8bfaba52858cfe71c9b60ca150476ba38b0500;hp=5e1d09166ec7c677d1c1f5c23868420e403ce147;hpb=bba9c28215f96a6570c290906b64eea83383beb8;p=mesa.git diff --git a/configure.ac b/configure.ac index 5e1d09166ec..d6f21ea8760 100644 --- a/configure.ac +++ b/configure.ac @@ -28,7 +28,7 @@ AC_SUBST([OSMESA_VERSION]) dnl Versions for external dependencies LIBDRM_REQUIRED=2.4.38 -LIBDRM_RADEON_REQUIRED=2.4.50 +LIBDRM_RADEON_REQUIRED=2.4.54 LIBDRM_INTEL_REQUIRED=2.4.52 LIBDRM_NVVIEUX_REQUIRED=2.4.33 LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41" @@ -54,7 +54,6 @@ AM_PROG_CC_C_O AM_PROG_AS AC_CHECK_PROGS([MAKE], [gmake make]) AC_CHECK_PROGS([PYTHON2], [python2 python]) -AX_PYTHON_MODULE([libxml2], [needed]) AC_PROG_SED AC_PROG_MKDIR_P @@ -285,13 +284,13 @@ 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 ) +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 +xnono) + AC_MSG_WARN([Cannot disable both static and shared libraries, enabling shared]) + enable_shared=yes ;; esac @@ -316,23 +315,47 @@ if test "x$enable_debug" = xyes; then fi fi +dnl +dnl Check if linker supports garbage collection +dnl +save_LDFLAGS=$LDFLAGS +LDFLAGS="$LDFLAGS -Wl,--gc-sections" +AC_MSG_CHECKING([whether ld supports --gc-sections]) +AC_LINK_IFELSE( + [AC_LANG_SOURCE([static char UnusedFunc() { return 5; } int main() { return 0;}])], + [AC_MSG_RESULT([yes]) + GC_SECTIONS="-Wl,--gc-sections";], + [AC_MSG_RESULT([no]) + GC_SECTIONS="";]) +LDFLAGS=$save_LDFLAGS + +AC_SUBST([GC_SECTIONS]) + +dnl +dnl compatibility symlinks +dnl +case "$host_os" in +linux* ) + HAVE_COMPAT_SYMLINKS=yes ;; +* ) + HAVE_COMPAT_SYMLINKS=no ;; +esac + +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]) @@ -457,6 +480,12 @@ AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"], [DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])]) AC_SUBST([DLOPEN_LIBS]) +dnl Check if that library also has dladdr +save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS $DLOPEN_LIBS" +AC_CHECK_FUNCS([dladdr]) +LDFLAGS="$save_LDFLAGS" + case "$host_os" in darwin*|mingw*) ;; @@ -523,11 +552,20 @@ AC_ARG_ENABLE([dri], [enable DRI modules @<:@default=enabled@:>@])], [enable_dri="$enableval"], [enable_dri=yes]) + +case "$host_os" in +linux*) + dri3_default=yes + ;; +*) + dri3_default=no + ;; +esac AC_ARG_ENABLE([dri3], [AS_HELP_STRING([--enable-dri3], - [enable DRI3 @<:@default=enabled@:>@])], + [enable DRI3 @<:@default=auto@:>@])], [enable_dri3="$enableval"], - [enable_dri3=yes]) + [enable_dri3="$dri3_default"]) AC_ARG_ENABLE([glx], [AS_HELP_STRING([--enable-glx], [enable GLX library @<:@default=enabled@:>@])], @@ -577,10 +615,8 @@ AC_ARG_ENABLE([omx], [enable_omx=no]) AC_ARG_ENABLE([opencl], [AS_HELP_STRING([--enable-opencl], - [enable OpenCL library NOTE: Enabling this option will also enable - --enable-llvm-shared-libs - @<:@default=no@:>@])], - [], + [enable OpenCL library @<:@default=no@:>@])], + [enable_opencl="$enableval"], [enable_opencl=no]) AC_ARG_ENABLE([opencl_icd], [AS_HELP_STRING([--enable-opencl-icd], @@ -748,8 +784,8 @@ if test "x$enable_dri" = xyes; then fi if test "x$enable_gallium_osmesa" = xyes; then - if test -z "$with_gallium_drivers"; then - AC_MSG_ERROR([Cannot enable gallium_osmesa without Gallium]) + if ! echo "$with_gallium_drivers" | grep -q 'swrast'; then + AC_MSG_ERROR([gallium_osmesa requires the gallium swrast driver]) fi if test "x$enable_osmesa" = xyes; then AC_MSG_ERROR([Cannot enable both classic and Gallium OSMesa implementations]) @@ -767,11 +803,17 @@ if test "x$have_libdrm" = xyes; then DEFINES="$DEFINES -DHAVE_LIBDRM" fi +case "$host_os" in +linux*) + need_libudev=yes ;; +*) + need_libudev=no ;; +esac + 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 @@ -826,9 +868,6 @@ xyesno) PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED]) GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED" if test x"$enable_dri3" = xyes; then - if test x"$have_libudev" != xyes; then - AC_MSG_ERROR([DRI3 requires libudev >= $LIBUDEV_REQUIRED]) - fi PKG_CHECK_MODULES([DRI3PROTO], [dri3proto >= $DRI3PROTO_REQUIRED]) PKG_CHECK_MODULES([PRESENTPROTO], [presentproto >= $PRESENTPROTO_REQUIRED]) fi @@ -981,7 +1020,7 @@ if test "x$enable_dri" = xyes; then gnu*) DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1" DEFINES="$DEFINES -DHAVE_ALIAS" - ;; + ;; solaris*) DEFINES="$DEFINES -DUSE_EXTERNAL_DXTN_LIB=1" ;; @@ -999,7 +1038,7 @@ if test "x$enable_dri" = xyes; then fi # Check for expat - PKG_CHECK_EXISTS([EXPAT], [have_expat=yes], [have_expat=no]) + PKG_CHECK_EXISTS([expat], [have_expat=yes], [have_expat=no]) if test "x$have_expat" = "xyes"; then PKG_CHECK_MODULES([EXPAT], [expat], [], AC_MSG_ERROR([Expat required for DRI.])) @@ -1023,12 +1062,9 @@ if test "x$enable_dri" = xyes; then # put all the necessary libs together DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS" - GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIBS -lm $CLOCK_LIB $PTHREAD_LIBS $DLOPEN_LIBS" - fi AC_SUBST([DRI_LIB_DEPS]) -AC_SUBST([GALLIUM_DRI_LIB_DEPS]) DRI_DIRS='' dnl Duplicates in DRI_DIRS are removed by sorting it at the end of this block @@ -1134,7 +1170,7 @@ if test "x$enable_gbm" = xauto; then esac fi if test "x$enable_gbm" = xyes; then - if test x"$have_libudev" != xyes; then + if test "x$need_libudev$have_libudev" = xyesno; then AC_MSG_ERROR([gbm requires udev >= $LIBUDEV_REQUIRED]) fi @@ -1146,7 +1182,11 @@ if test "x$enable_gbm" = xyes; then fi fi AM_CONDITIONAL(HAVE_GBM, test "x$enable_gbm" = xyes) -GBM_PC_REQ_PRIV="libudev >= $LIBUDEV_REQUIRED" +if test "x$need_libudev" = xyes; then + GBM_PC_REQ_PRIV="libudev >= $LIBUDEV_REQUIRED" +else + GBM_PC_REQ_PRIV="" +fi GBM_PC_LIB_PRIV="$DLOPEN_LIBS" AC_SUBST([GBM_PC_REQ_PRIV]) AC_SUBST([GBM_PC_LIB_PRIV]) @@ -1263,7 +1303,7 @@ AM_CONDITIONAL(HAVE_OPENVG, test "x$enable_openvg" = xyes) dnl dnl Gallium G3DVL configuration dnl -if test -n "$with_gallium_drivers"; then +if test -n "$with_gallium_drivers" && ! echo "$with_gallium_drivers" | grep -q 'swrast'; then if test "x$enable_xvmc" = xauto; then PKG_CHECK_EXISTS([xvmc], [enable_xvmc=yes], [enable_xvmc=no]) fi @@ -1431,8 +1471,8 @@ for plat in $egl_platforms; do ;; esac - case "$plat$have_libudev" in - waylandno|drmno) + case "$plat$need_libudev$have_libudev" in + waylandyesno|drmyesno) AC_MSG_ERROR([cannot build $plat platform without udev >= $LIBUDEV_REQUIRED]) ;; esac done @@ -1446,15 +1486,15 @@ else EGL_NATIVE_PLATFORM="_EGL_INVALID_PLATFORM" fi -if echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1; then +if echo "$egl_platforms" | grep -q 'x11'; then GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib" NEED_WINSYS_XLIB=yes fi -AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep 'x11' >/dev/null 2>&1) -AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep 'wayland' >/dev/null 2>&1) -AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep 'drm' >/dev/null 2>&1) -AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep 'fbdev' >/dev/null 2>&1) -AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep 'null' >/dev/null 2>&1) +AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep -q 'x11') +AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep -q 'wayland') +AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep -q 'drm') +AM_CONDITIONAL(HAVE_EGL_PLATFORM_FBDEV, echo "$egl_platforms" | grep -q 'fbdev') +AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep -q 'null') AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x") @@ -1502,8 +1542,8 @@ AC_ARG_ENABLE([gallium-llvm], AC_ARG_ENABLE([llvm-shared-libs], [AS_HELP_STRING([--enable-llvm-shared-libs], [link with LLVM shared libraries @<:@default=enabled@:>@])], - [], - [with_llvm_shared_libs=yes]) + [enable_llvm_shared_libs="$enableval"], + [enable_llvm_shared_libs=yes]) AC_ARG_WITH([llvm-prefix], [AS_HELP_STRING([--with-llvm-prefix], @@ -1559,7 +1599,6 @@ if test "x$enable_gallium_llvm" = xyes; then LLVM_CXXFLAGS=`strip_unwanted_llvm_flags "$LLVM_CONFIG --cxxflags"` LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir` LLVM_LIBDIR=`$LLVM_CONFIG --libdir` - LLVM_LDFLAGS="-Wl,-rpath,$LLVM_LIBDIR $LLVM_LDFLAGS" AC_COMPUTE_INT([LLVM_VERSION_MAJOR], [LLVM_VERSION_MAJOR], [#include "${LLVM_INCLUDEDIR}/llvm/Config/llvm-config.h"]) @@ -1638,11 +1677,16 @@ AC_ARG_WITH([vdpau-libdir], [VDPAU_LIB_INSTALL_DIR='${libdir}/vdpau']) AC_SUBST([VDPAU_LIB_INSTALL_DIR]) +OMX_LIB_INSTALL_DIR_DEFAULT='' +if test "x$enable_omx" = xyes; then + OMX_LIB_INSTALL_DIR_DEFAULT=`$PKG_CONFIG --variable=pluginsdir libomxil-bellagio` +fi + AC_ARG_WITH([omx-libdir], [AS_HELP_STRING([--with-omx-libdir=DIR], [directory for the OMX libraries])], [OMX_LIB_INSTALL_DIR="$withval"], - [OMX_LIB_INSTALL_DIR=`$PKG_CONFIG --variable=pluginsdir libomxil-bellagio`]) + [OMX_LIB_INSTALL_DIR="$OMX_LIB_INSTALL_DIR_DEFAULT"]) AC_SUBST([OMX_LIB_INSTALL_DIR]) dnl Directory for OpenCL libs @@ -1690,7 +1734,7 @@ gallium_require_llvm() { gallium_require_drm_loader() { if test "x$enable_gallium_loader" = xyes; then - if test "x$have_libudev" != xyes; then + if test "x$need_libudev$have_libudev" = xyesno; then AC_MSG_ERROR([Gallium drm loader requires libudev >= $LIBUDEV_REQUIRED]) fi if test "x$have_libdrm" != xyes; then @@ -1700,6 +1744,19 @@ gallium_require_drm_loader() { fi } +require_egl_drm() { + case "$with_egl_platforms" in + *drm*) + ;; + *) + AC_MSG_ERROR([--with-egl-platforms=drm is required to build the $1 driver.]) + ;; + esac + if test "x$enable_gbm" != xyes; then + AC_MSG_ERROR([--enable-gbm is required to build the $1 driver.]) + fi +} + radeon_llvm_check() { if test "x$enable_gallium_llvm" != "xyes"; then AC_MSG_ERROR([--enable-gallium-llvm is required when building $1]) @@ -1791,6 +1848,7 @@ if test -n "$with_gallium_drivers"; then gallium_require_drm_loader GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS radeonsi" radeon_llvm_check "radeonsi" + require_egl_drm "radeonsi" gallium_check_st "radeon/drm" "radeonsi/dri" "" "" "radeonsi/vdpau" "radeonsi/omx" DRICOMMON_NEED_LIBDRM=yes ;; @@ -1799,7 +1857,7 @@ if test -n "$with_gallium_drivers"; then PKG_CHECK_MODULES([NOUVEAU], [libdrm_nouveau >= $LIBDRM_NOUVEAU_REQUIRED]) gallium_require_drm_loader GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS nouveau" - gallium_check_st "nouveau/drm" "dri-nouveau" "" "xvmc-nouveau" "vdpau-nouveau" + gallium_check_st "nouveau/drm" "dri-nouveau" "" "xvmc-nouveau" "vdpau-nouveau" "omx-nouveau" DRICOMMON_NEED_LIBDRM=yes ;; xfreedreno) @@ -1840,7 +1898,7 @@ if test "x$MESA_LLVM" != x0; then LLVM_LIBS="`$LLVM_CONFIG --libs ${LLVM_COMPONENTS}`" - if test "x$with_llvm_shared_libs" = xyes; then + if test "x$enable_llvm_shared_libs" = xyes; then dnl We can't use $LLVM_VERSION because it has 'svn' stripped out, LLVM_SO_NAME=LLVM-`$LLVM_CONFIG --version` AS_IF([test -f "$LLVM_LIBDIR/lib$LLVM_SO_NAME.so"], [llvm_have_one_so=yes]) @@ -1857,18 +1915,17 @@ if test "x$MESA_LLVM" != x0; then and that your llvm libraries are installed in $LLVM_LIBDIR If you have installed your llvm libraries to a different directory you can use the --with-llvm-prefix= configure flag to specify this directory. - NOTE: Mesa is attempting to use llvm shared libraries because you have - passed one of the following options to configure: - --enable-llvm-shared-libs - --enable-opencl + NOTE: Mesa is attempting to use llvm shared libraries by default. If you do not want to build with llvm shared libraries and instead want to - use llvm static libraries then remove these options from your configure - invocation and reconfigure.])]) + use llvm static libraries then add --disable-llvm-shared-libs to your configure + invocation and rebuild.])]) dnl We don't need to update LLVM_LIBS in this case because the LLVM dnl install uses a shared object for each compoenent and we have dnl already added all of these objects to LLVM_LIBS. fi + else + AC_MSG_WARN([Building mesa with staticly linked LLVM may cause compilation issues]) fi fi @@ -1898,12 +1955,14 @@ AM_CONDITIONAL(NEED_GALLIUM_LLVMPIPE_DRIVER, test "x$HAVE_GALLIUM_I915" = xyes - if test "x$enable_gallium_loader" = xyes; then GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/null" - if test "x$enable_gallium_xlib_loader" = xyes; then - GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/xlib" - NEED_WINSYS_XLIB="yes" + if test "x$NEED_WINSYS_XLIB" = xyes; then GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_XLIB" fi + if test "x$enable_dri" = xyes; then + GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRI" + fi + if test "x$enable_gallium_drm_loader" = xyes; then GALLIUM_PIPE_LOADER_DEFINES="$GALLIUM_PIPE_LOADER_DEFINES -DHAVE_PIPE_LOADER_DRM" PKG_CHECK_MODULES([GALLIUM_PIPE_LOADER_XCB], [xcb xcb-dri2], @@ -1922,7 +1981,6 @@ if test "x$enable_gallium_loader" = xyes; then AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_DEFINES]) AC_SUBST([GALLIUM_PIPE_LOADER_CLIENT_LIBS]) fi -AM_CONDITIONAL(NEED_PIPE_LOADER_XLIB, test "x$enable_gallium_xlib_loader" = xyes) AM_CONDITIONAL(HAVE_I915_DRI, test x$HAVE_I915_DRI = xyes) AM_CONDITIONAL(HAVE_I965_DRI, test x$HAVE_I965_DRI = xyes) @@ -1963,9 +2021,14 @@ AC_SUBST([VDPAU_MINOR], 0) AC_SUBST([XVMC_MAJOR], 1) AC_SUBST([XVMC_MINOR], 0) -AC_SUBST([XA_MAJOR], 2) -AC_SUBST([XA_MINOR], 2) -AC_SUBST([XA_TINY], 0) +XA_HEADER="$srcdir/src/gallium/state_trackers/xa/xa_tracker.h" +XA_MAJOR=`grep "#define XA_TRACKER_VERSION_MAJOR" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_MAJOR //'` +XA_MINOR=`grep "#define XA_TRACKER_VERSION_MINOR" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_MINOR //'` +XA_TINY=`grep "#define XA_TRACKER_VERSION_PATCH" $XA_HEADER | $SED 's/^#define XA_TRACKER_VERSION_PATCH //'` + +AC_SUBST([XA_MAJOR], $XA_MAJOR) +AC_SUBST([XA_MINOR], $XA_MINOR) +AC_SUBST([XA_TINY], $XA_TINY) AC_SUBST([XA_VERSION], "$XA_MAJOR.$XA_MINOR.$XA_TINY") dnl Restore LDFLAGS and CPPFLAGS @@ -1985,8 +2048,6 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS" dnl Substitute the config AC_CONFIG_FILES([Makefile src/Makefile - src/egl/Makefile - src/egl/drivers/Makefile src/egl/drivers/dri2/Makefile src/egl/main/Makefile src/egl/main/egl.pc @@ -2039,6 +2100,7 @@ AC_CONFIG_FILES([Makefile src/gallium/targets/opencl/Makefile src/gallium/targets/xa/Makefile src/gallium/targets/xa/xatracker.pc + src/gallium/targets/omx-nouveau/Makefile src/gallium/targets/osmesa/Makefile src/gallium/targets/osmesa/osmesa.pc src/gallium/targets/pipe-loader/Makefile