OSDN Git Service

config: replace deprecated AC_HELP_STRING with AS_HELP_STRING
[android-x86/external-libpciaccess.git] / configure.ac
1 dnl (C) Copyright IBM Corporation 2006
2 dnl All Rights Reserved.
3 dnl
4 dnl Permission is hereby granted, free of charge, to any person obtaining a
5 dnl copy of this software and associated documentation files (the "Software"),
6 dnl to deal in the Software without restriction, including without limitation
7 dnl on the rights to use, copy, modify, merge, publish, distribute, sub
8 dnl license, and/or sell copies of the Software, and to permit persons to whom
9 dnl the Software is furnished to do so, subject to the following conditions:
10 dnl
11 dnl The above copyright notice and this permission notice (including the next
12 dnl paragraph) shall be included in all copies or substantial portions of the
13 dnl Software.
14 dnl
15 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 dnl FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
18 dnl IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 dnl DEALINGS IN THE SOFTWARE.
22 dnl
23 dnl Process this file with autoconf to create configure.
24
25 # Initialize Autoconf
26 AC_PREREQ([2.60])
27 AC_INIT([libpciaccess],[0.12.0],
28         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess],[libpciaccess])
29 AC_CONFIG_SRCDIR([Makefile.am])
30 AC_CONFIG_HEADERS([config.h])
31
32 # Initialize Automake
33 AM_INIT_AUTOMAKE([foreign dist-bzip2])
34 AM_MAINTAINER_MODE
35
36 # Require xorg-macros: XORG_DEFAULT_OPTIONS
37 m4_ifndef([XORG_MACROS_VERSION],
38           [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
39 XORG_MACROS_VERSION(1.3)
40 XORG_DEFAULT_OPTIONS
41
42 # Check for progs
43 AC_PROG_LIBTOOL
44
45 pciids_path=/usr/share/hwdata
46 AC_ARG_WITH(pciids-path, AS_HELP_STRING([--with-pciids-path=PCIIDS_PATH],
47         [Path to pci.ids file]), [pciids_path="$withval"])
48 AX_DEFINE_DIR(PCIIDS_PATH, pciids_path, [Path to pci.ids])
49
50 AC_ARG_ENABLE(linux-rom-fallback, AS_HELP_STRING([--enable-linux-rom-fallback],
51                 [Enable support for falling back to /dev/mem for roms (default: disabled)]),
52                 [LINUX_ROM=$enableval],[LINUX_ROM=no])
53
54 if test "x$LINUX_ROM" = xyes; then
55         AC_DEFINE(LINUX_ROM, 1, [Linux ROM read fallback])
56 fi
57
58 use_zlib=no
59 AC_ARG_WITH(zlib, AS_HELP_STRING([--with-zlib],
60         [Enable zlib support to read gzip compressed pci.ids]),
61         [use_zlib="$withval"])
62 if test "x$use_zlib" = xyes; then
63         AC_CHECK_LIB(z, gzopen,
64         [PCIACCESS_LIBS="$PCIACCESS_LIBS -lz"],
65         [AC_MSG_ERROR(Check for zlib library failed)])
66         AC_CHECK_HEADER([zlib.h],
67         [AC_DEFINE(HAVE_ZLIB, 1, [Use zlib to read gzip compressed pci.ids])],
68         [AC_MSG_ERROR(Check for zlib.h header file failed)])
69 fi
70
71 case $host_os in
72         *freebsd* | *dragonfly*)
73                 freebsd=yes
74                 ;;
75         *linux*)
76                 linux=yes
77                 ;;
78         *netbsd*)
79                 case $host in
80                 *i386*)
81                         PCIACCESS_LIBS="-li386"
82                         ;;
83                 *x86_64*|*amd64*)
84                         PCIACCESS_LIBS="-lx86_64"
85                         ;;
86                 esac
87                 netbsd=yes
88                 ;;
89         *openbsd*)
90                 openbsd=yes
91                 ;;
92         *solaris*)
93                 solaris=yes
94                 PCIACCESS_LIBS="$PCIACCESS_LIBS -ldevinfo"
95                 ;;
96         gnu*)
97                 gnu=yes
98                 ;;
99 esac
100
101 AM_CONDITIONAL(LINUX, [test "x$linux" = xyes])
102 AM_CONDITIONAL(FREEBSD, [test "x$freebsd" = xyes])
103 AM_CONDITIONAL(NETBSD, [test "x$netbsd" = xyes])
104 AM_CONDITIONAL(OPENBSD, [test "x$openbsd" = xyes])
105 AM_CONDITIONAL(SOLARIS, [test "x$solaris" = xyes])
106 AM_CONDITIONAL(GNU, [test "x$gnu" = xyes])
107
108 AC_SYS_LARGEFILE
109
110 AC_CHECK_HEADER([asm/mtrr.h], [have_mtrr_h="yes"], [have_mtrr_h="no"])
111
112 if test "x$have_mtrr_h" = xyes; then
113     AC_DEFINE(HAVE_MTRR, 1, [Use MTRRs on mappings])
114 fi
115
116 dnl check for the pci_io.pi_sel.pc_domain
117 AC_CHECK_MEMBER([struct pci_io.pi_sel.pc_domain],
118                [AC_DEFINE(HAVE_PCI_IO_PC_DOMAIN,1,[Have the pci_io.pi_sel.pc_domain member.])],
119                [],
120                [ #include <sys/types.h>
121                  #include <sys/pciio.h>
122                ])
123
124 AC_SUBST(PCIACCESS_CFLAGS)
125 AC_SUBST(PCIACCESS_LIBS)
126                   
127
128 AC_CONFIG_FILES([Makefile
129            include/Makefile
130            man/Makefile
131            src/Makefile
132            scanpci/Makefile
133            pciaccess.pc])
134 AC_OUTPUT