configure.ac revision 34a0776d
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 23# Initialize Autoconf 24AC_PREREQ([2.60]) 25AC_INIT([xf86-video-vmware], 26 [13.2.1], 27 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], 28 [xf86-video-vmware]) 29AC_CONFIG_SRCDIR([Makefile.am]) 30AC_CONFIG_HEADERS([config.h]) 31AC_CONFIG_AUX_DIR(.) 32AC_SYS_LARGEFILE 33 34# Initialize Automake 35AM_INIT_AUTOMAKE([foreign dist-bzip2]) 36AM_MAINTAINER_MODE 37 38# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS 39m4_ifndef([XORG_MACROS_VERSION], 40 [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) 41XORG_MACROS_VERSION(1.8) 42XORG_DEFAULT_OPTIONS 43 44# Initialize libtool 45AC_DISABLE_STATIC 46AC_PROG_LIBTOOL 47 48# Checks for programs. 49AM_PROG_CC_C_O 50 51AH_TOP([#include "xorg-server.h"]) 52 53# Define a configure option for an alternate module directory 54AC_ARG_WITH(xorg-module-dir, 55 AS_HELP_STRING([--with-xorg-module-dir=DIR], 56 [Default xorg module directory [[default=$libdir/xorg/modules]]]), 57 [moduledir="$withval"], 58 [moduledir="$libdir/xorg/modules"]) 59 60# Define a configure option to build the vmwarectrl client tool 61AC_ARG_ENABLE(vmwarectrl-client, 62 AS_HELP_STRING([--enable-vmwarectrl-client], 63 [Enable vmwarectrl client (default: disabled)]), 64 [VMWARECTRL=$enableval], [VMWARECTRL=no]) 65AM_CONDITIONAL(BUILD_VMWARECTRL, [test "x$VMWARECTRL" = xyes]) 66 67# Store the list of server defined optional extensions in REQUIRED_MODULES 68XORG_DRIVER_CHECK_EXT(RANDR, randrproto) 69XORG_DRIVER_CHECK_EXT(RENDER, renderproto) 70XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) 71XORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto) 72XORG_DRIVER_CHECK_EXT(XV, videoproto) 73 74# Obtain compiler/linker options for the driver dependencies 75PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.1 xproto fontsproto $REQUIRED_MODULES]) 76PKG_CHECK_EXISTS([xorg-server >= 1.1.0], 77 [AC_DEFINE([HAVE_XORG_SERVER_1_1_0], 1, 78 [Has version 1.1.0 or greater of the Xserver])]) 79 80PKG_CHECK_EXISTS([xorg-server >= 1.2.0], 81 [AC_DEFINE([HAVE_XORG_SERVER_1_2_0], 1, 82 [Has version 1.2.0 or greater of the Xserver])]) 83 84PKG_CHECK_EXISTS([xorg-server >= 1.4.99], 85 [AC_DEFINE([HAVE_XORG_SERVER_1_5_0], 1, 86 [Has version 1.5.0 or greater of the Xserver])]) 87 88PKG_CHECK_EXISTS([xorg-server >= 1.7.0], 89 [AC_DEFINE([HAVE_XORG_SERVER_1_7_0], 1, 90 [Has version 1.7.0 or greater of the Xserver]) 91 BUILD_VMWGFX=yes],[BUILD_VMWGFX=no]) 92 93PKG_CHECK_EXISTS([xorg-server >= 1.12.0], 94 [AC_DEFINE([HAVE_XORG_SERVER_1_12_0], 1, 95 [Has version 1.12.0 or greater of the Xserver])]) 96 97# Obtain compiler/linker options for the vmwarectrl client tool 98PKG_CHECK_MODULES(X11, x11 xext) 99 100# Checks for libraries. 101 102save_CFLAGS="$CFLAGS" 103CFLAGS="$XORG_CFLAGS" 104AC_CHECK_DECL(XSERVER_LIBPCIACCESS, 105 [XSERVER_LIBPCIACCESS=yes], [XSERVER_LIBPCIACCESS=no], 106 [#include "xorg-server.h"]) 107CFLAGS="$save_CFLAGS" 108 109if test x$XSERVER_LIBPCIACCESS = xyes; then 110 PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) 111fi 112 113AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes) 114 115AC_SUBST([moduledir]) 116 117if test x$BUILD_VMWGFX = xyes; then 118 PKG_CHECK_MODULES([LIBDRM], [libdrm],[],[BUILD_VMWGFX=no]) 119fi 120if test x$BUILD_VMWGFX = xyes; then 121# 122# Early versions of mesa 10 forgot to bump the XA major version number in 123# the xa_tracker.h header 124# 125 PKG_CHECK_MODULES([XATRACKER], [xatracker >= 0.4.0], 126 [PKG_CHECK_EXISTS([xatracker = 2.0.0], 127 [AC_DEFINE([HAVE_XA_2], 1, 128 [Has version 2 of XA])])], 129 [BUILD_VMWGFX=no]) 130# 131# Check for prime. 132# 133 PKG_CHECK_EXISTS([libdrm >= 2.4.38], 134 [AC_DEFINE([HAVE_LIBDRM_2_4_38], 1, 135 [Has version 2.4.38 or greater of libdrm])]) 136fi 137 138DRIVER_NAME=vmware 139AC_SUBST([DRIVER_NAME]) 140 141AC_MSG_CHECKING([whether to build Kernel Mode Setting and 3D]) 142if test x$BUILD_VMWGFX = xyes; then 143 AC_MSG_RESULT([yes]) 144 AC_DEFINE([BUILD_VMWGFX], 1, [Building the vmwgfx driver path]) 145 libudev_check=yes 146 AC_ARG_WITH([libudev], 147 [AS_HELP_STRING([--without-libudev], 148 [Use to build without libudev on linux])], 149 [if test x$withval = xno; then libudev_check=no; fi] 150 []) 151 if test $libudev_check != no; then 152 PKG_CHECK_MODULES(LIBUDEV, [libudev], 153 [AC_DEFINE([HAVE_LIBUDEV], 1, 154 [Has libudev installed])], 155 []); 156 fi 157else 158 AC_MSG_RESULT([no]) 159fi 160 161AM_CONDITIONAL(BUILD_VMWGFX, test "x$BUILD_VMWGFX" = xyes) 162 163AC_CONFIG_FILES([ 164 Makefile 165 man/Makefile 166 saa/Makefile 167 vmwgfx/Makefile 168 src/Makefile 169 vmwarectrl/Makefile 170]) 171 172AC_OUTPUT 173