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