Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 1 | AC_PREREQ(2.60) |
Lucas De Marchi | cb48c9b | 2011-12-12 16:41:38 -0200 | [diff] [blame] | 2 | AC_INIT([kmod], |
Lucas De Marchi | acc18b1 | 2011-12-20 23:48:46 -0200 | [diff] [blame] | 3 | [2], |
Lucas De Marchi | e17cc3a | 2011-12-16 04:11:25 -0200 | [diff] [blame] | 4 | [linux-modules@vger.kernel.org], |
Lucas De Marchi | cb48c9b | 2011-12-12 16:41:38 -0200 | [diff] [blame] | 5 | [kmod], |
| 6 | [http://git.profusion.mobi/cgit.cgi/kmod.git/]) |
Lucas De Marchi | 586fc30 | 2011-11-21 14:35:35 -0200 | [diff] [blame] | 7 | |
| 8 | AC_CONFIG_SRCDIR([libkmod/libkmod.c]) |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 9 | AC_CONFIG_AUX_DIR([build-aux]) |
Jan Engelhardt | a597c8b | 2011-12-20 16:28:27 +0100 | [diff] [blame] | 10 | AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules |
| 11 | tar-pax no-dist-gzip dist-xz subdir-objects]) |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 12 | AC_PROG_CC_STDC |
| 13 | AC_USE_SYSTEM_EXTENSIONS |
| 14 | AC_SYS_LARGEFILE |
| 15 | AC_CONFIG_MACRO_DIR([m4]) |
Luis Felipe Strano Moraes | fe8bf3b | 2011-12-14 15:56:10 -0200 | [diff] [blame] | 16 | m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])]) |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 17 | AM_SILENT_RULES([yes]) |
| 18 | LT_INIT([disable-static pic-only]) |
| 19 | AC_PREFIX_DEFAULT([/usr]) |
| 20 | |
Lucas De Marchi | 648a842 | 2011-11-22 17:46:19 -0200 | [diff] [blame] | 21 | AC_PROG_CC |
| 22 | AC_PROG_CC_C99 |
| 23 | AC_C_TYPEOF |
| 24 | AM_PROG_CC_C_O |
| 25 | AC_PROG_GCC_TRADITIONAL |
Gustavo Sverzut Barbieri | 708624a | 2011-12-18 01:25:06 -0200 | [diff] [blame] | 26 | AC_C_BIGENDIAN |
Lucas De Marchi | 648a842 | 2011-11-22 17:46:19 -0200 | [diff] [blame] | 27 | |
Kay Sievers | 9faa7b3 | 2011-12-21 11:48:07 -0200 | [diff] [blame] | 28 | AC_PROG_SED |
| 29 | AC_PROG_MKDIR_P |
| 30 | |
Gustavo Sverzut Barbieri | 3d8226e | 2011-12-16 16:08:53 -0200 | [diff] [blame] | 31 | required_private_libs="" |
| 32 | |
Kay Sievers | a308abe | 2011-12-20 17:58:05 +0100 | [diff] [blame] | 33 | AC_ARG_WITH([rootprefix], |
| 34 | AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]), |
Lucas De Marchi | 0c5fad9 | 2011-12-20 16:52:21 -0200 | [diff] [blame] | 35 | [], [with_rootprefix=""]) |
Kay Sievers | a308abe | 2011-12-20 17:58:05 +0100 | [diff] [blame] | 36 | AC_SUBST([rootprefix], [$with_rootprefix]) |
| 37 | |
Gustavo Sverzut Barbieri | 72c51a9 | 2011-12-10 22:19:41 -0200 | [diff] [blame] | 38 | AC_ARG_ENABLE([tools], |
| 39 | AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]), |
| 40 | [], enable_tools=yes) |
| 41 | AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"]) |
| 42 | |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 43 | AC_ARG_ENABLE([logging], |
| 44 | AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]), |
| 45 | [], enable_logging=yes) |
| 46 | AS_IF([test "x$enable_logging" = "xyes"], [ |
| 47 | AC_DEFINE(ENABLE_LOGGING, [1], [System logging.]) |
| 48 | ]) |
| 49 | |
Gustavo Sverzut Barbieri | 3d8226e | 2011-12-16 16:08:53 -0200 | [diff] [blame] | 50 | AC_ARG_ENABLE([zlib], |
Gustavo Sverzut Barbieri | 1e48278 | 2011-12-20 16:30:01 -0200 | [diff] [blame] | 51 | AS_HELP_STRING([--enable-zlib], [handle gzipped modules @<:@default=disabled@:>@]), |
Gustavo Sverzut Barbieri | 3d8226e | 2011-12-16 16:08:53 -0200 | [diff] [blame] | 52 | [], enable_zlib=no) |
Gustavo Sverzut Barbieri | 1e48278 | 2011-12-20 16:30:01 -0200 | [diff] [blame] | 53 | if test "x$enable_zlib" != "xno"; then |
Gustavo Sverzut Barbieri | 3d8226e | 2011-12-16 16:08:53 -0200 | [diff] [blame] | 54 | AC_CHECK_LIB([z], [gzopen], |
| 55 | [ |
| 56 | zlib_libs="-lz" |
| 57 | required_private_libs="${required_private_libs} ${zlib_libs}" |
| 58 | ], |
Gustavo Sverzut Barbieri | 1e48278 | 2011-12-20 16:30:01 -0200 | [diff] [blame] | 59 | [AC_MSG_ERROR([zlib is not present])]) |
Gustavo Sverzut Barbieri | 3d8226e | 2011-12-16 16:08:53 -0200 | [diff] [blame] | 60 | else |
| 61 | AC_MSG_NOTICE([zlib support not requested]) |
| 62 | zlib_libs="" |
| 63 | fi |
| 64 | if test "x$zlib_libs" != "x"; then |
| 65 | AC_DEFINE(ENABLE_ZLIB, [1], [Enable zlib for modules.]) |
| 66 | fi |
| 67 | AC_SUBST(zlib_libs) |
| 68 | |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 69 | AC_ARG_ENABLE([debug], |
| 70 | AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]), |
| 71 | [], [enable_debug=no]) |
| 72 | AS_IF([test "x$enable_debug" = "xyes"], [ |
| 73 | AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.]) |
| 74 | ]) |
| 75 | |
Gustavo Sverzut Barbieri | 822ce23 | 2011-12-10 22:26:40 -0200 | [diff] [blame] | 76 | CC_CHECK_CFLAGS_APPEND([ \ |
Lucas De Marchi | 7c41c2d | 2011-12-12 13:39:07 -0200 | [diff] [blame] | 77 | -pipe \ |
| 78 | -Wall \ |
| 79 | -W \ |
| 80 | -Wextra \ |
| 81 | -Wno-inline \ |
| 82 | -Wvla \ |
| 83 | -Wundef \ |
| 84 | -Wformat=2 \ |
| 85 | -Wlogical-op \ |
| 86 | -Wsign-compare \ |
| 87 | -Wformat-security \ |
| 88 | -Wmissing-include-dirs \ |
| 89 | -Wformat-nonliteral \ |
| 90 | -Wold-style-definition \ |
| 91 | -Wpointer-arith \ |
| 92 | -Winit-self \ |
| 93 | -Wdeclaration-after-statement \ |
| 94 | -Wfloat-equal \ |
| 95 | -Wmissing-prototypes \ |
| 96 | -Wstrict-prototypes \ |
| 97 | -Wredundant-decls \ |
| 98 | -Wmissing-declarations \ |
| 99 | -Wmissing-noreturn \ |
| 100 | -Wshadow \ |
| 101 | -Wendif-labels \ |
Lucas De Marchi | 7c41c2d | 2011-12-12 13:39:07 -0200 | [diff] [blame] | 102 | -Wstrict-aliasing=2 \ |
| 103 | -Wwrite-strings \ |
| 104 | -Wno-long-long \ |
| 105 | -Wno-overlength-strings \ |
| 106 | -Wno-unused-parameter \ |
| 107 | -Wno-missing-field-initializers \ |
| 108 | -Wno-unused-result \ |
| 109 | -Wnested-externs \ |
| 110 | -Wchar-subscripts \ |
| 111 | -Wtype-limits \ |
| 112 | -Wuninitialized \ |
Lucas De Marchi | 7c41c2d | 2011-12-12 13:39:07 -0200 | [diff] [blame] | 113 | -fno-common \ |
| 114 | -fdiagnostics-show-option \ |
Lucas De Marchi | 7c41c2d | 2011-12-12 13:39:07 -0200 | [diff] [blame] | 115 | -fvisibility=hidden \ |
| 116 | -ffunction-sections \ |
| 117 | -fdata-sections \ |
| 118 | -Wl,--as-needed \ |
| 119 | -Wl,--gc-sections]) |
Gustavo Sverzut Barbieri | 822ce23 | 2011-12-10 22:26:40 -0200 | [diff] [blame] | 120 | |
| 121 | |
Gustavo Sverzut Barbieri | 3d8226e | 2011-12-16 16:08:53 -0200 | [diff] [blame] | 122 | AC_SUBST(required_private_libs) |
| 123 | |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 124 | AC_CONFIG_HEADERS(config.h) |
| 125 | AC_CONFIG_FILES([ |
| 126 | Makefile |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 127 | ]) |
| 128 | |
| 129 | AC_OUTPUT |
| 130 | AC_MSG_RESULT([ |
| 131 | $PACKAGE $VERSION |
| 132 | ======== |
| 133 | |
| 134 | prefix: ${prefix} |
Kay Sievers | a308abe | 2011-12-20 17:58:05 +0100 | [diff] [blame] | 135 | rootprefix: ${rootprefix} |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 136 | sysconfdir: ${sysconfdir} |
| 137 | libdir: ${libdir} |
| 138 | includedir: ${includedir} |
Lucas De Marchi | 7c41c2d | 2011-12-12 13:39:07 -0200 | [diff] [blame] | 139 | bindir: ${bindir} |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 140 | |
| 141 | compiler: ${CC} |
| 142 | cflags: ${CFLAGS} |
| 143 | ldflags: ${LDFLAGS} |
| 144 | |
Lucas De Marchi | 7c41c2d | 2011-12-12 13:39:07 -0200 | [diff] [blame] | 145 | tools: ${enable_tools} |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 146 | logging: ${enable_logging} |
Gustavo Sverzut Barbieri | 3d8226e | 2011-12-16 16:08:53 -0200 | [diff] [blame] | 147 | zlib: ${enable_zlib} |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 148 | debug: ${enable_debug} |
| 149 | ]) |