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