1dnl Checks for SVGALib support
2AC_ARG_WITH(svga,
3[  --with-svga=DIR         use SVGALib found in DIR],
4HAVE_SVGA=$withval, HAVE_SVGA=auto)
5if test "x$HAVE_SVGA" != xno; then
6	if test "x$HAVE_SVGA" != xauto; then
7		SVGA_CFLAGS="$SVGA_CFLAGS -I$withval/include"
8		SVGA_LIBS="$SVGA_LIBS -L$withval/lib"
9		dnl The default system location is /usr/include or /usr/local/include
10		dnl and we (obviously) do not need to set CFLAGS for that
11	fi
12	save_CPPFLAGS="$CPPFLAGS"
13	CPPFLAGS="$CPPFLAGS $SVGA_CFLAGS"
14	AC_CHECK_HEADER(vga.h, HAVE_SVGA=yes, HAVE_SVGA=no)
15	CPPFLAGS="$save_CPPFLAGS"
16
17	if test "x$ASM_ARCH" = xyes; then
18		dnl Make sure -lvga works
19		if test "x$HAVE_SVGA" = xyes; then
20			AC_CHECK_LIB(vga, vga_getmousetype, SVGA_LIBS="$SVGA_LIBS -lvga"
21				HAVE_SVGA=yes, HAVE_SVGA=no, [$SVGA_LIBS]
22			)
23		fi
24		if test "x$HAVE_SVGA" != xyes; then
25			SVGA_CFLAGS="" SVGA_LIBS=""
26		fi
27	else
28		HAVE_SVGA=no
29		SVGA_CFLAGS=
30		SVGA_LIBS=
31	fi
32fi
33AC_SUBST(SVGA_CFLAGS)
34AC_SUBST(SVGA_LIBS)
35