blob: f5b16e8ab0e84acd562d63af8d31a47d385f8145 [file] [log] [blame]
Lucas De Marchiecd40ee2011-11-21 12:35:15 -02001AC_PREREQ(2.60)
Lucas De Marchi586fc302011-11-21 14:35:35 -02002AC_INIT([libkmod],
3 [0.1],
4 [],
5 [libkmod],
6 [http://git.profusion.mobi/cgit.cgi/lucas/libkmod/])
7
8AC_CONFIG_SRCDIR([libkmod/libkmod.c])
Lucas De Marchiecd40ee2011-11-21 12:35:15 -02009AC_CONFIG_AUX_DIR([build-aux])
Gustavo Sverzut Barbieri822ce232011-12-10 22:26:40 -020010AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax dist-bzip2 subdir-objects])
Lucas De Marchiecd40ee2011-11-21 12:35:15 -020011AC_PROG_CC_STDC
12AC_USE_SYSTEM_EXTENSIONS
13AC_SYS_LARGEFILE
14AC_CONFIG_MACRO_DIR([m4])
15AM_SILENT_RULES([yes])
16LT_INIT([disable-static pic-only])
17AC_PREFIX_DEFAULT([/usr])
18
Lucas De Marchi648a8422011-11-22 17:46:19 -020019AC_PROG_CC
20AC_PROG_CC_C99
21AC_C_TYPEOF
22AM_PROG_CC_C_O
23AC_PROG_GCC_TRADITIONAL
24
Gustavo Sverzut Barbieri72c51a92011-12-10 22:19:41 -020025AC_ARG_ENABLE([tools],
26 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
27 [], enable_tools=yes)
28AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
29
Lucas De Marchiecd40ee2011-11-21 12:35:15 -020030AC_ARG_ENABLE([logging],
31 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
32 [], enable_logging=yes)
33AS_IF([test "x$enable_logging" = "xyes"], [
34 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
35])
36
37AC_ARG_ENABLE([debug],
38 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
39 [], [enable_debug=no])
40AS_IF([test "x$enable_debug" = "xyes"], [
41 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
42])
43
Gustavo Sverzut Barbieri822ce232011-12-10 22:26:40 -020044CC_CHECK_CFLAGS_APPEND([ \
45 -pipe \
46 -Wall \
47 -W \
48 -Wextra \
49 -Wno-inline \
50 -Wvla \
51 -Wundef \
52 -Wformat=2 \
53 -Wlogical-op \
54 -Wsign-compare \
55 -Wformat-security \
56 -Wmissing-include-dirs \
57 -Wformat-nonliteral \
58 -Wold-style-definition \
59 -Wpointer-arith \
60 -Winit-self \
61 -Wdeclaration-after-statement \
62 -Wfloat-equal \
63 -Wmissing-prototypes \
64 -Wstrict-prototypes \
65 -Wredundant-decls \
66 -Wmissing-declarations \
67 -Wmissing-noreturn \
68 -Wshadow \
69 -Wendif-labels \
70 -Wcast-align \
71 -Wstrict-aliasing=2 \
72 -Wwrite-strings \
73 -Wno-long-long \
74 -Wno-overlength-strings \
75 -Wno-unused-parameter \
76 -Wno-missing-field-initializers \
77 -Wno-unused-result \
78 -Wp,-D_FORTIFY_SOURCE=2 \
79 -ffast-math \
80 -fno-common \
81 -fdiagnostics-show-option \
82 -fno-strict-aliasing \
83 -fvisibility=hidden \
84 -ffunction-sections \
85 -fdata-sections \
86 -Wl,--as-needed \
87 -Wl,--gc-sections])
88
89
Lucas De Marchiecd40ee2011-11-21 12:35:15 -020090AC_CONFIG_HEADERS(config.h)
91AC_CONFIG_FILES([
92 Makefile
Lucas De Marchi586fc302011-11-21 14:35:35 -020093 libkmod/libkmod.pc
Lucas De Marchiecd40ee2011-11-21 12:35:15 -020094])
95
96AC_OUTPUT
97AC_MSG_RESULT([
98 $PACKAGE $VERSION
99 ========
100
101 prefix: ${prefix}
102 sysconfdir: ${sysconfdir}
103 libdir: ${libdir}
104 includedir: ${includedir}
Gustavo Sverzut Barbieri72c51a92011-12-10 22:19:41 -0200105 bindir: ${bindir}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200106
107 compiler: ${CC}
108 cflags: ${CFLAGS}
109 ldflags: ${LDFLAGS}
110
Gustavo Sverzut Barbieri72c51a92011-12-10 22:19:41 -0200111 tools: ${enable_tools}
Lucas De Marchiecd40ee2011-11-21 12:35:15 -0200112 logging: ${enable_logging}
113 debug: ${enable_debug}
114])