build: Use AX_PROG_BISON
[mesa.git] / configure.ac
index bde5b057818c73d28d34e9f23bc002e98eb1cb5b..70599e1d33ee915c1ae304bfbf9c6c86f451db6b 100644 (file)
@@ -33,7 +33,7 @@ LIBDRM_REQUIRED=2.4.24
 LIBDRM_RADEON_REQUIRED=2.4.40
 LIBDRM_INTEL_REQUIRED=2.4.38
 LIBDRM_NVVIEUX_REQUIRED=2.4.33
-LIBDRM_NOUVEAU_REQUIRED=2.4.33
+LIBDRM_NOUVEAU_REQUIRED="2.4.33 libdrm >= 2.4.41"
 DRI2PROTO_REQUIRED=2.6
 GLPROTO_REQUIRED=1.4.14
 LIBDRM_XORG_REQUIRED=2.4.24
@@ -49,19 +49,16 @@ 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
 
 LT_PREREQ([2.2])
 LT_INIT([disable-static])
 
-AC_PROG_YACC
-AC_PATH_PROG([YACC_INST], $YACC)
-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
-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])]))
 AC_PROG_LEX
 
 AC_PATH_PROG([PERL], [perl])
@@ -645,13 +642,15 @@ AC_ARG_ENABLE([gallium_tests],
     [enable_gallium_tests=no])
 
 # Option for Gallium drivers
+
+# Keep this in sync with the --with-gallium-drivers help string default value
 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,radeonsi,svga,swrast"
-        @<:@default=r300,r600,swrast@:>@])],
+        @<:@default=r300,r600,svga,swrast@:>@])],
     [with_gallium_drivers="$withval"],
     [with_gallium_drivers="$GALLIUM_DRIVERS_DEFAULT"])
 
@@ -722,22 +721,17 @@ if test "x$enable_dri" = xno; then
     enable_shared_glapi=no
 fi
 
-# TODO: Get rid of SHARED_GLAPI variable
-SHARED_GLAPI="0"
 if test "x$enable_shared_glapi" = xyes; then
-    SHARED_GLAPI="1"
     # libGL will use libglapi for function lookups (IN_DRI_DRIVER means to use
     # the remap table)
     DEFINES="$DEFINES -DIN_DRI_DRIVER"
     CORE_DIRS="mapi/shared-glapi"
 fi
-AC_SUBST([SHARED_GLAPI])
 AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
 
 dnl
 dnl Driver specific build directories
 dnl
-SRC_DIRS="gtest"
 GALLIUM_DIRS="auxiliary drivers state_trackers"
 GALLIUM_TARGET_DIRS=""
 GALLIUM_WINSYS_DIRS="sw"
@@ -762,7 +756,7 @@ fi
 # build glsl and mesa if OpenGL or OpenGL ES is enabled
 case "x$enable_opengl$enable_gles1$enable_gles2" in
 x*yes*)
-    CORE_DIRS="mapi/glapi/gen $CORE_DIRS glsl mesa"
+    CORE_DIRS="mapi/glapi/gen $CORE_DIRS gtest glsl mesa"
     ;;
 esac
 
@@ -1830,7 +1824,7 @@ if test "x$with_gallium_drivers" != x; then
             PKG_CHECK_MODULES([RADEON], [libdrm_radeon >= $LIBDRM_RADEON_REQUIRED])
             gallium_require_llvm "Gallium R300"
             GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS r300"
-            gallium_check_st "radeon/drm" "dri-r300" "xorg-r300" "" "xvmc-r300" "vdpau-r300"
+            gallium_check_st "radeon/drm" "dri-r300" "" "" "xvmc-r300" "vdpau-r300"
             ;;
         xr600)
             HAVE_GALLIUM_R600=yes
@@ -1969,6 +1963,8 @@ 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)
 AM_CONDITIONAL(HAVE_SPARC_ASM, echo "$DEFINES" | grep 'SPARC_ASM' >/dev/null 2>&1)
 
+AM_CONDITIONAL(CROSS_COMPILING, test "x$cross_compiling" = xyes)
+
 AC_SUBST([VDPAU_MAJOR], 1)
 AC_SUBST([VDPAU_MINOR], 0)
 
@@ -2057,7 +2053,6 @@ AC_CONFIG_FILES([Makefile
                src/gallium/targets/xa-vmwgfx/xatracker.pc
                src/gallium/targets/xorg-i915/Makefile
                src/gallium/targets/xorg-nouveau/Makefile
-               src/gallium/targets/xorg-r300/Makefile
                src/gallium/targets/xorg-r600/Makefile
                src/gallium/targets/xorg-radeonsi/Makefile
                src/gallium/targets/xvmc-nouveau/Makefile
@@ -2083,8 +2078,6 @@ AC_CONFIG_FILES([Makefile
                src/gbm/main/gbm.pc
                src/glsl/Makefile
                src/glsl/builtin_compiler/Makefile
-               src/glsl/glcpp/Makefile
-               src/glsl/tests/Makefile
                src/glx/Makefile
                src/glx/tests/Makefile
                src/gtest/Makefile