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 |
Jan Engelhardt | 7b3a74f | 2011-12-24 04:45:22 +0100 | [diff] [blame] | 30 | PKG_PROG_PKG_CONFIG |
Gustavo Sverzut Barbieri | 3d8226e | 2011-12-16 16:08:53 -0200 | [diff] [blame] | 31 | |
Kay Sievers | a308abe | 2011-12-20 17:58:05 +0100 | [diff] [blame] | 32 | AC_ARG_WITH([rootprefix], |
| 33 | 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] | 34 | [], [with_rootprefix=""]) |
Kay Sievers | a308abe | 2011-12-20 17:58:05 +0100 | [diff] [blame] | 35 | AC_SUBST([rootprefix], [$with_rootprefix]) |
| 36 | |
Kay Sievers | e79bf83 | 2011-12-22 15:40:24 +0100 | [diff] [blame] | 37 | AC_ARG_WITH([rootlibdir], |
| 38 | AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]), |
| 39 | [], [with_rootlibdir=$libdir]) |
| 40 | AC_SUBST([rootlibdir], [$with_rootlibdir]) |
| 41 | |
Gustavo Sverzut Barbieri | 72c51a9 | 2011-12-10 22:19:41 -0200 | [diff] [blame] | 42 | AC_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) |
| 45 | AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"]) |
| 46 | |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 47 | AC_ARG_ENABLE([logging], |
| 48 | AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]), |
| 49 | [], enable_logging=yes) |
| 50 | AS_IF([test "x$enable_logging" = "xyes"], [ |
| 51 | AC_DEFINE(ENABLE_LOGGING, [1], [System logging.]) |
| 52 | ]) |
| 53 | |
Jan Engelhardt | b182f8f | 2011-12-24 14:58:30 +0100 | [diff] [blame^] | 54 | AC_ARG_WITH([xz], |
| 55 | AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]), |
| 56 | [], [with_xz=no]) |
| 57 | AS_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 Engelhardt | 5a51a35 | 2011-12-24 04:45:42 +0100 | [diff] [blame] | 64 | AC_ARG_WITH([zlib], |
| 65 | AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]), |
| 66 | [], [with_zlib=no]) |
| 67 | AS_IF([test "x$with_zlib" != "xno"], [ |
Jan Engelhardt | 7b3a74f | 2011-12-24 04:45:22 +0100 | [diff] [blame] | 68 | PKG_CHECK_MODULES([zlib], [zlib]) |
| 69 | AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.]) |
Lucas De Marchi | cfb908b | 2011-12-23 12:03:19 -0200 | [diff] [blame] | 70 | ], [ |
| 71 | AC_MSG_NOTICE([zlib support not requested]) |
Lucas De Marchi | cfb908b | 2011-12-23 12:03:19 -0200 | [diff] [blame] | 72 | ]) |
Gustavo Sverzut Barbieri | 3d8226e | 2011-12-16 16:08:53 -0200 | [diff] [blame] | 73 | |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 74 | AC_ARG_ENABLE([debug], |
| 75 | AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]), |
| 76 | [], [enable_debug=no]) |
| 77 | AS_IF([test "x$enable_debug" = "xyes"], [ |
| 78 | AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.]) |
| 79 | ]) |
| 80 | |
Gustavo Sverzut Barbieri | 822ce23 | 2011-12-10 22:26:40 -0200 | [diff] [blame] | 81 | CC_CHECK_CFLAGS_APPEND([ \ |
Lucas De Marchi | 7c41c2d | 2011-12-12 13:39:07 -0200 | [diff] [blame] | 82 | -pipe \ |
Lucas De Marchi | 769becb | 2011-12-22 03:50:54 -0200 | [diff] [blame] | 83 | -DANOTHER_BRICK_IN_THE \ |
Lucas De Marchi | 7c41c2d | 2011-12-12 13:39:07 -0200 | [diff] [blame] | 84 | -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 Marchi | 7c41c2d | 2011-12-12 13:39:07 -0200 | [diff] [blame] | 108 | -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 Marchi | 7c41c2d | 2011-12-12 13:39:07 -0200 | [diff] [blame] | 119 | -fno-common \ |
| 120 | -fdiagnostics-show-option \ |
Lucas De Marchi | 7c41c2d | 2011-12-12 13:39:07 -0200 | [diff] [blame] | 121 | -fvisibility=hidden \ |
| 122 | -ffunction-sections \ |
| 123 | -fdata-sections \ |
| 124 | -Wl,--as-needed \ |
| 125 | -Wl,--gc-sections]) |
Gustavo Sverzut Barbieri | 822ce23 | 2011-12-10 22:26:40 -0200 | [diff] [blame] | 126 | |
| 127 | |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 128 | AC_CONFIG_HEADERS(config.h) |
| 129 | AC_CONFIG_FILES([ |
| 130 | Makefile |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 131 | ]) |
| 132 | |
| 133 | AC_OUTPUT |
| 134 | AC_MSG_RESULT([ |
| 135 | $PACKAGE $VERSION |
| 136 | ======== |
| 137 | |
| 138 | prefix: ${prefix} |
Kay Sievers | a308abe | 2011-12-20 17:58:05 +0100 | [diff] [blame] | 139 | rootprefix: ${rootprefix} |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 140 | sysconfdir: ${sysconfdir} |
| 141 | libdir: ${libdir} |
Kay Sievers | e79bf83 | 2011-12-22 15:40:24 +0100 | [diff] [blame] | 142 | rootlibdir: ${rootlibdir} |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 143 | includedir: ${includedir} |
Lucas De Marchi | 7c41c2d | 2011-12-12 13:39:07 -0200 | [diff] [blame] | 144 | bindir: ${bindir} |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 145 | |
| 146 | compiler: ${CC} |
| 147 | cflags: ${CFLAGS} |
| 148 | ldflags: ${LDFLAGS} |
| 149 | |
Lucas De Marchi | 7c41c2d | 2011-12-12 13:39:07 -0200 | [diff] [blame] | 150 | tools: ${enable_tools} |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 151 | logging: ${enable_logging} |
Jan Engelhardt | b182f8f | 2011-12-24 14:58:30 +0100 | [diff] [blame^] | 152 | compression: xz=${with_xz} zlib=${with_zlib} |
Lucas De Marchi | ecd40ee | 2011-11-21 12:35:15 -0200 | [diff] [blame] | 153 | debug: ${enable_debug} |
| 154 | ]) |