Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1 | AC_INIT(version.h) |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 2 | AC_PREREQ(2.50) |
| 3 | AC_CONFIG_AUX_DIR(config) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 4 | MCONFIG=./MCONFIG |
| 5 | AC_SUBST_FILE(MCONFIG) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 6 | BINARY_TYPE=bin |
| 7 | dnl |
| 8 | dnl This is to figure out the version number and the date.... |
| 9 | dnl |
| 10 | E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \ |
| 11 | | awk '{print $3}' | tr \" " " | awk '{print $1}'` |
| 12 | DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \ |
| 13 | | tr \" " "` |
Theodore Ts'o | bff0cc9 | 2003-03-23 01:37:53 -0500 | [diff] [blame] | 14 | E2FSPROGS_DAY=`echo $DATE | awk -F- '{print $1}'` |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 15 | MONTH=`echo $DATE | awk -F- '{print $2}'` |
| 16 | YEAR=`echo $DATE | awk -F- '{print $3}'` |
| 17 | |
Theodore Ts'o | 40fa8cc | 1999-01-09 05:06:02 +0000 | [diff] [blame] | 18 | if expr $YEAR ">" 1900 > /dev/null ; then |
| 19 | E2FSPROGS_YEAR=$YEAR |
| 20 | elif expr $YEAR ">" 90 >/dev/null ; then |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 21 | E2FSPROGS_YEAR=19$YEAR |
| 22 | else |
| 23 | E2FSPROGS_YEAR=20$YEAR |
| 24 | fi |
| 25 | |
| 26 | case $MONTH in |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 27 | Jan) MONTH_NUM=01; E2FSPROGS_MONTH="January" ;; |
| 28 | Feb) MONTH_NUM=02; E2FSPROGS_MONTH="February" ;; |
| 29 | Mar) MONTH_NUM=03; E2FSPROGS_MONTH="March" ;; |
| 30 | Apr) MONTH_NUM=04; E2FSPROGS_MONTH="April" ;; |
| 31 | May) MONTH_NUM=05; E2FSPROGS_MONTH="May" ;; |
| 32 | Jun) MONTH_NUM=06; E2FSPROGS_MONTH="June" ;; |
| 33 | Jul) MONTH_NUM=07; E2FSPROGS_MONTH="July" ;; |
| 34 | Aug) MONTH_NUM=08; E2FSPROGS_MONTH="August" ;; |
| 35 | Sep) MONTH_NUM=09; E2FSPROGS_MONTH="September" ;; |
| 36 | Oct) MONTH_NUM=10; E2FSPROGS_MONTH="October" ;; |
| 37 | Nov) MONTH_NUM=11; E2FSPROGS_MONTH="November" ;; |
| 38 | Dec) MONTH_NUM=12; E2FSPROGS_MONTH="December" ;; |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 39 | *) echo "Unknown month $MONTH??" ;; |
| 40 | esac |
| 41 | |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 42 | base_ver=`echo $E2FSPROGS_VERSION | \ |
| 43 | sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'` |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 44 | |
| 45 | date_spec=${E2FSPROGS_YEAR}.${MONTH_NUM}.${E2FSPROGS_DAY} |
| 46 | |
| 47 | case $E2FSPROGS_VERSION in |
| 48 | *-WIP|pre-*) |
Theodore Ts'o | ab06396 | 2008-07-07 16:07:43 -0400 | [diff] [blame] | 49 | E2FSPROGS_PKGVER="$base_ver~WIP-$E2FSPROGS_YEAR-$MONTH_NUM-$E2FSPROGS_DAY" |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 50 | ;; |
| 51 | *) |
| 52 | E2FSPROGS_PKGVER="$base_ver" |
| 53 | ;; |
| 54 | esac |
| 55 | |
| 56 | unset DATE MONTH YEAR base_ver pre_vers date_spec |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 57 | echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION" |
| 58 | echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}" |
| 59 | AC_SUBST(E2FSPROGS_YEAR) |
| 60 | AC_SUBST(E2FSPROGS_MONTH) |
Theodore Ts'o | bff0cc9 | 2003-03-23 01:37:53 -0500 | [diff] [blame] | 61 | AC_SUBST(E2FSPROGS_DAY) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 62 | AC_SUBST(E2FSPROGS_VERSION) |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 63 | AC_SUBST(E2FSPROGS_PKGVER) |
Theodore Ts'o | ea97be5 | 2001-09-19 15:20:12 -0400 | [diff] [blame] | 64 | AC_CANONICAL_HOST |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 65 | dnl |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 66 | dnl Use diet libc |
| 67 | dnl |
Theodore Ts'o | eafba6c | 2008-07-10 10:21:42 -0400 | [diff] [blame^] | 68 | WITH_DIET_LIBC= |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 69 | AC_ARG_WITH([diet-libc], |
Theodore Ts'o | 3249394 | 2007-12-31 10:45:01 -0500 | [diff] [blame] | 70 | [ --with-diet-libc use diet libc], |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 71 | CC="diet cc -nostdinc" |
Theodore Ts'o | eafba6c | 2008-07-10 10:21:42 -0400 | [diff] [blame^] | 72 | WITH_DIET_LIBC=yes |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 73 | AC_MSG_RESULT(CC=$CC))dnl |
| 74 | dnl |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 75 | dnl set $(CC) from --with-cc=value |
| 76 | dnl |
| 77 | AC_ARG_WITH([cc], |
| 78 | [ --with-cc=COMPILER select compiler to use], |
| 79 | AC_MSG_RESULT(CC=$withval) |
| 80 | CC=$withval, |
| 81 | if test -z "$CC" ; then CC=cc; fi |
| 82 | [AC_MSG_RESULT(CC defaults to $CC)])dnl |
| 83 | export CC |
| 84 | AC_SUBST([CC]) |
Theodore Ts'o | 73ae2d4 | 2000-02-02 16:13:14 +0000 | [diff] [blame] | 85 | AC_PROG_CC |
Theodore Ts'o | 29a5dee | 2007-07-04 16:28:47 -0400 | [diff] [blame] | 86 | AC_PROG_CPP |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 87 | dnl |
| 88 | dnl set $(LD) from --with-linker=value |
| 89 | dnl |
| 90 | AC_ARG_WITH([linker], |
| 91 | [ --with-linker=LINKER select linker to use], |
| 92 | AC_MSG_RESULT(LD=$withval) |
| 93 | LD=$withval, |
| 94 | if test -z "$LD" ; then LD=$CC; fi |
| 95 | [AC_MSG_RESULT(LD defaults to $LD)])dnl |
| 96 | export LD |
| 97 | AC_SUBST([LD]) |
| 98 | dnl |
| 99 | dnl set $(CCOPTS) from --with-ccopts=value |
| 100 | dnl |
| 101 | AC_ARG_WITH([ccopts], |
| 102 | [ --with-ccopts=CCOPTS select compiler command line options], |
| 103 | AC_MSG_RESULT(CCOPTS is $withval) |
Theodore Ts'o | 877eb6d | 2001-06-11 06:54:13 +0000 | [diff] [blame] | 104 | CFLAGS=$withval, |
| 105 | )dnl |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 106 | dnl |
Theodore Ts'o | f8bd980 | 1999-10-26 04:19:45 +0000 | [diff] [blame] | 107 | dnl On systems without linux header files, we add an extra include directory |
| 108 | dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here |
| 109 | dnl is quoted so that it gets expanded by make, not by configure. |
| 110 | dnl |
| 111 | AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no]) |
Theodore Ts'o | 73ae2d4 | 2000-02-02 16:13:14 +0000 | [diff] [blame] | 112 | if test "$linux_headers" != yes; then |
| 113 | LINUX_INCLUDE='-I$(top_builddir)/include' |
Theodore Ts'o | f8bd980 | 1999-10-26 04:19:45 +0000 | [diff] [blame] | 114 | fi |
| 115 | AC_SUBST(LINUX_INCLUDE) |
| 116 | dnl |
Matthias Andree | b1c92f9 | 2004-02-23 21:30:11 +0100 | [diff] [blame] | 117 | dnl Alpha computers use fast and imprecise floating point code that may |
| 118 | dnl miss exceptions by default. Force sane options if we're using GCC. |
| 119 | AC_MSG_CHECKING(for additional special compiler flags) |
| 120 | if test "$GCC" = yes |
| 121 | then |
| 122 | case "$host_cpu" in |
| 123 | alpha) addcflags="-mieee" ;; |
| 124 | esac |
| 125 | fi |
| 126 | if test "x$addcflags" != x |
| 127 | then |
| 128 | AC_MSG_RESULT($addcflags) |
| 129 | CFLAGS="$addcflags $CFLAGS" |
| 130 | else |
| 131 | AC_MSG_RESULT([[(none)]]) |
| 132 | fi |
| 133 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 134 | dnl Set default values for library extentions. Will be dealt with after |
| 135 | dnl parsing configuration opions, which may modify these |
| 136 | dnl |
| 137 | LIB_EXT=.a |
| 138 | STATIC_LIB_EXT=.a |
| 139 | PROFILE_LIB_EXT=.a |
| 140 | dnl |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 141 | dnl set $(LDFLAGS) from --with-ldopts=value |
| 142 | dnl |
| 143 | AC_ARG_WITH([ldopts], |
| 144 | [ --with-ldopts=LDOPTS select linker command line options], |
| 145 | AC_MSG_RESULT(LDFLAGS is $withval) |
| 146 | LDFLAGS=$withval, |
| 147 | LDFLAGS=)dnl |
| 148 | AC_SUBST(LDFLAGS) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 149 | dnl |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 150 | dnl Allow separate `root_prefix' to be specified |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 151 | dnl |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 152 | AC_ARG_WITH([root-prefix], |
| 153 | [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root], |
| 154 | root_prefix=$withval, |
| 155 | root_prefix=NONE)dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 156 | dnl |
Theodore Ts'o | 98919bd | 2005-02-04 10:43:58 -0500 | [diff] [blame] | 157 | dnl handle --enable-maintainer-mode |
| 158 | dnl |
| 159 | AC_ARG_ENABLE([maintainer-mode], |
| 160 | [ --enable-maintainer-mode enable makefile rules useful for maintainers], |
| 161 | if test "$enableval" = "no" |
| 162 | then |
| 163 | MAINTAINER_CMT=# |
| 164 | echo "Disabling maintainer mode" |
| 165 | else |
| 166 | MAINTAINER_CMT= |
| 167 | echo "Enabling maintainer mode" |
| 168 | fi |
| 169 | , |
| 170 | MAINTAINER_CMT=# |
| 171 | echo "Disabling maintainer mode by default" |
| 172 | ) |
| 173 | AC_SUBST(MAINTAINER_CMT) |
| 174 | dnl |
Theodore Ts'o | 1917875 | 2000-02-11 15:55:07 +0000 | [diff] [blame] | 175 | dnl handle --enable-compression |
| 176 | dnl |
| 177 | AC_ARG_ENABLE([compression], |
| 178 | [ --enable-compression enable EXPERIMENTAL compression support], |
| 179 | if test "$enableval" = "no" |
| 180 | then |
| 181 | echo "Disabling compression support" |
| 182 | else |
| 183 | AC_DEFINE(ENABLE_COMPRESSION) |
| 184 | echo "Enabling compression support" |
| 185 | echo "WARNING: Compression support is experimental" |
| 186 | fi |
| 187 | , |
| 188 | echo "Disabling compression support by default" |
| 189 | ) |
| 190 | dnl |
Theodore Ts'o | 8fdc998 | 2002-06-25 23:26:34 -0400 | [diff] [blame] | 191 | dnl handle --enable-htree |
| 192 | dnl |
| 193 | AC_ARG_ENABLE([htree], |
| 194 | [ --enable-htree enable EXPERIMENTAL htree directory support], |
| 195 | if test "$enableval" = "no" |
| 196 | then |
| 197 | HTREE_CMT=# |
| 198 | echo "Disabling htree directory support" |
| 199 | else |
| 200 | HTREE_CMT= |
| 201 | AC_DEFINE(ENABLE_HTREE) |
| 202 | echo "Enabling htree directory support" |
Theodore Ts'o | 8fdc998 | 2002-06-25 23:26:34 -0400 | [diff] [blame] | 203 | fi |
| 204 | , |
Theodore Ts'o | 559ca6c | 2002-08-18 03:48:55 -0400 | [diff] [blame] | 205 | HTREE_CMT= |
| 206 | AC_DEFINE(ENABLE_HTREE) |
| 207 | echo "Enabling htree directory support by default" |
Theodore Ts'o | 8fdc998 | 2002-06-25 23:26:34 -0400 | [diff] [blame] | 208 | ) |
| 209 | AC_SUBST(HTREE_CMT) |
| 210 | dnl |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 211 | dnl This needs to be before all of the --enable-*-shlibs options |
| 212 | dnl |
| 213 | E2_PKG_CONFIG_STATIC=--static |
| 214 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 215 | dnl handle --enable-elf-shlibs |
| 216 | dnl |
| 217 | AC_ARG_ENABLE([elf-shlibs], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 218 | [ --enable-elf-shlibs select ELF shared libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 219 | if test "$enableval" = "no" |
| 220 | then |
| 221 | ELF_CMT=# |
| 222 | MAKEFILE_ELF=/dev/null |
| 223 | echo "Disabling ELF shared libraries" |
| 224 | else |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 225 | E2_PKG_CONFIG_STATIC= |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 226 | ELF_CMT= |
| 227 | MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib |
Theodore Ts'o | f5955dd | 2000-10-25 02:38:39 +0000 | [diff] [blame] | 228 | [case "$host_os" in |
| 229 | solaris2.*) |
| 230 | MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib |
| 231 | ;; |
| 232 | esac] |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 233 | BINARY_TYPE=elfbin |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 234 | LIB_EXT=.so |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 235 | echo "Enabling ELF shared libraries" |
| 236 | fi |
| 237 | , |
| 238 | MAKEFILE_ELF=/dev/null |
| 239 | ELF_CMT=# |
| 240 | echo "Disabling ELF shared libraries by default" |
| 241 | ) |
| 242 | AC_SUBST(ELF_CMT) |
| 243 | AC_SUBST_FILE(MAKEFILE_ELF) |
| 244 | dnl |
| 245 | dnl handle --enable-bsd-shlibs |
| 246 | dnl |
| 247 | AC_ARG_ENABLE([bsd-shlibs], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 248 | [ --enable-bsd-shlibs select BSD shared libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 249 | if test "$enableval" = "no" |
| 250 | then |
| 251 | BSDLIB_CMT=# |
| 252 | MAKEFILE_BSDLIB=/dev/null |
| 253 | echo "Disabling BSD shared libraries" |
| 254 | else |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 255 | E2_PKG_CONFIG_STATIC= |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 256 | BSDLIB_CMT= |
| 257 | MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 258 | LIB_EXT=.so |
Theodore Ts'o | e71d873 | 2003-03-14 02:13:48 -0500 | [diff] [blame] | 259 | [case "$host_os" in |
Theodore Ts'o | aa75ecc | 2003-03-17 10:01:22 -0500 | [diff] [blame] | 260 | darwin*) |
Theodore Ts'o | e71d873 | 2003-03-14 02:13:48 -0500 | [diff] [blame] | 261 | MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib |
| 262 | LIB_EXT=.dylib |
| 263 | ;; |
| 264 | esac] |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 265 | echo "Enabling BSD shared libraries" |
| 266 | fi |
| 267 | , |
| 268 | MAKEFILE_BSDLIB=/dev/null |
| 269 | BSDLIB_CMT=# |
| 270 | echo "Disabling BSD shared libraries by default" |
| 271 | ) |
| 272 | AC_SUBST(BSDLIB_CMT) |
| 273 | AC_SUBST_FILE(MAKEFILE_BSDLIB) |
| 274 | dnl |
| 275 | dnl handle --enable-profile |
| 276 | dnl |
| 277 | AC_ARG_ENABLE([profile], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 278 | [ --enable-profile build profiling libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 279 | if test "$enableval" = "no" |
| 280 | then |
| 281 | PROFILE_CMT=# |
| 282 | MAKEFILE_PROFILE=/dev/null |
| 283 | echo "Disabling profiling libraries" |
| 284 | else |
| 285 | PROFILE_CMT= |
| 286 | MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 287 | PROFILED_LIB_EXT=_p.a |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 288 | echo "Building profiling libraries" |
| 289 | fi |
| 290 | , |
| 291 | PROFILE_CMT=# |
| 292 | MAKEFILE_PROFILE=/dev/null |
| 293 | echo "Disabling profiling libraries by default" |
| 294 | ) |
| 295 | AC_SUBST(PROFILE_CMT) |
| 296 | AC_SUBST_FILE(MAKEFILE_PROFILE) |
| 297 | dnl |
| 298 | dnl handle --enable-checker |
| 299 | dnl |
| 300 | AC_ARG_ENABLE([checker], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 301 | [ --enable-checker build checker libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 302 | if test "$enableval" = "no" |
| 303 | then |
| 304 | CHECKER_CMT=# |
| 305 | MAKEFILE_CHECKER=/dev/null |
| 306 | echo "Disabling checker libraries" |
| 307 | else |
| 308 | CHECKER_CMT= |
| 309 | MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker |
| 310 | echo "Building checker libraries" |
| 311 | fi |
| 312 | , |
| 313 | CHECKER_CMT=# |
| 314 | MAKEFILE_CHECKER=/dev/null |
| 315 | echo "Disabling checker libraries by default" |
| 316 | ) |
| 317 | AC_SUBST(CHECKER_CMT) |
| 318 | AC_SUBST_FILE(MAKEFILE_CHECKER) |
| 319 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 320 | dnl Substitute library extensions |
| 321 | dnl |
| 322 | AC_SUBST(LIB_EXT) |
| 323 | AC_SUBST(STATIC_LIB_EXT) |
| 324 | AC_SUBST(PROFILED_LIB_EXT) |
| 325 | dnl |
Theodore Ts'o | 782bebf | 2002-11-08 18:46:45 -0500 | [diff] [blame] | 326 | dnl handle --enable-jbd-debug |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 327 | dnl |
Theodore Ts'o | 782bebf | 2002-11-08 18:46:45 -0500 | [diff] [blame] | 328 | AC_ARG_ENABLE([jbd-debug], |
| 329 | [ --enable-jbd-debug enable journal debugging], |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 330 | if test "$enableval" = "no" |
| 331 | then |
| 332 | echo "Disabling journal debugging" |
| 333 | else |
Theodore Ts'o | 8cf9333 | 2001-12-16 02:23:36 -0500 | [diff] [blame] | 334 | AC_DEFINE(CONFIG_JBD_DEBUG) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 335 | echo "Enabling journal debugging" |
| 336 | fi |
| 337 | , |
| 338 | echo "Disabling journal debugging by default" |
| 339 | ) |
| 340 | dnl |
Theodore Ts'o | f0a22d0 | 2003-02-22 13:19:53 -0500 | [diff] [blame] | 341 | dnl handle --enable-blkid-debug |
| 342 | dnl |
| 343 | AC_ARG_ENABLE([blkid-debug], |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 344 | [ --enable-blkid-debug enable blkid debugging], |
Theodore Ts'o | f0a22d0 | 2003-02-22 13:19:53 -0500 | [diff] [blame] | 345 | if test "$enableval" = "no" |
| 346 | then |
| 347 | echo "Disabling blkid debugging" |
| 348 | else |
| 349 | AC_DEFINE(CONFIG_BLKID_DEBUG) |
| 350 | echo "Enabling blkid debugging" |
| 351 | fi |
| 352 | , |
| 353 | echo "Disabling blkid debugging by default" |
| 354 | ) |
| 355 | dnl |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 356 | dnl handle --enable-testio-debug |
| 357 | dnl |
| 358 | AC_ARG_ENABLE([testio-debug], |
| 359 | [ --enable-testio-debug enable the use of the test I/O manager for debugging], |
| 360 | if test "$enableval" = "no" |
| 361 | then |
| 362 | echo "Disabling testio debugging" |
| 363 | else |
| 364 | AC_DEFINE(CONFIG_TESTIO_DEBUG) |
| 365 | echo "Enabling testio debugging" |
| 366 | fi |
| 367 | , |
| 368 | echo "Disabling testio debugging by default" |
| 369 | ) |
| 370 | dnl |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 371 | dnl handle --enable-debugfs |
| 372 | dnl |
| 373 | AC_ARG_ENABLE([debugfs], |
| 374 | [ --disable-debugfs disable support of debugfs program], |
| 375 | if test "$enableval" = "no" |
| 376 | then |
| 377 | echo "Disabling debugfs support" |
| 378 | DEBUGFS_CMT="#" |
| 379 | else |
| 380 | DEBUGFS_CMT= |
| 381 | echo "Enabling debugfs support" |
| 382 | fi |
| 383 | , |
| 384 | echo "Enabling debugfs support by default" |
| 385 | DEBUGFS_CMT= |
| 386 | ) |
| 387 | AC_SUBST(DEBUGFS_CMT) |
| 388 | dnl |
| 389 | dnl handle --enable-imager |
| 390 | dnl |
| 391 | AC_ARG_ENABLE([imager], |
| 392 | [ --disable-imager disable support of e2image program], |
| 393 | if test "$enableval" = "no" |
| 394 | then |
| 395 | echo "Disabling e2image support" |
| 396 | IMAGER_CMT="#" |
| 397 | else |
| 398 | IMAGER_CMT= |
| 399 | echo "Enabling e2image support" |
| 400 | fi |
| 401 | , |
| 402 | echo "Enabling e2image support by default" |
| 403 | IMAGER_CMT= |
| 404 | ) |
| 405 | AC_SUBST(IMAGER_CMT) |
| 406 | dnl |
| 407 | dnl handle --enable-resizer |
| 408 | dnl |
| 409 | AC_ARG_ENABLE([resizer], |
| 410 | [ --disable-resizer disable support of e2resize program], |
| 411 | if test "$enableval" = "no" |
| 412 | then |
| 413 | echo "Disabling e2resize support" |
| 414 | RESIZER_CMT="#" |
| 415 | else |
| 416 | RESIZER_CMT= |
| 417 | echo "Enabling e2resize support" |
| 418 | fi |
| 419 | , |
| 420 | echo "Enabling e2resize support by default" |
| 421 | RESIZER_CMT= |
| 422 | ) |
| 423 | AC_SUBST(RESIZER_CMT) |
| 424 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 425 | dnl See whether to install the `fsck' wrapper program (that calls e2fsck) |
| 426 | dnl |
| 427 | AC_ARG_ENABLE([fsck], |
| 428 | [ --enable-fsck build fsck wrapper program], |
| 429 | [if test "$enableval" = "no" |
| 430 | then |
| 431 | FSCK_PROG='' FSCK_MAN='' |
| 432 | echo "Not building fsck wrapper" |
| 433 | else |
| 434 | FSCK_PROG=fsck FSCK_MAN=fsck.8 |
| 435 | echo "Building fsck wrapper" |
| 436 | fi] |
| 437 | , |
| 438 | [case "$host_os" in |
Theodore Ts'o | e363240 | 2004-05-04 19:39:54 -0400 | [diff] [blame] | 439 | gnu*) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 440 | FSCK_PROG='' FSCK_MAN='' |
| 441 | echo "Not building fsck wrapper by default" |
| 442 | ;; |
| 443 | *) |
| 444 | FSCK_PROG=fsck FSCK_MAN=fsck.8 |
| 445 | echo "Building fsck wrapper by default" |
| 446 | esac] |
| 447 | ) |
| 448 | AC_SUBST(FSCK_PROG) |
| 449 | AC_SUBST(FSCK_MAN) |
| 450 | dnl |
Theodore Ts'o | 5d40773 | 2004-09-18 14:53:14 -0400 | [diff] [blame] | 451 | dnl See whether to install the `e2initrd-helper' program |
| 452 | dnl |
| 453 | AC_ARG_ENABLE([e2initrd-helper], |
| 454 | [ --enable-e2initrd-helper build e2initrd-helper program], |
| 455 | [if test "$enableval" = "no" |
| 456 | then |
| 457 | E2INITRD_PROG='' E2INITRD_MAN='' |
| 458 | echo "Not building e2initrd helper" |
| 459 | else |
| 460 | E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8 |
| 461 | echo "Building e2initrd helper" |
| 462 | fi] |
| 463 | , |
| 464 | E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8 |
| 465 | echo "Building e2initrd helper by default" |
| 466 | ) |
| 467 | AC_SUBST(E2INITRD_PROG) |
| 468 | AC_SUBST(E2INITRD_MAN) |
Karel Zak | 4db2f59 | 2006-03-08 14:17:28 -0500 | [diff] [blame] | 469 | dnl handle --enable-blkid-devmapper |
| 470 | dnl |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 471 | STATIC_BLKID_DEVMAPPER_LIBS='' |
Karel Zak | 4db2f59 | 2006-03-08 14:17:28 -0500 | [diff] [blame] | 472 | AC_ARG_ENABLE([blkid-devmapper], |
| 473 | [ --enable-blkid-devmapper build with device-mapper support], |
| 474 | [if test "$enableval" = "no" |
| 475 | then |
| 476 | echo "Disabling device-mapper support" |
| 477 | DEVMAPPER_REQ='' |
| 478 | DEVMAPPER_LIBS='' |
| 479 | STATIC_DEVMAPPER_LIBS='' |
| 480 | else |
| 481 | AC_DEFINE(HAVE_DEVMAPPER) |
| 482 | echo "Enabling device-mapper support" |
| 483 | |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 484 | PKG_PROG_PKG_CONFIG() |
Karel Zak | 4db2f59 | 2006-03-08 14:17:28 -0500 | [diff] [blame] | 485 | |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 486 | if test -z "$PKG_CONFIG"; then |
| 487 | echo "pkg-config not installed; please install it." |
| 488 | exit 1; |
| 489 | fi |
| 490 | |
| 491 | AC_CHECK_LIB(devmapper, dm_tree_create, |
| 492 | [DEVMAPPER_LIBS=`$PKG_CONFIG --libs devmapper`; |
| 493 | STATIC_DEVMAPPER_LIBS=`$PKG_CONFIG --static --libs devmapper`; |
| 494 | DEVMAPPER_REQ="devmapper"; |
| 495 | DEVMAPPER_PC_LIBS="-ldevmapper"], |
| 496 | [AC_MSG_ERROR([device-mapper library not found])], |
| 497 | [$DEVMAPPER_LIBS]) |
| 498 | # work around stupid devmapper.pc bug in Debian |
| 499 | case "$STATIC_DEVMAPPER_LIBS" in |
| 500 | *pthread*) |
| 501 | ;; |
| 502 | *) |
| 503 | echo "Working around Debian bug #390243..." |
| 504 | STATIC_DEVMAPPER_LIBS="-pthread $STATIC_DEVMAPPER_LIBS" |
| 505 | ;; |
| 506 | esac |
| 507 | if test "$E2_PKG_CONFIG_STATIC" = "--static"; then |
| 508 | DEVMAPPER_LIBS="$STATIC_DEVMAPPER_LIBS" |
| 509 | STATIC_BLKID_DEVMAPPER_LIBS="$STATIC_DEVMAPPER_LIBS" |
| 510 | fi |
Karel Zak | 4db2f59 | 2006-03-08 14:17:28 -0500 | [diff] [blame] | 511 | fi] |
| 512 | , |
| 513 | echo "Disabling device-mapper support by default" |
| 514 | ) |
| 515 | AC_SUBST(DEVMAPPER_REQ) |
| 516 | AC_SUBST(DEVMAPPER_PC_LIBS) |
| 517 | AC_SUBST(DEVMAPPER_LIBS) |
| 518 | AC_SUBST(STATIC_DEVMAPPER_LIBS) |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 519 | AC_SUBST(STATIC_BLKID_DEVMAPPER_LIBS) |
Karel Zak | 4db2f59 | 2006-03-08 14:17:28 -0500 | [diff] [blame] | 520 | dnl |
Theodore Ts'o | 5d40773 | 2004-09-18 14:53:14 -0400 | [diff] [blame] | 521 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 522 | dnl |
Theodore Ts'o | 3249394 | 2007-12-31 10:45:01 -0500 | [diff] [blame] | 523 | AC_ARG_ENABLE([tls], |
| 524 | [ --disable-tls disable use of thread local support], |
| 525 | [if test "$enableval" = "no" |
| 526 | then |
| 527 | try_tls="" |
| 528 | echo "Disabling thread local support" |
| 529 | else |
| 530 | try_tls="yes" |
| 531 | echo "Enabling thread local support" |
| 532 | fi] |
| 533 | , |
Theodore Ts'o | eafba6c | 2008-07-10 10:21:42 -0400 | [diff] [blame^] | 534 | if test -n "$WITH_DIET_LIBC" |
| 535 | then |
| 536 | try_tls="" |
| 537 | echo "Diet libc does not support thread local support" |
| 538 | else |
| 539 | try_tls="yes" |
| 540 | echo "Try using thread local support by default" |
| 541 | fi |
Theodore Ts'o | 3249394 | 2007-12-31 10:45:01 -0500 | [diff] [blame] | 542 | ) |
| 543 | if test "$try_tls" = "yes" |
| 544 | then |
| 545 | AX_TLS |
| 546 | fi |
| 547 | dnl |
| 548 | dnl |
| 549 | dnl |
Theodore Ts'o | 5610f99 | 2007-12-31 11:16:56 -0500 | [diff] [blame] | 550 | AC_ARG_ENABLE([uuidd], |
| 551 | [ --disable-uuidd disable building the uuid daemon], |
| 552 | [if test "$enableval" = "no" |
| 553 | then |
| 554 | echo "Not building uuidd" |
| 555 | UUIDD_CMT="#" |
| 556 | else |
| 557 | AC_DEFINE(USE_UUIDD) |
| 558 | UUIDD_CMT="" |
| 559 | echo "Building uuidd" |
| 560 | fi] |
| 561 | , |
| 562 | AC_DEFINE(USE_UUIDD) |
| 563 | UUIDD_CMT="" |
| 564 | echo "Building uuidd by default" |
| 565 | ) |
| 566 | AC_SUBST(UUIDD_CMT) |
| 567 | dnl |
| 568 | dnl |
| 569 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 570 | MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library |
| 571 | AC_SUBST_FILE(MAKEFILE_LIBRARY) |
| 572 | dnl |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 573 | dnl Add internationalization support, using gettext. |
| 574 | dnl |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 575 | GETTEXT_PACKAGE=e2fsprogs |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 576 | PACKAGE=e2fsprogs |
| 577 | VERSION="$E2FSPROGS_VERSION" |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 578 | VERSION=0.14.1 |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 579 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") |
| 580 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION") |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 581 | AC_SUBST(GETTEXT_PACKAGE) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 582 | AC_SUBST(PACKAGE) |
| 583 | AC_SUBST(VERSION) |
| 584 | |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 585 | AM_GNU_GETTEXT |
| 586 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 587 | dnl End of configuration options |
| 588 | dnl |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 589 | AC_SUBST(BINARY_TYPE) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 590 | AC_PROG_MAKE_SET |
| 591 | AC_PATH_PROG(LN, ln, ln) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 592 | AC_PROG_LN_S |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 593 | AC_PATH_PROG(MV, mv, mv) |
| 594 | AC_PATH_PROG(CP, cp, cp) |
| 595 | AC_PATH_PROG(RM, rm, rm) |
| 596 | AC_PATH_PROG(CHMOD, chmod, :) |
Theodore Ts'o | 3223701 | 2005-01-17 19:13:39 -0500 | [diff] [blame] | 597 | AC_PROG_AWK |
| 598 | AC_PROG_EGREP |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 599 | AC_PATH_PROG(SED, sed, sed) |
Theodore Ts'o | 9d564f7 | 1999-07-03 20:25:58 +0000 | [diff] [blame] | 600 | AC_PATH_PROG(PERL, perl, perl) |
Theodore Ts'o | 250f79f | 2001-05-19 22:02:22 +0000 | [diff] [blame] | 601 | AC_PATH_PROG(LDCONFIG, ldconfig, :) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 602 | AC_CHECK_TOOL(AR, ar, ar) |
| 603 | AC_CHECK_TOOL(RANLIB, ranlib, :) |
| 604 | AC_CHECK_TOOL(STRIP, strip, :) |
Manish Katiyar | 7321d94 | 2008-04-14 17:20:03 +0530 | [diff] [blame] | 605 | AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ) |
| 606 | if test "_$MAKEINFO" = "_"; then |
| 607 | MAKEINFO="@echo Makeinfo is missing. Info documentation will not be built.;true" |
| 608 | else |
| 609 | case "$MAKEINFO" in |
| 610 | */missing.*) |
| 611 | AC_MSG_WARN([ |
| 612 | *** Makeinfo is missing. Info documentation will not be built.]) |
| 613 | ;; |
| 614 | *) |
| 615 | ;; |
| 616 | esac |
| 617 | fi |
| 618 | AC_SUBST(MAKEINFO) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 619 | AC_PROG_INSTALL |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 620 | # See if we need a separate native compiler. |
| 621 | if test $cross_compiling = no; then |
| 622 | BUILD_CC="$CC" |
| 623 | AC_SUBST(BUILD_CC) |
| 624 | else |
| 625 | AC_CHECK_PROGS(BUILD_CC, gcc cc) |
| 626 | fi |
Christophe GRENIER | e7cc6f7 | 2008-02-16 12:10:56 +0100 | [diff] [blame] | 627 | AC_CHECK_HEADERS(dirent.h errno.h getopt.h malloc.h mntent.h paths.h setjmp.h signal.h stdarg.h stdint.h stdlib.h termios.h unistd.h utime.h linux/fd.h linux/major.h net/if_dl.h netinet/in.h sys/disklabel.h sys/ioctl.h sys/mkdev.h sys/mman.h sys/prctl.h sys/queue.h sys/resource.h sys/select.h sys/socket.h sys/sockio.h sys/stat.h sys/syscall.h sys/sysmacros.h sys/time.h sys/types.h sys/un.h sys/wait.h) |
Theodore Ts'o | da76d6b | 2005-01-18 23:29:01 -0500 | [diff] [blame] | 628 | AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,, |
| 629 | [[ |
| 630 | #if HAVE_SYS_QUEUE_H |
| 631 | #include <sys/queue.h> |
| 632 | #endif |
| 633 | ]]) |
| 634 | AC_CHECK_HEADERS(net/if.h,,, |
| 635 | [[ |
| 636 | #if HAVE_SYS_TYPES_H |
| 637 | #include <sys/types.h> |
| 638 | #endif |
| 639 | #if HAVE_SYS_SOCKET |
| 640 | #include <sys/socket.h> |
| 641 | #endif |
| 642 | ]]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 643 | AC_FUNC_VPRINTF |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 644 | dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen |
| 645 | dnl is not decleared. |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 646 | AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT)],, |
| 647 | [#include <dirent.h>]) |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 648 | dnl Check to see if ssize_t was decleared |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 649 | AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T)],, |
| 650 | [#include <sys/types.h>]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 651 | dnl |
Theodore Ts'o | b0b9c4d | 1997-10-20 23:36:30 +0000 | [diff] [blame] | 652 | dnl Check to see if llseek() is declared in unistd.h. On some libc's |
| 653 | dnl it is, and on others it isn't..... Thank you glibc developers.... |
| 654 | dnl |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 655 | AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)],, |
| 656 | [#include <unistd.h>]) |
Theodore Ts'o | b0b9c4d | 1997-10-20 23:36:30 +0000 | [diff] [blame] | 657 | dnl |
Theodore Ts'o | 6928adc | 2000-05-25 23:28:50 +0000 | [diff] [blame] | 658 | dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files |
| 659 | dnl are so convoluted that I can't tell whether it will always be defined, |
| 660 | dnl and if it isn't defined while lseek64 is defined in the library, |
| 661 | dnl disaster will strike. |
| 662 | dnl |
| 663 | dnl Warning! Use of --enable-gcc-wall may throw off this test. |
| 664 | dnl |
| 665 | dnl |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 666 | AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)],, |
| 667 | [#define _LARGEFILE_SOURCE |
| 668 | #define _LARGEFILE64_SOURCE |
| 669 | #include <unistd.h>]) |
Theodore Ts'o | 6928adc | 2000-05-25 23:28:50 +0000 | [diff] [blame] | 670 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 671 | dnl Word sizes... |
| 672 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 673 | AC_CHECK_SIZEOF(short) |
| 674 | AC_CHECK_SIZEOF(int) |
| 675 | AC_CHECK_SIZEOF(long) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 676 | AC_CHECK_SIZEOF(long long) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 677 | SIZEOF_SHORT=$ac_cv_sizeof_short |
| 678 | SIZEOF_INT=$ac_cv_sizeof_int |
| 679 | SIZEOF_LONG=$ac_cv_sizeof_long |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 680 | SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 681 | AC_SUBST(SIZEOF_SHORT) |
| 682 | AC_SUBST(SIZEOF_INT) |
| 683 | AC_SUBST(SIZEOF_LONG) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 684 | AC_SUBST(SIZEOF_LONG_LONG) |
Theodore Ts'o | 877eb6d | 2001-06-11 06:54:13 +0000 | [diff] [blame] | 685 | AC_C_BIGENDIAN |
Theodore Ts'o | 29a5dee | 2007-07-04 16:28:47 -0400 | [diff] [blame] | 686 | BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh |
Theodore Ts'o | 4ea7ea0 | 2006-04-09 08:41:55 -0400 | [diff] [blame] | 687 | ASM_TYPES_HEADER=./asm_types.h |
| 688 | AC_SUBST_FILE(ASM_TYPES_HEADER) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 689 | dnl |
Theodore Ts'o | 488c75a | 2008-06-07 08:55:21 -0400 | [diff] [blame] | 690 | dnl Save the configuration #defines needed for the public ext2fs.h |
| 691 | dnl header file |
| 692 | dnl |
| 693 | echo "/* These defines are needed for the public ext2fs.h header file */" \ |
| 694 | > public_config.h |
| 695 | if grep HAVE_SYS_TYPES_H confdefs.h > tmp_config.$$; then |
| 696 | uniq tmp_config.$$ >> public_config.h |
| 697 | else |
| 698 | echo "#undef HAVE_SYS_TYPES_H" >> public_config.h |
| 699 | fi |
| 700 | if grep WORDS_BIGENDIAN confdefs.h > tmp_config.$$; then |
| 701 | uniq tmp_config.$$ >> public_config.h |
| 702 | else |
| 703 | echo "#undef WORDS_BIGENDIAN" >> public_config.h |
| 704 | fi |
| 705 | rm -f tmp_config.$$ |
| 706 | PUBLIC_CONFIG_HEADER=./public_config.h |
| 707 | AC_SUBST_FILE(PUBLIC_CONFIG_HEADER) |
| 708 | dnl |
Theodore Ts'o | 0c193f8 | 2003-08-01 14:26:23 -0400 | [diff] [blame] | 709 | dnl See if we have inttypes.h and if intptr_t is defined |
| 710 | dnl |
| 711 | AC_CHECK_HEADERS([inttypes.h]) |
Theodore Ts'o | d2ee56d | 2005-01-09 00:57:45 -0500 | [diff] [blame] | 712 | AC_CHECK_TYPES(intptr_t) |
Theodore Ts'o | 0c193f8 | 2003-08-01 14:26:23 -0400 | [diff] [blame] | 713 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 714 | dnl See if struct stat has a st_flags field, in which case we can get file |
| 715 | dnl flags somewhat portably. Also check for the analogous setter, chflags(). |
| 716 | dnl |
| 717 | AC_MSG_CHECKING(whether struct stat has a st_flags field) |
| 718 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags, |
| 719 | AC_TRY_COMPILE([#include <sys/stat.h>], |
| 720 | [struct stat stat; stat.st_flags = 0;], |
| 721 | [e2fsprogs_cv_struct_st_flags=yes], |
| 722 | [e2fsprogs_cv_struct_st_flags=no])) |
| 723 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags) |
| 724 | if test "$e2fsprogs_cv_struct_st_flags" = yes; then |
Theodore Ts'o | c03bc4e | 1999-10-20 18:20:36 +0000 | [diff] [blame] | 725 | AC_MSG_CHECKING(whether st_flags field is useful) |
| 726 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut, |
| 727 | AC_TRY_COMPILE([#include <sys/stat.h>], |
| 728 | [struct stat stat; stat.st_flags |= UF_IMMUTABLE;], |
| 729 | [e2fsprogs_cv_struct_st_flags_immut=yes], |
| 730 | [e2fsprogs_cv_struct_st_flags_immut=no])) |
| 731 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut) |
| 732 | if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then |
| 733 | AC_DEFINE(HAVE_STAT_FLAGS) |
| 734 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 735 | fi |
Theodore Ts'o | 84ea6e7 | 2004-03-19 19:29:17 -0500 | [diff] [blame] | 736 | dnl |
| 737 | dnl Check for the presence of SA_LEN |
| 738 | dnl |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 739 | AC_CHECK_MEMBER(struct sockaddr.sa_len, |
| 740 | AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),, |
| 741 | [#include <sys/types.h> |
| 742 | #include <sys/socket.h>]) |
Theodore Ts'o | 84ea6e7 | 2004-03-19 19:29:17 -0500 | [diff] [blame] | 743 | dnl |
Theodore Ts'o | 261cd39 | 2008-01-21 13:45:00 -0500 | [diff] [blame] | 744 | AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 745 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 746 | dnl Check to see if -lsocket is required (solaris) to make something |
| 747 | dnl that uses socket() to compile; this is needed for the UUID library |
| 748 | dnl |
| 749 | SOCKET_LIB='' |
| 750 | AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket]) |
| 751 | AC_SUBST(SOCKET_LIB) |
| 752 | dnl |
Theodore Ts'o | 3ae497e | 2003-03-16 06:26:25 -0500 | [diff] [blame] | 753 | dnl Check to see if libdl exists for the sake of dlopen |
| 754 | dnl |
| 755 | DLOPEN_LIB='' |
| 756 | AC_CHECK_LIB(dl, dlopen, |
| 757 | [DLOPEN_LIB=-ldl |
| 758 | AC_DEFINE(HAVE_DLOPEN)]) |
| 759 | AC_SUBST(DLOPEN_LIB) |
| 760 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 761 | dnl See if optreset exists |
| 762 | dnl |
| 763 | AC_MSG_CHECKING(for optreset) |
| 764 | AC_CACHE_VAL(ac_cv_have_optreset, |
| 765 | [AC_EGREP_HEADER(optreset, unistd.h, |
| 766 | ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl |
| 767 | AC_MSG_RESULT($ac_cv_have_optreset) |
| 768 | if test $ac_cv_have_optreset = yes; then |
| 769 | AC_DEFINE(HAVE_OPTRESET) |
| 770 | fi |
| 771 | dnl |
Theodore Ts'o | e54635d | 2006-08-06 14:33:13 -0400 | [diff] [blame] | 772 | dnl Check for unified diff |
| 773 | dnl |
| 774 | AC_MSG_CHECKING(for unified diff option) |
Theodore Ts'o | 27f991b | 2008-04-01 20:32:55 -0400 | [diff] [blame] | 775 | if diff -u $0 $0 > /dev/null 2>&1 ; then |
Theodore Ts'o | e54635d | 2006-08-06 14:33:13 -0400 | [diff] [blame] | 776 | UNI_DIFF_OPTS=-u |
| 777 | else |
| 778 | UNI_DIFF_OPTS=-c |
| 779 | fi |
| 780 | AC_MSG_RESULT($UNI_DIFF_OPTS) |
| 781 | AC_SUBST(UNI_DIFF_OPTS) |
| 782 | dnl |
Theodore Ts'o | 8f3f29d | 2000-02-11 05:04:44 +0000 | [diff] [blame] | 783 | dnl We use the EXT2 ioctls only under Linux |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 784 | dnl |
Theodore Ts'o | 8f3f29d | 2000-02-11 05:04:44 +0000 | [diff] [blame] | 785 | case "$host_os" in |
| 786 | linux*) |
| 787 | AC_DEFINE(HAVE_EXT2_IOCTLS) |
| 788 | ;; |
| 789 | esac |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 790 | dnl |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 791 | dnl OS-specific uncomment control |
Theodore Ts'o | e6f2bda | 2002-08-18 03:37:10 -0400 | [diff] [blame] | 792 | dnl |
| 793 | LINUX_CMT="#" |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 794 | CYGWIN_CMT="#" |
| 795 | UNIX_CMT= |
Theodore Ts'o | e6f2bda | 2002-08-18 03:37:10 -0400 | [diff] [blame] | 796 | case "$host_os" in |
| 797 | linux*) |
| 798 | LINUX_CMT= |
| 799 | ;; |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 800 | cygwin) |
| 801 | CYGWIN_CMT= |
| 802 | UNIX_CMT="#" |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 803 | ;; |
Theodore Ts'o | e6f2bda | 2002-08-18 03:37:10 -0400 | [diff] [blame] | 804 | esac |
| 805 | AC_SUBST(LINUX_CMT) |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 806 | AC_SUBST(CYGWIN_CMT) |
| 807 | AC_SUBST(UNIX_CMT) |
Theodore Ts'o | e6f2bda | 2002-08-18 03:37:10 -0400 | [diff] [blame] | 808 | dnl |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 809 | dnl Linux and Hurd places root files in the / by default |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 810 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 811 | case "$host_os" in |
Theodore Ts'o | 93636bd | 2003-07-12 02:45:05 -0400 | [diff] [blame] | 812 | linux* | gnu* | k*bsd*-gnu) |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 813 | if test "$prefix" = NONE -a "$root_prefix" = NONE ; then |
| 814 | root_prefix=""; |
| 815 | echo "On $host_os systems, root_prefix defaults to ''" |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 816 | fi |
| 817 | ;; |
| 818 | esac |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 819 | dnl |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 820 | dnl On Linux/hurd, force the prefix to be /usr |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 821 | dnl |
| 822 | case "$host_os" in |
Theodore Ts'o | 93636bd | 2003-07-12 02:45:05 -0400 | [diff] [blame] | 823 | linux* | gnu* | k*bsd*-gnu) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 824 | if test "$prefix" = NONE ; then |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 825 | prefix="/usr"; |
| 826 | echo "On $host_os systems, prefix defaults to /usr" |
Theodore Ts'o | bff61a7 | 2002-05-21 22:21:38 -0400 | [diff] [blame] | 827 | if test "$mandir" = '${prefix}/man' ; then |
| 828 | echo "...and mandir defaults to /usr/share/man" |
| 829 | mandir=/usr/share/man |
| 830 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 831 | fi |
| 832 | ;; |
| 833 | esac |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 834 | if test "$root_prefix" = NONE ; then |
Theodore Ts'o | ffe1991 | 1998-04-08 06:05:49 +0000 | [diff] [blame] | 835 | if test "$prefix" = NONE ; then |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 836 | root_prefix="$ac_default_prefix" |
| 837 | else |
| 838 | root_prefix="$prefix" |
| 839 | fi |
Theodore Ts'o | b5ffead | 2002-05-11 19:17:00 -0400 | [diff] [blame] | 840 | root_bindir=$bindir |
| 841 | root_sbindir=$sbindir |
| 842 | root_libdir=$libdir |
| 843 | root_sysconfdir=$sysconfdir |
| 844 | else |
| 845 | root_bindir='${root_prefix}/bin' |
| 846 | root_sbindir='${root_prefix}/sbin' |
| 847 | root_libdir='${root_prefix}/lib' |
| 848 | root_sysconfdir='${root_prefix}/etc' |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 849 | fi |
Theodore Ts'o | c4ef11c | 2008-01-04 16:55:37 -0500 | [diff] [blame] | 850 | if test "$bindir" != '${exec_prefix}/bin'; then |
| 851 | root_bindir=$bindir |
| 852 | echo "Setting root_bindir to $root_bindir" |
| 853 | fi |
| 854 | if test "$sbindir" != '${exec_prefix}/sbin'; then |
| 855 | root_sbindir=$sbindir |
| 856 | echo "Setting root_sbindir to $root_sbindir" |
| 857 | fi |
| 858 | if test "$libdir" != '${exec_prefix}/lib'; then |
| 859 | root_libdir=$libdir |
| 860 | echo "Setting root_libdir to $root_libdir" |
| 861 | fi |
| 862 | if test "$sysconfdir" != '${prefix}/etc'; then |
| 863 | root_sysconfdir=$sysconfdir |
| 864 | echo "Setting root_sysconfdir to $root_sysconfdir" |
| 865 | fi |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 866 | AC_SUBST(root_prefix) |
Theodore Ts'o | b5ffead | 2002-05-11 19:17:00 -0400 | [diff] [blame] | 867 | AC_SUBST(root_bindir) |
| 868 | AC_SUBST(root_sbindir) |
| 869 | AC_SUBST(root_libdir) |
| 870 | AC_SUBST(root_sysconfdir) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 871 | dnl |
| 872 | dnl See if -static works. |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 873 | dnl |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 874 | AC_MSG_CHECKING([whether linker accepts -static]) |
| 875 | AC_CACHE_VAL(ac_cv_e2fsprogs_use_static, |
| 876 | [SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static" |
| 877 | AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);], |
| 878 | ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no) |
| 879 | LDFLAGS=$SAVE_LDFLAGS]) |
Theodore Ts'o | defde78 | 1999-01-04 07:39:19 +0000 | [diff] [blame] | 880 | dnl |
| 881 | dnl Regardless of how the test turns out, Solaris doesn't handle -static |
| 882 | dnl This is caused by the socket library requiring the nsl library, which |
| 883 | dnl requires the -dl library, which only works for dynamically linked |
| 884 | dnl programs. It basically means you can't have statically linked programs |
| 885 | dnl which use the network under Solaris. |
| 886 | dnl |
| 887 | case "$host_os" in |
| 888 | solaris2.*) |
| 889 | ac_cv_e2fsprogs_use_static=no |
| 890 | ;; |
| 891 | esac |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 892 | AC_MSG_RESULT($ac_cv_e2fsprogs_use_static) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 893 | LDFLAG_STATIC= |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 894 | if test $ac_cv_e2fsprogs_use_static = yes; then |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 895 | LDFLAG_STATIC=-static |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 896 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 897 | AC_SUBST(LDFLAG_STATIC) |
| 898 | dnl |
Theodore Ts'o | 07a0db1 | 2003-07-05 14:50:24 -0400 | [diff] [blame] | 899 | dnl Work around mysterious Darwin / GNU libintl problem |
| 900 | dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like |
| 901 | dnl Apple hacked gcc somehow?) |
| 902 | dnl |
| 903 | case "$host_os" in |
| 904 | darwin*) |
| 905 | echo "Using Apple Darwin / GNU libintl workaround" |
| 906 | AC_DEFINE(_INTL_REDIRECT_MACROS) |
| 907 | ;; |
| 908 | esac |
| 909 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 910 | dnl Make the ss and et directories work correctly. |
| 911 | dnl |
| 912 | SS_DIR=`cd ${srcdir}/lib/ss; pwd` |
| 913 | ET_DIR=`cd ${srcdir}/lib/et; pwd` |
| 914 | AC_SUBST(SS_DIR) |
| 915 | AC_SUBST(ET_DIR) |
| 916 | dnl |
| 917 | dnl Only try to run the test suite if we're not cross compiling. |
| 918 | dnl |
| 919 | if test "$cross_compiling" = yes ; then |
| 920 | DO_TEST_SUITE= |
| 921 | else |
| 922 | DO_TEST_SUITE=check |
| 923 | fi |
| 924 | AC_SUBST(DO_TEST_SUITE) |
| 925 | dnl |
Theodore Ts'o | c6f35b8 | 2003-05-17 16:29:27 -0400 | [diff] [blame] | 926 | dnl Only include the intl include files if we're building with them |
| 927 | dnl |
| 928 | INTL_FLAGS= |
| 929 | if test "$USE_INCLUDED_LIBINTL" = "yes" ; then |
| 930 | INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl' |
| 931 | fi |
| 932 | AC_SUBST(INTL_FLAGS) |
| 933 | dnl |
Theodore Ts'o | dd947da | 2005-11-09 18:37:07 -0400 | [diff] [blame] | 934 | dnl Build CFLAGS |
| 935 | dnl |
| 936 | if test $cross_compiling = no; then |
| 937 | BUILD_CFLAGS="$CFLAGS" |
| 938 | BUILD_LDFLAGS="$LDFLAGS" |
| 939 | else |
| 940 | BUILD_CFLAGS= |
| 941 | BUILD_LDFLAGS= |
| 942 | fi |
| 943 | AC_SUBST(BUILD_CFLAGS) |
| 944 | AC_SUBST(BUILD_LDFLAGS) |
| 945 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 946 | dnl Make our output files, being sure that we create the some miscellaneous |
| 947 | dnl directories |
| 948 | dnl |
| 949 | test -d lib || mkdir lib |
| 950 | test -d include || mkdir include |
| 951 | test -d include/linux || mkdir include/linux |
Theodore Ts'o | defde78 | 1999-01-04 07:39:19 +0000 | [diff] [blame] | 952 | test -d include/asm || mkdir include/asm |
Theodore Ts'o | bff0cc9 | 2003-03-23 01:37:53 -0500 | [diff] [blame] | 953 | for i in MCONFIG Makefile e2fsprogs.spec \ |
| 954 | util/Makefile util/subst.conf util/gen-tarball \ |
Theodore Ts'o | 4ea7ea0 | 2006-04-09 08:41:55 -0400 | [diff] [blame] | 955 | lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \ |
| 956 | lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \ |
Theodore Ts'o | 94ba8c7 | 2003-03-02 02:07:14 -0500 | [diff] [blame] | 957 | lib/uuid/Makefile lib/uuid/uuid_types.h \ |
| 958 | lib/blkid/Makefile lib/blkid/blkid_types.h \ |
Theodore Ts'o | e644186 | 2005-01-26 12:59:25 -0500 | [diff] [blame] | 959 | lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \ |
| 960 | 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] | 961 | misc/Makefile ext2ed/Makefile e2fsck/Makefile \ |
Theodore Ts'o | 94ba8c7 | 2003-03-02 02:07:14 -0500 | [diff] [blame] | 962 | debugfs/Makefile tests/Makefile tests/progs/Makefile \ |
| 963 | resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do |
| 964 | if test -d `dirname ${srcdir}/$i` ; then |
| 965 | outlist="$outlist $i" |
| 966 | fi |
| 967 | done |
| 968 | AC_OUTPUT($outlist) |
Theodore Ts'o | ee683a1 | 2005-02-05 15:53:56 -0500 | [diff] [blame] | 969 | if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi |
| 970 | |