-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconfigure.ac
72 lines (57 loc) · 2.56 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# Copyright (C) 2012,2013 Simon Richter
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.67])
AC_INIT([librevisa], [0.0.20130812], [[email protected]])
AM_INIT_AUTOMAKE([1.10 foreign parallel-tests])
LT_INIT
# Initialize pkg-config.
# We require at least 0.22, as "Requires.private" behaviour changed there.
PKG_PROG_PKG_CONFIG([0.22])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_FILES([Makefile src/Makefile man/Makefile tests/Makefile
librevisa.pc])
# Checks for programs.
AC_PROG_CXX
AC_PROG_LIBTOOL
# Checks for libraries.
AC_CHECK_LIB([vxiclient], [create_link_1])
AC_CHECK_LIB([pthread], [pthread_create])
AC_CHECK_HEADERS([boost/regex.hpp], [], [AC_MSG_ERROR(You need the Boost libraries.)])
# This variable collects the pkg-config names of all detected libs.
# It is then used to construct the "Requires.private:" field in the
# librevisa.pc file.
LIBREVISA_PKGLIBS=""
PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.8],
[CXXFLAGS="$CXXFLAGS $libusb_CFLAGS";
LIBS="$LIBS $libusb_LIBS";
LIBREVISA_PKGLIBS="$LIBREVISA_PKGLIBS libusb-1.0";
WITH_USB=yes], [WITH_USB=no])
PKG_CHECK_MODULES([avahi_client], [avahi-client >= 0.6],
[CXXFLAGS="$CXXFLAGS $avahi_client_CFLAGS";
LIBS="$LIBS $avahi_client_LIBS";
LIBREVISA_PKGLIBS="$LIBREVISA_PKGLIBS avahi-client";
WITH_AVAHI=yes;
AC_DEFINE([WITH_AVAHI], [1], [AVAHI support])], [WITH_AVAHI=no])
AC_SUBST(LIBREVISA_PKGLIBS)
# Checks for header files.
AC_CHECK_HEADER([vxi.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AM_CONDITIONAL([WITH_USB], [test "x$WITH_USB" = "xyes"])
AM_CONDITIONAL([WITH_VXI], [test $ac_cv_lib_vxiclient_create_link_1 = yes -a $ac_cv_header_vxi_h = yes])
AM_CONDITIONAL([WITH_AVAHI], [test "x$WITH_AVAHI" = "xyes"])
AC_OUTPUT