blob: 812f4abb0f5b675715c4965769a6b7067c8008b7 [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
Lucas De Marchiecd40ee2011-11-21 12:35:15 -020025AC_ARG_ENABLE([logging],
26 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
27 [], enable_logging=yes)
28AS_IF([test "x$enable_logging" = "xyes"], [
29 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
30])
31
32AC_ARG_ENABLE([debug],
33 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
34 [], [enable_debug=no])
35AS_IF([test "x$enable_debug" = "xyes"], [
36 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
37])
38
Gustavo Sverzut Barbieri822ce232011-12-10 22:26:40 -020039CC_CHECK_CFLAGS_APPEND([ \
40 -pipe \
41 -Wall \
42 -W \
43 -Wextra \
44 -Wno-inline \
45 -Wvla \
46 -Wundef \
47 -Wformat=2 \
48 -Wlogical-op \
49 -Wsign-compare \
50 -Wformat-security \
51 -Wmissing-include-dirs \
52 -Wformat-nonliteral \
53 -Wold-style-definition \
54 -Wpointer-arith \
55 -Winit-self \
56 -Wdeclaration-after-statement \
57 -Wfloat-equal \
58 -Wmissing-prototypes \
59 -Wstrict-prototypes \
60 -Wredundant-decls \
61 -Wmissing-declarations \
62 -Wmissing-noreturn \
63 -Wshadow \
64 -Wendif-labels \
65 -Wcast-align \
66 -Wstrict-aliasing=2 \
67 -Wwrite-strings \
68 -Wno-long-long \
69 -Wno-overlength-strings \
70 -Wno-unused-parameter \
71 -Wno-missing-field-initializers \
72 -Wno-unused-result \
73 -Wp,-D_FORTIFY_SOURCE=2 \
74 -ffast-math \
75 -fno-common \
76 -fdiagnostics-show-option \
77 -fno-strict-aliasing \
78 -fvisibility=hidden \
79 -ffunction-sections \
80 -fdata-sections \
81 -Wl,--as-needed \
82 -Wl,--gc-sections])
83
84
Lucas De Marchiecd40ee2011-11-21 12:35:15 -020085AC_CONFIG_HEADERS(config.h)
86AC_CONFIG_FILES([
87 Makefile
Lucas De Marchi586fc302011-11-21 14:35:35 -020088 libkmod/libkmod.pc
Lucas De Marchiecd40ee2011-11-21 12:35:15 -020089])
90
91AC_OUTPUT
92AC_MSG_RESULT([
93 $PACKAGE $VERSION
94 ========
95
96 prefix: ${prefix}
97 sysconfdir: ${sysconfdir}
98 libdir: ${libdir}
99 includedir: ${includedir}
100
101 compiler: ${CC}
102 cflags: ${CFLAGS}
103 ldflags: ${LDFLAGS}
104
105 logging: ${enable_logging}
106 debug: ${enable_debug}
107])