xenocara/lib/libpciaccess/configure.ac

136 lines
4.0 KiB
Plaintext
Raw Normal View History

# (C) Copyright IBM Corporation 2006
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# on the rights to use, copy, modify, merge, publish, distribute, sub
# license, and/or sell copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
# IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
2007-06-05 14:08:56 -06:00
# Initialize Autoconf
AC_PREREQ([2.60])
2012-04-09 12:50:44 -06:00
AC_INIT([libpciaccess],[0.13.1],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess],[libpciaccess])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
2007-06-05 14:08:56 -06:00
AM_MAINTAINER_MODE
2012-04-09 12:50:44 -06:00
AC_USE_SYSTEM_EXTENSIONS
2007-06-05 14:08:56 -06:00
# Initialize libtool
AC_PROG_LIBTOOL
# Require X.Org macros 1.8 or later
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.8)
XORG_DEFAULT_OPTIONS
2007-06-05 14:08:56 -06:00
pciids_path=/usr/share/hwdata
AC_ARG_WITH(pciids-path, AS_HELP_STRING([--with-pciids-path=PCIIDS_PATH],
[Path to pci.ids file]), [pciids_path="$withval"])
AX_DEFINE_DIR(PCIIDS_PATH, pciids_path, [Path to pci.ids])
AC_ARG_ENABLE(linux-rom-fallback, AS_HELP_STRING([--enable-linux-rom-fallback],
[Enable support for falling back to /dev/mem for roms (default: disabled)]),
[LINUX_ROM=$enableval],[LINUX_ROM=no])
2007-06-05 14:08:56 -06:00
if test "x$LINUX_ROM" = xyes; then
AC_DEFINE(LINUX_ROM, 1, [Linux ROM read fallback])
fi
2007-06-05 14:08:56 -06:00
use_zlib=no
AC_ARG_WITH(zlib, AS_HELP_STRING([--with-zlib],
[Enable zlib support to read gzip compressed pci.ids]),
[use_zlib="$withval"])
if test "x$use_zlib" = xyes; then
AC_CHECK_LIB(z, gzopen,
[PCIACCESS_LIBS="$PCIACCESS_LIBS -lz"],
[AC_MSG_ERROR(Check for zlib library failed)])
AC_CHECK_HEADER([zlib.h],
[AC_DEFINE(HAVE_ZLIB, 1, [Use zlib to read gzip compressed pci.ids])],
[AC_MSG_ERROR(Check for zlib.h header file failed)])
fi
2007-06-05 14:08:56 -06:00
case $host_os in
*freebsd* | *dragonfly*)
2007-06-05 14:08:56 -06:00
freebsd=yes
;;
*linux*)
linux=yes
;;
*netbsd*)
case $host in
*i386*)
PCIACCESS_LIBS="-li386"
;;
*x86_64*|*amd64*)
PCIACCESS_LIBS="-lx86_64"
;;
esac
netbsd=yes
;;
2007-06-06 15:01:25 -06:00
*openbsd*)
openbsd=yes
;;
2007-06-16 10:22:09 -06:00
*solaris*)
solaris=yes
PCIACCESS_LIBS="$PCIACCESS_LIBS -ldevinfo"
2007-06-16 10:22:09 -06:00
;;
gnu*)
gnu=yes
;;
2007-06-05 14:08:56 -06:00
esac
AM_CONDITIONAL(LINUX, [test "x$linux" = xyes])
AM_CONDITIONAL(FREEBSD, [test "x$freebsd" = xyes])
AM_CONDITIONAL(NETBSD, [test "x$netbsd" = xyes])
2007-06-06 15:01:25 -06:00
AM_CONDITIONAL(OPENBSD, [test "x$openbsd" = xyes])
2007-06-16 10:22:09 -06:00
AM_CONDITIONAL(SOLARIS, [test "x$solaris" = xyes])
AM_CONDITIONAL(GNU, [test "x$gnu" = xyes])
AC_SYS_LARGEFILE
2007-06-05 14:08:56 -06:00
AC_CHECK_HEADERS([err.h])
AC_CHECK_HEADER([asm/mtrr.h], [have_mtrr_h="yes"], [have_mtrr_h="no"])
if test "x$have_mtrr_h" = xyes; then
AC_DEFINE(HAVE_MTRR, 1, [Use MTRRs on mappings])
fi
# check for the pci_io.pi_sel.pc_domain
AC_CHECK_MEMBER([struct pci_io.pi_sel.pc_domain],
[AC_DEFINE(HAVE_PCI_IO_PC_DOMAIN,1,[Have the pci_io.pi_sel.pc_domain member.])],
[],
[ #include <sys/types.h>
#include <sys/pciio.h>
])
2007-06-05 14:08:56 -06:00
AC_SUBST(PCIACCESS_CFLAGS)
AC_SUBST(PCIACCESS_LIBS)
AC_CONFIG_FILES([Makefile
include/Makefile
man/Makefile
src/Makefile
scanpci/Makefile
pciaccess.pc])
AC_OUTPUT