1e07dc26bSmrg#  Copyright 2005 Adam Jackson.
2e07dc26bSmrg#
3e07dc26bSmrg#  Permission is hereby granted, free of charge, to any person obtaining a
4e07dc26bSmrg#  copy of this software and associated documentation files (the "Software"),
5e07dc26bSmrg#  to deal in the Software without restriction, including without limitation
6e07dc26bSmrg#  on the rights to use, copy, modify, merge, publish, distribute, sub
7e07dc26bSmrg#  license, and/or sell copies of the Software, and to permit persons to whom
8e07dc26bSmrg#  the Software is furnished to do so, subject to the following conditions:
9e07dc26bSmrg#
10e07dc26bSmrg#  The above copyright notice and this permission notice (including the next
11e07dc26bSmrg#  paragraph) shall be included in all copies or substantial portions of the
12e07dc26bSmrg#  Software.
13e07dc26bSmrg#
14e07dc26bSmrg#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15e07dc26bSmrg#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16e07dc26bSmrg#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
17e07dc26bSmrg#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18e07dc26bSmrg#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19e07dc26bSmrg#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20e07dc26bSmrg#
21e07dc26bSmrg# Process this file with autoconf to produce a configure script
22e07dc26bSmrg
23e07dc26bSmrg# Initialize Autoconf
24e07dc26bSmrgAC_PREREQ([2.60])
25e07dc26bSmrgAC_INIT([xf86-video-vboxvideo],
26636c353eSmrg        [1.0.1],
27636c353eSmrg        [https://gitlab.freedesktop.org/xorg/driver/xf86-video-vbox/-/issues],
28e07dc26bSmrg        [xf86-video-vboxvideo])
29e07dc26bSmrgAC_CONFIG_SRCDIR([Makefile.am])
30e07dc26bSmrgAC_CONFIG_HEADERS([config.h])
31e07dc26bSmrgAC_CONFIG_AUX_DIR(.)
32e07dc26bSmrg
33e07dc26bSmrg# Initialize Automake
34636c353eSmrgAM_INIT_AUTOMAKE([foreign dist-xz])
35e07dc26bSmrg
36e07dc26bSmrg# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
37e07dc26bSmrgm4_ifndef([XORG_MACROS_VERSION],
38e07dc26bSmrg          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
39e07dc26bSmrgXORG_MACROS_VERSION(1.8)
40e07dc26bSmrgXORG_DEFAULT_OPTIONS
41e07dc26bSmrg
42636c353eSmrg# Disable some of the warnings xorg-macros.m4 sets by default that cause
43636c353eSmrg# too much noise here
44636c353eSmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wno-declaration-after-statement])
45636c353eSmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wno-unused-but-set-variable])
46636c353eSmrgXORG_TESTSET_CFLAG([BASE_CFLAGS], [-Wno-unused-value])
47636c353eSmrg
48e07dc26bSmrg# Initialize libtool
49636c353eSmrgLT_INIT([disable-static])
50e07dc26bSmrg
51e07dc26bSmrgAH_TOP([#include "xorg-server.h"])
52e07dc26bSmrg
53e07dc26bSmrg# Define a configure option for an alternate module directory
54e07dc26bSmrgAC_ARG_WITH(xorg-module-dir, [  --with-xorg-module-dir=DIR ],
55e07dc26bSmrg                             [ moduledir="$withval" ],
56e07dc26bSmrg                             [ moduledir="$libdir/xorg/modules" ])
57e07dc26bSmrgAC_SUBST(moduledir)
58e07dc26bSmrg
59e07dc26bSmrg# Store the list of server defined optional extensions in REQUIRED_MODULES
60e07dc26bSmrgXORG_DRIVER_CHECK_EXT(RANDR, randrproto)
61e07dc26bSmrgXORG_DRIVER_CHECK_EXT(RENDER, renderproto)
62e07dc26bSmrgXORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
63e07dc26bSmrg
64e07dc26bSmrg# Obtain compiler/linker options for the driver dependencies
65e07dc26bSmrgPKG_CHECK_MODULES(XORG, xorg-server >= 1.6 xproto fontsproto $REQUIRED_MODULES)
66e07dc26bSmrgPKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
67e07dc26bSmrg                  HAVE_XEXTPROTO_71="yes", HAVE_XEXTPROTO_71="no")
68e07dc26bSmrg
69e07dc26bSmrgif test "x$HAVE_XEXTPROTO_71" = xyes; then
70e07dc26bSmrg    AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available])
71e07dc26bSmrgfi
72e07dc26bSmrg
73e07dc26bSmrgsave_CFLAGS="$CFLAGS"
74e07dc26bSmrgCFLAGS="$XORG_CFLAGS"
75e07dc26bSmrgAC_CHECK_DECL(xf86ConfigIsaEntity,
76e07dc26bSmrg	      [AC_DEFINE(HAVE_ISA, 1, [Have ISA support])],
77e07dc26bSmrg	      [],
78e07dc26bSmrg	      [#include "xf86.h"])
79e07dc26bSmrgCFLAGS="$save_CFLAGS"
80e07dc26bSmrg
81e07dc26bSmrgsave_CFLAGS="$CFLAGS"
82e07dc26bSmrgCFLAGS="$XORG_CFLAGS"
83e07dc26bSmrgAC_CHECK_DECL(XSERVER_LIBPCIACCESS,
84e07dc26bSmrg              [XSERVER_LIBPCIACCESS=yes], [XSERVER_LIBPCIACCESS=no],
85e07dc26bSmrg              [#include "xorg-server.h"])
86e07dc26bSmrgCFLAGS="$save_CFLAGS"
87e07dc26bSmrg
88e07dc26bSmrgif test "x$XSERVER_LIBPCIACCESS" = xyes; then
89e07dc26bSmrg    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.12.901])
90e07dc26bSmrgfi
91e07dc26bSmrg
92636c353eSmrg# Checks for library functions
93636c353eSmrg# We don't use strlcat, strlcpy, or timingsafe_memcmp, but check to quiet
94636c353eSmrg# -Wredundant-decls warning from xorg/os.h which will otherwise redefine them.
95636c353eSmrgAC_CHECK_FUNCS([strlcat strlcpy timingsafe_memcmp])
96e07dc26bSmrg
97e07dc26bSmrgDRIVER_NAME=vboxvideo
98e07dc26bSmrgAC_SUBST([DRIVER_NAME])
99e07dc26bSmrg
100e07dc26bSmrgAC_CONFIG_FILES([
101e07dc26bSmrg                Makefile
102e07dc26bSmrg                src/Makefile
103e07dc26bSmrg                man/Makefile
104e07dc26bSmrg])
105e07dc26bSmrgAC_OUTPUT
106