attach_to_bridge(): Improve error message.
[micoforia.git] / configure.ac
1 # SPDX-License-Identifier: GPL-2.0-only
2
3 AC_PREREQ([2.61])
4 # only for configure -h, see Makefile
5 AC_INIT([software], [packages])
6 AC_CONFIG_HEADERS([config.h])
7 AC_CONFIG_FILES([config.mak])
8 AC_USE_SYSTEM_EXTENSIONS
9 AC_PROG_CC
10 AC_PROG_CPP
11
12 AC_DEFUN([REQUIRE_EXECUTABLE], [
13         AC_PATH_PROG(m4_toupper([$1]), [$1])
14         test -z "$m4_toupper([$1])" && AC_MSG_ERROR([$2])
15 ])
16 REQUIRE_EXECUTABLE([m4], [m4 is required to build this package])
17
18 AC_DEFUN([LOPSUB_NOT_FOUND], [
19 The lopsub library is required to build this software, but the checks
20 indicate it is not installed on your system.  Run the following
21 command to download a copy.
22         git clone git://git.tuebingen.mpg.de/lopsub.git
23 Install the library, then run this configure script again.
24
25 If you installed lopsub at a non-standard location, make sure to set
26 PATH, CPPFLAGS and LDFLAGS accordingly. For example:
27
28         pfx=/prefix/where/lopsub/is/installed
29         export PATH=\$pfx/bin:\$PATH
30         export CPPFLAGS=-I\$pfx/include
31         export LDFLAGS=-L\$pfx/lib
32 ])
33 REQUIRE_EXECUTABLE([lopsubgen], [LOPSUB_NOT_FOUND()])
34 AC_CHECK_HEADER(lopsub.h, [], [AC_MSG_ERROR([LOPSUB_NOT_FOUND()])])
35 AC_CHECK_LIB([lopsub], [lls_merge], [], [AC_MSG_ERROR([LOPSUB_NOT_FOUND()])])
36
37 AC_DEFUN([LIBCAP_NOT_FOUND], [the libcap library is required to build dnl
38 this software. Package: libcap-dev])
39 AC_CHECK_HEADER([sys/capability.h], [], [AC_MSG_ERROR([LIBCAP_NOT_FOUND()])])
40 AC_CHECK_LIB([cap], [cap_from_text], [], [AC_MSG_ERROR([LIBCAP_NOT_FOUND()])])
41
42 AC_DEFUN([LIBMNL_NOT_FOUND], [the libmnl library is required to build dnl
43 this software. Package: libmnl-dev])
44 AC_CHECK_HEADER([libmnl/libmnl.h], [], [AC_MSG_ERROR([LIBMNL_NOT_FOUND()])])
45 AC_CHECK_LIB([mnl], [mnl_socket_open], [], [AC_MSG_ERROR([LIBMNL_NOT_FOUND()])])
46
47 AC_OUTPUT