configure.ac revision aac5f4514f71d04ac3dcb8b923209781895d7ff2
1ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAC_PREREQ(2.60)
2cb48c9b2e611251c68bd0b8f349312330310f644Lucas De MarchiAC_INIT([kmod],
3f9e2167b10a25f2894a49fe5033348086758d172Lucas De Marchi	[19],
4e17cc3afccc46bf89a3a6f2568f9d630fd91e366Lucas De Marchi	[linux-modules@vger.kernel.org],
5cb48c9b2e611251c68bd0b8f349312330310f644Lucas De Marchi	[kmod],
6bb05bc8ac139449c3fda63e16ba8e3f45d5f290eLucas De Marchi	[http://git.kernel.org/?p=utils/kernel/kmod/kmod.git])
7586fc304d85b2a31ae764377b4ddfb64cc9f221cLucas De Marchi
8586fc304d85b2a31ae764377b4ddfb64cc9f221cLucas De MarchiAC_CONFIG_SRCDIR([libkmod/libkmod.c])
9ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAC_CONFIG_AUX_DIR([build-aux])
10a597c8bbf5dcd490fb0ba701d6e0fb1e66cd91f5Jan EngelhardtAM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules
118edd5bb292fb128148191648a3f266027d3b56d8Lucas De Marchi	tar-pax no-dist-gzip dist-xz subdir-objects color-tests parallel-tests])
12ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAC_PROG_CC_STDC
13ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAC_USE_SYSTEM_EXTENSIONS
14ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAC_SYS_LARGEFILE
15ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAC_CONFIG_MACRO_DIR([m4])
16fe8bf3b0092b6cf86081be57e2b2a74d3ea3b0eaLuis Felipe Strano Moraesm4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
17ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAM_SILENT_RULES([yes])
18ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiLT_INIT([disable-static pic-only])
19ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAC_PREFIX_DEFAULT([/usr])
20f5cc26c77d2f332a9b40f51f0ec72e95711edf1eAnders OlofssonAM_MAINTAINER_MODE([enable])
21ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi
22b7016153ec87dba2b0f0d182cc8f1e3b12f4dfafLucas De MarchiAS_IF([test "x$enable_static" = "xyes"],
23b7016153ec87dba2b0f0d182cc8f1e3b12f4dfafLucas De Marchi      [AC_MSG_ERROR([--enable-static is not supported by kmod])])
24b7016153ec87dba2b0f0d182cc8f1e3b12f4dfafLucas De Marchi
25b7016153ec87dba2b0f0d182cc8f1e3b12f4dfafLucas De Marchi
263ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi#####################################################################
273ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi# Program checks and configurations
283ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi#####################################################################
293ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
30648a842bfdb8b3b37122581aebdc9328d2fdfc60Lucas De MarchiAC_PROG_CC
31648a842bfdb8b3b37122581aebdc9328d2fdfc60Lucas De MarchiAC_PROG_CC_C99
32648a842bfdb8b3b37122581aebdc9328d2fdfc60Lucas De MarchiAM_PROG_CC_C_O
33648a842bfdb8b3b37122581aebdc9328d2fdfc60Lucas De MarchiAC_PROG_GCC_TRADITIONAL
34708624a4ebffc515da2f9e2fdbdce79fc9c0aaafGustavo Sverzut BarbieriAC_C_BIGENDIAN
35648a842bfdb8b3b37122581aebdc9328d2fdfc60Lucas De Marchi
369faa7b376c1e1a48d8763829bab0ac4f0b924b01Kay SieversAC_PROG_SED
379faa7b376c1e1a48d8763829bab0ac4f0b924b01Kay SieversAC_PROG_MKDIR_P
387b3a74fc67993e6fb85918ec8c2f71c90903a4d4Jan EngelhardtPKG_PROG_PKG_CONFIG
39bccb4b2545a409a909d2ad1bc19a73300ae07c49Lucas De MarchiAC_PATH_PROG([XSLTPROC], [xsltproc])
403d8226edfea12b951f6e257b087ec7453135ed10Gustavo Sverzut Barbieri
413ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
423ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi#####################################################################
433ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi# Function and structure checks
443ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi#####################################################################
453ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
46d005aeb7529ab690c7b7119f0ef545e2c07a1ceaLucas De MarchiAC_CHECK_FUNCS_ONCE(__xstat)
4741a51c2af915bc99851446cf604fac99eca1848fCristian RodríguezAC_CHECK_FUNCS_ONCE([__secure_getenv secure_getenv])
4855112d19f7067dff89b1481d5bd8cc49139c4ecbLucas De MarchiAC_CHECK_FUNCS_ONCE([finit_module])
49d005aeb7529ab690c7b7119f0ef545e2c07a1ceaLucas De Marchi
50e6307200af74d1556466522216e8ae77b7c8b843Lucas De MarchiCC_CHECK_FUNC_BUILTIN([__builtin_clz])
51e6307200af74d1556466522216e8ae77b7c8b843Lucas De MarchiCC_CHECK_FUNC_BUILTIN([__builtin_types_compatible_p])
52aac5f4514f71d04ac3dcb8b923209781895d7ff2Lucas De MarchiCC_CHECK_FUNC_BUILTIN([__builtin_uaddl_overflow], [ ], [ ])
53aac5f4514f71d04ac3dcb8b923209781895d7ff2Lucas De MarchiCC_CHECK_FUNC_BUILTIN([__builtin_uaddll_overflow], [ ], [ ])
54e6307200af74d1556466522216e8ae77b7c8b843Lucas De Marchi
553ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi# dietlibc doesn't have st.st_mtim struct member
563ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De MarchiAC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
573ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
5804c0956e207e3b27a700494f8dc77f902cd53731Lucas De Marchi# musl 1.0 and bionic 4.4 don't have strndupa
5904c0956e207e3b27a700494f8dc77f902cd53731Lucas De MarchiAC_CHECK_DECLS_ONCE([strndupa])
6004c0956e207e3b27a700494f8dc77f902cd53731Lucas De Marchi
619b34db1ae63427269f918b2868b4cfcb50e6259bRandy MacLeod# RHEL 5 and older do not have be32toh
629b34db1ae63427269f918b2868b4cfcb50e6259bRandy MacLeodAC_CHECK_DECLS_ONCE([be32toh])
639b34db1ae63427269f918b2868b4cfcb50e6259bRandy MacLeod
64144d1826f1a0fcd6cc59c4535f0a8145163c640cKees Cook# Check kernel headers
65144d1826f1a0fcd6cc59c4535f0a8145163c640cKees CookAC_CHECK_HEADERS_ONCE([linux/module.h])
66144d1826f1a0fcd6cc59c4535f0a8145163c640cKees Cook
67dc8ed09f8f21d17ef9481001683d7edfdb308983Thomas PetazzoniAC_MSG_CHECKING([whether _Static_assert() is supported])
68dc8ed09f8f21d17ef9481001683d7edfdb308983Thomas PetazzoniAC_COMPILE_IFELSE(
69dc8ed09f8f21d17ef9481001683d7edfdb308983Thomas Petazzoni	[AC_LANG_SOURCE([[_Static_assert(1, "Test");]])],
70dc8ed09f8f21d17ef9481001683d7edfdb308983Thomas Petazzoni        [AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define if _Static_assert() is available])
71dc8ed09f8f21d17ef9481001683d7edfdb308983Thomas Petazzoni	 AC_MSG_RESULT([yes])],
72dc8ed09f8f21d17ef9481001683d7edfdb308983Thomas Petazzoni	[AC_MSG_RESULT([no])])
733ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
743ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi#####################################################################
753ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi# --with-
763ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi#####################################################################
773ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
78e79bf83b0648a44585dc5960f7022a9a8f4ab40cKay SieversAC_ARG_WITH([rootlibdir],
79e79bf83b0648a44585dc5960f7022a9a8f4ab40cKay Sievers        AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
80e79bf83b0648a44585dc5960f7022a9a8f4ab40cKay Sievers        [], [with_rootlibdir=$libdir])
81e79bf83b0648a44585dc5960f7022a9a8f4ab40cKay SieversAC_SUBST([rootlibdir], [$with_rootlibdir])
82e79bf83b0648a44585dc5960f7022a9a8f4ab40cKay Sievers
83b182f8fb5e5765dd5c935aa7b3775e382662b318Jan EngelhardtAC_ARG_WITH([xz],
84b182f8fb5e5765dd5c935aa7b3775e382662b318Jan Engelhardt	AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]),
85b182f8fb5e5765dd5c935aa7b3775e382662b318Jan Engelhardt	[], [with_xz=no])
86b182f8fb5e5765dd5c935aa7b3775e382662b318Jan EngelhardtAS_IF([test "x$with_xz" != "xno"], [
87b182f8fb5e5765dd5c935aa7b3775e382662b318Jan Engelhardt	PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99])
88b182f8fb5e5765dd5c935aa7b3775e382662b318Jan Engelhardt	AC_DEFINE([ENABLE_XZ], [1], [Enable Xz for modules.])
89b182f8fb5e5765dd5c935aa7b3775e382662b318Jan Engelhardt], [
90b182f8fb5e5765dd5c935aa7b3775e382662b318Jan Engelhardt	AC_MSG_NOTICE([Xz support not requested])
91b182f8fb5e5765dd5c935aa7b3775e382662b318Jan Engelhardt])
92b182f8fb5e5765dd5c935aa7b3775e382662b318Jan Engelhardt
935a51a357a8fad00582631592969f6d410228b8a7Jan EngelhardtAC_ARG_WITH([zlib],
945a51a357a8fad00582631592969f6d410228b8a7Jan Engelhardt	AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]),
955a51a357a8fad00582631592969f6d410228b8a7Jan Engelhardt	[], [with_zlib=no])
965a51a357a8fad00582631592969f6d410228b8a7Jan EngelhardtAS_IF([test "x$with_zlib" != "xno"], [
977b3a74fc67993e6fb85918ec8c2f71c90903a4d4Jan Engelhardt	PKG_CHECK_MODULES([zlib], [zlib])
987b3a74fc67993e6fb85918ec8c2f71c90903a4d4Jan Engelhardt	AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.])
99cfb908bf660871f9475b485806e004ddcc5ced18Lucas De Marchi], [
100cfb908bf660871f9475b485806e004ddcc5ced18Lucas De Marchi	AC_MSG_NOTICE([zlib support not requested])
101cfb908bf660871f9475b485806e004ddcc5ced18Lucas De Marchi])
1023d8226edfea12b951f6e257b087ec7453135ed10Gustavo Sverzut Barbieri
10380cf2c8f05813b04a5479746ce3ddaef00ea240dLucas De MarchiAC_ARG_WITH([bashcompletiondir],
10480cf2c8f05813b04a5479746ce3ddaef00ea240dLucas De Marchi	AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
10580cf2c8f05813b04a5479746ce3ddaef00ea240dLucas De Marchi	[],
10680cf2c8f05813b04a5479746ce3ddaef00ea240dLucas De Marchi	[AS_IF([$($PKG_CONFIG --exists bash-completion)], [
10780cf2c8f05813b04a5479746ce3ddaef00ea240dLucas De Marchi		with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
10880cf2c8f05813b04a5479746ce3ddaef00ea240dLucas De Marchi	] , [
10980cf2c8f05813b04a5479746ce3ddaef00ea240dLucas De Marchi		with_bashcompletiondir=${datadir}/bash-completion/completions
11080cf2c8f05813b04a5479746ce3ddaef00ea240dLucas De Marchi	])])
11180cf2c8f05813b04a5479746ce3ddaef00ea240dLucas De MarchiAC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
1123ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
1133ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi#####################################################################
1143ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi# --enable-
1153ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi#####################################################################
1163ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
1173ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De MarchiAC_ARG_ENABLE([tools],
1183ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi        AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
1193ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi	[], enable_tools=yes)
1203ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De MarchiAM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
1213ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
1228631552d3d48092932c6fb93baa6e38fb3ca951aColin WaltersAC_ARG_ENABLE([manpages],
1238631552d3d48092932c6fb93baa6e38fb3ca951aColin Walters        AS_HELP_STRING([--disable-manpages], [disable manpages @<:@default=enabled@:>@]),
1248631552d3d48092932c6fb93baa6e38fb3ca951aColin Walters	[], enable_manpages=yes)
1258631552d3d48092932c6fb93baa6e38fb3ca951aColin WaltersAM_CONDITIONAL([BUILD_MANPAGES], [test "x$enable_manpages" = "xyes"])
1268631552d3d48092932c6fb93baa6e38fb3ca951aColin Walters
1273ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De MarchiAC_ARG_ENABLE([logging],
1283ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi	AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
1293ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi	[], enable_logging=yes)
1303ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De MarchiAS_IF([test "x$enable_logging" = "xyes"], [
1313ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi	AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
1323ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi])
1333ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
134ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAC_ARG_ENABLE([debug],
135ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi	AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
136ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi	[], [enable_debug=no])
137ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAS_IF([test "x$enable_debug" = "xyes"], [
138ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi	AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
139ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi])
140ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi
1413a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De MarchiAC_ARG_ENABLE([python],
1423a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi	AS_HELP_STRING([--enable-python], [enable Python libkmod bindings @<:@default=disabled@:>@]),
1433a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi	[], [enable_python=no])
1443a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De MarchiAS_IF([test "x$enable_python" = "xyes"], [
1453a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi	AM_PATH_PYTHON(,,[:])
1463a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi	AC_PATH_PROG([CYTHON], [cython], [:])
1473a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi
1483a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi	PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}],
1493a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi			  [have_python=yes],
1503a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi			  [PKG_CHECK_MODULES([PYTHON], [python],
1513a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi					     [have_python=yes],
1523a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi					     [have_python=no])])
1533a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi
1543a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi	AS_IF([test "x$have_python" = xno],
1553a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi	      [AC_MSG_ERROR([*** python support requested but libraries not found])])
1563a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi])
1573a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De MarchiAM_CONDITIONAL([BUILD_PYTHON], [test "x$enable_python" = "xyes"])
1583a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi
159e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De MarchiAC_ARG_ENABLE([coverage],
160e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi	AS_HELP_STRING([--enable-coverage], [enable test coverage @<:@default=disabled@:>@]),
161e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi	[], [enable_coverage=no])
162e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De MarchiAS_IF([test "x$enable_coverage" = "xyes"], [
163e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi	AC_CHECK_PROG(have_coverage, [lcov], [yes], [no])
164e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi	AS_IF([test "x$have_coverage" = xno],[
165e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi		AC_MSG_ERROR([*** lcov support requested but the program was not found])
166e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi	], [
167e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi		lcov_version_major="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 1`"
168e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi		lcov_version_minor="`lcov --version | cut -d ' ' -f 4 | cut -d '.' -f 2`"
169e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi		AS_IF([test "$lcov_version_major" -lt 1 -o "$lcov_version_minor" -lt 10], [
170e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi			AC_MSG_ERROR([*** lcov version is too old. 1.10 required])
171e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi		], [
172e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi			have_coverage=yes
173e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi                        CC_CHECK_FLAGS_APPEND([with_coverage_cflags], [CFLAGS], [\
174e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi                        -fprofile-arcs \
175e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi                        -ftest-coverage])
176e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi		])
177e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi        ])
178e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi])
179e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De MarchiAM_CONDITIONAL([ENABLE_COVERAGE], [test "x$enable_coverage" = "xyes"])
180e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi
1813ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchim4_ifdef([GTK_DOC_CHECK], [
1823ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De MarchiGTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat])
1833ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi], [
1843ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De MarchiAM_CONDITIONAL([ENABLE_GTK_DOC], false)])
1853ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
1863ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
1873ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi#####################################################################
1883ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi# Default CFLAGS and LDFLAGS
1893ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi#####################################################################
1906068aaaea8e7cdc6039e6fd7a1aeab9db9d0225bLucas De Marchi
191e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De MarchiCC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\
192e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -pipe \
193e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -DANOTHER_BRICK_IN_THE \
194e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wall \
195e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -W \
196e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wextra \
197e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wno-inline \
198e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wvla \
199e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wundef \
200e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wformat=2 \
201e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wlogical-op \
202e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wsign-compare \
203e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wformat-security \
204e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wmissing-include-dirs \
205e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wformat-nonliteral \
206e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wold-style-definition \
207e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wpointer-arith \
208e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Winit-self \
209e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wdeclaration-after-statement \
210e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wfloat-equal \
211e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wmissing-prototypes \
212e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wstrict-prototypes \
213e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wredundant-decls \
214e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wmissing-declarations \
215e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wmissing-noreturn \
216e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wshadow \
217e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wendif-labels \
218db62153ea0beedbc6941e1d438c0b6e7189e78d9Lucas De Marchi		       -Wstrict-aliasing=3 \
219e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wwrite-strings \
220e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wno-long-long \
221e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wno-overlength-strings \
222e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wno-unused-parameter \
223e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wno-missing-field-initializers \
224e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wno-unused-result \
225e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wnested-externs \
226e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wchar-subscripts \
227e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wtype-limits \
228e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wuninitialized \
229e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -fno-common \
230e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -fdiagnostics-show-option \
231e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -fvisibility=hidden \
232e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -ffunction-sections \
233e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -fdata-sections])
23427bcc9111b63e94d091c3fa47e81fe52b806cd3eLucas De MarchiAC_SUBST([OUR_CFLAGS], "$with_cflags $with_coverage_cflags")
235e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi
236c677bf2c7d4c6b4390dcc5739aec55aecb0cd62eLucas De Marchi
237e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De MarchiCC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [ \
238e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wl,--as-needed \
239a5f799af9819876c5d1dc9d77dc3ee9f12171b65Lucas De Marchi		       -Wl,--no-undefined \
240e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi		       -Wl,--gc-sections])
24184aaaedfa6295ebe1f24b114b35ab0f53c138bbdLucas De MarchiAC_SUBST([OUR_LDFLAGS], $with_ldflags)
2423ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
2433ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi#####################################################################
2443ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi# Generate files from *.in
2453ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi#####################################################################
2463ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
247ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAC_CONFIG_HEADERS(config.h)
248ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAC_CONFIG_FILES([
249ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi	Makefile
250904b57d022b0187bc5c6eeeacf2d5bf566ca8881Lucas De Marchi	man/Makefile
251646b83b841a4591d00223cda14ce1530ec4dbd39Lucas De Marchi	libkmod/docs/Makefile
252646b83b841a4591d00223cda14ce1530ec4dbd39Lucas De Marchi	libkmod/docs/version.xml
253ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi])
254ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi
2553ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi
2563ef7208ecfa2fb3edc0d3f6344811e686907c94cLucas De Marchi#####################################################################
257646b83b841a4591d00223cda14ce1530ec4dbd39Lucas De Marchi
258ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAC_OUTPUT
259ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De MarchiAC_MSG_RESULT([
260ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi	$PACKAGE $VERSION
26180cf2c8f05813b04a5479746ce3ddaef00ea240dLucas De Marchi	=======
262ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi
263ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi	prefix:			${prefix}
264ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi	sysconfdir:		${sysconfdir}
265ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi	libdir:			${libdir}
266e79bf83b0648a44585dc5960f7022a9a8f4ab40cKay Sievers	rootlibdir:		${rootlibdir}
267ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi	includedir:		${includedir}
2687c41c2dd8c1357d10cdee912c43614fa47c8d4ecLucas De Marchi	bindir:			${bindir}
26980cf2c8f05813b04a5479746ce3ddaef00ea240dLucas De Marchi	Bash completions dir:   ${with_bashcompletiondir}
270ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi
271ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi	compiler:		${CC}
272e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi	cflags:			${with_cflags} ${CFLAGS}
273e48f37657dc03aee9aace60bf14ef9af489bf47cLucas De Marchi	ldflags:		${with_ldflags} ${LDFLAGS}
274ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi
2757c41c2dd8c1357d10cdee912c43614fa47c8d4ecLucas De Marchi	tools:			${enable_tools}
2763a33a7a566c221e13c426c0d2f3519ebe8f70a34Lucas De Marchi	python bindings:	${enable_python}
277ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi	logging:		${enable_logging}
278b182f8fb5e5765dd5c935aa7b3775e382662b318Jan Engelhardt	compression:		xz=${with_xz}  zlib=${with_zlib}
279ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi	debug:			${enable_debug}
280e9b0d1b40e645fd583f090601f4ae2a7926888a1Lucas De Marchi	coverage:		${enable_coverage}
281646b83b841a4591d00223cda14ce1530ec4dbd39Lucas De Marchi	doc:			${enable_gtk_doc}
282382de85c94ce6b057acc6e3513e314f34fef966bLucas De Marchi	man:			${enable_manpages}
283ecd40ee4992009e8b49f2f8088dd9ab896802ecLucas De Marchi])
284