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