diff --git a/configure.ac b/configure.ac index 472c130c2..0ca96aeb8 100644 --- a/configure.ac +++ b/configure.ac @@ -193,7 +193,12 @@ AC_CHECK_LIB(m, sqrt) AC_CHECK_FUNCS([cbrt]) dnl AGPGART headers -AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h sys/agpgart.h], AGP=yes) +AC_ARG_ENABLE(agp, AS_HELP_STRING([--enable-agp], + [Enable AGP support (default: auto)]), + [AGP=$enableval], [AGP=auto]) +if test "x$AGP" = "xauto" ; then + AC_CHECK_HEADERS([linux/agpgart.h sys/agpio.h sys/agpgart.h], AGP=yes) +fi AM_CONDITIONAL(AGP, [test "x$AGP" = xyes]) dnl fbdev header diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am index 7d4cf4222..4392fe8d4 100644 --- a/hw/xfree86/os-support/linux/Makefile.am +++ b/hw/xfree86/os-support/linux/Makefile.am @@ -24,15 +24,20 @@ LOGIND_SRCS = systemd-logind.c XORG_CFLAGS += $(DBUS_CFLAGS) endif +if AGP +AGP_SRCS = lnx_agp.c +endif + liblinux_la_SOURCES = linux.h lnx_init.c lnx_video.c \ - lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \ + lnx_kmod.c lnx_bell.c lnx_platform.c \ $(srcdir)/../shared/VTsw_usl.c \ $(srcdir)/../shared/posix_tty.c \ $(srcdir)/../shared/vidmem.c \ $(srcdir)/../shared/sigio.c \ $(ACPI_SRCS) \ $(APM_SRCS) \ - $(LOGIND_SRCS) + $(LOGIND_SRCS) \ + $(AGP_SRCS) AM_CFLAGS = -DHAVE_SYSV_IPC $(DIX_CFLAGS) $(XORG_CFLAGS) $(PLATFORM_DEFINES) diff --git a/hw/xfree86/os-support/meson.build b/hw/xfree86/os-support/meson.build index 65418b74a..484a118e7 100644 --- a/hw/xfree86/os-support/meson.build +++ b/hw/xfree86/os-support/meson.build @@ -25,9 +25,14 @@ if get_option('pciaccess') endif endif +if get_option('agp') == 'auto' + build_agp = cc.has_header('sys/agpio.h') or cc.has_header('sys/agpgart.h') or cc.has_header('linux/agpgart.h') +else + build_agp = get_option('agp') == 'true' +endif + if host_machine.system() == 'linux' srcs_xorg_os_support += [ - 'linux/lnx_agp.c', 'linux/lnx_bell.c', 'linux/lnx_init.c', 'linux/lnx_kmod.c', @@ -36,6 +41,11 @@ if host_machine.system() == 'linux' 'misc/SlowBcopy.c', 'shared/VTsw_usl.c', ] + if build_agp + srcs_xorg_os_support += 'linux/lnx_agp.c' + else + srcs_xorg_os_support += 'shared/agp_noop.c' + endif if build_systemd_logind srcs_xorg_os_support += 'linux/systemd-logind.c' endif @@ -65,7 +75,7 @@ elif host_machine.system() == 'solaris' srcs_xorg_os_support += 'shared/VTsw_noop.c' endif - if cc.has_header('sys/agpio.h') or cc.has_header('sys/agpgart.h') + if build_agp srcs_xorg_os_support += 'solaris/sun_agp.c' else srcs_xorg_os_support += 'shared/agp_noop.c' @@ -132,7 +142,7 @@ elif host_machine.system().endswith('bsd') srcs_xorg_os_support += 'shared/kmod_noop.c' endif - if cc.has_header('sys/agpio.h') or cc.has_header('sys/agpgart.h') + if build_agp srcs_xorg_os_support += 'linux/lnx_agp.c' else srcs_xorg_os_support += 'shared/agp_noop.c' diff --git a/meson_options.txt b/meson_options.txt index 7211f9ffa..3051932f7 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -98,6 +98,8 @@ option('linux_acpi', type: 'boolean', value: true, description: 'ACPI support on Linux') option('mitshm', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'SHM extension') +option('agp', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', + description: 'AGP support') option('dri1', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI1 extension (default: auto)') option('dri2', type: 'combo', choices: ['true', 'false', 'auto'], value: 'auto', description: 'Build DRI2 extension (default: auto)')