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