-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
100 lines (84 loc) · 3.28 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# ------------------------------------------------------------------------------
# versions
AC_PREREQ([2.64])
AC_INIT([firmwared],
[1],
[http://www.github.com/teg/firmwared/issues],
[firmwared],
[http://www.github.com/teg/firmwared])
# ------------------------------------------------------------------------------
# autotools
AC_CONFIG_SRCDIR([src/firmwared.c])
AC_CONFIG_MACRO_DIR([build/m4])
AC_CONFIG_HEADERS([build/config.h])
AC_CONFIG_AUX_DIR([build/build-aux])
# suppress conflicting defaults
CFLAGS=${CFLAGS:-""}
CXXFLAGS=${CXXFLAGS:-""}
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AM_MAINTAINER_MODE([enable])
AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects parallel-tests])
AM_SILENT_RULES([yes])
AC_CANONICAL_HOST
AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
AC_PROG_CC_C99
AC_PROG_RANLIB
AC_PROG_SED
AC_PROG_LN_S
m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
# ------------------------------------------------------------------------------
have_libudev=no
PKG_CHECK_MODULES(LIBUDEV, [ libudev ],
[AC_DEFINE(HAVE_LIBUDEV, 1, [Define if libudev is available]) have_libudev=yes], have_libudev=no)
if test "x$have_libudev" = xno; then
AC_MSG_ERROR([*** libudev support required but libraries not found])
fi
AM_CONDITIONAL(HAVE_LIBUDEV, [test "$have_libmount" = "yes"])
# ------------------------------------------------------------------------------
AC_ARG_ENABLE(test-runner,
AC_HELP_STRING([--disable-test-runner], [build test-runner for testing]),
[enable_test_runner=${enableval}])
if test "x$enable_test_runner" != xno; then
have_glib=no
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.28 gio-2.0,
[AC_DEFINE(HAVE_GLIB, 1, [Define if libglib is available]) have_glib=yes], have_glib=no)
if test "x$have_glib" = xno; then
AC_MSG_ERROR([*** libglib support required but libraries not found])
fi
fi
AM_CONDITIONAL(TEST_RUNNER, [test "x$enable_test_runner" != "xno"])
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
# ------------------------------------------------------------------------------
AC_ARG_WITH(firmware-path,
AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
[Firmware search path (default="/lib/firmware/updates:/lib/firmware")]),
[], [with_firmware_path="/lib/firmware/updates:/lib/firmware"])
OLD_IFS=$IFS
IFS=:
for i in $with_firmware_path; do
if test "x${FIRMWARE_PATH}" = "x"; then
FIRMWARE_PATH="\\\"${i}/\\\""
else
FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\""
fi
done
IFS=$OLD_IFS
AC_SUBST(FIRMWARE_PATH)
# ------------------------------------------------------------------------------
# report
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE_NAME $VERSION
firmware_path: ${FIRMWARE_PATH}
libudev: ${have_libudev}
prefix: ${prefix}
exec_prefix: ${exec_prefix}
includedir: ${includedir}
libdir: ${libdir}
CFLAGS: ${CFLAGS}
CPPFLAGS: ${CPPFLAGS}
LDFLAGS: ${LDFLAGS}
])