blob: bbb4d1f43b0c65826ea7882abe073cee5754978d [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
Jan Engelhardt7b3a74f2011-12-24 04:45:22 +010030PKG_PROG_PKG_CONFIG
Gustavo Sverzut Barbieri3d8226e2011-12-16 16:08:53 -020031
Kay Sieversa308abe2011-12-20 17:58:05 +010032AC_ARG_WITH([rootprefix],
33 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
Lucas De Marchi0c5fad92011-12-20 16:52:21 -020034 [], [with_rootprefix=""])
Kay Sieversa308abe2011-12-20 17:58:05 +010035AC_SUBST([rootprefix], [$with_rootprefix])
36
Kay Sieverse79bf832011-12-22 15:40:24 +010037AC_ARG_WITH([rootlibdir],
38 AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
39 [], [with_rootlibdir=$libdir])
40AC_SUBST([rootlibdir], [$with_rootlibdir])
41
Gustavo Sverzut Barbieri72c51a92011-12-10 22:19:41 -020042AC_ARG_ENABLE([tools],
43 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
44 [], enable_tools=yes)
45AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
46
Lucas De Marchiecd40ee2011-11-21 12:35:15 -020047AC_ARG_ENABLE([logging],
48 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
49 [], enable_logging=yes)
50AS_IF([test "x$enable_logging" = "xyes"], [
51 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
52])
53
Jan Engelhardtb182f8f2011-12-24 14:58:30 +010054AC_ARG_WITH([xz],
55 AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]),
56 [], [with_xz=no])
57AS_IF([test "x$with_xz" != "xno"], [
58 PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99])
59 AC_DEFINE([ENABLE_XZ], [1], [Enable Xz for modules.])
60], [
61 AC_MSG_NOTICE([Xz support not requested])
62])
63
Jan Engelhardt5a51a352011-12-24 04:45:42 +010064AC_ARG_WITH([zlib],
65 AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]),
66 [], [with_zlib=no])
67AS_IF([test "x$with_zlib" != "xno"], [
Jan Engelhardt7b3a74f2011-12-24 04:45:22 +010068 PKG_CHECK_MODULES([zlib], [zlib])
69 AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.])
Lucas De Marchicfb908b2011-12-23 12:03:19 -020070], [
71 AC_MSG_NOTICE([zlib support not requested])
Lucas De Marchicfb908b2011-12-23 12:03:19 -020072])
Gustavo Sverzut Barbieri3d8226e2011-12-16 16:08:53 -020073
Lucas De Marchiecd40ee2011-11-21 12:35:15 -020074AC_ARG_ENABLE([debug],
75 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
76 [], [enable_debug=no])
77AS_IF([test "x$enable_debug" = "xyes"], [
78 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
79])
80
Gustavo Sverzut Barbieri822ce232011-12-10 22:26:40 -020081CC_CHECK_CFLAGS_APPEND([ \
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -020082 -pipe \
Lucas De Marchi769becb2011-12-22 03:50:54 -020083 -DANOTHER_BRICK_IN_THE \
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -020084 -Wall \
85 -W \
86 -Wextra \
87 -Wno-inline \
88 -Wvla \
89 -Wundef \
90 -Wformat=2 \
91 -Wlogical-op \
92 -Wsign-compare \
93 -Wformat-security \
94 -Wmissing-include-dirs \
95 -Wformat-nonliteral \
96 -Wold-style-definition \
97 -Wpointer-arith \
98 -Winit-self \
99 -Wdeclaration-after-statement \
100 -Wfloat-equal \
101 -Wmissing-prototypes \
102 -Wstrict-prototypes \
103 -Wredundant-decls \
104 -Wmissing-declarations \
105 -Wmissing-noreturn \
106 -Wshadow \
107 -Wendif-labels \
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -0200108 -Wstrict-aliasing=2 \
109 -Wwrite-strings \
110 -Wno-long-long \
111 -Wno-overlength-strings \
112 -Wno-unused-parameter \
113 -Wno-missing-field-initializers \
114 -Wno-unused-result \
115 -Wnested-externs \
116 -Wchar-subscripts \
117 -Wtype-limits \
118 -Wuninitialized \
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -0200119 -fno-common \
120 -fdiagnostics-show-option \
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -0200121 -fvisibility=hidden \
122 -ffunction-sections \
123 -fdata-sections \
124 -Wl,--as-needed \
125 -Wl,--gc-sections])
Gustavo Sverzut Barbieri822ce232011-12-10 22:26:40 -0200126
127
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200128AC_CONFIG_HEADERS(config.h)
129AC_CONFIG_FILES([
130 Makefile
Lucas De Marchi646b83b2012-01-09 04:20:55 -0200131 libkmod/docs/Makefile
132 libkmod/docs/version.xml
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200133])
134
Lucas De Marchi646b83b2012-01-09 04:20:55 -0200135GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat])
136
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200137AC_OUTPUT
138AC_MSG_RESULT([
139 $PACKAGE $VERSION
140 ========
141
142 prefix: ${prefix}
Kay Sieversa308abe2011-12-20 17:58:05 +0100143 rootprefix: ${rootprefix}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200144 sysconfdir: ${sysconfdir}
145 libdir: ${libdir}
Kay Sieverse79bf832011-12-22 15:40:24 +0100146 rootlibdir: ${rootlibdir}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200147 includedir: ${includedir}
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -0200148 bindir: ${bindir}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200149
150 compiler: ${CC}
151 cflags: ${CFLAGS}
152 ldflags: ${LDFLAGS}
153
Lucas De Marchi7c41c2d2011-12-12 13:39:07 -0200154 tools: ${enable_tools}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200155 logging: ${enable_logging}
Jan Engelhardtb182f8f2011-12-24 14:58:30 +0100156 compression: xz=${with_xz} zlib=${with_zlib}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200157 debug: ${enable_debug}
Lucas De Marchi646b83b2012-01-09 04:20:55 -0200158 doc: ${enable_gtk_doc}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200159])