]> git.ipfire.org Git - thirdparty/kmod.git/blame - configure.ac
build-sys: move remaining warning flags to configure
[thirdparty/kmod.git] / configure.ac
CommitLineData
ecd40ee4 1AC_PREREQ(2.60)
586fc304
LDM
2AC_INIT([libkmod],
3 [0.1],
4 [],
5 [libkmod],
6 [http://git.profusion.mobi/cgit.cgi/lucas/libkmod/])
7
8AC_CONFIG_SRCDIR([libkmod/libkmod.c])
ecd40ee4 9AC_CONFIG_AUX_DIR([build-aux])
822ce234 10AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax dist-bzip2 subdir-objects])
ecd40ee4
LDM
11AC_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
648a842b
LDM
19AC_PROG_CC
20AC_PROG_CC_C99
21AC_C_TYPEOF
22AM_PROG_CC_C_O
23AC_PROG_GCC_TRADITIONAL
24
72c51a9e
GSB
25AC_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
ecd40ee4
LDM
30AC_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
822ce234
GSB
44CC_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 \
1dcac911
LDM
78 -Wnested-externs \
79 -Wchar-subscripts \
80 -Wtype-limits \
81 -Wuninitialized \
822ce234
GSB
82 -Wp,-D_FORTIFY_SOURCE=2 \
83 -ffast-math \
84 -fno-common \
85 -fdiagnostics-show-option \
86 -fno-strict-aliasing \
87 -fvisibility=hidden \
88 -ffunction-sections \
89 -fdata-sections \
90 -Wl,--as-needed \
91 -Wl,--gc-sections])
92
93
ecd40ee4
LDM
94AC_CONFIG_HEADERS(config.h)
95AC_CONFIG_FILES([
96 Makefile
586fc304 97 libkmod/libkmod.pc
ecd40ee4
LDM
98])
99
100AC_OUTPUT
101AC_MSG_RESULT([
102 $PACKAGE $VERSION
103 ========
104
105 prefix: ${prefix}
106 sysconfdir: ${sysconfdir}
107 libdir: ${libdir}
108 includedir: ${includedir}
72c51a9e 109 bindir: ${bindir}
ecd40ee4
LDM
110
111 compiler: ${CC}
112 cflags: ${CFLAGS}
113 ldflags: ${LDFLAGS}
114
72c51a9e 115 tools: ${enable_tools}
ecd40ee4
LDM
116 logging: ${enable_logging}
117 debug: ${enable_debug}
118])