Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1 | AC_INIT(version.h) |
Theodore Ts'o | 37cdbee | 2012-12-22 22:24:45 -0500 | [diff] [blame] | 2 | AC_PREREQ(2.54) |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 3 | AC_CONFIG_AUX_DIR(config) |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 4 | AC_CONFIG_HEADERS([lib/config.h]) |
Theodore Ts'o | c714d02 | 2014-01-30 18:48:23 -0500 | [diff] [blame] | 5 | AH_BOTTOM([#include <dirpaths.h>]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 6 | MCONFIG=./MCONFIG |
| 7 | AC_SUBST_FILE(MCONFIG) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 8 | BINARY_TYPE=bin |
| 9 | dnl |
| 10 | dnl This is to figure out the version number and the date.... |
| 11 | dnl |
| 12 | E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \ |
| 13 | | awk '{print $3}' | tr \" " " | awk '{print $1}'` |
| 14 | DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \ |
| 15 | | tr \" " "` |
Theodore Ts'o | bff0cc9 | 2003-03-23 01:37:53 -0500 | [diff] [blame] | 16 | E2FSPROGS_DAY=`echo $DATE | awk -F- '{print $1}'` |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 17 | MONTH=`echo $DATE | awk -F- '{print $2}'` |
| 18 | YEAR=`echo $DATE | awk -F- '{print $3}'` |
| 19 | |
Theodore Ts'o | 40fa8cc | 1999-01-09 05:06:02 +0000 | [diff] [blame] | 20 | if expr $YEAR ">" 1900 > /dev/null ; then |
| 21 | E2FSPROGS_YEAR=$YEAR |
| 22 | elif expr $YEAR ">" 90 >/dev/null ; then |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 23 | E2FSPROGS_YEAR=19$YEAR |
| 24 | else |
| 25 | E2FSPROGS_YEAR=20$YEAR |
| 26 | fi |
| 27 | |
| 28 | case $MONTH in |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 29 | Jan) MONTH_NUM=01; E2FSPROGS_MONTH="January" ;; |
| 30 | Feb) MONTH_NUM=02; E2FSPROGS_MONTH="February" ;; |
| 31 | Mar) MONTH_NUM=03; E2FSPROGS_MONTH="March" ;; |
| 32 | Apr) MONTH_NUM=04; E2FSPROGS_MONTH="April" ;; |
| 33 | May) MONTH_NUM=05; E2FSPROGS_MONTH="May" ;; |
| 34 | Jun) MONTH_NUM=06; E2FSPROGS_MONTH="June" ;; |
| 35 | Jul) MONTH_NUM=07; E2FSPROGS_MONTH="July" ;; |
| 36 | Aug) MONTH_NUM=08; E2FSPROGS_MONTH="August" ;; |
| 37 | Sep) MONTH_NUM=09; E2FSPROGS_MONTH="September" ;; |
| 38 | Oct) MONTH_NUM=10; E2FSPROGS_MONTH="October" ;; |
| 39 | Nov) MONTH_NUM=11; E2FSPROGS_MONTH="November" ;; |
| 40 | Dec) MONTH_NUM=12; E2FSPROGS_MONTH="December" ;; |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 41 | *) AC_MSG_WARN([Unknown month $MONTH??]) ;; |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 42 | esac |
| 43 | |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 44 | base_ver=`echo $E2FSPROGS_VERSION | \ |
| 45 | sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'` |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 46 | |
| 47 | date_spec=${E2FSPROGS_YEAR}.${MONTH_NUM}.${E2FSPROGS_DAY} |
| 48 | |
| 49 | case $E2FSPROGS_VERSION in |
| 50 | *-WIP|pre-*) |
Theodore Ts'o | ab06396 | 2008-07-07 16:07:43 -0400 | [diff] [blame] | 51 | E2FSPROGS_PKGVER="$base_ver~WIP-$E2FSPROGS_YEAR-$MONTH_NUM-$E2FSPROGS_DAY" |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 52 | ;; |
| 53 | *) |
| 54 | E2FSPROGS_PKGVER="$base_ver" |
| 55 | ;; |
| 56 | esac |
| 57 | |
| 58 | unset DATE MONTH YEAR base_ver pre_vers date_spec |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 59 | AC_MSG_RESULT([Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION]) |
| 60 | AC_MSG_RESULT([Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}]) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 61 | AC_SUBST(E2FSPROGS_YEAR) |
| 62 | AC_SUBST(E2FSPROGS_MONTH) |
Theodore Ts'o | bff0cc9 | 2003-03-23 01:37:53 -0500 | [diff] [blame] | 63 | AC_SUBST(E2FSPROGS_DAY) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 64 | AC_SUBST(E2FSPROGS_VERSION) |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 65 | AC_SUBST(E2FSPROGS_PKGVER) |
Theodore Ts'o | 57aa50d | 2009-11-26 10:38:04 -0500 | [diff] [blame] | 66 | dnl |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 67 | dnl Use diet libc |
| 68 | dnl |
Theodore Ts'o | eafba6c | 2008-07-10 10:21:42 -0400 | [diff] [blame] | 69 | WITH_DIET_LIBC= |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 70 | AC_ARG_WITH([diet-libc], |
Theodore Ts'o | 3249394 | 2007-12-31 10:45:01 -0500 | [diff] [blame] | 71 | [ --with-diet-libc use diet libc], |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 72 | CC="diet cc -nostdinc" |
Theodore Ts'o | eafba6c | 2008-07-10 10:21:42 -0400 | [diff] [blame] | 73 | WITH_DIET_LIBC=yes |
Theodore Ts'o | 6c59a66 | 2014-01-04 20:44:29 -0500 | [diff] [blame] | 74 | if test -z "$LIBS" |
| 75 | then |
| 76 | LIBS="-lcompat" |
| 77 | else |
| 78 | LIBS="$LIBS -lcompat" |
| 79 | fi |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 80 | AC_MSG_RESULT(CC=$CC))dnl |
| 81 | dnl |
Theodore Ts'o | 6c59a66 | 2014-01-04 20:44:29 -0500 | [diff] [blame] | 82 | AC_CANONICAL_HOST |
| 83 | dnl |
| 84 | dnl Check to see if libdl exists for the sake of dlopen |
| 85 | dnl |
| 86 | DLOPEN_LIB='' |
| 87 | AC_CHECK_LIB(dl, dlopen, |
| 88 | [DLOPEN_LIB=-ldl |
| 89 | AC_DEFINE(HAVE_DLOPEN, 1, [Define to 1 if dlopen/libdl exists])]) |
| 90 | AC_SUBST(DLOPEN_LIB) |
| 91 | dnl |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 92 | AC_ARG_WITH([cc], |
Theodore Ts'o | 0b5b9f9 | 2009-09-06 21:28:47 -0400 | [diff] [blame] | 93 | AC_HELP_STRING([--with-cc],[no longer supported, use CC= instead]), |
| 94 | AC_MSG_ERROR([--with-cc no longer supported; use CC= instead])) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 95 | dnl |
| 96 | AC_ARG_WITH([ccopts], |
Theodore Ts'o | 0b5b9f9 | 2009-09-06 21:28:47 -0400 | [diff] [blame] | 97 | AC_HELP_STRING([--with-ccopts],[no longer supported, use CFLAGS= instead]), |
| 98 | AC_MSG_ERROR([--with-ccopts no longer supported; use CFLAGS= instead])) |
| 99 | dnl |
| 100 | AC_ARG_WITH([ldopts], |
| 101 | AC_HELP_STRING([--with-ldopts],[no longer supported, use LDFLAGS= instead]), |
| 102 | AC_MSG_ERROR([--with-ldopts no longer supported; use LDFLAGS= instead])) |
| 103 | dnl |
| 104 | AC_PROG_CC |
Theodore Ts'o | 9b3018a | 2011-08-11 14:56:49 -0400 | [diff] [blame] | 105 | if test "$GCC" = yes; then |
| 106 | RDYNAMIC="-rdynamic" |
| 107 | AC_SUBST(RDYNAMIC) |
| 108 | fi |
Theodore Ts'o | 0b5b9f9 | 2009-09-06 21:28:47 -0400 | [diff] [blame] | 109 | AC_PROG_CPP |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 110 | dnl |
Matthias Andree | b1c92f9 | 2004-02-23 21:30:11 +0100 | [diff] [blame] | 111 | dnl Alpha computers use fast and imprecise floating point code that may |
| 112 | dnl miss exceptions by default. Force sane options if we're using GCC. |
| 113 | AC_MSG_CHECKING(for additional special compiler flags) |
| 114 | if test "$GCC" = yes |
| 115 | then |
| 116 | case "$host_cpu" in |
| 117 | alpha) addcflags="-mieee" ;; |
| 118 | esac |
| 119 | fi |
| 120 | if test "x$addcflags" != x |
| 121 | then |
| 122 | AC_MSG_RESULT($addcflags) |
| 123 | CFLAGS="$addcflags $CFLAGS" |
| 124 | else |
| 125 | AC_MSG_RESULT([[(none)]]) |
| 126 | fi |
Theodore Ts'o | 9361395 | 2014-07-03 23:44:13 -0400 | [diff] [blame] | 127 | AC_USE_SYSTEM_EXTENSIONS |
Matthias Andree | b1c92f9 | 2004-02-23 21:30:11 +0100 | [diff] [blame] | 128 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 129 | dnl Set default values for library extentions. Will be dealt with after |
| 130 | dnl parsing configuration opions, which may modify these |
| 131 | dnl |
| 132 | LIB_EXT=.a |
| 133 | STATIC_LIB_EXT=.a |
Theodore Ts'o | 14b596d | 2009-04-22 09:18:30 -0400 | [diff] [blame] | 134 | PROFILED_LIB_EXT=.a |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 135 | dnl |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 136 | dnl Allow separate `root_prefix' to be specified |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 137 | dnl |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 138 | AC_ARG_WITH([root-prefix], |
| 139 | [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root], |
| 140 | root_prefix=$withval, |
| 141 | root_prefix=NONE)dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 142 | dnl |
Theodore Ts'o | 98919bd | 2005-02-04 10:43:58 -0500 | [diff] [blame] | 143 | dnl handle --enable-maintainer-mode |
| 144 | dnl |
| 145 | AC_ARG_ENABLE([maintainer-mode], |
| 146 | [ --enable-maintainer-mode enable makefile rules useful for maintainers], |
| 147 | if test "$enableval" = "no" |
| 148 | then |
| 149 | MAINTAINER_CMT=# |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 150 | AC_MSG_RESULT([Disabling maintainer mode]) |
Theodore Ts'o | 98919bd | 2005-02-04 10:43:58 -0500 | [diff] [blame] | 151 | else |
| 152 | MAINTAINER_CMT= |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 153 | AC_MSG_RESULT([Enabling maintainer mode]) |
Theodore Ts'o | 98919bd | 2005-02-04 10:43:58 -0500 | [diff] [blame] | 154 | fi |
| 155 | , |
| 156 | MAINTAINER_CMT=# |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 157 | AC_MSG_RESULT([Disabling maintainer mode by default]) |
Theodore Ts'o | 98919bd | 2005-02-04 10:43:58 -0500 | [diff] [blame] | 158 | ) |
| 159 | AC_SUBST(MAINTAINER_CMT) |
| 160 | dnl |
Theodore Ts'o | 5aa6c3f | 2010-05-17 19:21:42 -0400 | [diff] [blame] | 161 | dnl handle --enable-symlink-install |
| 162 | dnl |
| 163 | AC_ARG_ENABLE([symlink-install], |
| 164 | [ --enable-symlink-install use symlinks when installing instead of hard links], |
| 165 | if test "$enableval" = "no" |
| 166 | then |
| 167 | LINK_INSTALL_FLAGS=-f |
| 168 | AC_MSG_RESULT([Disabling symlinks for install]) |
| 169 | else |
| 170 | LINK_INSTALL_FLAGS=-sf |
| 171 | AC_MSG_RESULT([Enabling symlinks for install]) |
| 172 | fi |
| 173 | , |
| 174 | LINK_INSTALL_FLAGS=-f |
Theodore Ts'o | 183c73b | 2012-05-12 23:13:24 -0400 | [diff] [blame] | 175 | AC_MSG_RESULT([Disabling symlinks for install by default]) |
Theodore Ts'o | 5aa6c3f | 2010-05-17 19:21:42 -0400 | [diff] [blame] | 176 | ) |
| 177 | AC_SUBST(LINK_INSTALL_FLAGS) |
| 178 | dnl |
Theodore Ts'o | 183c73b | 2012-05-12 23:13:24 -0400 | [diff] [blame] | 179 | dnl handle --enable-relative-symlinks |
| 180 | dnl |
Theodore Ts'o | 91d11da | 2012-09-06 23:01:14 -0400 | [diff] [blame] | 181 | relative_symlink_defined= |
| 182 | AC_ARG_ENABLE([relative-symlinks], |
Theodore Ts'o | 183c73b | 2012-05-12 23:13:24 -0400 | [diff] [blame] | 183 | [ --enable-relative-symlinks use relative symlinks when installing], |
| 184 | if test "$enableval" = "no" |
| 185 | then |
| 186 | SYMLINK_RELATIVE= |
Theodore Ts'o | 91d11da | 2012-09-06 23:01:14 -0400 | [diff] [blame] | 187 | relative_symlink_defined=yes |
Theodore Ts'o | 183c73b | 2012-05-12 23:13:24 -0400 | [diff] [blame] | 188 | AC_MSG_RESULT([Disabling relative symlinks for install]) |
| 189 | else |
| 190 | SYMLINK_RELATIVE=--relative |
Theodore Ts'o | 91d11da | 2012-09-06 23:01:14 -0400 | [diff] [blame] | 191 | relative_symlink_defined=yes |
| 192 | AC_MSG_RESULT([Enabling relative symlinks for install]) |
| 193 | fi) |
| 194 | AC_ARG_ENABLE([symlink-relative-symlinks],, |
| 195 | if test "$enableval" = "no" |
| 196 | then |
| 197 | SYMLINK_RELATIVE=yes |
| 198 | AC_MSG_RESULT([Disabling relative symlinks for install]) |
| 199 | else |
| 200 | SYMLINK_RELATIVE=--relative |
| 201 | AC_MSG_RESULT([Enabling relative symlinks for install]) |
Theodore Ts'o | 183c73b | 2012-05-12 23:13:24 -0400 | [diff] [blame] | 202 | fi |
| 203 | , |
Theodore Ts'o | 91d11da | 2012-09-06 23:01:14 -0400 | [diff] [blame] | 204 | if test -z "$relative_symlink_defined" |
| 205 | then |
Theodore Ts'o | 183c73b | 2012-05-12 23:13:24 -0400 | [diff] [blame] | 206 | SYMLINK_RELATIVE= |
| 207 | AC_MSG_RESULT([Disabling relative symlinks for install by default]) |
Theodore Ts'o | 91d11da | 2012-09-06 23:01:14 -0400 | [diff] [blame] | 208 | fi |
Theodore Ts'o | 183c73b | 2012-05-12 23:13:24 -0400 | [diff] [blame] | 209 | ) |
| 210 | AC_SUBST(SYMLINK_RELATIVE) |
| 211 | dnl |
Theodore Ts'o | 5aa6c3f | 2010-05-17 19:21:42 -0400 | [diff] [blame] | 212 | dnl handle --enable-symlink-build |
| 213 | dnl |
| 214 | AC_ARG_ENABLE([symlink-build], |
| 215 | [ --enable-symlink-build use symlinks while building instead of hard links], |
| 216 | if test "$enableval" = "no" |
| 217 | then |
| 218 | LINK_BUILD_FLAGS= |
| 219 | AC_MSG_RESULT([Disabling symlinks for build]) |
| 220 | else |
| 221 | LINK_BUILD_FLAGS=-s |
| 222 | AC_MSG_RESULT([Enabling symlinks for build]) |
| 223 | fi |
| 224 | , |
| 225 | LINK_BUILD_FLAGS= |
Theodore Ts'o | 183c73b | 2012-05-12 23:13:24 -0400 | [diff] [blame] | 226 | AC_MSG_RESULT([Disabling symlinks for build by default]) |
Theodore Ts'o | 5aa6c3f | 2010-05-17 19:21:42 -0400 | [diff] [blame] | 227 | ) |
| 228 | AC_SUBST(LINK_BUILD_FLAGS) |
| 229 | dnl |
Theodore Ts'o | c13351f | 2009-07-02 00:11:17 -0400 | [diff] [blame] | 230 | dnl handle --enable-verbose-makecmds |
| 231 | dnl |
| 232 | AC_ARG_ENABLE([verbose-makecmds], |
Theodore Ts'o | 5aa6c3f | 2010-05-17 19:21:42 -0400 | [diff] [blame] | 233 | [ --enable-verbose-makecmds enable verbose make command output], |
Theodore Ts'o | c13351f | 2009-07-02 00:11:17 -0400 | [diff] [blame] | 234 | if test "$enableval" = "no" |
| 235 | then |
| 236 | AC_MSG_RESULT([Disabling verbose make commands]) |
| 237 | E=@echo |
Theodore Ts'o | c1986ec | 2012-06-13 15:29:13 -0400 | [diff] [blame] | 238 | ES=echo |
Theodore Ts'o | c13351f | 2009-07-02 00:11:17 -0400 | [diff] [blame] | 239 | Q=@ |
| 240 | else |
| 241 | AC_MSG_RESULT([Enabling verbose make commands]) |
| 242 | E=@\\# |
Theodore Ts'o | c1986ec | 2012-06-13 15:29:13 -0400 | [diff] [blame] | 243 | ES=\\# |
Theodore Ts'o | c13351f | 2009-07-02 00:11:17 -0400 | [diff] [blame] | 244 | Q= |
| 245 | fi |
| 246 | , |
| 247 | AC_MSG_RESULT([Disabling verbose make commands]) |
| 248 | E=@echo |
Theodore Ts'o | c1986ec | 2012-06-13 15:29:13 -0400 | [diff] [blame] | 249 | ES=echo |
Theodore Ts'o | c13351f | 2009-07-02 00:11:17 -0400 | [diff] [blame] | 250 | Q=@ |
| 251 | ) |
| 252 | AC_SUBST(E) |
Theodore Ts'o | c1986ec | 2012-06-13 15:29:13 -0400 | [diff] [blame] | 253 | AC_SUBST(ES) |
Theodore Ts'o | c13351f | 2009-07-02 00:11:17 -0400 | [diff] [blame] | 254 | AC_SUBST(Q) |
| 255 | dnl |
Theodore Ts'o | 1917875 | 2000-02-11 15:55:07 +0000 | [diff] [blame] | 256 | dnl handle --enable-compression |
| 257 | dnl |
| 258 | AC_ARG_ENABLE([compression], |
| 259 | [ --enable-compression enable EXPERIMENTAL compression support], |
| 260 | if test "$enableval" = "no" |
| 261 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 262 | AC_MSG_RESULT([Disabling compression support]) |
Theodore Ts'o | 1917875 | 2000-02-11 15:55:07 +0000 | [diff] [blame] | 263 | else |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 264 | AC_DEFINE(ENABLE_COMPRESSION, 1, |
| 265 | [Define to 1 if ext2 compression enabled]) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 266 | AC_MSG_RESULT([Enabling compression support]) |
| 267 | AC_MSG_WARN([Compression support is experimental]) |
Theodore Ts'o | 1917875 | 2000-02-11 15:55:07 +0000 | [diff] [blame] | 268 | fi |
| 269 | , |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 270 | AC_MSG_RESULT([Disabling compression support by default]) |
Theodore Ts'o | 1917875 | 2000-02-11 15:55:07 +0000 | [diff] [blame] | 271 | ) |
| 272 | dnl |
Theodore Ts'o | 8fdc998 | 2002-06-25 23:26:34 -0400 | [diff] [blame] | 273 | dnl handle --enable-htree |
| 274 | dnl |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 275 | AH_TEMPLATE([ENABLE_HTREE], [Define to 1 if ext3/4 htree support enabled]) |
Theodore Ts'o | 8fdc998 | 2002-06-25 23:26:34 -0400 | [diff] [blame] | 276 | AC_ARG_ENABLE([htree], |
| 277 | [ --enable-htree enable EXPERIMENTAL htree directory support], |
| 278 | if test "$enableval" = "no" |
| 279 | then |
| 280 | HTREE_CMT=# |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 281 | AC_MSG_RESULT([Disabling htree directory support]) |
Theodore Ts'o | 8fdc998 | 2002-06-25 23:26:34 -0400 | [diff] [blame] | 282 | else |
| 283 | HTREE_CMT= |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 284 | AC_DEFINE(ENABLE_HTREE, 1) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 285 | AC_MSG_RESULT([Enabling htree directory support]) |
Theodore Ts'o | 8fdc998 | 2002-06-25 23:26:34 -0400 | [diff] [blame] | 286 | fi |
| 287 | , |
Theodore Ts'o | 559ca6c | 2002-08-18 03:48:55 -0400 | [diff] [blame] | 288 | HTREE_CMT= |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 289 | AC_DEFINE(ENABLE_HTREE, 1) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 290 | AC_MSG_RESULT([Enabling htree directory support by default]) |
Theodore Ts'o | 8fdc998 | 2002-06-25 23:26:34 -0400 | [diff] [blame] | 291 | ) |
| 292 | AC_SUBST(HTREE_CMT) |
| 293 | dnl |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 294 | dnl This needs to be before all of the --enable-*-shlibs options |
| 295 | dnl |
| 296 | E2_PKG_CONFIG_STATIC=--static |
Theodore Ts'o | 55da987 | 2008-09-02 23:12:38 -0400 | [diff] [blame] | 297 | LDFLAG_DYNAMIC= |
| 298 | PRIVATE_LIBS_CMT= |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 299 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 300 | dnl handle --enable-elf-shlibs |
| 301 | dnl |
| 302 | AC_ARG_ENABLE([elf-shlibs], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 303 | [ --enable-elf-shlibs select ELF shared libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 304 | if test "$enableval" = "no" |
| 305 | then |
| 306 | ELF_CMT=# |
| 307 | MAKEFILE_ELF=/dev/null |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 308 | AC_MSG_RESULT([Disabling ELF shared libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 309 | else |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 310 | E2_PKG_CONFIG_STATIC= |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 311 | ELF_CMT= |
| 312 | MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib |
Theodore Ts'o | f5955dd | 2000-10-25 02:38:39 +0000 | [diff] [blame] | 313 | [case "$host_os" in |
| 314 | solaris2.*) |
| 315 | MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib |
| 316 | ;; |
| 317 | esac] |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 318 | BINARY_TYPE=elfbin |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 319 | LIB_EXT=.so |
Theodore Ts'o | 55da987 | 2008-09-02 23:12:38 -0400 | [diff] [blame] | 320 | PRIVATE_LIBS_CMT=# |
| 321 | LDFLAG_DYNAMIC=['-Wl,-rpath-link,$(top_builddir)/lib'] |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 322 | AC_MSG_RESULT([Enabling ELF shared libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 323 | fi |
| 324 | , |
| 325 | MAKEFILE_ELF=/dev/null |
| 326 | ELF_CMT=# |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 327 | AC_MSG_RESULT([Disabling ELF shared libraries by default]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 328 | ) |
| 329 | AC_SUBST(ELF_CMT) |
| 330 | AC_SUBST_FILE(MAKEFILE_ELF) |
| 331 | dnl |
| 332 | dnl handle --enable-bsd-shlibs |
| 333 | dnl |
| 334 | AC_ARG_ENABLE([bsd-shlibs], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 335 | [ --enable-bsd-shlibs select BSD shared libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 336 | if test "$enableval" = "no" |
| 337 | then |
| 338 | BSDLIB_CMT=# |
| 339 | MAKEFILE_BSDLIB=/dev/null |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 340 | AC_MSG_RESULT([Disabling BSD shared libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 341 | else |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 342 | E2_PKG_CONFIG_STATIC= |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 343 | BSDLIB_CMT= |
| 344 | MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 345 | LIB_EXT=.so |
Theodore Ts'o | e71d873 | 2003-03-14 02:13:48 -0500 | [diff] [blame] | 346 | [case "$host_os" in |
Theodore Ts'o | aa75ecc | 2003-03-17 10:01:22 -0500 | [diff] [blame] | 347 | darwin*) |
Theodore Ts'o | e71d873 | 2003-03-14 02:13:48 -0500 | [diff] [blame] | 348 | MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib |
| 349 | LIB_EXT=.dylib |
| 350 | ;; |
| 351 | esac] |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 352 | AC_MSG_RESULT([Enabling BSD shared libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 353 | fi |
| 354 | , |
| 355 | MAKEFILE_BSDLIB=/dev/null |
| 356 | BSDLIB_CMT=# |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 357 | AC_MSG_RESULT([Disabling BSD shared libraries by default]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 358 | ) |
| 359 | AC_SUBST(BSDLIB_CMT) |
| 360 | AC_SUBST_FILE(MAKEFILE_BSDLIB) |
| 361 | dnl |
| 362 | dnl handle --enable-profile |
| 363 | dnl |
| 364 | AC_ARG_ENABLE([profile], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 365 | [ --enable-profile build profiling libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 366 | if test "$enableval" = "no" |
| 367 | then |
| 368 | PROFILE_CMT=# |
| 369 | MAKEFILE_PROFILE=/dev/null |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 370 | AC_MSG_RESULT([Disabling profiling libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 371 | else |
| 372 | PROFILE_CMT= |
| 373 | MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 374 | PROFILED_LIB_EXT=_p.a |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 375 | AC_MSG_RESULT([Building profiling libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 376 | fi |
| 377 | , |
| 378 | PROFILE_CMT=# |
| 379 | MAKEFILE_PROFILE=/dev/null |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 380 | AC_MSG_RESULT([Disabling profiling libraries by default]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 381 | ) |
| 382 | AC_SUBST(PROFILE_CMT) |
| 383 | AC_SUBST_FILE(MAKEFILE_PROFILE) |
| 384 | dnl |
Theodore Ts'o | fedfb27 | 2014-02-23 00:17:09 -0500 | [diff] [blame] | 385 | dnl handle --enable-gcov |
| 386 | dnl |
| 387 | AC_ARG_ENABLE([gcov], |
| 388 | [ --enable-gcov build for coverage testing using gcov], |
| 389 | if test "$enableval" = "yes" |
| 390 | then |
| 391 | CFLAGS="-g -fprofile-arcs -ftest-coverage" |
| 392 | LDFLAGS="-fprofile-arcs -ftest-coverage" |
| 393 | AC_MSG_RESULT([Enabling gcov support]) |
| 394 | fi |
| 395 | ) |
Eric Sandeen | 2f8d025 | 2014-04-17 17:05:38 -0500 | [diff] [blame] | 396 | |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 397 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 398 | dnl Substitute library extensions |
| 399 | dnl |
| 400 | AC_SUBST(LIB_EXT) |
| 401 | AC_SUBST(STATIC_LIB_EXT) |
| 402 | AC_SUBST(PROFILED_LIB_EXT) |
Theodore Ts'o | 55da987 | 2008-09-02 23:12:38 -0400 | [diff] [blame] | 403 | AC_SUBST(LDFLAG_DYNAMIC) |
| 404 | AC_SUBST(PRIVATE_LIBS_CMT) |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 405 | dnl |
Theodore Ts'o | 782bebf | 2002-11-08 18:46:45 -0500 | [diff] [blame] | 406 | dnl handle --enable-jbd-debug |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 407 | dnl |
Theodore Ts'o | 782bebf | 2002-11-08 18:46:45 -0500 | [diff] [blame] | 408 | AC_ARG_ENABLE([jbd-debug], |
| 409 | [ --enable-jbd-debug enable journal debugging], |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 410 | if test "$enableval" = "no" |
| 411 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 412 | AC_MSG_RESULT([Disabling journal debugging]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 413 | else |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 414 | AC_DEFINE(CONFIG_JBD_DEBUG, 1, |
| 415 | [Define to 1 if debugging ext3/4 journal code]) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 416 | AC_MSG_RESULT([Enabling journal debugging]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 417 | fi |
| 418 | , |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 419 | AC_MSG_RESULT([Disabling journal debugging by default]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 420 | ) |
| 421 | dnl |
Theodore Ts'o | f0a22d0 | 2003-02-22 13:19:53 -0500 | [diff] [blame] | 422 | dnl handle --enable-blkid-debug |
| 423 | dnl |
| 424 | AC_ARG_ENABLE([blkid-debug], |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 425 | [ --enable-blkid-debug enable blkid debugging], |
Theodore Ts'o | f0a22d0 | 2003-02-22 13:19:53 -0500 | [diff] [blame] | 426 | if test "$enableval" = "no" |
| 427 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 428 | AC_MSG_RESULT([Disabling blkid debugging]) |
Theodore Ts'o | f0a22d0 | 2003-02-22 13:19:53 -0500 | [diff] [blame] | 429 | else |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 430 | AC_DEFINE(CONFIG_BLKID_DEBUG, 1, |
| 431 | [Define to 1 if debugging the blkid library]) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 432 | AC_MSG_RESULT([Enabling blkid debugging]) |
Theodore Ts'o | f0a22d0 | 2003-02-22 13:19:53 -0500 | [diff] [blame] | 433 | fi |
| 434 | , |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 435 | AC_MSG_RESULT([Disabling blkid debugging by default]) |
Theodore Ts'o | f0a22d0 | 2003-02-22 13:19:53 -0500 | [diff] [blame] | 436 | ) |
| 437 | dnl |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 438 | dnl handle --enable-testio-debug |
| 439 | dnl |
| 440 | AC_ARG_ENABLE([testio-debug], |
Theodore Ts'o | af77365 | 2008-09-01 11:27:27 -0400 | [diff] [blame] | 441 | [ --disable-testio-debug disable the use of the test I/O manager for debugging], |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 442 | AH_TEMPLATE([CONFIG_TESTIO_DEBUG], |
| 443 | [Define to 1 if the testio I/O manager should be enabled]) |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 444 | if test "$enableval" = "no" |
| 445 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 446 | AC_MSG_RESULT([Disabling testio debugging]) |
Theodore Ts'o | af77365 | 2008-09-01 11:27:27 -0400 | [diff] [blame] | 447 | TEST_IO_CMT="#" |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 448 | else |
Theodore Ts'o | af77365 | 2008-09-01 11:27:27 -0400 | [diff] [blame] | 449 | TEST_IO_CMT= |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 450 | AC_DEFINE(CONFIG_TESTIO_DEBUG, 1) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 451 | AC_MSG_RESULT([Enabling testio debugging]) |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 452 | fi |
| 453 | , |
Theodore Ts'o | af77365 | 2008-09-01 11:27:27 -0400 | [diff] [blame] | 454 | AC_MSG_RESULT([Enabling testio debugging by default]) |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 455 | AC_DEFINE(CONFIG_TESTIO_DEBUG, 1) |
Theodore Ts'o | af77365 | 2008-09-01 11:27:27 -0400 | [diff] [blame] | 456 | TEST_IO_CMT= |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 457 | ) |
Theodore Ts'o | af77365 | 2008-09-01 11:27:27 -0400 | [diff] [blame] | 458 | AC_SUBST(TEST_IO_CMT) |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 459 | dnl |
Scott James Remnant | 39fd3d4 | 2009-05-14 13:03:25 +0100 | [diff] [blame] | 460 | dnl handle --disable-libuuid |
| 461 | dnl |
| 462 | PKG_PROG_PKG_CONFIG |
| 463 | LIBUUID= |
| 464 | DEPLIBUUID= |
| 465 | STATIC_LIBUUID= |
| 466 | DEPSTATIC_LIBUUID= |
| 467 | PROFILED_LIBUUID= |
| 468 | DEPPROFILED_LIBUUID= |
| 469 | UUID_CMT= |
| 470 | AC_ARG_ENABLE([libuuid], |
| 471 | [ --disable-libuuid do not build private uuid library], |
| 472 | if test "$enableval" = "no" |
| 473 | then |
| 474 | if test -z "$PKG_CONFIG"; then |
| 475 | AC_MSG_ERROR([pkg-config not installed; please install it.]) |
| 476 | fi |
| 477 | |
| 478 | AC_CHECK_LIB(uuid, uuid_generate, |
| 479 | [LIBUUID=`$PKG_CONFIG --libs uuid`; |
| 480 | STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`], |
Theodore Ts'o | 2d7583b | 2014-07-05 00:27:02 -0400 | [diff] [blame] | 481 | [AC_MSG_ERROR([external uuid library not found])]) |
Theodore Ts'o | 5afdf37 | 2014-09-18 21:11:33 -0400 | [diff] [blame] | 482 | PROFILED_LIBUUID=$LIBUUID |
Scott James Remnant | 39fd3d4 | 2009-05-14 13:03:25 +0100 | [diff] [blame] | 483 | UUID_CMT=# |
| 484 | AC_MSG_RESULT([Disabling private uuid library]) |
| 485 | else |
| 486 | LIBUUID='$(LIB)/libuuid'$LIB_EXT |
| 487 | DEPLIBUUID=$LIBUUID |
| 488 | STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT |
| 489 | DEPSTATIC_LIBUUID=$STATIC_LIBUUID |
| 490 | PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT |
| 491 | DEPPROFILED_LIBUUID=$PROFILED_LIBUUID |
| 492 | AC_MSG_RESULT([Enabling private uuid library]) |
| 493 | fi |
| 494 | , |
| 495 | LIBUUID='$(LIB)/libuuid'$LIB_EXT |
| 496 | DEPLIBUUID=$LIBUUID |
| 497 | STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT |
| 498 | DEPSTATIC_LIBUUID=$STATIC_LIBUUID |
| 499 | PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT |
| 500 | DEPPROFILED_LIBUUID=$PROFILED_LIBUUID |
| 501 | AC_MSG_RESULT([Enabling private uuid library by default]) |
| 502 | ) |
| 503 | AC_SUBST(LIBUUID) |
| 504 | AC_SUBST(DEPLIBUUID) |
| 505 | AC_SUBST(STATIC_LIBUUID) |
| 506 | AC_SUBST(DEPSTATIC_LIBUUID) |
| 507 | AC_SUBST(PROFILED_LIBUUID) |
| 508 | AC_SUBST(DEPPROFILED_LIBUUID) |
| 509 | AC_SUBST(UUID_CMT) |
| 510 | dnl |
Theodore Ts'o | 14b596d | 2009-04-22 09:18:30 -0400 | [diff] [blame] | 511 | dnl handle --disable-libblkid |
| 512 | dnl |
| 513 | PKG_PROG_PKG_CONFIG |
| 514 | LIBBLKID= |
| 515 | DEPLIBBLKID= |
| 516 | STATIC_LIBBLKID= |
| 517 | DEPSTATIC_LIBBLKID= |
| 518 | PROFILED_LIBBLKID= |
| 519 | DEPPROFILED_LIBBLKID= |
| 520 | BLKID_CMT= |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 521 | AH_TEMPLATE([CONFIG_BUILD_FINDFS], [Define to 1 to compile findfs]) |
Theodore Ts'o | 14b596d | 2009-04-22 09:18:30 -0400 | [diff] [blame] | 522 | AC_ARG_ENABLE([libblkid], |
| 523 | [ --disable-libblkid do not build private blkid library], |
| 524 | if test "$enableval" = "no" |
| 525 | then |
| 526 | if test -z "$PKG_CONFIG"; then |
| 527 | AC_MSG_ERROR([pkg-config not installed; please install it.]) |
| 528 | fi |
| 529 | |
| 530 | AC_CHECK_LIB(blkid, blkid_get_cache, |
| 531 | [LIBBLKID=`$PKG_CONFIG --libs blkid`; |
| 532 | STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`], |
Theodore Ts'o | 2d7583b | 2014-07-05 00:27:02 -0400 | [diff] [blame] | 533 | [AC_MSG_ERROR([external blkid library not found])], -luuid) |
Theodore Ts'o | 14b596d | 2009-04-22 09:18:30 -0400 | [diff] [blame] | 534 | BLKID_CMT=# |
Theodore Ts'o | 5afdf37 | 2014-09-18 21:11:33 -0400 | [diff] [blame] | 535 | PROFILED_LIBBLKID=$LIBBLKID |
Theodore Ts'o | 14b596d | 2009-04-22 09:18:30 -0400 | [diff] [blame] | 536 | AC_MSG_RESULT([Disabling private blkid library]) |
| 537 | else |
| 538 | LIBBLKID='$(LIB)/libblkid'$LIB_EXT |
| 539 | DEPLIBBLKID=$LIBBLKID |
| 540 | STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT |
| 541 | DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID |
| 542 | PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT |
| 543 | DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 544 | AC_DEFINE(CONFIG_BUILD_FINDFS, 1) |
Theodore Ts'o | 14b596d | 2009-04-22 09:18:30 -0400 | [diff] [blame] | 545 | AC_MSG_RESULT([Enabling private blkid library]) |
| 546 | fi |
| 547 | , |
| 548 | LIBBLKID='$(LIB)/libblkid'$LIB_EXT |
| 549 | DEPLIBBLKID=$LIBBLKID |
| 550 | STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT |
| 551 | DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID |
| 552 | PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT |
| 553 | DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 554 | AC_DEFINE(CONFIG_BUILD_FINDFS, 1) |
Theodore Ts'o | 14b596d | 2009-04-22 09:18:30 -0400 | [diff] [blame] | 555 | AC_MSG_RESULT([Enabling private blkid library by default]) |
| 556 | ) |
| 557 | AC_SUBST(LIBBLKID) |
| 558 | AC_SUBST(DEPLIBBLKID) |
| 559 | AC_SUBST(STATIC_LIBBLKID) |
| 560 | AC_SUBST(DEPSTATIC_LIBBLKID) |
| 561 | AC_SUBST(PROFILED_LIBBLKID) |
| 562 | AC_SUBST(DEPPROFILED_LIBBLKID) |
| 563 | AC_SUBST(BLKID_CMT) |
| 564 | dnl |
Theodore Ts'o | 7becb20 | 2011-11-14 10:40:43 -0500 | [diff] [blame] | 565 | dnl handle --enable-quota |
Aditya Kali | f239fef | 2011-07-20 11:40:02 -0700 | [diff] [blame] | 566 | dnl |
Eric Sandeen | f5589f4 | 2013-10-14 08:54:15 -0400 | [diff] [blame] | 567 | QUOTA_MAN_COMMENT='.\"' |
Niu Yawei | 43075b4 | 2013-10-14 09:49:27 -0400 | [diff] [blame] | 568 | QUOTA_CMT= |
Eric Sandeen | f5589f4 | 2013-10-14 08:54:15 -0400 | [diff] [blame] | 569 | AC_SUBST(QUOTA_MAN_COMMENT) |
Aditya Kali | f239fef | 2011-07-20 11:40:02 -0700 | [diff] [blame] | 570 | PKG_PROG_PKG_CONFIG |
Theodore Ts'o | 7becb20 | 2011-11-14 10:40:43 -0500 | [diff] [blame] | 571 | AH_TEMPLATE([CONFIG_QUOTA], [Define to 1 to enable quota support]) |
| 572 | AC_ARG_ENABLE([quota], |
Eric Sandeen | 7b8912e | 2012-11-27 12:21:56 -0600 | [diff] [blame] | 573 | [ --enable-quota enable quota support], |
Aditya Kali | f239fef | 2011-07-20 11:40:02 -0700 | [diff] [blame] | 574 | if test "$enableval" = "no" |
| 575 | then |
Niu Yawei | 43075b4 | 2013-10-14 09:49:27 -0400 | [diff] [blame] | 576 | QUOTA_CMT=# |
Theodore Ts'o | 7becb20 | 2011-11-14 10:40:43 -0500 | [diff] [blame] | 577 | AC_MSG_RESULT([Disabling quota support]) |
Aditya Kali | f239fef | 2011-07-20 11:40:02 -0700 | [diff] [blame] | 578 | else |
Niu Yawei | 43075b4 | 2013-10-14 09:49:27 -0400 | [diff] [blame] | 579 | QUOTA_CMT= |
Theodore Ts'o | 7becb20 | 2011-11-14 10:40:43 -0500 | [diff] [blame] | 580 | AC_DEFINE(CONFIG_QUOTA, 1) |
| 581 | AC_MSG_RESULT([Enabling quota support]) |
Eric Sandeen | f5589f4 | 2013-10-14 08:54:15 -0400 | [diff] [blame] | 582 | QUOTA_MAN_COMMENT="" |
| 583 | AC_SUBST(QUOTA_MAN_COMMENT) |
Aditya Kali | f239fef | 2011-07-20 11:40:02 -0700 | [diff] [blame] | 584 | fi |
| 585 | , |
Niu Yawei | 43075b4 | 2013-10-14 09:49:27 -0400 | [diff] [blame] | 586 | QUOTA_CMT=# |
Theodore Ts'o | 7becb20 | 2011-11-14 10:40:43 -0500 | [diff] [blame] | 587 | AC_MSG_RESULT([Disabling quota support by default]) |
| 588 | ) |
| 589 | dnl |
| 590 | dnl Define stuff expected for quota library |
| 591 | dnl |
Aditya Kali | f239fef | 2011-07-20 11:40:02 -0700 | [diff] [blame] | 592 | LIBQUOTA='$(LIB)/libquota'$LIB_EXT |
| 593 | DEPLIBQUOTA=$LIBQUOTA |
| 594 | STATIC_LIBQUOTA='$(LIB)/libquota'$STATIC_LIB_EXT |
| 595 | DEPSTATIC_LIBQUOTA=$STATIC_LIBQUOTA |
| 596 | PROFILED_LIBQUOTA='$(LIB)/libquota'$PROFILED_LIB_EXT |
| 597 | DEPPROFILED_LIBQUOTA=$PROFILED_LIBQUOTA |
Aditya Kali | f239fef | 2011-07-20 11:40:02 -0700 | [diff] [blame] | 598 | AC_SUBST(LIBQUOTA) |
| 599 | AC_SUBST(DEPLIBQUOTA) |
| 600 | AC_SUBST(STATIC_LIBQUOTA) |
| 601 | AC_SUBST(DEPSTATIC_LIBQUOTA) |
| 602 | AC_SUBST(PROFILED_LIBQUOTA) |
| 603 | AC_SUBST(DEPPROFILED_LIBQUOTA) |
| 604 | AC_SUBST(QUOTA_CMT) |
| 605 | dnl |
Theodore Ts'o | 3df6014 | 2013-06-16 16:14:40 -0400 | [diff] [blame] | 606 | dnl handle --disable-backtrace |
| 607 | dnl |
| 608 | AH_TEMPLATE([DISABLE_BACKTRACE], [Define to 1 to disable use of backtrace]) |
| 609 | AC_ARG_ENABLE([backtrace], |
| 610 | [ --disable-backtrace disable use backtrace], |
| 611 | if test "$enableval" = "no" |
| 612 | then |
| 613 | AC_MSG_RESULT([Disabling use of backtrace]) |
| 614 | AC_DEFINE(DISABLE_BACKTRACE, 1) |
| 615 | else |
| 616 | AC_MSG_RESULT([Enabling use of backtrace]) |
| 617 | fi |
| 618 | , |
| 619 | AC_MSG_RESULT([Enabling use of backtrace by default]) |
| 620 | ) |
| 621 | dnl |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 622 | dnl handle --enable-debugfs |
| 623 | dnl |
| 624 | AC_ARG_ENABLE([debugfs], |
| 625 | [ --disable-debugfs disable support of debugfs program], |
| 626 | if test "$enableval" = "no" |
| 627 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 628 | AC_MSG_RESULT([Disabling debugfs support]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 629 | DEBUGFS_CMT="#" |
| 630 | else |
| 631 | DEBUGFS_CMT= |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 632 | AC_MSG_RESULT([Enabling debugfs support]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 633 | fi |
| 634 | , |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 635 | AC_MSG_RESULT([Enabling debugfs support by default]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 636 | DEBUGFS_CMT= |
| 637 | ) |
| 638 | AC_SUBST(DEBUGFS_CMT) |
| 639 | dnl |
| 640 | dnl handle --enable-imager |
| 641 | dnl |
| 642 | AC_ARG_ENABLE([imager], |
| 643 | [ --disable-imager disable support of e2image program], |
| 644 | if test "$enableval" = "no" |
| 645 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 646 | AC_MSG_RESULT([Disabling e2image support]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 647 | IMAGER_CMT="#" |
| 648 | else |
| 649 | IMAGER_CMT= |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 650 | AC_MSG_RESULT([Enabling e2image support]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 651 | fi |
| 652 | , |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 653 | AC_MSG_RESULT([Enabling e2image support by default]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 654 | IMAGER_CMT= |
| 655 | ) |
| 656 | AC_SUBST(IMAGER_CMT) |
| 657 | dnl |
| 658 | dnl handle --enable-resizer |
| 659 | dnl |
| 660 | AC_ARG_ENABLE([resizer], |
| 661 | [ --disable-resizer disable support of e2resize program], |
| 662 | if test "$enableval" = "no" |
| 663 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 664 | AC_MSG_RESULT([Disabling e2resize support]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 665 | RESIZER_CMT="#" |
| 666 | else |
| 667 | RESIZER_CMT= |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 668 | AC_MSG_RESULT([Enabling e2resize support]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 669 | fi |
| 670 | , |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 671 | AC_MSG_RESULT([Enabling e2resize support by default]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 672 | RESIZER_CMT= |
| 673 | ) |
| 674 | AC_SUBST(RESIZER_CMT) |
| 675 | dnl |
Theodore Ts'o | 8d9c50c | 2010-12-24 15:19:44 -0500 | [diff] [blame] | 676 | dnl handle --enable-defrag |
| 677 | dnl |
| 678 | AC_ARG_ENABLE([defrag], |
| 679 | [ --disable-defrag disable support of e4defrag program], |
| 680 | if test "$enableval" = "no" |
| 681 | then |
| 682 | AC_MSG_RESULT([Disabling e4defrag support]) |
| 683 | DEFRAG_CMT="#" |
| 684 | else |
| 685 | DEFRAG_CMT= |
| 686 | AC_MSG_RESULT([Enabling e4defrag support]) |
| 687 | fi |
| 688 | , |
Theodore Ts'o | 6c59a66 | 2014-01-04 20:44:29 -0500 | [diff] [blame] | 689 | if test -z "$WITH_DIET_LIBC" |
| 690 | then |
| 691 | AC_MSG_RESULT([Enabling e4defrag support by default]) |
| 692 | DEFRAG_CMT= |
| 693 | else |
| 694 | AC_MSG_RESULT([Disabling e4defrag support by default]) |
| 695 | DEFRAG_CMT="#" |
| 696 | fi |
Theodore Ts'o | 8d9c50c | 2010-12-24 15:19:44 -0500 | [diff] [blame] | 697 | ) |
| 698 | AC_SUBST(DEFRAG_CMT) |
| 699 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 700 | dnl See whether to install the `fsck' wrapper program (that calls e2fsck) |
| 701 | dnl |
| 702 | AC_ARG_ENABLE([fsck], |
| 703 | [ --enable-fsck build fsck wrapper program], |
| 704 | [if test "$enableval" = "no" |
| 705 | then |
| 706 | FSCK_PROG='' FSCK_MAN='' |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 707 | AC_MSG_RESULT([Not building fsck wrapper]) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 708 | else |
| 709 | FSCK_PROG=fsck FSCK_MAN=fsck.8 |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 710 | AC_MSG_RESULT([Building fsck wrapper]) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 711 | fi] |
| 712 | , |
| 713 | [case "$host_os" in |
Theodore Ts'o | e363240 | 2004-05-04 19:39:54 -0400 | [diff] [blame] | 714 | gnu*) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 715 | FSCK_PROG='' FSCK_MAN='' |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 716 | AC_MSG_RESULT([Not building fsck wrapper by default]) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 717 | ;; |
| 718 | *) |
| 719 | FSCK_PROG=fsck FSCK_MAN=fsck.8 |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 720 | AC_MSG_RESULT([Building fsck wrapper by default]) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 721 | esac] |
| 722 | ) |
| 723 | AC_SUBST(FSCK_PROG) |
| 724 | AC_SUBST(FSCK_MAN) |
| 725 | dnl |
Theodore Ts'o | 5d40773 | 2004-09-18 14:53:14 -0400 | [diff] [blame] | 726 | dnl See whether to install the `e2initrd-helper' program |
| 727 | dnl |
| 728 | AC_ARG_ENABLE([e2initrd-helper], |
| 729 | [ --enable-e2initrd-helper build e2initrd-helper program], |
| 730 | [if test "$enableval" = "no" |
| 731 | then |
| 732 | E2INITRD_PROG='' E2INITRD_MAN='' |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 733 | AC_MSG_RESULT([Not building e2initrd helper]) |
Theodore Ts'o | 5d40773 | 2004-09-18 14:53:14 -0400 | [diff] [blame] | 734 | else |
| 735 | E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8 |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 736 | AC_MSG_RESULT([Building e2initrd helper]) |
Theodore Ts'o | 5d40773 | 2004-09-18 14:53:14 -0400 | [diff] [blame] | 737 | fi] |
| 738 | , |
| 739 | E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8 |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 740 | AC_MSG_RESULT([Building e2initrd helper by default]) |
Theodore Ts'o | 5d40773 | 2004-09-18 14:53:14 -0400 | [diff] [blame] | 741 | ) |
| 742 | AC_SUBST(E2INITRD_PROG) |
| 743 | AC_SUBST(E2INITRD_MAN) |
Karel Zak | 4db2f59 | 2006-03-08 14:17:28 -0500 | [diff] [blame] | 744 | dnl |
Theodore Ts'o | 5d40773 | 2004-09-18 14:53:14 -0400 | [diff] [blame] | 745 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 746 | dnl |
Theodore Ts'o | 3249394 | 2007-12-31 10:45:01 -0500 | [diff] [blame] | 747 | AC_ARG_ENABLE([tls], |
| 748 | [ --disable-tls disable use of thread local support], |
| 749 | [if test "$enableval" = "no" |
| 750 | then |
| 751 | try_tls="" |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 752 | AC_MSG_RESULT([Disabling thread local support]) |
Theodore Ts'o | 3249394 | 2007-12-31 10:45:01 -0500 | [diff] [blame] | 753 | else |
| 754 | try_tls="yes" |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 755 | AC_MSG_RESULT([Enabling thread local support]) |
Theodore Ts'o | 3249394 | 2007-12-31 10:45:01 -0500 | [diff] [blame] | 756 | fi] |
| 757 | , |
Theodore Ts'o | eafba6c | 2008-07-10 10:21:42 -0400 | [diff] [blame] | 758 | if test -n "$WITH_DIET_LIBC" |
| 759 | then |
| 760 | try_tls="" |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 761 | AC_MSG_RESULT([Diet libc does not support thread local support]) |
Theodore Ts'o | eafba6c | 2008-07-10 10:21:42 -0400 | [diff] [blame] | 762 | else |
| 763 | try_tls="yes" |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 764 | AC_MSG_RESULT([Try using thread local support by default]) |
Theodore Ts'o | eafba6c | 2008-07-10 10:21:42 -0400 | [diff] [blame] | 765 | fi |
Theodore Ts'o | 3249394 | 2007-12-31 10:45:01 -0500 | [diff] [blame] | 766 | ) |
| 767 | if test "$try_tls" = "yes" |
| 768 | then |
| 769 | AX_TLS |
| 770 | fi |
| 771 | dnl |
| 772 | dnl |
| 773 | dnl |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 774 | AH_TEMPLATE([USE_UUIDD], [Define to 1 to build uuidd]) |
Theodore Ts'o | 5610f99 | 2007-12-31 11:16:56 -0500 | [diff] [blame] | 775 | AC_ARG_ENABLE([uuidd], |
| 776 | [ --disable-uuidd disable building the uuid daemon], |
| 777 | [if test "$enableval" = "no" |
| 778 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 779 | AC_MSG_RESULT([Not building uuidd]) |
Theodore Ts'o | 5610f99 | 2007-12-31 11:16:56 -0500 | [diff] [blame] | 780 | UUIDD_CMT="#" |
| 781 | else |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 782 | AC_DEFINE(USE_UUIDD, 1) |
Theodore Ts'o | 5610f99 | 2007-12-31 11:16:56 -0500 | [diff] [blame] | 783 | UUIDD_CMT="" |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 784 | AC_MSG_RESULT([Building uuidd]) |
Theodore Ts'o | 5610f99 | 2007-12-31 11:16:56 -0500 | [diff] [blame] | 785 | fi] |
| 786 | , |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 787 | AC_DEFINE(USE_UUIDD, 1) |
Theodore Ts'o | e3d1015 | 2014-09-19 00:26:26 -0400 | [diff] [blame^] | 788 | if test -z "$UUID_CMT" |
| 789 | then |
| 790 | UUIDD_CMT="" |
| 791 | AC_MSG_RESULT([Building uuidd by default]) |
| 792 | else |
| 793 | UUIDD_CMT="#" |
| 794 | AC_MSG_RESULT([Disabling uuidd by default]) |
| 795 | fi |
Theodore Ts'o | 5610f99 | 2007-12-31 11:16:56 -0500 | [diff] [blame] | 796 | ) |
| 797 | AC_SUBST(UUIDD_CMT) |
| 798 | dnl |
| 799 | dnl |
| 800 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 801 | MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library |
| 802 | AC_SUBST_FILE(MAKEFILE_LIBRARY) |
| 803 | dnl |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 804 | dnl Add internationalization support, using gettext. |
| 805 | dnl |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 806 | GETTEXT_PACKAGE=e2fsprogs |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 807 | PACKAGE=e2fsprogs |
| 808 | VERSION="$E2FSPROGS_VERSION" |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 809 | VERSION=0.14.1 |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 810 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [package name for gettext]) |
| 811 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [version for gettext]) |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 812 | AC_SUBST(GETTEXT_PACKAGE) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 813 | AC_SUBST(PACKAGE) |
| 814 | AC_SUBST(VERSION) |
| 815 | |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 816 | AM_GNU_GETTEXT |
| 817 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 818 | dnl End of configuration options |
| 819 | dnl |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 820 | AC_SUBST(BINARY_TYPE) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 821 | AC_PROG_MAKE_SET |
Theodore Ts'o | bcb915b | 2009-07-02 18:19:10 -0400 | [diff] [blame] | 822 | CHECK_GNU_MAKE |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 823 | AC_PATH_PROG(LN, ln, ln) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 824 | AC_PROG_LN_S |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 825 | AC_PATH_PROG(MV, mv, mv) |
| 826 | AC_PATH_PROG(CP, cp, cp) |
| 827 | AC_PATH_PROG(RM, rm, rm) |
| 828 | AC_PATH_PROG(CHMOD, chmod, :) |
Theodore Ts'o | 3223701 | 2005-01-17 19:13:39 -0500 | [diff] [blame] | 829 | AC_PROG_AWK |
| 830 | AC_PROG_EGREP |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 831 | AC_PATH_PROG(SED, sed, sed) |
Theodore Ts'o | 9d564f7 | 1999-07-03 20:25:58 +0000 | [diff] [blame] | 832 | AC_PATH_PROG(PERL, perl, perl) |
Theodore Ts'o | 250f79f | 2001-05-19 22:02:22 +0000 | [diff] [blame] | 833 | AC_PATH_PROG(LDCONFIG, ldconfig, :) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 834 | AC_CHECK_TOOL(AR, ar, ar) |
| 835 | AC_CHECK_TOOL(RANLIB, ranlib, :) |
| 836 | AC_CHECK_TOOL(STRIP, strip, :) |
Manish Katiyar | 7321d94 | 2008-04-14 17:20:03 +0530 | [diff] [blame] | 837 | AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ) |
| 838 | if test "_$MAKEINFO" = "_"; then |
| 839 | MAKEINFO="@echo Makeinfo is missing. Info documentation will not be built.;true" |
| 840 | else |
| 841 | case "$MAKEINFO" in |
| 842 | */missing.*) |
| 843 | AC_MSG_WARN([ |
| 844 | *** Makeinfo is missing. Info documentation will not be built.]) |
| 845 | ;; |
| 846 | *) |
| 847 | ;; |
| 848 | esac |
| 849 | fi |
| 850 | AC_SUBST(MAKEINFO) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 851 | AC_PROG_INSTALL |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 852 | # See if we need a separate native compiler. |
| 853 | if test $cross_compiling = no; then |
| 854 | BUILD_CC="$CC" |
| 855 | AC_SUBST(BUILD_CC) |
| 856 | else |
| 857 | AC_CHECK_PROGS(BUILD_CC, gcc cc) |
| 858 | fi |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 859 | AC_CHECK_HEADERS(m4_flatten([ |
| 860 | dirent.h |
| 861 | errno.h |
| 862 | execinfo.h |
| 863 | getopt.h |
| 864 | malloc.h |
| 865 | mntent.h |
| 866 | paths.h |
| 867 | semaphore.h |
| 868 | setjmp.h |
| 869 | signal.h |
| 870 | stdarg.h |
| 871 | stdint.h |
| 872 | stdlib.h |
| 873 | termios.h |
| 874 | termio.h |
| 875 | unistd.h |
| 876 | utime.h |
| 877 | linux/falloc.h |
| 878 | linux/fd.h |
| 879 | linux/major.h |
Kazuya Mio | fbabd5c | 2013-12-16 00:48:12 -0500 | [diff] [blame] | 880 | linux/loop.h |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 881 | net/if_dl.h |
| 882 | netinet/in.h |
| 883 | sys/disklabel.h |
Andreas Dilger | 5105054 | 2014-06-11 12:59:05 -0600 | [diff] [blame] | 884 | sys/disk.h |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 885 | sys/file.h |
| 886 | sys/ioctl.h |
| 887 | sys/mkdev.h |
| 888 | sys/mman.h |
Andreas Dilger | 5105054 | 2014-06-11 12:59:05 -0600 | [diff] [blame] | 889 | sys/mount.h |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 890 | sys/prctl.h |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 891 | sys/resource.h |
| 892 | sys/select.h |
| 893 | sys/socket.h |
| 894 | sys/sockio.h |
| 895 | sys/stat.h |
| 896 | sys/syscall.h |
| 897 | sys/sysmacros.h |
| 898 | sys/time.h |
| 899 | sys/types.h |
| 900 | sys/un.h |
| 901 | sys/wait.h |
| 902 | ])) |
Theodore Ts'o | da76d6b | 2005-01-18 23:29:01 -0500 | [diff] [blame] | 903 | AC_CHECK_HEADERS(net/if.h,,, |
| 904 | [[ |
| 905 | #if HAVE_SYS_TYPES_H |
| 906 | #include <sys/types.h> |
| 907 | #endif |
| 908 | #if HAVE_SYS_SOCKET |
| 909 | #include <sys/socket.h> |
| 910 | #endif |
| 911 | ]]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 912 | AC_FUNC_VPRINTF |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 913 | dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen |
| 914 | dnl is not decleared. |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 915 | AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT, 1, |
| 916 | [Define to 1 if dirent has d_reclen])],, |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 917 | [#include <dirent.h>]) |
Theodore Ts'o | 2873927 | 2014-01-03 00:26:43 -0500 | [diff] [blame] | 918 | AC_CHECK_MEMBERS([struct stat.st_atim]) |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 919 | dnl Check to see if ssize_t was declared |
| 920 | AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T, 1, |
| 921 | [Define to 1 if ssize_t declared])],, |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 922 | [#include <sys/types.h>]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 923 | dnl |
Theodore Ts'o | b0b9c4d | 1997-10-20 23:36:30 +0000 | [diff] [blame] | 924 | dnl Check to see if llseek() is declared in unistd.h. On some libc's |
| 925 | dnl it is, and on others it isn't..... Thank you glibc developers.... |
| 926 | dnl |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 927 | AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE, 1, |
| 928 | [Define to 1 if llseek declared in unistd.h])],, |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 929 | [#include <unistd.h>]) |
Theodore Ts'o | b0b9c4d | 1997-10-20 23:36:30 +0000 | [diff] [blame] | 930 | dnl |
Theodore Ts'o | 6928adc | 2000-05-25 23:28:50 +0000 | [diff] [blame] | 931 | dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files |
| 932 | dnl are so convoluted that I can't tell whether it will always be defined, |
| 933 | dnl and if it isn't defined while lseek64 is defined in the library, |
| 934 | dnl disaster will strike. |
| 935 | dnl |
| 936 | dnl Warning! Use of --enable-gcc-wall may throw off this test. |
| 937 | dnl |
| 938 | dnl |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 939 | AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE, 1, |
| 940 | [Define to 1 if lseek64 declared in unistd.h])],, |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 941 | [#define _LARGEFILE_SOURCE |
| 942 | #define _LARGEFILE64_SOURCE |
| 943 | #include <unistd.h>]) |
Theodore Ts'o | 6928adc | 2000-05-25 23:28:50 +0000 | [diff] [blame] | 944 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 945 | dnl Word sizes... |
| 946 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 947 | AC_CHECK_SIZEOF(short) |
| 948 | AC_CHECK_SIZEOF(int) |
| 949 | AC_CHECK_SIZEOF(long) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 950 | AC_CHECK_SIZEOF(long long) |
Phillip Susi | 274d46e | 2013-01-24 11:21:56 -0500 | [diff] [blame] | 951 | AC_CHECK_SIZEOF(off_t) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 952 | SIZEOF_SHORT=$ac_cv_sizeof_short |
| 953 | SIZEOF_INT=$ac_cv_sizeof_int |
| 954 | SIZEOF_LONG=$ac_cv_sizeof_long |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 955 | SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long |
Phillip Susi | 274d46e | 2013-01-24 11:21:56 -0500 | [diff] [blame] | 956 | SIZEOF_OFF_T=$ac_cv_sizeof_off_t |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 957 | AC_SUBST(SIZEOF_SHORT) |
| 958 | AC_SUBST(SIZEOF_INT) |
| 959 | AC_SUBST(SIZEOF_LONG) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 960 | AC_SUBST(SIZEOF_LONG_LONG) |
Phillip Susi | 274d46e | 2013-01-24 11:21:56 -0500 | [diff] [blame] | 961 | AC_SUBST(SIZEOF_OFF_T) |
Theodore Ts'o | 877eb6d | 2001-06-11 06:54:13 +0000 | [diff] [blame] | 962 | AC_C_BIGENDIAN |
Chen Qi | 91f0468 | 2014-05-05 21:08:42 -0400 | [diff] [blame] | 963 | if test $cross_compiling = no; then |
| 964 | BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh |
| 965 | else |
| 966 | CROSS_COMPILE="1" BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh |
| 967 | fi |
Theodore Ts'o | 4ea7ea0 | 2006-04-09 08:41:55 -0400 | [diff] [blame] | 968 | ASM_TYPES_HEADER=./asm_types.h |
| 969 | AC_SUBST_FILE(ASM_TYPES_HEADER) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 970 | dnl |
Theodore Ts'o | 488c75a | 2008-06-07 08:55:21 -0400 | [diff] [blame] | 971 | dnl Save the configuration #defines needed for the public ext2fs.h |
| 972 | dnl header file |
| 973 | dnl |
| 974 | echo "/* These defines are needed for the public ext2fs.h header file */" \ |
| 975 | > public_config.h |
| 976 | if grep HAVE_SYS_TYPES_H confdefs.h > tmp_config.$$; then |
| 977 | uniq tmp_config.$$ >> public_config.h |
| 978 | else |
| 979 | echo "#undef HAVE_SYS_TYPES_H" >> public_config.h |
| 980 | fi |
| 981 | if grep WORDS_BIGENDIAN confdefs.h > tmp_config.$$; then |
| 982 | uniq tmp_config.$$ >> public_config.h |
| 983 | else |
| 984 | echo "#undef WORDS_BIGENDIAN" >> public_config.h |
| 985 | fi |
| 986 | rm -f tmp_config.$$ |
| 987 | PUBLIC_CONFIG_HEADER=./public_config.h |
| 988 | AC_SUBST_FILE(PUBLIC_CONFIG_HEADER) |
| 989 | dnl |
Theodore Ts'o | 0c193f8 | 2003-08-01 14:26:23 -0400 | [diff] [blame] | 990 | dnl See if we have inttypes.h and if intptr_t is defined |
| 991 | dnl |
| 992 | AC_CHECK_HEADERS([inttypes.h]) |
Theodore Ts'o | d2ee56d | 2005-01-09 00:57:45 -0500 | [diff] [blame] | 993 | AC_CHECK_TYPES(intptr_t) |
Theodore Ts'o | 0c193f8 | 2003-08-01 14:26:23 -0400 | [diff] [blame] | 994 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 995 | dnl See if struct stat has a st_flags field, in which case we can get file |
| 996 | dnl flags somewhat portably. Also check for the analogous setter, chflags(). |
| 997 | dnl |
| 998 | AC_MSG_CHECKING(whether struct stat has a st_flags field) |
| 999 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags, |
| 1000 | AC_TRY_COMPILE([#include <sys/stat.h>], |
| 1001 | [struct stat stat; stat.st_flags = 0;], |
| 1002 | [e2fsprogs_cv_struct_st_flags=yes], |
| 1003 | [e2fsprogs_cv_struct_st_flags=no])) |
| 1004 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags) |
| 1005 | if test "$e2fsprogs_cv_struct_st_flags" = yes; then |
Theodore Ts'o | c03bc4e | 1999-10-20 18:20:36 +0000 | [diff] [blame] | 1006 | AC_MSG_CHECKING(whether st_flags field is useful) |
| 1007 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut, |
| 1008 | AC_TRY_COMPILE([#include <sys/stat.h>], |
| 1009 | [struct stat stat; stat.st_flags |= UF_IMMUTABLE;], |
| 1010 | [e2fsprogs_cv_struct_st_flags_immut=yes], |
| 1011 | [e2fsprogs_cv_struct_st_flags_immut=no])) |
| 1012 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut) |
| 1013 | if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 1014 | AC_DEFINE(HAVE_STAT_FLAGS, 1, |
| 1015 | [Define to 1 if struct stat has st_flags]) |
Theodore Ts'o | c03bc4e | 1999-10-20 18:20:36 +0000 | [diff] [blame] | 1016 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1017 | fi |
Theodore Ts'o | 84ea6e7 | 2004-03-19 19:29:17 -0500 | [diff] [blame] | 1018 | dnl |
| 1019 | dnl Check for the presence of SA_LEN |
| 1020 | dnl |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 1021 | AC_CHECK_MEMBER(struct sockaddr.sa_len, |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 1022 | AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1, |
| 1023 | [Define to 1 if if struct sockaddr contains sa_len]),, |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 1024 | [#include <sys/types.h> |
| 1025 | #include <sys/socket.h>]) |
Theodore Ts'o | 84ea6e7 | 2004-03-19 19:29:17 -0500 | [diff] [blame] | 1026 | dnl |
Eric Sandeen | 9ed8e5f | 2009-10-02 11:32:42 -0500 | [diff] [blame] | 1027 | dnl This will add -lblkid to the AC_CHECK_FUNCS search if we are using |
| 1028 | dnl the system-provided blkid library |
| 1029 | dnl |
| 1030 | if test -n "$BLKID_CMT"; then |
| 1031 | AC_SEARCH_LIBS([blkid_probe_all], [blkid]) |
| 1032 | fi |
| 1033 | dnl |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 1034 | AC_CHECK_FUNCS(m4_flatten([ |
| 1035 | __secure_getenv |
| 1036 | backtrace |
| 1037 | blkid_probe_get_topology |
Theodore Ts'o | 2de2628 | 2014-05-05 01:22:22 -0400 | [diff] [blame] | 1038 | blkid_probe_enable_partitions |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 1039 | chflags |
Baruch Siach | 9a39389 | 2014-01-02 13:05:37 -0500 | [diff] [blame] | 1040 | fadvise64 |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 1041 | fallocate |
| 1042 | fallocate64 |
| 1043 | fchown |
| 1044 | fdatasync |
| 1045 | fstat64 |
| 1046 | ftruncate64 |
Theodore Ts'o | 2873927 | 2014-01-03 00:26:43 -0500 | [diff] [blame] | 1047 | futimes |
Theodore Ts'o | 6c59a66 | 2014-01-04 20:44:29 -0500 | [diff] [blame] | 1048 | getcwd |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 1049 | getdtablesize |
| 1050 | getmntinfo |
Theodore Ts'o | 25ff772 | 2012-04-05 15:16:50 -0700 | [diff] [blame] | 1051 | getpwuid_r |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 1052 | getrlimit |
| 1053 | getrusage |
| 1054 | jrand48 |
| 1055 | llseek |
| 1056 | lseek64 |
| 1057 | mallinfo |
| 1058 | mbstowcs |
| 1059 | memalign |
Theodore Ts'o | 6c59a66 | 2014-01-04 20:44:29 -0500 | [diff] [blame] | 1060 | mempcpy |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 1061 | mmap |
| 1062 | msync |
| 1063 | nanosleep |
| 1064 | open64 |
| 1065 | pathconf |
| 1066 | posix_fadvise |
Baruch Siach | 9a39389 | 2014-01-02 13:05:37 -0500 | [diff] [blame] | 1067 | posix_fadvise64 |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 1068 | posix_memalign |
| 1069 | prctl |
Darrick J. Wong | baa3544 | 2014-08-02 19:18:03 -0400 | [diff] [blame] | 1070 | pread |
| 1071 | pwrite |
Theodore Ts'o | f00948a | 2014-08-08 16:42:05 -0400 | [diff] [blame] | 1072 | pread64 |
| 1073 | pwrite64 |
Theodore Ts'o | 1ad3174 | 2013-06-16 14:34:59 -0400 | [diff] [blame] | 1074 | secure_getenv |
Theodore Ts'o | b24efa2 | 2012-04-05 15:31:09 -0700 | [diff] [blame] | 1075 | setmntent |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 1076 | setresgid |
| 1077 | setresuid |
Theodore Ts'o | c42de75 | 2014-07-08 20:02:48 -0400 | [diff] [blame] | 1078 | snprintf |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 1079 | srandom |
Theodore Ts'o | 6c59a66 | 2014-01-04 20:44:29 -0500 | [diff] [blame] | 1080 | stpcpy |
Mike Frysinger | 677fc91 | 2012-03-06 20:13:54 -0500 | [diff] [blame] | 1081 | strcasecmp |
| 1082 | strdup |
| 1083 | strnlen |
| 1084 | strptime |
| 1085 | strtoull |
| 1086 | sync_file_range |
| 1087 | sysconf |
| 1088 | usleep |
| 1089 | utime |
| 1090 | valloc |
| 1091 | ])) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 1092 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 1093 | dnl Check to see if -lsocket is required (solaris) to make something |
| 1094 | dnl that uses socket() to compile; this is needed for the UUID library |
| 1095 | dnl |
| 1096 | SOCKET_LIB='' |
| 1097 | AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket]) |
| 1098 | AC_SUBST(SOCKET_LIB) |
| 1099 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1100 | dnl See if optreset exists |
| 1101 | dnl |
| 1102 | AC_MSG_CHECKING(for optreset) |
| 1103 | AC_CACHE_VAL(ac_cv_have_optreset, |
| 1104 | [AC_EGREP_HEADER(optreset, unistd.h, |
| 1105 | ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl |
| 1106 | AC_MSG_RESULT($ac_cv_have_optreset) |
| 1107 | if test $ac_cv_have_optreset = yes; then |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 1108 | AC_DEFINE(HAVE_OPTRESET, 1, [Define to 1 if optreset for getopt is present]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1109 | fi |
| 1110 | dnl |
Theodore Ts'o | d7f45af | 2008-09-12 10:15:26 -0400 | [diff] [blame] | 1111 | dnl Test for sem_init, and which library it might require: |
| 1112 | dnl |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 1113 | AH_TEMPLATE([HAVE_SEM_INIT], [Define to 1 if sem_init() exists]) |
Theodore Ts'o | d7f45af | 2008-09-12 10:15:26 -0400 | [diff] [blame] | 1114 | SEM_INIT_LIB='' |
| 1115 | AC_CHECK_FUNC(sem_init, , |
| 1116 | AC_CHECK_LIB(pthread, sem_init, |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 1117 | AC_DEFINE(HAVE_SEM_INIT, 1) |
Theodore Ts'o | d7f45af | 2008-09-12 10:15:26 -0400 | [diff] [blame] | 1118 | SEM_INIT_LIB=-lpthread, |
| 1119 | AC_CHECK_LIB(rt, sem_init, |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 1120 | AC_DEFINE(HAVE_SEM_INIT, 1) |
Theodore Ts'o | d7f45af | 2008-09-12 10:15:26 -0400 | [diff] [blame] | 1121 | SEM_INIT_LIB=-lrt, |
| 1122 | AC_CHECK_LIB(posix4, sem_init, |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 1123 | AC_DEFINE(HAVE_SEM_INIT, 1) |
Theodore Ts'o | d7f45af | 2008-09-12 10:15:26 -0400 | [diff] [blame] | 1124 | SEM_INIT_LIB=-lposix4))))dnl |
| 1125 | AC_SUBST(SEM_INIT_LIB) |
| 1126 | dnl |
Theodore Ts'o | e54635d | 2006-08-06 14:33:13 -0400 | [diff] [blame] | 1127 | dnl Check for unified diff |
| 1128 | dnl |
| 1129 | AC_MSG_CHECKING(for unified diff option) |
Theodore Ts'o | 27f991b | 2008-04-01 20:32:55 -0400 | [diff] [blame] | 1130 | if diff -u $0 $0 > /dev/null 2>&1 ; then |
Theodore Ts'o | e54635d | 2006-08-06 14:33:13 -0400 | [diff] [blame] | 1131 | UNI_DIFF_OPTS=-u |
| 1132 | else |
| 1133 | UNI_DIFF_OPTS=-c |
| 1134 | fi |
| 1135 | AC_MSG_RESULT($UNI_DIFF_OPTS) |
| 1136 | AC_SUBST(UNI_DIFF_OPTS) |
| 1137 | dnl |
Theodore Ts'o | 8f3f29d | 2000-02-11 05:04:44 +0000 | [diff] [blame] | 1138 | dnl We use the EXT2 ioctls only under Linux |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1139 | dnl |
Theodore Ts'o | 8f3f29d | 2000-02-11 05:04:44 +0000 | [diff] [blame] | 1140 | case "$host_os" in |
| 1141 | linux*) |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 1142 | AC_DEFINE(HAVE_EXT2_IOCTLS, 1, [Define to 1 if Ext2 ioctls present]) |
Theodore Ts'o | 8f3f29d | 2000-02-11 05:04:44 +0000 | [diff] [blame] | 1143 | ;; |
| 1144 | esac |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1145 | dnl |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 1146 | dnl OS-specific uncomment control |
Theodore Ts'o | e6f2bda | 2002-08-18 03:37:10 -0400 | [diff] [blame] | 1147 | dnl |
| 1148 | LINUX_CMT="#" |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 1149 | CYGWIN_CMT="#" |
| 1150 | UNIX_CMT= |
Theodore Ts'o | e6f2bda | 2002-08-18 03:37:10 -0400 | [diff] [blame] | 1151 | case "$host_os" in |
| 1152 | linux*) |
| 1153 | LINUX_CMT= |
| 1154 | ;; |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 1155 | cygwin) |
| 1156 | CYGWIN_CMT= |
| 1157 | UNIX_CMT="#" |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 1158 | ;; |
Theodore Ts'o | e6f2bda | 2002-08-18 03:37:10 -0400 | [diff] [blame] | 1159 | esac |
| 1160 | AC_SUBST(LINUX_CMT) |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 1161 | AC_SUBST(CYGWIN_CMT) |
| 1162 | AC_SUBST(UNIX_CMT) |
Theodore Ts'o | e6f2bda | 2002-08-18 03:37:10 -0400 | [diff] [blame] | 1163 | dnl |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 1164 | dnl Linux and Hurd places root files in the / by default |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1165 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1166 | case "$host_os" in |
Theodore Ts'o | 93636bd | 2003-07-12 02:45:05 -0400 | [diff] [blame] | 1167 | linux* | gnu* | k*bsd*-gnu) |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 1168 | if test "$prefix" = NONE -a "$root_prefix" = NONE ; then |
| 1169 | root_prefix=""; |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 1170 | AC_MSG_RESULT([On $host_os systems, root_prefix defaults to '']) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 1171 | fi |
| 1172 | ;; |
| 1173 | esac |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 1174 | dnl |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 1175 | dnl On Linux/hurd, force the prefix to be /usr |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 1176 | dnl |
| 1177 | case "$host_os" in |
Theodore Ts'o | 93636bd | 2003-07-12 02:45:05 -0400 | [diff] [blame] | 1178 | linux* | gnu* | k*bsd*-gnu) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 1179 | if test "$prefix" = NONE ; then |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 1180 | prefix="/usr"; |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 1181 | AC_MSG_RESULT([On $host_os systems, prefix defaults to /usr]) |
Theodore Ts'o | bff61a7 | 2002-05-21 22:21:38 -0400 | [diff] [blame] | 1182 | if test "$mandir" = '${prefix}/man' ; then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 1183 | AC_MSG_RESULT([...and mandir defaults to /usr/share/man]) |
Theodore Ts'o | bff61a7 | 2002-05-21 22:21:38 -0400 | [diff] [blame] | 1184 | mandir=/usr/share/man |
| 1185 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1186 | fi |
| 1187 | ;; |
| 1188 | esac |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 1189 | if test "$root_prefix" = NONE ; then |
Theodore Ts'o | ffe1991 | 1998-04-08 06:05:49 +0000 | [diff] [blame] | 1190 | if test "$prefix" = NONE ; then |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 1191 | root_prefix="$ac_default_prefix" |
| 1192 | else |
| 1193 | root_prefix="$prefix" |
| 1194 | fi |
Theodore Ts'o | b5ffead | 2002-05-11 19:17:00 -0400 | [diff] [blame] | 1195 | root_bindir=$bindir |
| 1196 | root_sbindir=$sbindir |
| 1197 | root_libdir=$libdir |
| 1198 | root_sysconfdir=$sysconfdir |
| 1199 | else |
| 1200 | root_bindir='${root_prefix}/bin' |
| 1201 | root_sbindir='${root_prefix}/sbin' |
| 1202 | root_libdir='${root_prefix}/lib' |
| 1203 | root_sysconfdir='${root_prefix}/etc' |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 1204 | fi |
Theodore Ts'o | c4ef11c | 2008-01-04 16:55:37 -0500 | [diff] [blame] | 1205 | if test "$bindir" != '${exec_prefix}/bin'; then |
| 1206 | root_bindir=$bindir |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 1207 | AC_MSG_RESULT([Setting root_bindir to $root_bindir]) |
Theodore Ts'o | c4ef11c | 2008-01-04 16:55:37 -0500 | [diff] [blame] | 1208 | fi |
| 1209 | if test "$sbindir" != '${exec_prefix}/sbin'; then |
| 1210 | root_sbindir=$sbindir |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 1211 | AC_MSG_RESULT([Setting root_sbindir to $root_sbindir]) |
Theodore Ts'o | c4ef11c | 2008-01-04 16:55:37 -0500 | [diff] [blame] | 1212 | fi |
| 1213 | if test "$libdir" != '${exec_prefix}/lib'; then |
| 1214 | root_libdir=$libdir |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 1215 | AC_MSG_RESULT([Setting root_libdir to $root_libdir]) |
Theodore Ts'o | c4ef11c | 2008-01-04 16:55:37 -0500 | [diff] [blame] | 1216 | fi |
| 1217 | if test "$sysconfdir" != '${prefix}/etc'; then |
| 1218 | root_sysconfdir=$sysconfdir |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 1219 | AC_MSG_RESULT([Setting root_sysconfdir to $root_sysconfdir]) |
Theodore Ts'o | c4ef11c | 2008-01-04 16:55:37 -0500 | [diff] [blame] | 1220 | fi |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 1221 | AC_SUBST(root_prefix) |
Theodore Ts'o | b5ffead | 2002-05-11 19:17:00 -0400 | [diff] [blame] | 1222 | AC_SUBST(root_bindir) |
| 1223 | AC_SUBST(root_sbindir) |
| 1224 | AC_SUBST(root_libdir) |
| 1225 | AC_SUBST(root_sysconfdir) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1226 | dnl |
Theodore Ts'o | 55e00a2 | 2011-09-18 23:53:23 -0400 | [diff] [blame] | 1227 | dnl Allow specification of the multiarch arch |
| 1228 | dnl |
| 1229 | AC_ARG_WITH([multiarch], |
| 1230 | [ --with-multiarch=ARCH specify the multiarch triplet], |
Theodore Ts'o | d7fa410 | 2014-02-05 15:45:36 -0500 | [diff] [blame] | 1231 | if test "$withval" = "lib64"; then |
| 1232 | libdir=/usr/lib64 |
| 1233 | root_libdir=/lib64 |
| 1234 | else |
| 1235 | libdir=$libdir/$withval |
| 1236 | root_libdir=$root_libdir/$withval |
| 1237 | fi |
Theodore Ts'o | 55e00a2 | 2011-09-18 23:53:23 -0400 | [diff] [blame] | 1238 | )dnl |
| 1239 | dnl |
Theodore Ts'o | d3de1a7 | 2012-12-15 22:10:27 -0500 | [diff] [blame] | 1240 | dnl See if -static works. This could fail if the linker does not |
| 1241 | dnl support -static, or if required external libraries are not available |
| 1242 | dnl in static form. |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1243 | dnl |
Theodore Ts'o | d3de1a7 | 2012-12-15 22:10:27 -0500 | [diff] [blame] | 1244 | AC_MSG_CHECKING([whether we can link with -static]) |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 1245 | AC_CACHE_VAL(ac_cv_e2fsprogs_use_static, |
| 1246 | [SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static" |
| 1247 | AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);], |
| 1248 | ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no) |
| 1249 | LDFLAGS=$SAVE_LDFLAGS]) |
Theodore Ts'o | defde78 | 1999-01-04 07:39:19 +0000 | [diff] [blame] | 1250 | dnl |
| 1251 | dnl Regardless of how the test turns out, Solaris doesn't handle -static |
| 1252 | dnl This is caused by the socket library requiring the nsl library, which |
| 1253 | dnl requires the -dl library, which only works for dynamically linked |
| 1254 | dnl programs. It basically means you can't have statically linked programs |
| 1255 | dnl which use the network under Solaris. |
| 1256 | dnl |
| 1257 | case "$host_os" in |
| 1258 | solaris2.*) |
| 1259 | ac_cv_e2fsprogs_use_static=no |
| 1260 | ;; |
| 1261 | esac |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 1262 | AC_MSG_RESULT($ac_cv_e2fsprogs_use_static) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 1263 | LDFLAG_STATIC= |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 1264 | if test $ac_cv_e2fsprogs_use_static = yes; then |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1265 | LDFLAG_STATIC=-static |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 1266 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1267 | AC_SUBST(LDFLAG_STATIC) |
| 1268 | dnl |
Theodore Ts'o | 07a0db1 | 2003-07-05 14:50:24 -0400 | [diff] [blame] | 1269 | dnl Work around mysterious Darwin / GNU libintl problem |
| 1270 | dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like |
| 1271 | dnl Apple hacked gcc somehow?) |
| 1272 | dnl |
| 1273 | case "$host_os" in |
| 1274 | darwin*) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 1275 | AC_MSG_RESULT([Using Apple Darwin / GNU libintl workaround]) |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 1276 | AC_DEFINE(_INTL_REDIRECT_MACROS, 1, |
| 1277 | [Define to 1 if Apple Darwin libintl workaround is needed]) |
Theodore Ts'o | 07a0db1 | 2003-07-05 14:50:24 -0400 | [diff] [blame] | 1278 | ;; |
| 1279 | esac |
| 1280 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1281 | dnl Make the ss and et directories work correctly. |
| 1282 | dnl |
| 1283 | SS_DIR=`cd ${srcdir}/lib/ss; pwd` |
| 1284 | ET_DIR=`cd ${srcdir}/lib/et; pwd` |
| 1285 | AC_SUBST(SS_DIR) |
| 1286 | AC_SUBST(ET_DIR) |
| 1287 | dnl |
| 1288 | dnl Only try to run the test suite if we're not cross compiling. |
| 1289 | dnl |
| 1290 | if test "$cross_compiling" = yes ; then |
| 1291 | DO_TEST_SUITE= |
| 1292 | else |
| 1293 | DO_TEST_SUITE=check |
| 1294 | fi |
| 1295 | AC_SUBST(DO_TEST_SUITE) |
| 1296 | dnl |
Theodore Ts'o | c6f35b8 | 2003-05-17 16:29:27 -0400 | [diff] [blame] | 1297 | dnl Only include the intl include files if we're building with them |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 1298 | dnl |
| 1299 | INCLUDES='-I. -I$(top_builddir)/lib -I$(top_srcdir)/lib' |
| 1300 | if test -n "$CPPFLAGS" ; then |
| 1301 | INCLUDES="$INCLUDES $CPPFLAGS" |
Theodore Ts'o | c6f35b8 | 2003-05-17 16:29:27 -0400 | [diff] [blame] | 1302 | fi |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 1303 | if test "$USE_INCLUDED_LIBINTL" = "yes" ; then |
| 1304 | INCLUDES=$INCLUDES' -I$(top_builddir)/intl -I$(top_srcdir)/intl' |
| 1305 | fi |
Theodore Ts'o | 6c59a66 | 2014-01-04 20:44:29 -0500 | [diff] [blame] | 1306 | if test -n "$WITH_DIET_LIBC" ; then |
| 1307 | INCLUDES="$INCLUDES -D_REENTRANT" |
| 1308 | fi |
Theodore Ts'o | d1154eb | 2011-09-18 17:34:37 -0400 | [diff] [blame] | 1309 | AC_SUBST(INCLUDES) |
Theodore Ts'o | 5b5bd2c | 2014-07-10 00:17:05 -0400 | [diff] [blame] | 1310 | AM_MKINSTALLDIRS |
Theodore Ts'o | c6f35b8 | 2003-05-17 16:29:27 -0400 | [diff] [blame] | 1311 | dnl |
Theodore Ts'o | dd947da | 2005-11-09 18:37:07 -0400 | [diff] [blame] | 1312 | dnl Build CFLAGS |
| 1313 | dnl |
| 1314 | if test $cross_compiling = no; then |
Theodore Ts'o | 2873927 | 2014-01-03 00:26:43 -0500 | [diff] [blame] | 1315 | BUILD_CFLAGS="$CFLAGS $CPPFLAGS $INCLUDES -DHAVE_CONFIG_H" |
Theodore Ts'o | dd947da | 2005-11-09 18:37:07 -0400 | [diff] [blame] | 1316 | BUILD_LDFLAGS="$LDFLAGS" |
Theodore Ts'o | dd947da | 2005-11-09 18:37:07 -0400 | [diff] [blame] | 1317 | fi |
| 1318 | AC_SUBST(BUILD_CFLAGS) |
| 1319 | AC_SUBST(BUILD_LDFLAGS) |
| 1320 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1321 | dnl Make our output files, being sure that we create the some miscellaneous |
| 1322 | dnl directories |
| 1323 | dnl |
| 1324 | test -d lib || mkdir lib |
| 1325 | test -d include || mkdir include |
| 1326 | test -d include/linux || mkdir include/linux |
Theodore Ts'o | defde78 | 1999-01-04 07:39:19 +0000 | [diff] [blame] | 1327 | test -d include/asm || mkdir include/asm |
Theodore Ts'o | bff0cc9 | 2003-03-23 01:37:53 -0500 | [diff] [blame] | 1328 | for i in MCONFIG Makefile e2fsprogs.spec \ |
Theodore Ts'o | 183c73b | 2012-05-12 23:13:24 -0400 | [diff] [blame] | 1329 | util/Makefile util/subst.conf util/gen-tarball util/install-symlink \ |
Theodore Ts'o | 4ea7ea0 | 2006-04-09 08:41:55 -0400 | [diff] [blame] | 1330 | lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \ |
| 1331 | lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \ |
Theodore Ts'o | 94ba8c7 | 2003-03-02 02:07:14 -0500 | [diff] [blame] | 1332 | lib/uuid/Makefile lib/uuid/uuid_types.h \ |
Aditya Kali | f239fef | 2011-07-20 11:40:02 -0700 | [diff] [blame] | 1333 | lib/blkid/Makefile lib/blkid/blkid_types.h lib/quota/Makefile \ |
Theodore Ts'o | e644186 | 2005-01-26 12:59:25 -0500 | [diff] [blame] | 1334 | lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \ |
| 1335 | lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \ |
Theodore Ts'o | 921f4ad | 2004-11-19 17:25:27 -0500 | [diff] [blame] | 1336 | misc/Makefile ext2ed/Makefile e2fsck/Makefile \ |
Theodore Ts'o | 94ba8c7 | 2003-03-02 02:07:14 -0500 | [diff] [blame] | 1337 | debugfs/Makefile tests/Makefile tests/progs/Makefile \ |
Matthias Andree | 98a5ad6 | 2009-07-15 17:37:52 +0200 | [diff] [blame] | 1338 | resize/Makefile doc/Makefile intl/Makefile \ |
| 1339 | intl/libgnuintl.h po/Makefile.in ; do |
Theodore Ts'o | 94ba8c7 | 2003-03-02 02:07:14 -0500 | [diff] [blame] | 1340 | if test -d `dirname ${srcdir}/$i` ; then |
| 1341 | outlist="$outlist $i" |
| 1342 | fi |
| 1343 | done |
| 1344 | AC_OUTPUT($outlist) |
Theodore Ts'o | ee683a1 | 2005-02-05 15:53:56 -0500 | [diff] [blame] | 1345 | if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi |