configure.ac 63 KB
Newer Older
Daniel Stone's avatar
Daniel Stone committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
dnl $Id$
dnl
dnl Copyright © 2003-2005 Keith Packard, Daniel Stone
dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
dnl documentation for any purpose is hereby granted without fee, provided that
dnl the above copyright notice appear in all copies and that both that
dnl copyright notice and this permission notice appear in supporting
dnl documentation, and that the names of Keith Packard and Daniel Stone not be
dnl used in advertising or publicity pertaining to distribution of the software
dnl without specific, written prior permission.  Keith Packard and Daniel Stone
dnl make no representations about the suitability of this software for any
dnl purpose.  It is provided "as is" without express or implied warranty.
dnl
dnl KEITH PACKARD AND DANIEL STONE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
dnl SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
dnl IN NO EVENT SHALL KEITH PACKARD OR DANIEL STONE BE LIABLE FOR ANY SPECIAL,
dnl INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
dnl LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
dnl OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
dnl PERFORMANCE OF THIS SOFTWARE.
dnl
dnl Process this file with autoconf to create configure.

25
AC_PREREQ(2.57)
26 27
dnl This is the not the Xorg version number, it's the server version number.
dnl Yes, that's weird.
Daniel Stone's avatar
Daniel Stone committed
28
AC_INIT([xorg-server], 1.1.99.2, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
Daniel Stone's avatar
Daniel Stone committed
29
AC_CONFIG_SRCDIR([Makefile.am])
30
AM_INIT_AUTOMAKE([dist-bzip2 foreign])
Daniel Stone's avatar
Daniel Stone committed
31
AM_MAINTAINER_MODE
32

Daniel Stone's avatar
Daniel Stone committed
33 34 35 36 37 38 39 40 41
dnl this gets generated by autoheader, and thus contains all the defines.  we
dnl don't ever actually use it, internally.
AC_CONFIG_HEADERS(include/do-not-use-config.h)
dnl xorg-server.h is an external header, designed to be included by loadable
dnl drivers.
AC_CONFIG_HEADERS(include/xorg-server.h)
dnl dix-config.h covers most of the DIX (i.e. everything but the DDX, not just
dnl dix/).
AC_CONFIG_HEADERS(include/dix-config.h)
42 43
dnl xgl-config.h covers the Xgl DDX.
AC_CONFIG_HEADERS(include/xgl-config.h)
44 45
dnl xorg-config.h covers the Xorg DDX.
AC_CONFIG_HEADERS(include/xorg-config.h)
Kevin E Martin's avatar
Kevin E Martin committed
46 47
dnl xkb-config.h covers XKB for the Xorg and Xnest DDXs.
AC_CONFIG_HEADERS(include/xkb-config.h)
48 49
dnl xwin-config.h covers the XWin DDX.
AC_CONFIG_HEADERS(include/xwin-config.h)
50 51
dnl kdrive-config.h covers the kdrive DDX
AC_CONFIG_HEADERS(include/kdrive-config.h)
Daniel Stone's avatar
Daniel Stone committed
52

53

Daniel Stone's avatar
Daniel Stone committed
54 55 56 57 58
AC_PROG_CC
AM_PROG_AS
AC_PROG_INSTALL
AC_PROG_LN_S
AC_LIBTOOL_WIN32_DLL
59
AC_DISABLE_STATIC
Daniel Stone's avatar
Daniel Stone committed
60 61 62
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
63 64
AC_PROG_LEX
AC_PROG_YACC
65
XORG_PROG_RAWCPP
Daniel Stone's avatar
Daniel Stone committed
66 67 68 69 70

AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])

71
dnl Checks for typedefs, structures, and compiler characteristics.
Daniel Stone's avatar
Daniel Stone committed
72
AC_C_CONST
73 74 75 76 77 78
AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"])

AC_CHECK_SIZEOF([unsigned long])
if test "$ac_cv_sizeof_unsigned_long" = 8; then
	AC_DEFINE(_XSERVER64, 1, [Define to 1 if unsigned long is 64 bits.])
fi
79

Daniel Stone's avatar
Daniel Stone committed
80 81
AC_TYPE_PID_T

82
dnl Checks for library functions.
Daniel Stone's avatar
Daniel Stone committed
83
AC_FUNC_VPRINTF
84 85
AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr \
		strtol getopt getopt_long vsnprintf walkcontext backtrace])
Daniel Stone's avatar
Daniel Stone committed
86
AC_FUNC_ALLOCA
87 88 89 90 91 92 93 94 95
dnl Old HAS_* names used in os/*.c.
AC_CHECK_FUNC([getdtablesize],
	AC_DEFINE(HAS_GETDTABLESIZE, 1, [Have the `getdtablesize' function.]))
AC_CHECK_FUNC([getifaddrs],
	AC_DEFINE(HAS_GETIFADDRS, 1, [Have the `getifaddrs' function.]))
AC_CHECK_FUNC([getpeereid],
	AC_DEFINE(HAS_GETPEEREID, 1, [Have the `getpeereid' function.]))
AC_CHECK_FUNC([getpeerucred],
	AC_DEFINE(HAS_GETPEERUCRED, 1, [Have the `getpeerucred' function.]))
96 97
AC_CHECK_FUNC([strlcat], HAVE_STRLCAT=yes, HAVE_STRLCAT=no)
AM_CONDITIONAL(NEED_STRLCAT, [test x$HAVE_STRLCAT = xno])	
Daniel Stone's avatar
Daniel Stone committed
98

Adam Jackson's avatar
Adam Jackson committed
99 100
AM_CONDITIONAL(NEED_VSNPRINTF, [test x$HAVE_VSNPRINTF = xno])

Alan Coopersmith's avatar
Alan Coopersmith committed
101 102 103
dnl Check for mmap support for Xvfb
AC_CHECK_FUNC([mmap], AC_DEFINE(HAS_MMAP, 1, [Have the `mmap' function.]))

104
dnl Find the math libary
Daniel Stone's avatar
Daniel Stone committed
105 106 107 108
AC_CHECK_LIB(m, sqrt)

AC_CHECK_HEADERS([ndbm.h dbm.h rpcsvc/dbm.h])

109
dnl AGPGART headers
110
AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h], AGP=yes)
Donnie Berkholz's avatar
Donnie Berkholz committed
111
AM_CONDITIONAL(AGP, [test "x$AGP" = xyes])
Daniel Stone's avatar
Daniel Stone committed
112

113
dnl APM header
114 115
AC_CHECK_HEADERS([linux/apm_bios.h], LNXAPM=yes)
AM_CONDITIONAL(LNXAPM, [test "x$LNXAPM" = xyes])
Daniel Stone's avatar
Daniel Stone committed
116

117
dnl fbdev header
118
AC_CHECK_HEADERS([linux/fb.h], FBDEV=yes)
119
AM_CONDITIONAL(FBDEVHW, [test "x$FBDEV" = xyes])
Daniel Stone's avatar
Daniel Stone committed
120

121
dnl MTRR header
122 123 124 125
AC_CHECK_HEADERS([asm/mtrr.h], ac_cv_asm_mtrr_h=yes)
if test "x$ac_cv_asm_mtrr_h" = xyes; then
	HAVE_MTRR=yes
fi
Daniel Stone's avatar
Daniel Stone committed
126

127 128
dnl BSD MTRR header
AC_CHECK_HEADERS([sys/memrange.h], ac_cv_memrange_h=yes)
Donnie Berkholz's avatar
Donnie Berkholz committed
129
if test "x$ac_cv_memrange_h" = xyes; then
130 131 132 133 134
	HAVE_MTRR=yes
fi

if test "x$HAVE_MTRR" = xyes; then
	AC_DEFINE(HAS_MTRR_SUPPORT, 1, [MTRR support available])
135 136 137
fi

dnl A NetBSD MTRR header
138 139
AC_CHECK_HEADERS([machine/mtrr.h], ac_cv_machine_mtrr_h=yes)
if test "x$ac_cv_machine_mtrr_h" = xyes; then
140 141 142 143 144
	AC_DEFINE(HAS_MTRR_BUILTIN, 1, [Define to 1 if NetBSD built-in MTRR
		support is available])
fi

dnl FreeBSD kldload support (sys/linker.h)
145
AC_CHECK_HEADERS([sys/linker.h],
146
	[ac_cv_sys_linker_h=yes],
147 148
	[ac_cv_sys_linker_h=no],
	[#include <sys/param.h>])
Donnie Berkholz's avatar
Donnie Berkholz committed
149
AM_CONDITIONAL(FREEBSD_KLDLOAD, [test "x$ac_cv_sys_linker_h" = xyes])
150

Daniel Stone's avatar
Daniel Stone committed
151 152
AC_CACHE_CHECK([for SYSV IPC],
		ac_cv_sysv_ipc,
153
		[AC_TRY_LINK([
Daniel Stone's avatar
Daniel Stone committed
154
#include <sys/shm.h>
155
],[
Daniel Stone's avatar
Daniel Stone committed
156 157 158 159 160 161 162 163
int main () { 
    int id;
    id = shmget(IPC_PRIVATE, 512, SHM_W | SHM_R);
    if (id < 0) return -1;
    return shmctl(id, IPC_RMID, 0);
}],
	[ac_cv_sysv_ipc=yes],
	[ac_cv_sysv_ipc=no])])
164 165
if test "x$ac_cv_sysv_ipc" = xyes; then
	AC_DEFINE(HAVE_SYSV_IPC, 1, [Define to 1 if SYSV IPC is available])
Daniel Stone's avatar
Daniel Stone committed
166 167
fi

168 169 170 171 172
dnl OpenBSD /dev/xf86 aperture driver 
if test -c /dev/xf86 ; then
	AC_DEFINE(HAS_APERTURE_DRV, 1, [System has /dev/xf86 aperture driver])
fi

173 174 175 176
dnl glibc backtrace support check (hw/xfree86/common/xf86Events.c)
AC_CHECK_HEADER([execinfo.h],[
    AC_CHECK_LIB(c, backtrace, [
        AC_DEFINE(HAVE_BACKTRACE, 1, [Has backtrace support])
177
    ])]
178 179
)

180 181 182 183
dnl ---------------------------------------------------------------------------
dnl Bus options and CPU capabilities.  Replaces logic in
dnl hw/xfree86/os-support/bus/Makefile.am, among others.
dnl ---------------------------------------------------------------------------
184
DEFAULT_INT10="x86emu"
185
use_x86_asm="no"
186

187
dnl Override defaults as needed for specific platforms:
188

Daniel Stone's avatar
Daniel Stone committed
189
case $host_cpu in
190 191 192 193 194 195 196 197
  alpha*)
	ALPHA_VIDEO=yes
	case $host_os in
		*netbsd*)	AC_DEFINE(USE_ALPHA_PIO, 1, [NetBSD PIO alpha IO]) ;;
	esac
	;;
  arm*)
	ARM_VIDEO=yes
Daniel Stone's avatar
Daniel Stone committed
198 199
	;;
  i*86)
200
	use_x86_asm="yes"
201
	I386_VIDEO=yes
202
	case $host_os in
203
		*linux*)	DEFAULT_INT10=vm86 ;;
204
		*freebsd*)	AC_DEFINE(USE_DEV_IO) ;;
205 206 207
		*netbsd*)	AC_DEFINE(USE_I386_IOPL)
				SYS_LIBS=-li386
				;;
208 209 210
		*openbsd*)	AC_DEFINE(USE_I386_IOPL) 
				SYS_LIBS=-li386
				;;
211
	esac
Daniel Stone's avatar
Daniel Stone committed
212
        ;;
213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
  powerpc*)
	PPC_VIDEO=yes
	case $host_os in
		*freebsd*)	DEFAULT_INT10=stub ;;
	esac
	;;
  sparc*)
	xorg_loader_sparcmuldiv="yes"
	SPARC64_VIDEO=yes
	BSD_ARCH_SOURCES="sparc64_video.c ioperm_noop.c"
	;;
  x86_64*|amd64*)
  	use_x86_asm="yes"
	I386_VIDEO=yes
	case $host_os in
		*freebsd*)	AC_DEFINE(USE_DEV_IO, 1, [BSD /dev/io]) ;;
229 230 231
		*netbsd*)	AC_DEFINE(USE_I386_IOPL, 1, [BSD i386 iopl])
				SYS_LIBS=-lx86_64
				;;
232 233 234
		*openbsd*)	AC_DEFINE(USE_AMD64_IOPL, 1, [BSD AMD64 iopl])
				SYS_LIBS=-lamd64
				;;
235 236 237 238 239
	esac
	;;
esac

dnl BSD *_video.c selection
Donnie Berkholz's avatar
Donnie Berkholz committed
240 241 242 243 244
AM_CONDITIONAL(ALPHA_VIDEO, [test "x$ALPHA_VIDEO" = xyes])
AM_CONDITIONAL(ARM_VIDEO, [test "x$ARM_VIDEO" = xyes])
AM_CONDITIONAL(I386_VIDEO, [test "x$I386_VIDEO" = xyes])
AM_CONDITIONAL(PPC_VIDEO, [test "x$PPC_VIDEO" = xyes])
AM_CONDITIONAL(SPARC64_VIDEO, [test "x$SPARC64_VIDEO" = xyes])
245

246
DRI=no
247
KDRIVE_HW=no
248 249 250
dnl it would be nice to autodetect these *CONS_SUPPORTs
case $host_os in
  *freebsd*)
251 252 253 254
	case $host_os in
		kfreebsd*-gnu) ;;
		*) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) ;;
	esac
255 256 257
	AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console])
	AC_DEFINE(PCVT_SUPPORT, 1, [System has PCVT console])
	AC_DEFINE(SYSCONS_SUPPORT, 1, [System has syscons console])
258
	DRI=yes
259 260 261 262 263
	;;
  *netbsd*)
	AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
	AC_DEFINE(PCCONS_SUPPORT, 1, [System has PC console])
	AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console])
264
	DRI=yes
265 266 267
	;;
  *openbsd*)
	AC_DEFINE(CSRG_BASED, 1, [System is BSD-like])
268
	AC_DEFINE(PCVT_SUPPORT, 1, [System has PC console])
269
	AC_DEFINE(WSCONS_SUPPORT, 1, [System has wscons console])
270
	;;
271 272
  *linux*)
	DRI=yes
273
	KDRIVE_HW=yes
274
	;;
Daniel Stone's avatar
Daniel Stone committed
275
esac
276
AM_CONDITIONAL(KDRIVE_HW, test "x$KDRIVE_HW" = xyes)
Daniel Stone's avatar
Daniel Stone committed
277

278 279 280
AC_MSG_CHECKING(for MMX capable platform)
if test "x$use_x86_asm" = xyes && test "x$GCC" = xyes ; then
	AC_PREPROC_IFELSE([
281
#if (!defined (__GNUC__) || __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
282 283 284 285 286 287 288
    #error Not supported
#endif
], mmx_capable=yes, mmx_capable=no)
fi
AC_MSG_RESULT([$mmx_capable])
AM_CONDITIONAL(MMX_CAPABLE, [test "x$mmx_capable" = xyes])

Daniel Stone's avatar
Daniel Stone committed
289

290 291 292 293
OSNAME=`uname -srm`
AC_DEFINE_UNQUOTED(OSNAME, "$OSNAME", 
	[Define to OS Name string to display for build OS in Xorg log])

294 295
DEFAULT_VENDOR_NAME="The X.Org Foundation"
DEFAULT_VENDOR_NAME_SHORT="X.Org"
296 297 298 299 300
DEFAULT_VERSION_MAJOR=7
DEFAULT_VERSION_MINOR=0
DEFAULT_VERSION_PATCH=0
DEFAULT_VERSION_SNAP=0
DEFAULT_RELEASE_DATE="21 December 2005"
Daniel Stone's avatar
Daniel Stone committed
301 302
DEFAULT_VENDOR_WEB="http://wiki.x.org"

303 304
m4_ifdef([AS_HELP_STRING], , [m4_define([AS_HELP_STRING], m4_defn([AC_HELP_STRING]))])

305
dnl Build options.
306 307 308 309 310 311
AC_ARG_ENABLE(werror,        AS_HELP_STRING([--enable-werror],
				  [Treat warnings as errors (default: disabled)]),
			        [WERROR=$enableval], [WERROR=no])
AC_ARG_ENABLE(debug,         AS_HELP_STRING([--enable-debug],
				  [Enable debugging (default: disabled)]),
			        [DEBUGGING=$enableval], [DEBUGGING=no])
312
AC_ARG_WITH(int10,           AS_HELP_STRING([--with-int10=BACKEND], [int10 backend: vm86, x86emu or stub]),
Daniel Stone's avatar
Daniel Stone committed
313 314
				[INT10="$withval"],
				[INT10="$DEFAULT_INT10"])
315
AC_ARG_WITH(vendor-name,     AS_HELP_STRING([--with-vendor-string=VENDOR],
316
				  [Vendor string reported by the server]),
Daniel Stone's avatar
Daniel Stone committed
317
			     	[ VENDOR_STRING="$withval" ],
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338
			     	[ VENDOR_STRING="$DEFAULT_VENDOR_NAME" ])
AC_ARG_WITH(vendor-name-short, AS_HELP_STRING([--with-vendor-string-short=VENDOR],
				  [Short version of vendor string reported by the server]),
			     	[ VENDOR_STRING_SHORT="$withval" ],
			     	[ VENDOR_STRING_SHORT="$DEFAULT_VENDOR_NAME_SHORT" ])
AC_ARG_WITH(release-major,   AS_HELP_STRING([--with-release-major=MAJOR],
				  [Release major number reported by the server]),
				[ VERSION_MAJOR="$withval" ],
				[ VERSION_MAJOR="$DEFAULT_VERSION_MAJOR" ])
AC_ARG_WITH(release-minor,   AS_HELP_STRING([--with-release-minor=MINOR],
				  [Release minor number reported by the server]),
				[ VERSION_MINOR="$withval" ],
				[ VERSION_MINOR="$DEFAULT_VERSION_MINOR" ])
AC_ARG_WITH(release-patch,   AS_HELP_STRING([--with-release-patch=PATCH],
				  [Release patch number reported by the server]),
				[ VERSION_PATCH="$withval" ],
				[ VERSION_PATCH="$DEFAULT_VERSION_PATCH" ])
AC_ARG_WITH(release-snap,    AS_HELP_STRING([--with-release-snap=SNAP],
				  [Release snap number reported by the server]),
				[ VERSION_SNAP="$withval" ],
				[ VERSION_SNAP="$DEFAULT_VERSION_SNAP" ])
339 340 341 342
AC_ARG_WITH(release-date,    AS_HELP_STRING([--with-release-date=DATE],
				  [Release date reported by the server]),
				[ RELEASE_DATE="$withval" ],
				[ RELEASE_DATE="$DEFAULT_RELEASE_DATE" ])
343 344
AC_ARG_WITH(vendor-web,      AS_HELP_STRING([--with-vendor-web=URL],
				  [Vendor web address reported by the server]),
Daniel Stone's avatar
Daniel Stone committed
345 346
				[ VENDOR_WEB="$withval" ],
				[ VENDOR_WEB="$DEFAULT_VENDOR_WEB" ])
347
AC_ARG_WITH(module-dir,      AS_HELP_STRING([--with-module-dir=DIR],
348
				  [Directory where modules are installed (default: $libdir/xorg/modules)]),
Daniel Stone's avatar
Daniel Stone committed
349
				[ moduledir="$withval" ],
350
				[ moduledir="${libdir}/xorg/modules" ])
351 352
AC_ARG_WITH(log-dir,         AS_HELP_STRING([--with-log-dir=DIR],
				  [Directory where log files are kept (default: $localstatedir/log)]),
353 354
				[ logdir="$withval" ],
				[ logdir="$localstatedir/log" ])
355 356
AC_ARG_WITH(builder-addr,    AS_HELP_STRING([--with-builder-addr=ADDRESS],
				  [Builder address (default: xorg@lists.freedesktop.org)]),
Daniel Stone's avatar
Daniel Stone committed
357 358
				[ BUILDERADDR="$withval" ],
				[ BUILDERADDR="xorg@lists.freedesktop.org" ])
359
AC_ARG_WITH(os-name,         AS_HELP_STRING([--with-os-name=OSNAME], [Name of OS (default: UNKNOWN)]),
360 361
				[ OSNAME="$withval" ],
				[ OSNAME="UNKNOWN" ])
362
AC_ARG_WITH(os-vendor,       AS_HELP_STRING([--with-os-vendor=OSVENDOR], [Name of OS vendor]),
363 364
				[ OSVENDOR="$withval" ],
				[ OSVENDOR="" ])
365
AC_ARG_WITH(mesa-source,     AS_HELP_STRING([--with-mesa-source=MESA_SOURCE], [Path to Mesa source tree]),
366 367
                                [ MESA_SOURCE="$withval" ],
                                [ MESA_SOURCE="" ])
368 369 370
AC_ARG_WITH(fontdir,         AS_HELP_STRING([--with-fontdir=FONTDIR], [Path to top level dir where fonts are installed (default: ${libdir}/X11/fonts)]),
                                [ FONTDIR="$withval" ],
                                [ FONTDIR="${libdir}/X11/fonts" ])
371
DEFAULT_FONT_PATH="${FONTDIR}/misc/,${FONTDIR}/TTF/,${FONTDIR}/OTF,${FONTDIR}/Type1/,${FONTDIR}/CID/,${FONTDIR}/100dpi/,${FONTDIR}/75dpi/"
372
AC_ARG_WITH(default-font-path, AS_HELP_STRING([--with-default-font-path=PATH], [Comma separated list of font dirs]),
373
				[ FONTPATH="$withval" ],
374
				[ FONTPATH="${DEFAULT_FONT_PATH}" ])
375
AC_ARG_WITH(xkb-path,         AS_HELP_STRING([--with-xkb-path=PATH], [Path to XKB base dir (default: ${datadir}/X11/xkb)]),
376 377
				[ XKBPATH="$withval" ],
				[ XKBPATH="${datadir}/X11/xkb" ])
378
AC_ARG_WITH(xkb-output,       AS_HELP_STRING([--with-xkb-output=PATH], [Path to XKB output dir (default: ${datadir}/X11/xkb/compiled)]),
379
				[ XKBOUTPUT="$withval" ],
380
				[ XKBOUTPUT="compiled" ])
381
AC_ARG_WITH(rgb-path,         AS_HELP_STRING([--with-rgb-path=PATH], [Path to RGB database (default: ${datadir}/X11/rgb)]),
Daniel Stone's avatar
Daniel Stone committed
382 383
				[ RGBPATH="$withval" ],
				[ RGBPATH="${datadir}/X11/rgb" ])
384 385 386
AC_ARG_WITH(dri-driver-path,  AS_HELP_STRING([--with-dri-driver-path=PATH], [Path to DRI drivers (default: ${libdir}/dri)]),
				[ DRI_DRIVER_PATH="$withval" ],
				[ DRI_DRIVER_PATH="${libdir}/dri" ])
387
AC_ARG_ENABLE(builddocs,      AS_HELP_STRING([--enable-builddocs], [Build docs (default: disabled)]),
388 389
                                [BUILDDOCS=$enableval],
                                [BUILDDOCS=no])
390 391 392 393 394
AC_ARG_ENABLE(install-libxf86config,
				AS_HELP_STRING([--enable-install-libxf86config],
				[Install libxf86config (default: disabled)]),
				[INSTALL_LIBXF86CONFIG=$enableval],
				[INSTALL_LIBXF86CONFIG=no])
395 396

dnl Extensions.
397 398 399
AC_ARG_ENABLE(composite,      AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes])
AC_ARG_ENABLE(mitshm,         AS_HELP_STRING([--disable-shm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes])
AC_ARG_ENABLE(xres,           AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes])
400
AC_ARG_ENABLE(xtrap,          AS_HELP_STRING([--disable-xtrap], [Build XTrap extension (default: enabled)]), [XTRAP=$enableval], [XTRAP=yes])
401 402
AC_ARG_ENABLE(record,         AS_HELP_STRING([--disable-record], [Build Record extension (default: enabled)]), [RECORD=$enableval], [RECORD=yes])
AC_ARG_ENABLE(xv,             AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes])
403
AC_ARG_ENABLE(xvmc,           AS_HELP_STRING([--disable-xvmc], [Build XvMC extension (default: enabled)]), [XVMC=$enableval], [XVMC=yes])
404
AC_ARG_ENABLE(dga,            AS_HELP_STRING([--disable-dga], [Build DGA extension (default: enabled)]), [DGA=$enableval], [DGA=yes])
405 406 407 408
AC_ARG_ENABLE(screensaver,    AS_HELP_STRING([--disable-screensaver], [Build ScreenSaver extension (default: enabled)]), [SCREENSAVER=$enableval], [SCREENSAVER=yes])
AC_ARG_ENABLE(xdmcp,          AS_HELP_STRING([--disable-xdmcp], [Build XDMCP extension (default: auto)]), [XDMCP=$enableval], [XDMCP=auto])
AC_ARG_ENABLE(xdm-auth-1,     AS_HELP_STRING([--disable-xdm-auth-1], [Build XDM-Auth-1 extension (default: auto)]), [XDMAUTH=$enableval], [XDMAUTH=auto])
AC_ARG_ENABLE(glx,            AS_HELP_STRING([--disable-glx], [Build GLX extension (default: enabled)]), [GLX=$enableval], [GLX=yes])
409
AC_ARG_ENABLE(aiglx,          AS_HELP_STRING([--enable-aiglx], [Build accelerated indirect GLX (default: enabled)]), [AIGLX=$enableval], [AIGLX=yes])
410
AC_ARG_ENABLE(glx-tls,        AS_HELP_STRING([--enable-glx-tls], [Build GLX with TLS support (default: disabled)]), [GLX_USE_TLS=$enableval], [GLX_USE_TLS=no])
411 412 413 414
AC_ARG_ENABLE(dri,            AS_HELP_STRING([--enable-dri], [Build DRI extension (default: auto)]), [DRI=$enableval])
AC_ARG_ENABLE(xinerama,	      AS_HELP_STRING([--disable-xinerama], [Build Xinerama extension (default: enabled)]), [XINERAMA=$enableval], [XINERAMA=yes])
AC_ARG_ENABLE(xf86vidmode,    AS_HELP_STRING([--disable-xf86vidmode], [Build XF86VidMode extension (default: enabled)]), [XF86VIDMODE=$enableval], [XF86VIDMODE=yes])
AC_ARG_ENABLE(xf86misc,       AS_HELP_STRING([--disable-xf86misc], [Build XF86Misc extension (default: enabled)]), [XF86MISC=$enableval], [XF86MISC=yes])
415 416
AC_ARG_ENABLE(xcsecurity,     AS_HELP_STRING([--disable-xcsecurity], [Build Security extension (default: enabled)]), [XCSECURITY=$enableval], [XCSECURITY=yes])
AC_ARG_ENABLE(xevie,          AS_HELP_STRING([--disable-xevie], [Build XEvIE extension (default: enabled)]), [XEVIE=$enableval], [XEVIE=yes])
417 418 419 420 421 422
AC_ARG_ENABLE(appgroup,       AS_HELP_STRING([--disable-appgroup], [Build XC-APPGROUP extension (default: enabled)]), [APPGROUP=$enableval], [APPGROUP=yes])
AC_ARG_ENABLE(cup,            AS_HELP_STRING([--disable-cup], [Build TOG-CUP extension (default: enabled)]), [CUP=$enableval], [CUP=yes])
AC_ARG_ENABLE(evi,            AS_HELP_STRING([--disable-evi], [Build Extended-Visual-Information extension (default: enabled)]), [EVI=$enableval], [EVI=yes])
AC_ARG_ENABLE(multibuffer,    AS_HELP_STRING([--enable-multibuffer], [Build Multibuffer extension (default: disabled)]), [MULTIBUFFER=$enableval], [MULTIBUFFER=no])
AC_ARG_ENABLE(fontcache,      AS_HELP_STRING([--enable-fontcache], [Build FontCache extension (default: disabled)]), [FONTCACHE=$enableval], [FONTCACHE=no])
AC_ARG_ENABLE(dbe,            AS_HELP_STRING([--disable-dbe], [Build DBE extension (default: enabled)]), [DBE=$enableval], [DBE=yes])
423 424
AC_ARG_ENABLE(xf86bigfont,    AS_HELP_STRING([--disable-xf86bigfont], [Build XF86 Big Font extension (default: enabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=yes])
AC_ARG_ENABLE(dpms,           AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMS=$enableval], [DPMSExtension=yes])
Daniel Stone's avatar
Daniel Stone committed
425
AC_ARG_ENABLE(xinput,         AS_HELP_STRING([--disable-xinput], [Build XInput Extension (default: enabled)]), [XINPUT=$enableval], [XINPUT=yes])
426 427 428 429 430 431 432 433

dnl DDXes.
AC_ARG_ENABLE(xorg,    	      AS_HELP_STRING([--enable-xorg], [Build Xorg server (default: auto)]), [XORG=$enableval], [XORG=auto])
AC_ARG_ENABLE(dmx,    	      AS_HELP_STRING([--enable-dmx], [Build DMX server (default: auto)]), [DMX=$enableval], [DMX=auto])
AC_ARG_ENABLE(xvfb,    	      AS_HELP_STRING([--enable-xvfb], [Build Xvfb server (default: yes)]), [XVFB=$enableval], [XVFB=yes])
AC_ARG_ENABLE(xnest,   	      AS_HELP_STRING([--enable-xnest], [Build Xnest server (default: auto)]), [XNEST=$enableval], [XNEST=auto])
AC_ARG_ENABLE(xwin,    	      AS_HELP_STRING([--enable-xwin], [Build XWin server (default: auto)]), [XWIN=$enableval], [XWIN=auto])
AC_ARG_ENABLE(xprint,         AS_HELP_STRING([--enable-xprint], [Build Xprint extension and server (default: auto)]), [XPRINT=$enableval], [XPRINT=auto])
434 435 436
AC_ARG_ENABLE(xgl,            AS_HELP_STRING([--enable-xgl], [Build Xgl server (default: no)]), [XGL=$enableval], [XGL=no])
AC_ARG_ENABLE(xglx,           AS_HELP_STRING([--enable-xglx], [Build Xglx xgl module (default: no)]), [XGLX=$enableval], [XGLX=no])
AC_ARG_ENABLE(xegl,           AS_HELP_STRING([--enable-xegl], [Build Xegl xgl module (default: no)]), [XEGL=$enableval], [XEGL=no])
437
dnl kdrive and its subsystems
438
AC_ARG_ENABLE(kdrive,         AS_HELP_STRING([--enable-kdrive], [Build kdrive servers (default: no)]), [KDRIVE=$enableval], [KDRIVE=no])
Adam Jackson's avatar
Adam Jackson committed
439 440
AC_ARG_ENABLE(xephyr,         AS_HELP_STRING([--enable-xephyr], [Build the kdrive Xephyr server (default: auto)]), [XEPHYR=$enableval], [XEPHYR=auto])
AC_ARG_ENABLE(xsdl,           AS_HELP_STRING([--enable-xsdl], [Build the kdrive Xsdl server (default: auto)]), [XSDL=$enableval], [XSDL=auto])
441
dnl xprint
442
AC_ARG_ENABLE(freetype,       AS_HELP_STRING([ --enable-freetype], [Build Xprint FreeType backend (default: yes)]), [XP_USE_FREETYPE=$enableval],[XP_USE_FREETYPE=no])
443 444
AC_ARG_WITH(freetype-config,  AS_HELP_STRING([ --with-freetype-config=PROG], [Use FreeType configuration program PROG (default: auto)]), freetype_config=$withval, freetype_config=auto)

445

446 447 448 449 450 451
dnl chown/chmod to be setuid root as part of build
dnl Replaces InstallXserverSetUID in imake
AC_ARG_ENABLE(install-setuid, 
    AS_HELP_STRING([--enable-install-setuid],
       [Install Xorg server as owned by root with setuid bit (default: auto)]),
    [SETUID=$enableval], [SETUID=auto])
452
AC_MSG_CHECKING([to see if we can install the Xorg server as root])
453 454 455 456 457 458 459 460 461
if test "x$SETUID" = "xauto" ; then
	case $host_os in
	    darwin*)		SETUID="no"  ;;
	    *)
	   	case $host_cpu in
		    sparc)	SETUID="no"  ;;
		    *)		SETUID="yes" ;;
		esac
	esac
462 463 464 465 466
	if test "x$SETUID" = xyes; then
		touch testfile
		chown root testfile > /dev/null 2>&1 || SETUID="no"
		rm -f testfile
	fi
467
fi
468
AC_MSG_RESULT([$SETUID])
469 470
AM_CONDITIONAL(INSTALL_SETUID, [test "x$SETUID" = "xyes"])

471 472 473 474 475 476 477 478 479 480 481
dnl Issue an error if xtrans.m4 was not found and XTRANS_CONNECTION_FLAGS macro
dnl was not expanded, since libX11 with no transport types is rather useless.
dnl
dnl If you're seeing an error here, be sure you installed the lib/xtrans module
dnl first and if it's not in the default location, that you set the ACLOCAL
dnl environment variable to find it, such as:
dnl	ACLOCAL="aclocal -I ${PREFIX}/share/aclocal"
m4_pattern_forbid(XTRANS_CONNECTION_FLAGS)

# Transport selection macro from xtrans.m4
XTRANS_CONNECTION_FLAGS
Daniel Stone's avatar
Daniel Stone committed
482

483 484
# Secure RPC detection macro from xtrans.m4
XTRANS_SECURE_RPC_FLAGS
485

486 487 488 489 490 491
AM_CONDITIONAL(INT10_VM86, [test "x$INT10" = xvm86])
AM_CONDITIONAL(INT10_X86EMU, [test "x$INT10" = xx86emu])
AM_CONDITIONAL(INT10_STUB, [test "x$INT10" = xstub])
if test "x$INT10" = xyes; then
	dnl VM86 headers
	AC_CHECK_HEADERS([sys/vm86.h sys/io.h])
Kevin E Martin's avatar
Kevin E Martin committed
492 493
fi

494 495
dnl Handle building documentation
AM_CONDITIONAL(BUILDDOCS, test "x$BUILDDOCS" = xyes)
Kevin E Martin's avatar
Kevin E Martin committed
496 497 498 499

dnl Only build sgml docs when linuxdoc is available and
dnl def.ents has been installed
XORG_CHECK_LINUXDOC
500

501 502 503
dnl Handle installing libxf86config
AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes])

504 505 506 507 508
dnl ---------------------------------------------------------------------------
dnl Extension section
dnl ---------------------------------------------------------------------------
XEXT_INC='-I$(top_srcdir)/Xext'
XEXT_LIB='$(top_builddir)/Xext/libXext.la'
509
XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
510

511
dnl Core modules for most extensions, et al.
512
REQUIRED_MODULES="randrproto renderproto [fixesproto >= 4.0] damageproto xcmiscproto xextproto xproto xtrans xf86miscproto xf86vidmodeproto xf86bigfontproto [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto inputproto xf86dgaproto"
513
REQUIRED_LIBS="xfont xau fontenc"
514

515 516 517
AM_CONDITIONAL(XV, [test "x$XV" = xyes])
if test "x$XV" = xyes; then
	AC_DEFINE(XV, 1, [Support Xv extension])
518
	AC_DEFINE(XvExtension, 1, [Build Xv extension])
519
	REQUIRED_MODULES="$REQUIRED_MODULES videoproto"
520 521 522 523 524 525 526
else
	XVMC=no
fi

AM_CONDITIONAL(XVMC, [test "x$XVMC" = xyes])
if test "x$XVMC" = xyes; then
	AC_DEFINE(XvMCExtension, 1, [Build XvMC extension])
527 528
fi

529 530 531 532 533
AM_CONDITIONAL(DGA, [test "x$DGA" = xyes])
if test "x$DGA" = xyes; then
	AC_DEFINE(DGA, 1, [Support DGA extension])
fi

534 535 536
AM_CONDITIONAL(COMPOSITE, [test "x$COMPOSITE" = xyes])
if test "x$COMPOSITE" = xyes; then
	AC_DEFINE(COMPOSITE, 1, [Support Composite Extension])
537
	REQUIRED_MODULES="$REQUIRED_MODULES [compositeproto >= 0.3]"
538 539
	COMPOSITE_LIB='$(top_builddir)/composite/libcomposite.la'
	COMPOSITE_INC='-I$(top_srcdir)/composite'
Daniel Stone's avatar
Daniel Stone committed
540 541
fi

542 543 544 545
AM_CONDITIONAL(MITSHM, [test "x$MITSHM" = xyes])
if test "x$MITSHM" = xyes; then
	AC_DEFINE(MITSHM, 1, [Support MIT-SHM extension])
	AC_DEFINE(HAS_SHM, 1, [Support SHM])
Daniel Stone's avatar
Daniel Stone committed
546 547
fi

548 549 550
AM_CONDITIONAL(XTRAP, [test "x$XTRAP" = xyes])
if test "x$XTRAP" = xyes; then
	AC_DEFINE(XTRAP, 1, [Support XTrap extension])
551
	REQUIRED_MODULES="$REQUIRED_MODULES trapproto"
552
	XTRAP_LIB='$(top_builddir)/XTrap/libxtrap.la'
Daniel Stone's avatar
Daniel Stone committed
553 554
fi

555 556 557
AM_CONDITIONAL(RECORD, [test "x$RECORD" = xyes])
if test "x$RECORD" = xyes; then
	AC_DEFINE(XRECORD, 1, [Support Record extension])
Daniel Stone's avatar
Daniel Stone committed
558
	REQUIRED_MODULES="$REQUIRED_MODULES recordproto"
559
	RECORD_LIB='$(top_builddir)/record/librecord.la'
Daniel Stone's avatar
Daniel Stone committed
560 561
fi

562 563 564
AM_CONDITIONAL(SCREENSAVER, [test "x$SCREENSAVER" = xyes])
if test "x$SCREENSAVER" = xyes; then
	AC_DEFINE(SCREENSAVER, 1, [Support MIT-SCREEN-SAVER extension])
Daniel Stone's avatar
Daniel Stone committed
565
fi
566 567

AM_CONDITIONAL(RES, [test "x$RES" = xyes])
568
if test "x$RES" = xyes; then
569
	AC_DEFINE(RES, 1, [Support X resource extension])
Daniel Stone's avatar
Daniel Stone committed
570 571
	REQUIRED_MODULES="$REQUIRED_MODULES resourceproto"
fi
572 573

if test "x$GLX" = xyes && ! test "x$MESA_SOURCE" = x; then
574
	PKG_CHECK_MODULES([XLIB], [x11])
575
	PKG_CHECK_MODULES([GL], [glproto >= 1.4.6])
576
	AC_SUBST(XLIB_CFLAGS)
577
	AC_DEFINE(GLXEXT, 1, [Build GLX extension])
578
	GLX_LIBS='$(top_builddir)/GL/glx/libglx.la $(top_builddir)/GL/mesa/libGLcore.la'
579
	test -d GL || mkdir GL
580
        $srcdir/GL/symlink-mesa.sh $MESA_SOURCE GL/
581 582 583
	if test $? -ne 0; then
		AC_MSG_ERROR([Failed to link Mesa source tree.  Please specify a proper path to Mesa sources, or disable GLX.])
	fi
584 585
else
        GLX=no
Daniel Stone's avatar
Daniel Stone committed
586
fi
587
AM_CONDITIONAL(GLX, test "x$GLX" = xyes)
Daniel Stone's avatar
Daniel Stone committed
588 589
AC_SUBST([MESA_SOURCE])

590 591 592 593 594 595 596
if test "x$AIGLX" = xyes -a "x$GLX" = xyes -a "x$DRI" = xyes; then
	AC_DEFINE(AIGLX, 1, [Build AIGLX loader])
else
	AIGLX=no
fi
AM_CONDITIONAL(AIGLX, test "x$AIGLX" = xyes)

597 598
if test "x$GLX_USE_TLS" = xyes -a "x$AIGLX" = xyes; then
	GLX_DEFINES="-DGLX_USE_TLS -DPTHREADS"
Kristian Høgsberg's avatar
Kristian Høgsberg committed
599
	GLX_LIBS="$GLX_LIBS -lpthread"
600 601 602
fi
AC_SUBST([GLX_DEFINES])

603 604 605
AM_CONDITIONAL(DRI, test "x$DRI" = xyes)
if test "x$DRI" = xyes; then
	AC_DEFINE(XF86DRI, 1, [Build DRI extension])
606
	PKG_CHECK_MODULES([DRIPROTO], [xf86driproto])
607
	PKG_CHECK_MODULES([LIBDRM], [libdrm])
608
	PKG_CHECK_MODULES([GL], [glproto >= 1.4.1])
609
	AC_SUBST(DRIPROTO_CFLAGS)
610
	AC_SUBST(LIBDRM_CFLAGS)
611
	AC_SUBST(GL_CFLAGS)
Daniel Stone's avatar
Daniel Stone committed
612 613
fi

614 615 616 617
AM_CONDITIONAL(XINERAMA, [test "x$XINERAMA" = xyes])
if test "x$XINERAMA" = xyes; then
	AC_DEFINE(XINERAMA, 1, [Support Xinerama extension])
	AC_DEFINE(PANORAMIX, 1, [Internal define for Xinerama])
618
	REQUIRED_MODULES="$REQUIRED_MODULES xineramaproto"
Daniel Stone's avatar
Daniel Stone committed
619
fi
620 621 622 623

AM_CONDITIONAL(XCSECURITY, [test "x$XCSECURITY" = xyes])
if test "x$XCSECURITY" = xyes; then
	AC_DEFINE(XCSECURITY, 1, [Build Security extension])
Daniel Stone's avatar
Daniel Stone committed
624
fi
625 626 627 628

AM_CONDITIONAL(XEVIE, [test "x$XEVIE" = xyes])
if test "x$XEVIE" = xyes; then
	AC_DEFINE(XEVIE, 1, [Build XEvIE extension])
629
	REQUIRED_MODULES="$REQUIRED_MODULES evieproto"
Daniel Stone's avatar
Daniel Stone committed
630 631
fi

632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664
if test "x$APPGROUP" = xyes && test "x$XCSECURITY" != xyes; then
	AC_MSG_NOTICE([Disabling APPGROUP extension])
	APPGROUP=no
fi
AM_CONDITIONAL(APPGROUP, [test "x$APPGROUP" = xyes])
if test "x$APPGROUP" = xyes; then
	AC_DEFINE(XAPPGROUP, 1, [Build APPGROUP extension])
fi

AM_CONDITIONAL(CUP, [test "x$CUP" = xyes])
if test "x$CUP" = xyes; then
	AC_DEFINE(TOGCUP, 1, [Build TOG-CUP extension])
	# Requires xextproto which is always required
fi

AM_CONDITIONAL(EVI, [test "x$EVI" = xyes])
if test "x$EVI" = xyes; then
	AC_DEFINE(EVI, 1, [Build Extended-Visual-Information extension])
	# Requires xextproto which is always required
fi

AM_CONDITIONAL(MULTIBUFFER, [test "x$MULTIBUFFER" = xyes])
if test "x$MULTIBUFFER" = xyes; then
	AC_DEFINE(MULTIBUFFER, 1, [Build Multibuffer extension])
	# Requires xextproto which is always required
fi

AM_CONDITIONAL(FONTCACHE, [test "x$FONTCACHE" = xyes])
if test "x$FONTCACHE" = xyes; then
	AC_DEFINE(FONTCACHE, 1, [Build FontCache extension])
	REQUIRED_MODULES="$REQUIRED_MODULES fontcacheproto"
fi

665 666 667 668 669 670
AM_CONDITIONAL(DBE, [test "x$DBE" = xyes])
if test "x$DBE" = xyes; then
	AC_DEFINE(DBE, 1, [Support DBE extension])
	DBE_LIB='$(top_builddir)/dbe/libdbe.la'
fi

671 672 673 674 675 676 677 678 679 680
AM_CONDITIONAL(XF86BIGFONT, [test "x$XF86BIGFONT" = xyes])
if test "x$XF86BIGFONT" = xyes; then
	AC_DEFINE(XF86BIGFONT, 1, [Support XF86 Big font extension])
fi

AM_CONDITIONAL(DPMSExtension, [test "x$DPMSExtension" = xyes])
if test "x$DPMSExtension" = xyes; then
	AC_DEFINE(DPMSExtension, 1, [Support DPMS extension])
fi

681 682
if test "x$XF86VIDMODE" = xyes; then
	AC_DEFINE(XF86VIDMODE, 1, [Support XFree86 Video Mode extension])
Daniel Stone's avatar
Daniel Stone committed
683 684
fi

685 686 687
if test "x$XF86MISC" = xyes; then
	AC_DEFINE(XF86MISC, 1, [Support XFree86 miscellaneous extensions])
fi
Daniel Stone's avatar
Daniel Stone committed
688

689
if test "x$XPRINT" = xauto; then
690
	PKG_CHECK_MODULES([XPRINTPROTO], [printproto], [XPRINT=yes], [XPRINT=no])
691 692 693 694 695 696 697
fi
AM_CONDITIONAL(XPRINT, [test "x$XPRINT" = xyes])
if test "x$XPRINT" = xyes; then
	AC_DEFINE(XPRINT, 1, [Build Print extension])
	REQUIRED_MODULES="$REQUIRED_MODULES printproto"
fi

698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716
AC_DEFINE(RENDER, 1, [Support RENDER extension])
RENDER_LIB='$(top_builddir)/render/librender.la'
RENDER_INC='-I$(top_srcdir)/render'

AC_DEFINE(RANDR, 1, [Support RANDR extension])
RANDR_LIB='$(top_builddir)/randr/librandr.la'
RANDR_INC='-I$(top_srcdir)/randr'

AC_DEFINE(XFIXES,1,[Support XFixes extension])
FIXES_LIB='$(top_builddir)/xfixes/libxfixes.la'
FIXES_INC='-I$(top_srcdir)/xfixes'

AC_DEFINE(DAMAGE,1,[Support Damage extension])
DAMAGE_LIB='$(top_builddir)/damageext/libdamageext.la'
DAMAGE_INC='-I$(top_srcdir)/damageext'
MIEXT_DAMAGE_LIB='$(top_builddir)/miext/damage/libdamage.la'
dnl damage (may) need the composite wrapper when composite is enabled
if test "$COMPOSITE" = yes; then
	MIEXT_DAMAGE_LIB="$MIEXT_DAMAGE_LIB "'$(top_builddir)/miext/cw/libcw.la'
Daniel Stone's avatar
Daniel Stone committed
717
fi
718 719
MIEXT_DAMAGE_INC='-I$(top_srcdir)/miext/damage'

720 721 722 723 724 725
AM_CONDITIONAL(XINPUT, [test "x$XINPUT" = xyes])
if test "x$XINPUT" = xyes; then
   	AC_DEFINE(XINPUT, 1, [Support X Input extension])
	XI_LIB='$(top_builddir)/Xi/libXi.la'
	XI_INC='-I$(top_srcdir)/Xi'
fi
726 727 728 729 730 731 732 733 734

AC_DEFINE(SHAPE, 1, [Support SHAPE extension])

AC_DEFINE(XKB, 1, [Build XKB])
AC_DEFINE(XKB_IN_SERVER, 1, [Build XKB server])
AC_DEFINE(XKB_DFLT_DISABLED, 0, [Disable XKB per default])
REQUIRED_MODULES="$REQUIRED_MODULES xkbfile"
XKB_LIB='$(top_builddir)/xkb/libxkb.la'
XKB_STUB_LIB='$(top_builddir)/xkb/libxkbstubs.la'
Daniel Stone's avatar
Daniel Stone committed
735

736 737
AC_CHECK_FUNC(strcasecmp, [], AC_DEFINE([NEED_STRCASECMP], 1,
                                        [Do not have `strcasecmp'.]))
Daniel Stone's avatar
Daniel Stone committed
738

739 740 741 742 743 744
PKG_CHECK_MODULES([XDMCP], [xdmcp], [have_libxdmcp="yes"], [have_libxdmcp="no"])
if test "x$have_libxdmcp" = xyes; then
	AC_CHECK_LIB(Xdmcp, XdmcpWrap, [have_xdmcpwrap="yes"], [have_xdmcpwrap="no"], [$XDMCP_LIBS])
fi
if test "x$XDMCP" = xauto; then
	if test "x$have_libxdmcp" = xyes; then
Daniel Stone's avatar
Daniel Stone committed
745 746 747 748 749
		XDMCP=yes
	else
		XDMCP=no
	fi
fi
750 751
if test "x$XDMAUTH" = xauto; then
	if test "x$have_libxdmcp" = xyes && test "x$have_xdmcpwrap" = xyes; then
Daniel Stone's avatar
Daniel Stone committed
752 753 754 755 756 757
		XDMAUTH=yes
	else
		XDMAUTH=no
	fi
fi

758 759 760
AM_CONDITIONAL(XDMCP, [test "x$XDMCP" = xyes])
if test "x$XDMCP" = xyes; then
	AC_DEFINE(XDMCP, 1, [Support XDM Control Protocol])
761
	REQUIRED_LIBS="$REQUIRED_LIBS xdmcp"
762
	XDMCP_MODULES="xdmcp"
Daniel Stone's avatar
Daniel Stone committed
763 764
fi

765 766
AM_CONDITIONAL(XDMAUTH, [test "x$XDMAUTH" = xyes])
if test "x$XDMAUTH" = xyes; then
Daniel Stone's avatar
Daniel Stone committed
767
	AC_DEFINE(HASXDMAUTH,1,[Support XDM-AUTH*-1])
768
	if ! test "x$XDMCP" = xyes; then
769
		REQUIRED_LIBS="$REQUIRED_LIBS xdmcp"
770
		XDMCP_MODULES="xdmcp"
Daniel Stone's avatar
Daniel Stone committed
771 772 773
	fi
fi

774 775 776
AM_CONDITIONAL(USE_RGB_BUILTIN, [test "x$USE_RGB_BUILTIN" = xyes])
if test "x$USE_RGB_BUILTIN" = xyes; then
	AC_DEFINE(USE_RGB_BUILTIN, 1, [Use built-in RGB color database])
Daniel Stone's avatar
Daniel Stone committed
777 778
fi

779
VENDOR_RELEASE="((($VERSION_MAJOR) * 10000000) + (($VERSION_MINOR) * 100000) + (($VERSION_PATCH) * 1000) + $VERSION_SNAP)"
780 781 782 783 784 785 786 787 788 789 790 791 792

if test $VERSION_SNAP = "0"; then
	if test $VERSION_PATCH = "0"; then
		VENDOR_VERSION_STRING="${VERSION_MAJOR}.${VERSION_MINOR}"
	else
		VENDOR_VERSION_STRING="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
	fi
else
	VENDOR_VERSION_STRING="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_SNAP}"
fi

VENDOR_RELEASE_STRING="Release ${VENDOR_VERSION_STRING}"
VENDOR_MAN_VERSION="Version ${VENDOR_VERSION_STRING}"
793

Daniel Stone's avatar
Daniel Stone committed
794
AC_DEFINE_DIR(COMPILEDDEFAULTFONTPATH, FONTPATH, [Default font path])
795
AC_DEFINE_DIR(RGB_DB, RGBPATH, [Default RGB path])
796
AC_DEFINE_DIR(DRI_DRIVER_PATH, DRI_DRIVER_PATH, [Default DRI driver path])
797
AC_DEFINE_UNQUOTED(XVENDORNAME, ["$VENDOR_STRING"], [Vendor name])
798
AC_DEFINE_UNQUOTED(XVENDORNAMESHORT, ["$VENDOR_STRING_SHORT"], [Short vendor name])
799 800
AC_DEFINE_UNQUOTED(XORG_RELEASE, ["$VENDOR_RELEASE_STRING"], [Vendor release])
AC_DEFINE_UNQUOTED(XORG_DATE, ["$RELEASE_DATE"], [Vendor release])
801
AC_DEFINE_UNQUOTED(XORG_MAN_VERSION, ["$VENDOR_MAN_VERSION"], [Vendor man version])
Daniel Stone's avatar
Daniel Stone committed
802
AC_DEFINE_UNQUOTED(BUILDERADDR, ["$BUILDERADDR"], [Builder address])
803 804
AC_DEFINE_UNQUOTED(OSNAME, ["$OSNAME"], [Operating System Name])
AC_DEFINE_UNQUOTED(OSVENDOR, ["$OSVENDOR"], [Operating System Vendor])
805
AC_SUBST([VENDOR_STRING])
806
AC_SUBST([VENDOR_STRING_SHORT])
807
AC_SUBST([VENDOR_RELEASE])
808
AC_SUBST([VENDOR_MAN_VERSION])
Daniel Stone's avatar
Daniel Stone committed
809

810 811 812
AC_DEFINE(DDXOSINIT, 1, [Use OsVendorInit])
AC_DEFINE(SERVER_LOCK, 1, [Use a lock to prevent multiple servers on a display])
AC_DEFINE(SMART_SCHEDULE, 1, [Include time-based scheduler])
813
AC_DEFINE(NO_LIBCWRAPPER, 1, [Define to 1 if modules should avoid the libcwrapper])
Daniel Stone's avatar
Daniel Stone committed
814
AM_CONDITIONAL(DEBUG, test "x$DEBUGGING" = xyes)
Daniel Stone's avatar
Daniel Stone committed
815

816 817
if ! test "x$DEBUGGING" = xyes; then
  AC_DEFINE(NDEBUG, 1, [Disable some debugging code])
Daniel Stone's avatar
Daniel Stone committed
818 819
fi

820 821 822 823 824 825 826 827
AC_DEFINE(USE_RGB_TXT, 1, [Use rgb.txt directly])
AC_DEFINE(MITMISC, 1, [Support MIT Misc extension])
AC_DEFINE(XTEST, 1, [Support XTest extension])
AC_DEFINE(XSYNC, 1, [Support XSync extension])
AC_DEFINE(XCMISC, 1, [Support XCMisc extension])
AC_DEFINE(BIGREQS, 1, [Support BigRequests extension])
AC_DEFINE(PIXPRIV, 1, [Support pixmap privates])

Daniel Stone's avatar
Daniel Stone committed
828 829
DIX_LIB='$(top_builddir)/dix/libdix.la'
OS_LIB='$(top_builddir)/os/libos.la'
830
CWRAP_LIB='$(top_builddir)/os/libcwrapper.la'
Daniel Stone's avatar
Daniel Stone committed
831 832 833 834
MI_LIB='$(top_builddir)/mi/libmi.la'
MINIMI_LIB='$(top_builddir)/mi/libminimi.la'
MI_EXT_LIB='$(top_builddir)/mi/libmiext.la'
MI_INC='-I$(top_srcdir)/mi'
835
FB_LIB='$(top_builddir)/fb/libfb.la'
Daniel Stone's avatar
Daniel Stone committed
836
FB_INC='-I$(top_srcdir)/fb'
837 838
MIEXT_SHADOW_INC='-I$(top_srcdir)/miext/shadow'
MIEXT_SHADOW_LIB='$(top_builddir)/miext/shadow/libshadow.la'
Daniel Stone's avatar
Daniel Stone committed
839
XPSTUBS_LIB='$(top_builddir)/dix/libxpstubs.la'
Daniel Stone's avatar
Daniel Stone committed
840
CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include'
Daniel Stone's avatar
Daniel Stone committed
841

842 843 844 845
PKG_CHECK_MODULES([XSERVERCFLAGS], [$REQUIRED_MODULES $REQUIRED_LIBS])
PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])

XSERVER_CFLAGS="${XSERVERCFLAGS_CFLAGS}"
846
XSERVER_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} -lm -lz"
847
AC_SUBST([XSERVER_LIBS])
848
AC_SUBST([SYS_LIBS])
849

850 851
dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so
dnl we need to replicate that here until those can all be fixed
852 853 854 855 856 857 858 859 860
AC_MSG_CHECKING([if SVR4 needs to be defined])
AC_EGREP_CPP([I_AM_SVR4],[
#if defined(SVR4) || defined(__svr4__) || defined(__SVR4)
 I_AM_SVR4
#endif
],[
AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4])
AC_MSG_RESULT([yes])], AC_MSG_RESULT([no]))

Daniel Stone's avatar
Daniel Stone committed
861
XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC"
862 863 864 865 866 867
AC_DEFINE_UNQUOTED(X_BYTE_ORDER,[$ENDIAN],[Endian order])

dnl ---------------------------------------------------------------------------
dnl DDX section.
dnl ---------------------------------------------------------------------------

868
dnl These are used to define Xorg module, loader and general server defines
869 870
MODULE_DEFINES=""
LOADER_DEFINES=""
871
SERVER_DEFINES=""
872 873 874 875

dnl DMX DDX

AC_MSG_CHECKING([whether to build Xdmx DDX])
876
PKG_CHECK_MODULES([DMXMODULES], [xmuu xext x11 xrender xfont xi dmxproto xau $XDMCP_MODULES], [have_dmx=yes], [have_dmx=no])
877 878 879 880 881 882 883 884 885 886 887 888
if test "x$DMX" = xauto; then
	DMX="$have_dmx"
fi
AC_MSG_RESULT([$DMX])
AM_CONDITIONAL(DMX, [test "x$DMX" = xyes])

if test "x$DMX" = xyes; then
	if test "x$have_dmx" = xno; then
		AC_MSG_ERROR([Xdmx build explicitly requested, but required
		              modules not found.])
	fi
	DMX_INCLUDES="$XEXT_INC $RENDER_INC $XTRAP_INC $RECORD_INC"
Daniel Stone's avatar
Daniel Stone committed
889
	XDMX_LIBS="$FB_LIB $MI_LIB $XEXT_LIB $RENDER_LIB $XTRAP_LIB $RECORD_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $OS_LIB $CWRAP_LIB"
890
	AC_SUBST([XDMX_LIBS])
891 892

dnl USB sources in DMX require <linux/input.h>
893 894
	AC_CHECK_HEADER([linux/input.h], DMX_BUILD_USB="yes",
			DMX_BUILD_USB="no")
895
dnl Linux sources in DMX require <linux/keyboard.h>
896 897
	AC_CHECK_HEADER([linux/keyboard.h], DMX_BUILD_LNX="yes",
			DMX_BUILD_LNX="no")
898 899 900
	if test "x$GLX" = xyes; then
		PKG_CHECK_MODULES([GL], [glproto])
	fi
901
	PKG_CHECK_MODULES([XDMXCONFIG_DEP], [xaw7 xmu xt xpm x11])
902
	AC_SUBST(XDMXCONFIG_DEP_CFLAGS)
903 904 905 906 907 908 909 910 911 912 913 914 915
	AC_SUBST(XDMXCONFIG_DEP_LIBS)
	PKG_CHECK_MODULES([DMXEXAMPLES_DEP], [dmx xext x11])
	AC_SUBST(DMXEXAMPLES_DEP_LIBS)
	PKG_CHECK_MODULES([DMXXMUEXAMPLES_DEP], [dmx xmu xext x11])
	AC_SUBST(DMXXMUEXAMPLES_DEP_LIBS)
	PKG_CHECK_MODULES([DMXXIEXAMPLES_DEP], [dmx xi xext x11])
	AC_SUBST(DMXXIEXAMPLES_DEP_LIBS)
	PKG_CHECK_MODULES([XTSTEXAMPLES_DEP], [xtst xext x11])
	AC_SUBST(XTSTEXAMPLES_DEP_LIBS)
	PKG_CHECK_MODULES([XRESEXAMPLES_DEP], [xres xext x11])
	AC_SUBST(XRESEXAMPLES_DEP_LIBS)
	PKG_CHECK_MODULES([X11EXAMPLES_DEP], [xext x11])
	AC_SUBST(X11EXAMPLES_DEP_LIBS)
916
fi
917 918
AM_CONDITIONAL([DMX_BUILD_LNX], [test "x$DMX_BUILD_LNX" = xyes])
AM_CONDITIONAL([DMX_BUILD_USB], [test "x$DMX_BUILD_USB" = xyes])
919 920 921 922 923 924 925 926 927


dnl Xvfb DDX

AC_MSG_CHECKING([whether to build Xvfb DDX])
AC_MSG_RESULT([$XVFB])
AM_CONDITIONAL(XVFB, [test "x$XVFB" = xyes])

if test "x$XVFB" = xyes; then
Daniel Stone's avatar
Daniel Stone committed
928
	XVFB_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB"
929 930 931 932 933 934 935
	AC_SUBST([XVFB_LIBS])
fi


dnl Xnest DDX

AC_MSG_CHECKING([whether to build Xnest DDX])
936
PKG_CHECK_MODULES(XNESTMODULES, [xfont xext x11 xau $XDMCP_MODULES], [have_xnest=yes], [have_xnest=no])
937
if test "x$XNEST" = xauto; then
938
	XNEST="$have_xnest"
939 940 941 942 943
fi
AC_MSG_RESULT([$XNEST])
AM_CONDITIONAL(XNEST, [test "x$XNEST" = xyes])

if test "x$XNEST" = xyes; then
Daniel Stone's avatar
Daniel Stone committed
944
	XNEST_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB"
945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960
	AC_SUBST([XNEST_LIBS])
fi


dnl Xorg DDX

AC_MSG_CHECKING([whether to build Xorg DDX])
if test "x$XORG" = xauto; then
	XORG="yes"
	case $host_os in
		cygwin*) XORG="no" ;;
		darwin*) XORG="no" ;;
	esac
fi
AC_MSG_RESULT([$XORG])

961 962 963 964 965 966 967 968 969 970 971 972
dnl Xgl DDX

AC_MSG_CHECKING([whether to build Xgl DDX])
if test "x$XGL" != xno; then
  PKG_CHECK_MODULES([XGLMODULES], [glitz-glx >= 0.4.3], [XGL=yes], [XGL=no])
  AC_SUBST(XGLMODULES_CFLAGS)
  AC_SUBST(XGLMODULES_LIBS)
fi
AC_MSG_RESULT([$XGL])
AM_CONDITIONAL(XGL, [test "x$XGL" = xyes])

if test "x$XGL" = xyes; then
Daniel Stone's avatar
Daniel Stone committed
973
	XGL_LIBS="$FB_LIB $MI_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB"
974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993
	AC_SUBST([XGL_LIBS])
	AC_DEFINE(XGL_MODULAR, 1, [Use loadable XGL modules])

	xglmoduledir="$moduledir/xgl"
	AC_SUBST([xglmoduledir])
	AC_DEFINE_DIR(XGL_MODULE_PATH, xglmoduledir, [Default XGL module search path])
fi

dnl Xegl DDX

AC_MSG_CHECKING([whether to build Xegl DDX])
if test "x$XEGL" != xno; then
  PKG_CHECK_MODULES([XGLMODULES], [glitz-glx >= 0.4.3], [XEGL=yes], [XEGL=no])
  AC_SUBST(XEGLMODULES_CFLAGS)
  AC_SUBST(XEGLMODULES_LIBS)
fi
AC_MSG_RESULT([$XEGL])
AM_CONDITIONAL(XEGL, [test "x$XEGL" = xyes])

if test "x$XEGL" = xyes; then
Daniel Stone's avatar
Daniel Stone committed
994
	XEGL_LIBS="$FB_LIB $MI_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB"
995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009
	AC_SUBST([XEGL_LIBS])
fi

dnl Xglx DDX

AC_MSG_CHECKING([whether to build Xglx DDX])
if test "x$XGLX" != xno; then
  PKG_CHECK_MODULES([XGLXMODULES], [glitz-glx >= 0.4.3 xrender], [XGLX=yes], [XGLX=no])
  AC_SUBST(XGLXMODULES_CFLAGS)
  AC_SUBST(XGLXMODULES_LIBS)
fi
AC_MSG_RESULT([$XGLX])
AM_CONDITIONAL(XGLX, [test "x$XGLX" = xyes])

if test "x$XGLX" = xyes; then
Daniel Stone's avatar
Daniel Stone committed
1010
	XGLX_LIBS="$FB_LIB $MI_LIB $COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $XTRAP_LIB $RECORD_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $MIEXT_LAYER_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB $CWRAP_LIB $OS_LIB"
1011 1012 1013
	AC_SUBST([XGLX_LIBS])
fi

1014 1015 1016 1017
# XORG_CORE_LIBS is needed even if you're not building the Xorg DDX
XORG_CORE_LIBS="$DIX_LIB"
AC_SUBST([XORG_CORE_LIBS])

1018 1019 1020 1021 1022 1023 1024 1025
xorg_bus_linuxpci=no
xorg_bus_freebsdpci=no
xorg_bus_netbsdpci=no
xorg_bus_ix86pci=no
xorg_bus_ppcpci=no
xorg_bus_sparcpci=no
xorg_bus_sparc=no

1026
if test "x$XORG" = xyes -o "x$XGL" = xyes; then
1027 1028 1029 1030
	XORG_DDXINCS='-I$(top_srcdir)/hw/xfree86 -I$(top_srcdir)/hw/xfree86/include -I$(top_srcdir)/hw/xfree86/common'
	XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os'
	XORG_INCS="$XORG_DDXINCS $XORG_OSINCS"
	XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H"
Daniel Stone's avatar
Daniel Stone committed
1031
	XORG_LIBS="$MI_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RENDER_LIB $RANDR_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $COMPOSITE_LIB $XPSTUBS_LIB $OS_LIB"
1032 1033 1034

	AC_CHECK_LIB([dl], [dlopen], XORG_LIBS="$XORG_LIBS -ldl")

1035 1036
	case $host_os in
	  linux*)
1037 1038 1039
		if test "x$LNXAPM" = xyes; then
			XORG_CFLAGS="$XORG_CFLAGS -DXF86PM"
		fi
1040 1041 1042
	  	XORG_OS="linux"
		XORG_OS_SUBDIR="linux"
		XORG_OS_KBD="Lnx"
1043
		xorg_bus_linuxpci="yes"
1044
		linux_acpi="no"
1045 1046 1047
		case $host_cpu in
		  ia64*)
			linux_ia64=yes
1048
			linux_acpi="yes"
1049
			;;
1050 1051 1052
		  alpha*)
		  	linux_alpha=yes
			XORG_OS_PCI="axp"
1053
			xorg_bus_linuxpci="no"
1054
			;;
1055
		  i*86|amd64*|x86_64*)
1056
			linux_acpi="yes"
1057
			;;
1058 1059 1060
		  *)
			;;
		esac
1061
		;;
1062
	  freebsd* | kfreebsd*-gnu)
1063 1064 1065
	  	XORG_OS="freebsd"
		XORG_OS_SUBDIR="bsd"
		XORG_OS_KBD="BSD"
1066 1067 1068 1069 1070 1071 1072
		case $host_cpu in
		  i*86)
			;;
		  *)
			xorg_bus_freebsdpci="yes"
			;;
		esac
1073
		;;
1074 1075 1076 1077
	  netbsd*)
	  	XORG_OS="netbsd"
		XORG_OS_SUBDIR="bsd"
		XORG_OS_KBD="BSD"
1078 1079 1080 1081 1082 1083 1084
		case $host_cpu in
		  i*86|amd64*|x86_64*|ia64*)
			;;
		  *)
			xorg_bus_netbsdpci="yes"
			;;
		esac
1085
		;;
1086 1087 1088 1089
	  openbsd*)
	  	XORG_OS="openbsd"
		XORG_OS_SUBDIR="bsd"
		XORG_OS_KBD="BSD"
1090 1091 1092 1093 1094 1095 1096
		case $host_cpu in
		  i*86|amd64*|x86_64*|ia64*)
			;;
		  *)
			xorg_bus_freebsdpci="yes"
			;;
		esac
1097
		;;
1098 1099 1100 1101 1102 1103 1104 1105 1106 1107
	  solaris*)
	  	XORG_OS="solaris"
		XORG_OS_SUBDIR="solaris"
		# This really should be tests for specific features, but the #ifdef's
		# were done as a simple version check in XFree86 4.x and haven't been 
		# fixed yet
		AC_MSG_CHECKING([Solaris version])
	        OS_MINOR=`echo ${host_os}|sed -e 's/^.*solaris2\.//' -e s'/\..*$//'`
		if test "${OS_MINOR}" -ge 7 ; then
	        	AC_MSG_RESULT(Solaris ${OS_MINOR})
1108
		else
1109
			AC_MSG_RESULT(Solaris `echo ${host_os}|sed -e 's/^.*solaris//`)
1110
		fi
1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141
		if test "${OS_MINOR}" -ge 8 ; then
			AC_DEFINE(__SOL8__,1,[Solaris 8 or later])
		fi
		AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
		if test "x$SUNCC" = "xyes"; then
			solaris_asm_inline="yes"
		fi
		AC_CHECK_DECL([_LP64], [SOLARIS_64="yes"], [SOLARIS_64="no"])
			
		case $host_cpu in
		  sparc*)	
			SOLARIS_INOUT_ARCH="sparcv8plus"
			;;
		  i*86)	
			if test x$SOLARIS_64 = xyes ; then
				SOLARIS_INOUT_ARCH="amd64"
			else
				SOLARIS_INOUT_ARCH="ia32"
			fi
			if test "${OS_MINOR}" -lt 8 ; then
				solaris_usl_console="yes"
			fi
			;;
		  *)
			AC_MSG_ERROR([Unsupported Solaris platform. Only SPARC & x86 \
			are supported on Solaris in this release.   If you are \
			interested in porting Xorg to your platform, please email \
			xorg@lists.freedesktop.org.]) ;;
		esac
		AC_SUBST([SOLARIS_INOUT_ARCH])
		if test x$solaris_asm_inline = xyes ; then
1142 1143
			SOLARIS_ASM_CFLAGS='$(top_srcdir)/hw/xfree86/os-support/solaris/solaris-$(SOLARIS_INOUT_ARCH).il'
			XORG_CFLAGS="${XORG_CFLAGS} "'$(SOLARIS_ASM_CFLAGS)'
1144
		fi
1145
		AC_SUBST([SOLARIS_ASM_CFLAGS])
1146
		;;
Alan Coopersmith's avatar