configure.ac revision 170d5fdc
1# Copyright 2005 Adam Jackson. 2# 3# Permission is hereby granted, free of charge, to any person obtaining a 4# copy of this software and associated documentation files (the "Software"), 5# to deal in the Software without restriction, including without limitation 6# on the rights to use, copy, modify, merge, publish, distribute, sub 7# license, and/or sell copies of the Software, and to permit persons to whom 8# the Software is furnished to do so, subject to the following conditions: 9# 10# The above copyright notice and this permission notice (including the next 11# paragraph) shall be included in all copies or substantial portions of the 12# Software. 13# 14# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 17# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 18# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20# 21# Process this file with autoconf to produce a configure script 22 23AC_PREREQ(2.59) 24AC_INIT([xf86-video-geode], 25 [2.11.10], 26 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver%2Fgeode], 27 [xf86-video-geode], 28 [http://www.x.org/wiki/GeodeDriver]) 29 30AC_CONFIG_SRCDIR([Makefile.am]) 31AM_CONFIG_HEADER([config.h]) 32AC_CONFIG_AUX_DIR(.) 33 34# Require xorg-macros: XORG_DEFAULT_OPTIONS 35m4_ifndef([XORG_MACROS_VERSION], 36 [m4_fatal([must install xorg-macros 1.4 or later before running autoconf/autogen])]) 37XORG_MACROS_VERSION(1.4) 38XORG_DEFAULT_OPTIONS 39 40AM_INIT_AUTOMAKE([foreign dist-bzip2]) 41 42AM_MAINTAINER_MODE 43 44# Checks for programs. 45AC_DISABLE_STATIC 46AC_PROG_LIBTOOL 47AC_PROG_CC 48AM_PROG_AS 49 50AH_TOP([#include "xorg-server.h"]) 51 52AC_ARG_WITH(xorg-module-dir, 53 AC_HELP_STRING([--with-xorg-module-dir=DIR], 54 [Default xorg module directory [[default=$libdir/xorg/modules]]]), 55 [moduledir="$withval"], 56 [moduledir="$libdir/xorg/modules"]) 57 58AC_ARG_ENABLE(geodegx-panel, 59 AC_HELP_STRING([--disable-geodegx-panel], 60 [Disable support for flatpanels with the Geode GX]), 61 [ ], 62 [ AMD_CFLAGS="-DPNL_SUP $AMD_CFLAGS" ]) 63 64AC_ARG_ENABLE(werror, AC_HELP_STRING([--enable-werror], 65 [Treat warnings as errors (default: disabled)]), 66 [WERROR=$enableval], [WERROR=no]) 67AC_ARG_ENABLE(visibility, 68 AC_HELP_STRING([--enable-visibility], 69 [Enable GCC visibility optimizations]), 70 [ AMD_CFLAGS="$AMD_CFLAGS -fvisibility=hidden" ], 71 [ : ]) 72 73if test "x$GCC" = "xyes"; then 74 GCC_WARNINGS1="-Wall -Wpointer-arith -Wstrict-prototypes" 75 GCC_WARNINGS2="-Wmissing-prototypes -Wmissing-declarations" 76 GCC_WARNINGS3="-Wnested-externs -fno-strict-aliasing" 77 GCC_WARNINGS="$GCC_WARNINGS1 $GCC_WARNINGS2 $GCC_WARNINGS3" 78 if test "x$WERROR" = "xyes"; then 79 GCC_WARNINGS="${GCC_WARNINGS} -Werror" 80 fi 81 AMD_CFLAGS="$GCC_WARNINGS $AMD_CFLAGS" 82fi 83 84# Checks for extensions 85XORG_DRIVER_CHECK_EXT(RANDR, randrproto) 86XORG_DRIVER_CHECK_EXT(RENDER, renderproto) 87XORG_DRIVER_CHECK_EXT(XV, videoproto) 88XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) 89 90# Checks for pkg-config packages 91PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto $REQUIRED_MODULES]) 92PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1], 93 HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]), 94 HAVE_XEXTPROTO_71="no") 95AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ]) 96 97# Checks for libraries. 98SAVE_CPPFLAGS="$CPPFLAGS" 99CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" 100AC_CHECK_DECL(XSERVER_LIBPCIACCESS, 101 [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no], 102 [#include "xorg-server.h"]) 103CPPFLAGS="$SAVE_CPPFLAGS" 104 105# Checks for header files. 106AC_HEADER_STDC 107 108if test "x$XSERVER_LIBPCIACCESS" = xyes; then 109 PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) 110 XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" 111fi 112 113AC_SUBST([XORG_CFLAGS]) 114AC_SUBST([moduledir]) 115AC_SUBST([AMD_CFLAGS]) 116 117is386=false 118 119case $host_cpu in 120 i*86) 121 is386=true 122 ;; 123esac 124 125# Unset is386 if compiling for AMD64/EM64T 126if test $is386 = true ; then 127 AC_CHECK_DECLS([_LP64, __amd64__, amd64], [is386=false]) 128fi 129 130AM_CONDITIONAL([I386ARCH], [test $is386 = true]) 131 132DRIVER_NAME=geode 133AC_SUBST([DRIVER_NAME]) 134 135AC_OUTPUT([ 136 Makefile 137 src/Makefile 138]) 139