update to 9.0.3
[profile/ivi/mesa.git] / configure.ac
index 224caea..eb273b9 100644 (file)
@@ -6,9 +6,10 @@ dnl Tell the user about autoconf.html in the --help output
 m4_divert_once([HELP_END], [
 See docs/autoconf.html for more details on the options for Mesa.])
 
-AC_INIT([Mesa], [8.1.0],
+AC_INIT([Mesa], [9.0.3],
     [https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
 AC_CONFIG_AUX_DIR([bin])
+AC_CONFIG_MACRO_DIR([m4])
 AC_CANONICAL_HOST
 AM_INIT_AUTOMAKE([foreign])
 
@@ -26,10 +27,14 @@ m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
 LT_PREREQ([2.2])
 LT_INIT([disable-static])
 
+dnl Set internal versions
+OSMESA_VERSION=8
+AC_SUBST([OSMESA_VERSION])
+
 dnl Versions for external dependencies
 LIBDRM_REQUIRED=2.4.24
-LIBDRM_RADEON_REQUIRED=2.4.38
-LIBDRM_INTEL_REQUIRED=2.4.37
+LIBDRM_RADEON_REQUIRED=2.4.39
+LIBDRM_INTEL_REQUIRED=2.4.38
 LIBDRM_NVVIEUX_REQUIRED=2.4.33
 LIBDRM_NOUVEAU_REQUIRED=2.4.33
 DRI2PROTO_REQUIRED=2.6
@@ -45,6 +50,7 @@ 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
 AC_PATH_PROG([MKDEP], [makedepend])
@@ -55,7 +61,7 @@ fi
 
 AC_PROG_YACC
 AC_PATH_PROG([YACC_INST], $YACC)
-if test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.y"; then
+if test ! -f "$srcdir/src/glsl/glcpp/glcpp-parse.c"; then
     if test -z "$YACC_INST"; then
         AC_MSG_ERROR([yacc not found - unable to compile glcpp-parse.y])
     fi
@@ -155,13 +161,13 @@ DEFINES=""
 AC_SUBST([DEFINES])
 case "$host_os" in
 linux*|*-gnu*|gnu*)
-    DEFINES="$DEFINES -D_GNU_SOURCE -DPTHREADS"
+    DEFINES="$DEFINES -D_GNU_SOURCE -DHAVE_PTHREAD"
     ;;
 solaris*)
-    DEFINES="$DEFINES -DPTHREADS -DSVR4"
+    DEFINES="$DEFINES -DHAVE_PTHREAD -DSVR4"
     ;;
 cygwin*)
-    DEFINES="$DEFINES -DPTHREADS"
+    DEFINES="$DEFINES -DHAVE_PTHREAD"
     ;;
 esac
 
@@ -283,6 +289,8 @@ xnono )
     ;;
 esac
 
+AM_CONDITIONAL(BUILD_SHARED, test "x$enable_shared" = xyes)
+
 dnl
 dnl mklib options
 dnl
@@ -338,18 +346,12 @@ AC_ARG_WITH([gl-lib-name],
     [specify GL library name @<:@default=GL@:>@])],
   [GL_LIB=$withval],
   [GL_LIB=GL])
-AC_ARG_WITH([glu-lib-name],
-  [AS_HELP_STRING([--with-glu-lib-name@<:@=NAME@:>@],
-    [specify GLU library name @<:@default=GLU@:>@])],
-  [GLU_LIB=$withval],
-  [GLU_LIB=GLU])
 AC_ARG_WITH([osmesa-lib-name],
   [AS_HELP_STRING([--with-osmesa-lib-name@<:@=NAME@:>@],
     [specify OSMesa library name @<:@default=OSMesa@:>@])],
   [OSMESA_LIB=$withval],
   [OSMESA_LIB=OSMesa])
 AS_IF([test "x$GL_LIB" = xyes], [GL_LIB=GL])
-AS_IF([test "x$GLU_LIB" = xyes], [GLU_LIB=GLU])
 AS_IF([test "x$OSMESA_LIB" = xyes], [OSMESA_LIB=OSMesa])
 
 dnl
@@ -364,11 +366,9 @@ AC_ARG_ENABLE([mangling],
 if test "x${enable_mangling}" = "xyes" ; then
   DEFINES="${DEFINES} -DUSE_MGL_NAMESPACE"
   GL_LIB="Mangled${GL_LIB}"
-  GLU_LIB="Mangled${GLU_LIB}"
   OSMESA_LIB="Mangled${OSMESA_LIB}"
 fi
 AC_SUBST([GL_LIB])
-AC_SUBST([GLU_LIB])
 AC_SUBST([OSMESA_LIB])
 
 dnl
@@ -387,7 +387,6 @@ if test "x$enable_texture_float" = xyes; then
 fi
 
 GL_LIB_NAME='lib$(GL_LIB).'${LIB_EXTENSION}
-GLU_LIB_NAME='lib$(GLU_LIB).'${LIB_EXTENSION}
 OSMESA_LIB_NAME='lib$(OSMESA_LIB).'${LIB_EXTENSION}
 EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
 GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
@@ -396,7 +395,6 @@ VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
 GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
 
 GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
-GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
 EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
 EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
 GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
@@ -405,7 +403,6 @@ VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENS
 GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
 
 AC_SUBST([GL_LIB_NAME])
-AC_SUBST([GLU_LIB_NAME])
 AC_SUBST([OSMESA_LIB_NAME])
 AC_SUBST([EGL_LIB_NAME])
 AC_SUBST([GLESv1_CM_LIB_NAME])
@@ -414,7 +411,6 @@ AC_SUBST([VG_LIB_NAME])
 AC_SUBST([GLAPI_LIB_NAME])
 
 AC_SUBST([GL_LIB_GLOB])
-AC_SUBST([GLU_LIB_GLOB])
 AC_SUBST([EGL_LIB_GLOB])
 AC_SUBST([GLESv1_CM_LIB_GLOB])
 AC_SUBST([GLESv2_LIB_GLOB])
@@ -497,13 +493,21 @@ MESA_PIC_FLAGS
 
 dnl Check to see if dlopen is in default libraries (like Solaris, which
 dnl has it in libc), or if libdl is needed to get it.
-AC_CHECK_FUNC([dlopen], [],
-    [AC_CHECK_LIB([dl], [dlopen], [DLOPEN_LIBS="-ldl"])])
+AC_CHECK_FUNC([dlopen], [DEFINES="$DEFINES -DHAVE_DLOPEN"],
+    [AC_CHECK_LIB([dl], [dlopen],
+       [DEFINES="$DEFINES -DHAVE_DLOPEN"; DLOPEN_LIBS="-ldl"])])
 AC_SUBST([DLOPEN_LIBS])
 
 dnl See if posix_memalign is available
 AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
 
+dnl Check for pthreads
+AX_PTHREAD
+dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
+dnl to -pthread, which causes problems if we need -lpthread to appear in
+dnl pkgconfig files.
+test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
+
 dnl SELinux awareness.
 AC_ARG_ENABLE([selinux],
     [AS_HELP_STRING([--enable-selinux],
@@ -518,6 +522,7 @@ if test "x$enable_selinux" = "xyes"; then
     SELINUX_LIBS="-lselinux"
     DEFINES="$DEFINES -DMESA_SELINUX"
 fi
+AC_SUBST([SELINUX_LIBS])
 
 dnl Options for APIs
 AC_ARG_ENABLE([opengl],
@@ -641,7 +646,7 @@ GALLIUM_DRIVERS_DEFAULT="r300,r600,svga,swrast"
 AC_ARG_WITH([gallium-drivers],
     [AS_HELP_STRING([--with-gallium-drivers@<:@=DIRS...@:>@],
         [comma delimited Gallium drivers list, e.g.
-        "i915,nouveau,r300,r600,svga,swrast"
+        "i915,nouveau,r300,r600,radeonsi,svga,swrast"
         @<:@default=r300,r600,swrast@:>@])],
     [with_gallium_drivers="$withval"],
     [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
@@ -667,6 +672,17 @@ if test "x$enable_opengl" = xno -a \
     AC_MSG_ERROR([at least one API should be enabled])
 fi
 
+# Building OpenGL ES1 and/or ES2 without OpenGL is not supported on mesa 9.0.x
+if test "x$enable_opengl" = xno -a \
+        "x$enable_gles1" = xyes; then
+    AC_MSG_ERROR([Building OpenGL ES1 without OpenGL is not supported])
+fi
+
+if test "x$enable_opengl" = xno -a \
+        "x$enable_gles2" = xyes; then
+    AC_MSG_ERROR([Building OpenGL ES2 without OpenGL is not supported])
+fi
+
 API_DEFINES=""
 if test "x$enable_opengl" = xno; then
     API_DEFINES="$API_DEFINES -DFEATURE_GL=0"
@@ -690,6 +706,16 @@ if test "x$enable_dri$enable_xlib_glx" = xyesyes; then
     AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together])
 fi
 
+if test "x$enable_opengl$enable_xlib_glx" = xnoyes; then
+    AC_MSG_ERROR([Xlib-GLX cannot be built without OpenGL])
+fi
+
+# Disable GLX if OpenGL is not enabled
+if test "x$enable_glx$enable_opengl" = xyesno; then
+    AC_MSG_WARN([OpenGL not enabled, disabling GLX])
+    enable_glx=no
+fi
+
 # Disable GLX if DRI and Xlib-GLX are not enabled
 if test "x$enable_glx" = xyes -a \
         "x$enable_dri" = xno -a \
@@ -698,7 +724,9 @@ if test "x$enable_glx" = xyes -a \
     enable_glx=no
 fi
 
-AM_CONDITIONAL(HAVE_DRI, test x"$enable_dri" = xyes)
+AM_CONDITIONAL(HAVE_DRI, test "x$enable_dri" = xyes)
+AM_CONDITIONAL(NEED_LIBMESA, test "x$enable_xlib_glx" = xyes -o \
+                                  "x$enable_osmesa" = xyes)
 
 AC_ARG_ENABLE([shared-glapi],
     [AS_HELP_STRING([--enable-shared-glapi],
@@ -728,7 +756,6 @@ dnl
 dnl Driver specific build directories
 dnl
 SRC_DIRS="gtest"
-GLU_DIRS="sgi"
 GALLIUM_DIRS="auxiliary drivers state_trackers"
 GALLIUM_TARGET_DIRS=""
 GALLIUM_WINSYS_DIRS="sw"
@@ -784,7 +811,6 @@ if test "x$enable_osmesa" = xyes; then
 fi
 
 AC_SUBST([SRC_DIRS])
-AC_SUBST([GLU_DIRS])
 AC_SUBST([DRIVER_DIRS])
 AC_SUBST([GALLIUM_DIRS])
 AC_SUBST([GALLIUM_TARGET_DIRS])
@@ -858,19 +884,18 @@ xyesyes)
     GL_PC_REQ_PRIV="x11 xext"
     X11_INCLUDES="$X11_INCLUDES $XLIBGL_CFLAGS"
     GL_LIB_DEPS="$XLIBGL_LIBS"
-    GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm -lpthread $DLOPEN_LIBS"
-    GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm -lpthread"
+    GL_LIB_DEPS="$GL_LIB_DEPS $SELINUX_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
+    GL_PC_LIB_PRIV="$GL_PC_LIB_PRIV $SELINUX_LIBS -lm $PTHREAD_LIBS"
     ;;
 xyesno)
     # DRI-based GLX
     PKG_CHECK_MODULES([GLPROTO], [glproto >= $GLPROTO_REQUIRED])
-    GL_PC_REQ_PRIV="glproto >= $GLPROTO_REQUIRED"
     if test x"$driglx_direct" = xyes; then
         if test "x$have_libdrm" != xyes; then
             AC_MSG_ERROR([Direct rendering requires libdrm >= $LIBDRM_REQUIRED])
         fi
         PKG_CHECK_MODULES([DRI2PROTO], [dri2proto >= $DRI2PROTO_REQUIRED])
-        GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED dri2proto >= $DRI2PROTO_REQUIRED"
+        GL_PC_REQ_PRIV="$GL_PC_REQ_PRIV libdrm >= $LIBDRM_REQUIRED"
     fi
 
     # find the DRI deps for libGL
@@ -887,9 +912,9 @@ xyesno)
     X11_INCLUDES="$X11_INCLUDES $DRIGL_CFLAGS"
     GL_LIB_DEPS="$DRIGL_LIBS"
 
-    # need DRM libs, -lpthread, etc.
-    GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
-    GL_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
+    # need DRM libs, $PTHREAD_LIBS, etc.
+    GL_LIB_DEPS="$GL_LIB_DEPS $LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
+    GL_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
     ;;
 esac
 
@@ -897,10 +922,10 @@ esac
 # builds.
 AM_CONDITIONAL(HAVE_XF86VIDMODE, test "x$HAVE_XF86VIDMODE" = xyes)
 
-GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
-GLESv1_CM_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
-GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm -lpthread $DLOPEN_LIBS"
-GLESv2_PC_LIB_PRIV="-lm -lpthread $DLOPEN_LIBS"
+GLESv1_CM_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
+GLESv1_CM_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
+GLESv2_LIB_DEPS="$LIBDRM_LIBS -lm $PTHREAD_LIBS $DLOPEN_LIBS"
+GLESv2_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
 
 AC_SUBST([GL_LIB_DEPS])
 AC_SUBST([GL_PC_REQ_PRIV])
@@ -912,14 +937,7 @@ AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
 AC_SUBST([GLESv2_LIB_DEPS])
 AC_SUBST([GLESv2_PC_LIB_PRIV])
 
-GLAPI_LIB_DEPS="-lpthread $SELINUX_LIBS"
-AC_SUBST([GLAPI_LIB_DEPS])
-
-
 DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la"
-GALLIUM_DRI_LIB_DEPS="\$(TOP)/\$(LIB_DIR)/libdricore${VERSION}.so"
-
-AM_CONDITIONAL(HAVE_DRICORE, test "x$enable_dri" = xyes)
 
 AC_SUBST([HAVE_XF86VIDMODE])
 
@@ -949,8 +967,8 @@ AC_ARG_ENABLE([glx-tls],
     [GLX_USE_TLS=no])
 AC_SUBST(GLX_TLS, ${GLX_USE_TLS})
 
-AS_IF([test "x$GLX_USE_TLS" = xyes],
-      [DEFINES="${DEFINES} -DGLX_USE_TLS -DPTHREADS"])
+AS_IF([test "x$GLX_USE_TLS" = xyes -a "x$ax_pthread_ok" = xyes],
+      [DEFINES="${DEFINES} -DGLX_USE_TLS -DHAVE_PTHREAD"])
 
 dnl
 dnl More DRI setup
@@ -1034,7 +1052,7 @@ if test "x$enable_dri" = xyes; then
         esac
         ;;
     freebsd* | dragonfly* | *netbsd*)
-        DEFINES="$DEFINES -DPTHREADS -DUSE_EXTERNAL_DXTN_LIB=1"
+        DEFINES="$DEFINES -DHAVE_PTHREAD -DUSE_EXTERNAL_DXTN_LIB=1"
         DEFINES="$DEFINES -DIN_DRI_DRIVER -DHAVE_ALIAS"
 
         if test "x$DRI_DIRS" = "xyes"; then
@@ -1093,9 +1111,10 @@ if test "x$enable_dri" = xyes; then
     fi
 
     # put all the necessary libs together
-    DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
-    GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm -lpthread $DLOPEN_LIBS"
+    DRI_LIB_DEPS="$DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
+    GALLIUM_DRI_LIB_DEPS="$GALLIUM_DRI_LIB_DEPS $SELINUX_LIBS $LIBDRM_LIBS $EXPAT_LIB -lm $PTHREAD_LIBS $DLOPEN_LIBS"
 fi
+AM_CONDITIONAL(NEED_LIBDRICORE, test -n "$DRI_DIRS")
 AC_SUBST([DRI_DIRS])
 AC_SUBST([EXPAT_INCLUDES])
 AC_SUBST([DRI_LIB_DEPS])
@@ -1190,21 +1209,18 @@ esac
 if test "x$enable_osmesa" = xyes; then
     # only link libraries with osmesa if shared
     if test "$enable_static" = no; then
-        OSMESA_LIB_DEPS="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
+        OSMESA_LIB_DEPS="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
     else
         OSMESA_LIB_DEPS=""
     fi
     OSMESA_MESA_DEPS=""
-    OSMESA_PC_LIB_PRIV="-lm -lpthread $SELINUX_LIBS $DLOPEN_LIBS"
+    OSMESA_PC_LIB_PRIV="-lm $PTHREAD_LIBS $SELINUX_LIBS $DLOPEN_LIBS"
 fi
 
-OSMESA_VERSION=`echo "$VERSION" | $SED 's/\./:/g'`
-
 AC_SUBST([OSMESA_LIB_DEPS])
 AC_SUBST([OSMESA_MESA_DEPS])
 AC_SUBST([OSMESA_PC_REQ])
 AC_SUBST([OSMESA_PC_LIB_PRIV])
-AC_SUBST([OSMESA_VERSION])
 
 dnl
 dnl gbm configuration
@@ -1242,7 +1258,7 @@ EGL_CLIENT_APIS=""
 
 if test "x$enable_egl" = xyes; then
     SRC_DIRS="$SRC_DIRS egl"
-    EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS -lpthread"
+    EGL_LIB_DEPS="$DLOPEN_LIBS $SELINUX_LIBS $PTHREAD_LIBS"
 
     AC_CHECK_FUNC(mincore, [DEFINES="$DEFINES -DHAVE_MINCORE"])
 
@@ -1365,10 +1381,12 @@ if test "x$enable_openvg" = xyes; then
     fi
 
     EGL_CLIENT_APIS="$EGL_CLIENT_APIS "'$(VG_LIB)'
-    VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS -lpthread"
+    VG_LIB_DEPS="$VG_LIB_DEPS $SELINUX_LIBS $PTHREAD_LIBS"
     CORE_DIRS="$CORE_DIRS mapi/vgapi"
     GALLIUM_STATE_TRACKERS_DIRS="vega $GALLIUM_STATE_TRACKERS_DIRS"
     HAVE_ST_VEGA=yes
+    VG_PC_LIB_PRIV="-lm $PTHREAD_LIBS $DLOPEN_LIBS"
+    AC_SUBST([VG_PC_LIB_PRIV])
 fi
 
 dnl
@@ -1437,17 +1455,27 @@ dnl
 
 AC_ARG_WITH([libclc-path],
    [AS_HELP_STRING([--with-libclc-path],
-         [Path to libclc builtins library.  Example: --with-libclc-path=\$HOME/libclc/])],
+         [DEPRECATED: See http://dri.freedesktop.org/wiki/GalliumCompute#How_to_Install])],
    [LIBCLC_PATH="$withval"],
    [LIBCLC_PATH=""])
 
+if test "x$LIBCLC_PATH" != x; then
+   AC_MSG_ERROR([The --with-libclc-path option has been deprecated.
+                  Please review the updated build instructions for clover:
+                 http://dri.freedesktop.org/wiki/GalliumCompute])
+fi
+
+
 AC_ARG_WITH([clang-libdir],
    [AS_HELP_STRING([--with-clang-libdir],
          [Path to Clang libraries @<:@default=llvm-config --libdir@:>@])],
    [CLANG_LIBDIR="$withval"],
    [CLANG_LIBDIR=""])
 
-AC_SUBST([LIBCLC_PATH])
+LIBCLC_INCLUDEDIR=`pkg-config --variable=includedir libclc`
+LIBCLC_LIBEXECDIR=`pkg-config --variable=libexecdir libclc`
+AC_SUBST([LIBCLC_INCLUDEDIR])
+AC_SUBST([LIBCLC_LIBEXECDIR])
 
 if test "x$enable_opencl" = xyes; then
     if test "x$with_gallium_drivers" = x; then
@@ -1458,66 +1486,16 @@ if test "x$enable_opencl" = xyes; then
         AC_MSG_ERROR([gcc >= 4.6 is required to build clover])
     fi
 
+    if test "x$LIBCLC_INCLUDEDIR" == x || test "x$LIBCLC_LIBEXECDIR" == x; then
+        AC_MSG_ERROR([pkg-config cannot use libclc.pc which is required to build clover])
+    fi
+
     GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS clover"
     GALLIUM_TARGET_DIRS="$GALLIUM_TARGET_DIRS opencl"
     enable_gallium_loader=yes
 fi
 
 dnl
-dnl GLU configuration
-dnl
-AC_ARG_ENABLE([glu],
-    [AS_HELP_STRING([--disable-glu],
-        [enable OpenGL Utility library @<:@default=enabled@:>@])],
-    [enable_glu="$enableval"],
-    [enable_glu=yes])
-
-if test "x$enable_glu" = xyes; then
-    if test "x$enable_glx" = xno -a "x$enable_osmesa" = xno; then
-        AC_MSG_NOTICE([Disabling GLU since there is no OpenGL driver])
-        enable_glu=no
-    fi
-fi
-
-if test "x$enable_glu" = xyes; then
-    SRC_DIRS="$SRC_DIRS glu"
-
-    if test "x$enable_glx" = xno; then
-        # Link libGLU to libOSMesa instead of libGL
-        GLU_LIB_DEPS=""
-        GLU_PC_REQ="osmesa"
-        if test "$enable_static" = no; then
-            GLU_MESA_DEPS='-l$(OSMESA_LIB)'
-        else
-            GLU_MESA_DEPS=""
-        fi
-    else
-        # If static, empty GLU_LIB_DEPS and add libs for programs to link
-        GLU_PC_REQ="gl"
-        GLU_PC_LIB_PRIV="-lm"
-        if test "$enable_static" = no; then
-            GLU_LIB_DEPS="-lm"
-            GLU_MESA_DEPS='-l$(GL_LIB)'
-        else
-            GLU_LIB_DEPS=""
-            GLU_MESA_DEPS=""
-        fi
-    fi
-fi
-if test "$enable_static" = no; then
-    GLU_LIB_DEPS="$GLU_LIB_DEPS $OS_CPLUSPLUS_LIBS"
-fi
-GLU_PC_LIB_PRIV="$GLU_PC_LIB_PRIV $OS_CPLUSPLUS_LIBS"
-AC_SUBST([GLU_LIB_DEPS])
-AC_SUBST([GLU_MESA_DEPS])
-AC_SUBST([GLU_PC_REQ])
-AC_SUBST([GLU_PC_REQ_PRIV])
-AC_SUBST([GLU_PC_LIB_PRIV])
-AC_SUBST([GLU_PC_CFLAGS])
-
-AC_SUBST([PROGRAM_DIRS])
-
-dnl
 dnl Gallium configuration
 dnl
 if test "x$with_gallium_drivers" != x; then
@@ -1574,8 +1552,7 @@ for plat in $egl_platforms; do
                ;;
 
        wayland)
-               PKG_CHECK_MODULES([WAYLAND], [wayland-client wayland-server],, \
-                                 [AC_MSG_ERROR([cannot find libwayland-client])])
+               PKG_CHECK_MODULES([WAYLAND], [wayland-client >= 1.0.2 wayland-server >= 1.0.2])
                GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
 
                 WAYLAND_PREFIX=`$PKG_CONFIG --variable=prefix wayland-client`
@@ -1719,8 +1696,8 @@ if test "x$enable_gallium_llvm" = xyes; then
        fi
        LLVM_LDFLAGS=`$LLVM_CONFIG --ldflags`
        LLVM_BINDIR=`$LLVM_CONFIG --bindir`
-       LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags`
-       LLVM_CPPFLAGS=`$LLVM_CONFIG --cppflags`
+       LLVM_CXXFLAGS=`$LLVM_CONFIG --cxxflags|sed -e 's/-DNDEBUG\>//g' -e 's/-pedantic//g' -e 's/-Wcovered-switch-default//g'`
+       LLVM_CPPFLAGS=`$LLVM_CONFIG --cppflags|sed -e 's/-DNDEBUG\>//g' -e 's/-pedantic//g' -e 's/-Wcovered-switch-default//g'`
        LLVM_INCLUDEDIR=`$LLVM_CONFIG --includedir`
        LLVM_LIBDIR=`$LLVM_CONFIG --libdir`
        DEFINES="${DEFINES} -DHAVE_LLVM=`echo $LLVM_VERSION | sed -e 's/\([[0-9]]\)\.\([[0-9]]\)/0x0\10\2/g'`"
@@ -1979,7 +1956,6 @@ AM_CONDITIONAL(HAVE_GALLIUM_COMPUTE, test x$enable_opencl = xyes)
 AC_SUBST([GALLIUM_MAKE_DIRS])
 
 AM_CONDITIONAL(HAVE_X11_DRIVER, echo "$DRIVER_DIRS" | grep 'x11' >/dev/null 2>&1)
-AM_CONDITIONAL(HAVE_DRI_DRIVER, echo "$DRIVER_DIRS" | grep 'dri' >/dev/null 2>&1)
 
 AM_CONDITIONAL(HAVE_X86_ASM, echo "$DEFINES" | grep 'X86_ASM' >/dev/null 2>&1)
 AM_CONDITIONAL(HAVE_X86_64_ASM, echo "$DEFINES" | grep 'X86_64_ASM' >/dev/null 2>&1)
@@ -1999,56 +1975,62 @@ CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
 dnl Substitute the config
 AC_CONFIG_FILES([configs/current
                Makefile
-               src/Makefile
-               src/gallium/Makefile
-               src/gallium/auxiliary/pipe-loader/Makefile
-               src/gallium/state_trackers/clover/Makefile
-               src/gallium/drivers/Makefile
-               src/gallium/drivers/r300/Makefile
-               src/gallium/drivers/r600/Makefile
-               src/gallium/targets/opencl/Makefile
-               src/gbm/Makefile
-               src/gbm/main/gbm.pc
+               src/egl/Makefile
                src/egl/drivers/Makefile
                src/egl/drivers/dri2/Makefile
                src/egl/drivers/glx/Makefile
-               src/egl/Makefile
                src/egl/main/Makefile
                src/egl/main/egl.pc
                src/egl/wayland/Makefile
+               src/egl/wayland/wayland-drm/Makefile
                src/egl/wayland/wayland-egl/Makefile
                src/egl/wayland/wayland-egl/wayland-egl.pc
-               src/egl/wayland/wayland-drm/Makefile
+               src/gallium/Makefile
+               src/gallium/auxiliary/pipe-loader/Makefile
+               src/gallium/drivers/Makefile
+               src/gallium/drivers/r300/Makefile
+               src/gallium/drivers/r600/Makefile
+               src/gallium/state_trackers/clover/Makefile
+               src/gallium/targets/opencl/Makefile
+               src/gbm/Makefile
+               src/gbm/main/gbm.pc
                src/glsl/Makefile
                src/glsl/glcpp/Makefile
                src/glsl/tests/Makefile
                src/glx/Makefile
                src/glx/tests/Makefile
+               src/gtest/Makefile
+               src/Makefile
+               src/mapi/es1api/Makefile
+               src/mapi/es1api/glesv1_cm.pc
+               src/mapi/es2api/Makefile
+               src/mapi/es2api/glesv2.pc
                src/mapi/glapi/Makefile
                src/mapi/glapi/gen/Makefile
-               src/mapi/shared-glapi/Makefile
                src/mapi/glapi/tests/Makefile
+               src/mapi/shared-glapi/Makefile
                src/mapi/shared-glapi/tests/Makefile
-               src/gtest/Makefile
+               src/mapi/vgapi/Makefile
+               src/mapi/vgapi/vg.pc
                src/mesa/Makefile
-               src/mesa/libdricore/Makefile
-               src/mesa/main/tests/Makefile
-               src/mesa/x86/Makefile
-               src/mesa/x86-64/Makefile
+               src/mesa/gl.pc
                src/mesa/drivers/Makefile
                src/mesa/drivers/dri/dri.pc
-               src/mesa/drivers/dri/Makefile
                src/mesa/drivers/dri/common/Makefile
                src/mesa/drivers/dri/i915/Makefile
                src/mesa/drivers/dri/i965/Makefile
+               src/mesa/drivers/dri/Makefile
                src/mesa/drivers/dri/nouveau/Makefile
                src/mesa/drivers/dri/r200/Makefile
                src/mesa/drivers/dri/radeon/Makefile
                src/mesa/drivers/dri/swrast/Makefile
                src/mesa/drivers/osmesa/Makefile
+               src/mesa/drivers/osmesa/osmesa.pc
                src/mesa/drivers/x11/Makefile
-               src/mesa/gl.pc
-               src/mesa/drivers/osmesa/osmesa.pc])
+               src/mesa/libdricore/Makefile
+               src/mesa/main/tests/Makefile
+               src/mesa/x86-64/Makefile
+               src/mesa/x86/Makefile])
 
 dnl Sort the dirs alphabetically
 GALLIUM_TARGET_DIRS=`echo $GALLIUM_TARGET_DIRS|tr " " "\n"|sort -u|tr "\n" " "`
@@ -2104,9 +2086,6 @@ xyesno)
     ;;
 esac
 
-echo ""
-echo "        GLU:             $enable_glu"
-
 dnl EGL
 echo ""
 echo "        EGL:             $enable_egl"