automake: convert es2api
[mesa.git] / configure.ac
index 10d7b666d7873f5f0446e0b6a9dd2b27f5752945..eafbd65a7480e674087abe0c3decd6b27ad0a157 100644 (file)
@@ -543,19 +543,19 @@ AC_ARG_ENABLE([openvg],
 
 AC_ARG_ENABLE([dri],
     [AS_HELP_STRING([--enable-dri],
-        [enable DRI modules @<:@default=auto@:>@])],
+        [enable DRI modules @<:@default=enabled@:>@])],
     [enable_dri="$enableval"],
-    [enable_dri=auto])
+    [enable_dri=yes])
 AC_ARG_ENABLE([glx],
     [AS_HELP_STRING([--enable-glx],
-        [enable GLX library @<:@default=auto@:>@])],
+        [enable GLX library @<:@default=enabled@:>@])],
     [enable_glx="$enableval"],
-    [enable_glx=auto])
+    [enable_glx=yes])
 AC_ARG_ENABLE([osmesa],
     [AS_HELP_STRING([--enable-osmesa],
-        [enable OSMesa library @<:@default=auto@:>@])],
+        [enable OSMesa library @<:@default=disabled@:>@])],
     [enable_osmesa="$enableval"],
-    [enable_osmesa=auto])
+    [enable_osmesa=no])
 AC_ARG_ENABLE([egl],
     [AS_HELP_STRING([--disable-egl],
         [disable EGL library @<:@default=enabled@:>@])],
@@ -605,9 +605,9 @@ AC_ARG_ENABLE([opencl],
    [enable_opencl=no])
 AC_ARG_ENABLE([xlib_glx],
     [AS_HELP_STRING([--enable-xlib-glx],
-        [make GLX library Xlib-based instead of DRI-based @<:@default=disable@:>@])],
+        [make GLX library Xlib-based instead of DRI-based @<:@default=disabled@:>@])],
     [enable_xlib_glx="$enableval"],
-    [enable_xlib_glx=auto])
+    [enable_xlib_glx=no])
 AC_ARG_ENABLE([gallium_egl],
     [AS_HELP_STRING([--enable-gallium-egl],
         [enable optional EGL state tracker (not required
@@ -681,83 +681,52 @@ if test "x$enable_gles2" = xyes; then
 fi
 AC_SUBST([API_DEFINES])
 
+if test "x$enable_glx" = xno; then
+    AC_MSG_WARN([GLX disabled, disabling Xlib-GLX])
+    enable_xlib_glx=no
+fi
+
+if test "x$enable_dri$enable_xlib_glx" = xyesyes; then
+    AC_MSG_ERROR([DRI and Xlib-GLX cannot be built together])
+fi
+
+# Disable GLX if DRI and Xlib-GLX are not enabled
+if test "x$enable_glx" = xyes -a \
+        "x$enable_dri" = xno -a \
+        "x$enable_xlib_glx" = xno; then
+    AC_MSG_WARN([Neither DRI nor Xlib-GLX enabled, disabling GLX])
+    enable_glx=no
+fi
+
+AM_CONDITIONAL(HAVE_DRI, test x"$enable_dri" = xyes)
+
 AC_ARG_ENABLE([shared-glapi],
     [AS_HELP_STRING([--enable-shared-glapi],
         [Enable shared glapi for OpenGL @<:@default=yes@:>@])],
     [enable_shared_glapi="$enableval"],
-    [enable_shared_glapi=yes])
+    [enable_shared_glapi="$enable_dri"])
+
+# Shared GLAPI is only useful for DRI
+if test "x$enable_dri" = xno; then
+    AC_MSG_NOTICE([Shared GLAPI is only useful for DRI, disabling])
+    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"
-    SRC_DIRS="$SRC_DIRS mapi/shared-glapi"
+    CORE_DIRS="mapi/shared-glapi"
 fi
 AC_SUBST([SHARED_GLAPI])
-AM_CONDITIONAL(HAVE_SHARED_GLAPI, test $SHARED_GLAPI = 1)
-
-dnl Driver configuration. Options are xlib, dri and osmesa.
-default_driver="xlib"
-
-case "$host_os" in
-linux*)
-    default_driver="dri"
-    ;;
-*freebsd* | dragonfly* | *netbsd*)
-    case "$host_cpu" in
-    i*86|x86_64|powerpc*|sparc*) default_driver="dri";;
-    esac
-    ;;
-esac
-
-if test "x$enable_opengl" = xno; then
-    default_driver="no"
-fi
-
-# map $default_driver to APIs
-if test "x$enable_dri" = xauto; then
-    case "x$default_driver" in
-    xdri) enable_dri=yes ;;
-    *)    enable_dri=no ;;
-    esac
-fi
-
-if test "x$enable_glx" = xauto; then
-    case "x$default_driver" in
-    xdri|xxlib) enable_glx=yes ;;
-    *)          enable_glx=no ;;
-    esac
-fi
-
-if test "x$enable_osmesa" = xauto; then
-    case "x$default_driver" in
-    xxlib|xosmesa) enable_osmesa=yes ;;
-    *)             enable_osmesa=no ;;
-    esac
-fi
-
-if test "x$enable_xlib_glx" = xauto; then
-    case "x$default_driver" in
-    xxlib) enable_xlib_glx=yes ;;
-    *)     enable_xlib_glx=no ;;
-    esac
-fi
-
-if test "x$enable_glx" = xno; then
-    enable_xlib_glx=no
-fi
-
-AM_CONDITIONAL(HAVE_DRI, test x"$enable_dri" = xyes)
+AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
 
 dnl
 dnl Driver specific build directories
 dnl
-
-dnl this variable will be prepended to SRC_DIRS and is not exported
-CORE_DIRS=""
-
 SRC_DIRS="gtest"
 GLU_DIRS="sgi"
 GALLIUM_DIRS="auxiliary drivers state_trackers"
@@ -766,13 +735,6 @@ GALLIUM_WINSYS_DIRS="sw"
 GALLIUM_DRIVERS_DIRS="galahad trace rbug noop identity"
 GALLIUM_STATE_TRACKERS_DIRS=""
 
-# build shared-glapi if enabled for OpenGL or if OpenGL ES is enabled
-case "x$enable_shared_glapi$enable_gles1$enable_gles2" in
-x*yes*)
-    CORE_DIRS="$CORE_DIRS mapi/shared-glapi"
-    ;;
-esac
-
 # build glapi if OpenGL is enabled
 if test "x$enable_opengl" = xyes; then
     CORE_DIRS="$CORE_DIRS mapi/glapi"
@@ -954,17 +916,10 @@ GLAPI_LIB_DEPS="-lpthread $SELINUX_LIBS"
 AC_SUBST([GLAPI_LIB_DEPS])
 
 
-dnl dri libraries are linking with mesa
-DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.la'
-GALLIUM_DRI_LIB_DEPS='$(TOP)/src/mesa/libmesa.a'
+DRI_LIB_DEPS="\$(top_builddir)/src/mesa/libdricore/libdricore${VERSION}.la"
+GALLIUM_DRI_LIB_DEPS="\$(TOP)/\$(LIB_DIR)/libdricore${VERSION}.so"
 
-dnl ... or dricore?
-if test "x$enable_dri" = xyes && test "x$driglx_direct" = xyes ; then
-    DRI_LIB_DEPS="\$(TOP)/src/mesa/libdricore/libdricore${VERSION}.la"
-    GALLIUM_DRI_LIB_DEPS="\$(TOP)/\$(LIB_DIR)/libdricore${VERSION}.so"
-    HAVE_DRICORE=yes
-fi
-AM_CONDITIONAL(HAVE_DRICORE, test x$HAVE_DRICORE = xyes)
+AM_CONDITIONAL(HAVE_DRICORE, test "x$enable_dri" = xyes)
 
 AC_SUBST([HAVE_XF86VIDMODE])
 
@@ -1270,7 +1225,7 @@ if test "x$enable_gbm" = xyes; then
 
     if test "x$enable_dri" = xyes; then
         GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
-        if test "$SHARED_GLAPI" -eq 0; then
+        if test "x$enable_shared_glapi" = xno; then
             AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
         fi
     fi
@@ -1568,6 +1523,7 @@ dnl
 if test "x$with_gallium_drivers" != x; then
     SRC_DIRS="$SRC_DIRS gallium gallium/winsys gallium/targets"
 fi
+AM_CONDITIONAL(HAVE_GALLIUM, test "x$with_gallium_drivers" != x)
 
 AC_SUBST([LLVM_BINDIR])
 AC_SUBST([LLVM_CFLAGS])
@@ -2068,6 +2024,8 @@ AC_CONFIG_FILES([configs/current
                src/glsl/tests/Makefile
                src/glx/Makefile
                src/glx/tests/Makefile
+               src/mapi/es2api/Makefile
+               src/mapi/es2api/glesv2.pc
                src/mapi/glapi/Makefile
                src/mapi/glapi/gen/Makefile
                src/mapi/shared-glapi/Makefile
@@ -2199,6 +2157,7 @@ dnl Libraries
 echo ""
 echo "        Shared libs:     $enable_shared"
 echo "        Static libs:     $enable_static"
+echo "        Shared-glapi:    $enable_shared_glapi"
 
 dnl Compiler options
 # cleanup the CFLAGS/CXXFLAGS/DEFINES vars