AC_PREREQ(2.60)
AC_INIT([kmod],
- [14],
+ [19],
[linux-modules@vger.kernel.org],
[kmod],
[http://git.kernel.org/?p=utils/kernel/kmod/kmod.git])
AM_SILENT_RULES([yes])
LT_INIT([disable-static pic-only])
AC_PREFIX_DEFAULT([/usr])
+AM_MAINTAINER_MODE([enable])
AS_IF([test "x$enable_static" = "xyes"],
[AC_MSG_ERROR([--enable-static is not supported by kmod])])
AC_PROG_CC
AC_PROG_CC_C99
-AC_C_TYPEOF
AM_PROG_CC_C_O
AC_PROG_GCC_TRADITIONAL
AC_C_BIGENDIAN
AC_PROG_SED
AC_PROG_MKDIR_P
PKG_PROG_PKG_CONFIG
+AC_PATH_PROG([XSLTPROC], [xsltproc])
#####################################################################
# dietlibc doesn't have st.st_mtim struct member
AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
+# musl 1.0 and bionic 4.4 don't have strndupa
+AC_CHECK_DECLS_ONCE([strndupa])
+
+# RHEL 5 and older do not have be32toh
+AC_CHECK_DECLS_ONCE([be32toh])
+
# Check kernel headers
AC_CHECK_HEADERS_ONCE([linux/module.h])
+AC_MSG_CHECKING([whether _Static_assert() is supported])
+AC_COMPILE_IFELSE(
+ [AC_LANG_SOURCE([[_Static_assert(1, "Test");]])],
+ [AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define if _Static_assert() is available])
+ AC_MSG_RESULT([yes])],
+ [AC_MSG_RESULT([no])])
#####################################################################
# --with-
AC_MSG_NOTICE([zlib support not requested])
])
+AC_ARG_WITH([bashcompletiondir],
+ AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
+ [],
+ [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
+ with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
+ ] , [
+ with_bashcompletiondir=${datadir}/bash-completion/completions
+ ])])
+AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
#####################################################################
# --enable-
AS_HELP_STRING([--disable-manpages], [disable manpages @<:@default=enabled@:>@]),
[], enable_manpages=yes)
AM_CONDITIONAL([BUILD_MANPAGES], [test "x$enable_manpages" = "xyes"])
-AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
-AS_IF([test "x$XSLTPROC" = "xno" && test "x$enable_manpages" = "xyes"], [
- AC_MSG_ERROR([xsltproc command not found, try ./configure --disable-manpages])
-])
AC_ARG_ENABLE([logging],
AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
])
+AC_ARG_ENABLE([python],
+ AS_HELP_STRING([--enable-python], [enable Python libkmod bindings @<:@default=disabled@:>@]),
+ [], [enable_python=no])
+AS_IF([test "x$enable_python" = "xyes"], [
+ AM_PATH_PYTHON(,,[:])
+ AC_PATH_PROG([CYTHON], [cython], [:])
+
+ PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}],
+ [have_python=yes],
+ [PKG_CHECK_MODULES([PYTHON], [python],
+ [have_python=yes],
+ [have_python=no])])
+
+ AS_IF([test "x$have_python" = xno],
+ [AC_MSG_ERROR([*** python support requested but libraries not found])])
+])
+AM_CONDITIONAL([BUILD_PYTHON], [test "x$enable_python" = "xyes"])
+
m4_ifdef([GTK_DOC_CHECK], [
GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat])
], [
-Wmissing-noreturn \
-Wshadow \
-Wendif-labels \
- -Wstrict-aliasing=2 \
+ -Wstrict-aliasing=3 \
-Wwrite-strings \
-Wno-long-long \
-Wno-overlength-strings \
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE $VERSION
- ======
+ =======
prefix: ${prefix}
sysconfdir: ${sysconfdir}
rootlibdir: ${rootlibdir}
includedir: ${includedir}
bindir: ${bindir}
+ Bash completions dir: ${with_bashcompletiondir}
compiler: ${CC}
cflags: ${with_cflags} ${CFLAGS}
ldflags: ${with_ldflags} ${LDFLAGS}
tools: ${enable_tools}
+ python bindings: ${enable_python}
logging: ${enable_logging}
compression: xz=${with_xz} zlib=${with_zlib}
debug: ${enable_debug}