configure.ac revision 63847c39
176888252Smrg#  Copyright 2005 Adam Jackson.
276888252Smrg#
376888252Smrg#  Permission is hereby granted, free of charge, to any person obtaining a
476888252Smrg#  copy of this software and associated documentation files (the "Software"),
576888252Smrg#  to deal in the Software without restriction, including without limitation
676888252Smrg#  on the rights to use, copy, modify, merge, publish, distribute, sub
776888252Smrg#  license, and/or sell copies of the Software, and to permit persons to whom
876888252Smrg#  the Software is furnished to do so, subject to the following conditions:
976888252Smrg#
1076888252Smrg#  The above copyright notice and this permission notice (including the next
1176888252Smrg#  paragraph) shall be included in all copies or substantial portions of the
1276888252Smrg#  Software.
1376888252Smrg#
1476888252Smrg#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1576888252Smrg#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1676888252Smrg#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
1776888252Smrg#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
1876888252Smrg#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1976888252Smrg#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2076888252Smrg#
2176888252Smrg# Process this file with autoconf to produce a configure script
2276888252Smrg
2363847c39Smrg# Initialize Autoconf
2463847c39SmrgAC_PREREQ([2.60])
2576888252SmrgAC_INIT([xf86-video-cirrus],
2663847c39Smrg        [1.5.2],
2776888252Smrg        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
2863847c39Smrg        [xf86-video-cirrus])
2976888252SmrgAC_CONFIG_SRCDIR([Makefile.am])
3063847c39SmrgAC_CONFIG_HEADERS([config.h])
3176888252SmrgAC_CONFIG_AUX_DIR(.)
3276888252Smrg
3363847c39Smrg# Initialize Automake
3463847c39SmrgAM_INIT_AUTOMAKE([foreign dist-bzip2])
3576888252SmrgAM_MAINTAINER_MODE
3676888252Smrg
3763847c39Smrg# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
3863847c39Smrgm4_ifndef([XORG_MACROS_VERSION],
3963847c39Smrg          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
4063847c39SmrgXORG_MACROS_VERSION(1.8)
4163847c39SmrgXORG_DEFAULT_OPTIONS
421ae1b5e8Smrg
4363847c39Smrg# Initialize libtool
4476888252SmrgAC_DISABLE_STATIC
4576888252SmrgAC_PROG_LIBTOOL
4676888252Smrg
4776888252SmrgAH_TOP([#include "xorg-server.h"])
4876888252Smrg
4963847c39Smrg# Define a configure option for an alternate module directory
5076888252SmrgAC_ARG_WITH(xorg-module-dir,
5163847c39Smrg            AS_HELP_STRING([--with-xorg-module-dir=DIR],
5276888252Smrg                           [Default xorg module directory [[default=$libdir/xorg/modules]]]),
5376888252Smrg            [moduledir="$withval"],
5476888252Smrg            [moduledir="$libdir/xorg/modules"])
5576888252Smrg
5663847c39Smrg# Store the list of server defined optional extensions in REQUIRED_MODULES
5776888252SmrgXORG_DRIVER_CHECK_EXT(RANDR, randrproto)
5876888252SmrgXORG_DRIVER_CHECK_EXT(RENDER, renderproto)
5976888252SmrgXORG_DRIVER_CHECK_EXT(XV, videoproto)
6076888252SmrgXORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
6176888252Smrg
6263847c39Smrg# Obtain compiler/linker options for the driver dependencies
631ae1b5e8SmrgPKG_CHECK_MODULES(XORG, [xorg-server >= 1.4 xproto fontsproto $REQUIRED_MODULES])
6476888252Smrg
6576888252Smrg# Checks for libraries.
661ae1b5e8SmrgSAVE_CPPFLAGS="$CPPFLAGS"
671ae1b5e8SmrgCPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
681ae1b5e8SmrgAC_CHECK_DECL(XSERVER_LIBPCIACCESS,
691ae1b5e8Smrg              [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
701ae1b5e8Smrg              [#include "xorg-server.h"])
711ae1b5e8SmrgAC_CHECK_HEADER(xf1bpp.h,[AC_DEFINE(HAVE_XF1BPP, 1, [Have 1bpp support])],[])
721ae1b5e8SmrgAC_CHECK_HEADER(xf4bpp.h,[AC_DEFINE(HAVE_XF4BPP, 1, [Have 4bpp support])],[])
731ae1b5e8SmrgCPPFLAGS="$SAVE_CPPFLAGS"
741ae1b5e8Smrg
7563847c39SmrgAC_ARG_ENABLE(xaa,
7663847c39Smrg              AS_HELP_STRING([--enable-xaa],
7763847c39Smrg                             [Enable legacy X Acceleration Architecture (XAA) [default=auto]]),
7863847c39Smrg              [XAA="$enableval"],
7963847c39Smrg              [XAA=auto])
8063847c39Smrgif test "x$XAA" != xno; then
8163847c39Smrg        save_CFLAGS=$CFLAGS
8263847c39Smrg        save_CPPFLAGS=$CPPFLAGS
8363847c39Smrg        CFLAGS=$XORG_CFLAGS
8463847c39Smrg        CPPFLAGS="$XORG_CFLAGS"
8563847c39Smrg        AC_CHECK_HEADERS([xaa.h], XAA=yes, XAA=no)
8663847c39Smrg        CFLAGS=$save_CFLAGS
8763847c39Smrg        CPPFLAGS=$save_CPPFLAGS
8863847c39Smrgfi
8963847c39SmrgAC_MSG_CHECKING([whether to include XAA support])
9063847c39SmrgAM_CONDITIONAL(XAA, test "x$XAA" = xyes)
9163847c39SmrgAC_MSG_RESULT([$XAA])
9263847c39Smrg
931ae1b5e8Smrgif test "x$XSERVER_LIBPCIACCESS" = xyes; then
941ae1b5e8Smrg    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
951ae1b5e8Smrg    XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
961ae1b5e8Smrgfi
971ae1b5e8SmrgAM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
9876888252Smrg
9976888252Smrg
10076888252SmrgAC_SUBST([moduledir])
10176888252Smrg
10276888252SmrgDRIVER_NAME=cirrus
10376888252SmrgAC_SUBST([DRIVER_NAME])
10476888252Smrg
10563847c39SmrgAC_CONFIG_FILES([
10663847c39Smrg                Makefile
10763847c39Smrg                src/Makefile
10863847c39Smrg                man/Makefile
10976888252Smrg])
11063847c39SmrgAC_OUTPUT
111