blob: fe2e8f1f1e7b8c5a3ff4764ea23288d618764bee [file] [log] [blame]
Lucas De Marchiecd40ee2011-11-21 12:35:15 -02001AC_PREREQ(2.60)
Lucas De Marchicb48c9b2011-12-12 16:41:38 -02002AC_INIT([kmod],
Lucas De Marchib30a71b2012-01-04 22:27:58 -02003 [3],
Lucas De Marchie17cc3a2011-12-16 04:11:25 -02004 [linux-modules@vger.kernel.org],
Lucas De Marchicb48c9b2011-12-12 16:41:38 -02005 [kmod],
6 [http://git.profusion.mobi/cgit.cgi/kmod.git/])
Lucas De Marchi586fc302011-11-21 14:35:35 -02007
8AC_CONFIG_SRCDIR([libkmod/libkmod.c])
Lucas De Marchiecd40ee2011-11-21 12:35:15 -02009AC_CONFIG_AUX_DIR([build-aux])
Jan Engelhardta597c8b2011-12-20 16:28:27 +010010AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules
11 tar-pax no-dist-gzip dist-xz subdir-objects])
Lucas De Marchiecd40ee2011-11-21 12:35:15 -020012AC_PROG_CC_STDC
13AC_USE_SYSTEM_EXTENSIONS
14AC_SYS_LARGEFILE
15AC_CONFIG_MACRO_DIR([m4])
Luis Felipe Strano Moraesfe8bf3b2011-12-14 15:56:10 -020016m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
Lucas De Marchiecd40ee2011-11-21 12:35:15 -020017AM_SILENT_RULES([yes])
18LT_INIT([disable-static pic-only])
19AC_PREFIX_DEFAULT([/usr])
20
Lucas De Marchi648a8422011-11-22 17:46:19 -020021AC_PROG_CC
22AC_PROG_CC_C99
23AC_C_TYPEOF
24AM_PROG_CC_C_O
25AC_PROG_GCC_TRADITIONAL
Gustavo Sverzut Barbieri708624a2011-12-18 01:25:06 -020026AC_C_BIGENDIAN
Lucas De Marchi648a8422011-11-22 17:46:19 -020027
Kay Sievers9faa7b32011-12-21 11:48:07 -020028AC_PROG_SED
29AC_PROG_MKDIR_P
Lucas De Marchi904b57d2012-01-12 11:48:21 -020030AC_PATH_PROG([XSLTPROC], [xsltproc])
Jan Engelhardt7b3a74f2011-12-24 04:45:22 +010031PKG_PROG_PKG_CONFIG
Gustavo Sverzut Barbieri3d8226e2011-12-16 16:08:53 -020032
Kay Sieversa308abe2011-12-20 17:58:05 +010033AC_ARG_WITH([rootprefix],
34 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
Lucas De Marchi0c5fad92011-12-20 16:52:21 -020035 [], [with_rootprefix=""])
Kay Sieversa308abe2011-12-20 17:58:05 +010036AC_SUBST([rootprefix], [$with_rootprefix])
37
Kay Sieverse79bf832011-12-22 15:40:24 +010038AC_ARG_WITH([rootlibdir],
39 AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
40 [], [with_rootlibdir=$libdir])
41AC_SUBST([rootlibdir], [$with_rootlibdir])
42
Gustavo Sverzut Barbieri72c51a92011-12-10 22:19:41 -020043AC_ARG_ENABLE([tools],
44 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
45 [], enable_tools=yes)
46AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
47
Lucas De Marchiecd40ee2011-11-21 12:35:15 -020048AC_ARG_ENABLE([logging],
49 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
50 [], enable_logging=yes)
51AS_IF([test "x$enable_logging" = "xyes"], [
52 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
53])
54
Jan Engelhardtb182f8f2011-12-24 14:58:30 +010055AC_ARG_WITH([xz],
56 AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]),
57 [], [with_xz=no])
58AS_IF([test "x$with_xz" != "xno"], [
59 PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99])
60 AC_DEFINE([ENABLE_XZ], [1], [Enable Xz for modules.])
61], [
62 AC_MSG_NOTICE([Xz support not requested])
63])
64
Jan Engelhardt5a51a352011-12-24 04:45:42 +010065AC_ARG_WITH([zlib],
66 AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]),
67 [], [with_zlib=no])
68AS_IF([test "x$with_zlib" != "xno"], [
Jan Engelhardt7b3a74f2011-12-24 04:45:22 +010069 PKG_CHECK_MODULES([zlib], [zlib])
70 AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.])
Lucas De Marchicfb908b2011-12-23 12:03:19 -020071], [
72 AC_MSG_NOTICE([zlib support not requested])
Lucas De Marchicfb908b2011-12-23 12:03:19 -020073])
Gustavo Sverzut Barbieri3d8226e2011-12-16 16:08:53 -020074
Lucas De Marchiecd40ee2011-11-21 12:35:15 -020075AC_ARG_ENABLE([debug],
76 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
77 [], [enable_debug=no])
78AS_IF([test "x$enable_debug" = "xyes"], [
79 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
80])
81
Gustavo Sverzut Barbieri822ce232011-12-10 22:26:40 -020082CC_CHECK_CFLAGS_APPEND([ \
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -020083 -pipe \
Lucas De Marchi769becb2011-12-22 03:50:54 -020084 -DANOTHER_BRICK_IN_THE \
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -020085 -Wall \
86 -W \
87 -Wextra \
88 -Wno-inline \
89 -Wvla \
90 -Wundef \
91 -Wformat=2 \
92 -Wlogical-op \
93 -Wsign-compare \
94 -Wformat-security \
95 -Wmissing-include-dirs \
96 -Wformat-nonliteral \
97 -Wold-style-definition \
98 -Wpointer-arith \
99 -Winit-self \
100 -Wdeclaration-after-statement \
101 -Wfloat-equal \
102 -Wmissing-prototypes \
103 -Wstrict-prototypes \
104 -Wredundant-decls \
105 -Wmissing-declarations \
106 -Wmissing-noreturn \
107 -Wshadow \
108 -Wendif-labels \
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -0200109 -Wstrict-aliasing=2 \
110 -Wwrite-strings \
111 -Wno-long-long \
112 -Wno-overlength-strings \
113 -Wno-unused-parameter \
114 -Wno-missing-field-initializers \
115 -Wno-unused-result \
116 -Wnested-externs \
117 -Wchar-subscripts \
118 -Wtype-limits \
119 -Wuninitialized \
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -0200120 -fno-common \
121 -fdiagnostics-show-option \
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -0200122 -fvisibility=hidden \
123 -ffunction-sections \
124 -fdata-sections \
125 -Wl,--as-needed \
126 -Wl,--gc-sections])
Gustavo Sverzut Barbieri822ce232011-12-10 22:26:40 -0200127
128
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200129AC_CONFIG_HEADERS(config.h)
130AC_CONFIG_FILES([
131 Makefile
Lucas De Marchi904b57d2012-01-12 11:48:21 -0200132 man/Makefile
Lucas De Marchi646b83b2012-01-09 04:20:55 -0200133 libkmod/docs/Makefile
134 libkmod/docs/version.xml
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200135])
136
Lucas De Marchi4fb900c2012-01-10 12:55:13 -0200137m4_ifdef([GTK_DOC_CHECK], [
Lucas De Marchi646b83b2012-01-09 04:20:55 -0200138GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat])
Lucas De Marchi4fb900c2012-01-10 12:55:13 -0200139], [
140AM_CONDITIONAL([ENABLE_GTK_DOC], false)])
Lucas De Marchi646b83b2012-01-09 04:20:55 -0200141
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200142AC_OUTPUT
143AC_MSG_RESULT([
144 $PACKAGE $VERSION
Lucas De Marchi63dc8322012-01-09 13:00:28 -0200145 ======
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200146
147 prefix: ${prefix}
Kay Sieversa308abe2011-12-20 17:58:05 +0100148 rootprefix: ${rootprefix}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200149 sysconfdir: ${sysconfdir}
150 libdir: ${libdir}
Kay Sieverse79bf832011-12-22 15:40:24 +0100151 rootlibdir: ${rootlibdir}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200152 includedir: ${includedir}
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -0200153 bindir: ${bindir}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200154
155 compiler: ${CC}
156 cflags: ${CFLAGS}
157 ldflags: ${LDFLAGS}
158
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -0200159 tools: ${enable_tools}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200160 logging: ${enable_logging}
Jan Engelhardtb182f8f2011-12-24 14:58:30 +0100161 compression: xz=${with_xz} zlib=${with_zlib}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200162 debug: ${enable_debug}
Lucas De Marchi646b83b2012-01-09 04:20:55 -0200163 doc: ${enable_gtk_doc}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200164])