Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1 | AC_INIT(version.h) |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 2 | AC_PREREQ(2.12) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 3 | MCONFIG=./MCONFIG |
| 4 | AC_SUBST_FILE(MCONFIG) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 5 | BINARY_TYPE=bin |
| 6 | dnl |
| 7 | dnl This is to figure out the version number and the date.... |
| 8 | dnl |
| 9 | E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \ |
| 10 | | awk '{print $3}' | tr \" " " | awk '{print $1}'` |
| 11 | DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \ |
| 12 | | tr \" " "` |
| 13 | MONTH=`echo $DATE | awk -F- '{print $2}'` |
| 14 | YEAR=`echo $DATE | awk -F- '{print $3}'` |
| 15 | |
Theodore Ts'o | 40fa8cc | 1999-01-09 05:06:02 +0000 | [diff] [blame] | 16 | if expr $YEAR ">" 1900 > /dev/null ; then |
| 17 | E2FSPROGS_YEAR=$YEAR |
| 18 | elif expr $YEAR ">" 90 >/dev/null ; then |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 19 | E2FSPROGS_YEAR=19$YEAR |
| 20 | else |
| 21 | E2FSPROGS_YEAR=20$YEAR |
| 22 | fi |
| 23 | |
| 24 | case $MONTH in |
| 25 | Jan) E2FSPROGS_MONTH="January" ;; |
| 26 | Feb) E2FSPROGS_MONTH="February" ;; |
| 27 | Mar) E2FSPROGS_MONTH="March" ;; |
| 28 | Apr) E2FSPROGS_MONTH="April" ;; |
| 29 | May) E2FSPROGS_MONTH="May" ;; |
| 30 | Jun) E2FSPROGS_MONTH="June" ;; |
| 31 | Jul) E2FSPROGS_MONTH="July" ;; |
| 32 | Aug) E2FSPROGS_MONTH="August" ;; |
| 33 | Sep) E2FSPROGS_MONTH="September" ;; |
| 34 | Oct) E2FSPROGS_MONTH="October" ;; |
| 35 | Nov) E2FSPROGS_MONTH="November" ;; |
| 36 | Dec) E2FSPROGS_MONTH="December" ;; |
| 37 | *) echo "Unknown month $MONTH??" ;; |
| 38 | esac |
| 39 | |
| 40 | unset DATE MONTH YEAR |
| 41 | echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION" |
| 42 | echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}" |
| 43 | AC_SUBST(E2FSPROGS_YEAR) |
| 44 | AC_SUBST(E2FSPROGS_MONTH) |
| 45 | AC_SUBST(E2FSPROGS_VERSION) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 46 | AC_REQUIRE([AC_CANONICAL_HOST]) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 47 | dnl |
| 48 | dnl set $(CC) from --with-cc=value |
| 49 | dnl |
| 50 | AC_ARG_WITH([cc], |
| 51 | [ --with-cc=COMPILER select compiler to use], |
| 52 | AC_MSG_RESULT(CC=$withval) |
| 53 | CC=$withval, |
| 54 | if test -z "$CC" ; then CC=cc; fi |
| 55 | [AC_MSG_RESULT(CC defaults to $CC)])dnl |
| 56 | export CC |
| 57 | AC_SUBST([CC]) |
Theodore Ts'o | 73ae2d4 | 2000-02-02 16:13:14 +0000 | [diff] [blame] | 58 | AC_PROG_CC |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 59 | dnl |
| 60 | dnl set $(LD) from --with-linker=value |
| 61 | dnl |
| 62 | AC_ARG_WITH([linker], |
| 63 | [ --with-linker=LINKER select linker to use], |
| 64 | AC_MSG_RESULT(LD=$withval) |
| 65 | LD=$withval, |
| 66 | if test -z "$LD" ; then LD=$CC; fi |
| 67 | [AC_MSG_RESULT(LD defaults to $LD)])dnl |
| 68 | export LD |
| 69 | AC_SUBST([LD]) |
| 70 | dnl |
| 71 | dnl set $(CCOPTS) from --with-ccopts=value |
| 72 | dnl |
| 73 | AC_ARG_WITH([ccopts], |
| 74 | [ --with-ccopts=CCOPTS select compiler command line options], |
| 75 | AC_MSG_RESULT(CCOPTS is $withval) |
| 76 | CCOPTS=$withval |
| 77 | CFLAGS="$CFLAGS $withval", |
| 78 | CCOPTS=)dnl |
| 79 | AC_SUBST(CCOPTS) |
| 80 | dnl |
Theodore Ts'o | f8bd980 | 1999-10-26 04:19:45 +0000 | [diff] [blame] | 81 | dnl On systems without linux header files, we add an extra include directory |
| 82 | dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here |
| 83 | dnl is quoted so that it gets expanded by make, not by configure. |
| 84 | dnl |
| 85 | 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] | 86 | if test "$linux_headers" != yes; then |
| 87 | LINUX_INCLUDE='-I$(top_builddir)/include' |
Theodore Ts'o | f8bd980 | 1999-10-26 04:19:45 +0000 | [diff] [blame] | 88 | fi |
| 89 | AC_SUBST(LINUX_INCLUDE) |
| 90 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 91 | dnl Set default values for library extentions. Will be dealt with after |
| 92 | dnl parsing configuration opions, which may modify these |
| 93 | dnl |
| 94 | LIB_EXT=.a |
| 95 | STATIC_LIB_EXT=.a |
| 96 | PROFILE_LIB_EXT=.a |
| 97 | dnl |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 98 | dnl set $(LDFLAGS) from --with-ldopts=value |
| 99 | dnl |
| 100 | AC_ARG_WITH([ldopts], |
| 101 | [ --with-ldopts=LDOPTS select linker command line options], |
| 102 | AC_MSG_RESULT(LDFLAGS is $withval) |
| 103 | LDFLAGS=$withval, |
| 104 | LDFLAGS=)dnl |
| 105 | AC_SUBST(LDFLAGS) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 106 | dnl |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 107 | dnl Allow separate `root_prefix' to be specified |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 108 | dnl |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 109 | AC_ARG_WITH([root-prefix], |
| 110 | [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root], |
| 111 | root_prefix=$withval, |
| 112 | root_prefix=NONE)dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 113 | dnl |
Theodore Ts'o | 1917875 | 2000-02-11 15:55:07 +0000 | [diff] [blame] | 114 | dnl handle --enable-compression |
| 115 | dnl |
| 116 | AC_ARG_ENABLE([compression], |
| 117 | [ --enable-compression enable EXPERIMENTAL compression support], |
| 118 | if test "$enableval" = "no" |
| 119 | then |
| 120 | echo "Disabling compression support" |
| 121 | else |
| 122 | AC_DEFINE(ENABLE_COMPRESSION) |
| 123 | echo "Enabling compression support" |
| 124 | echo "WARNING: Compression support is experimental" |
| 125 | fi |
| 126 | , |
| 127 | echo "Disabling compression support by default" |
| 128 | ) |
| 129 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 130 | dnl handle --enable-dll-shlibs |
| 131 | dnl |
| 132 | AC_ARG_ENABLE([dll-shlibs], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 133 | [ --enable-dll-shlibs select DLL libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 134 | if test "$enableval" = "no" |
| 135 | then |
| 136 | DLL_CMT=# |
| 137 | MAKEFILE_DLL=/dev/null |
| 138 | echo "Disabling DLL shared libraries" |
| 139 | else |
| 140 | DLL_CMT= |
| 141 | MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 142 | BINARY_TYPE=dllbin |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 143 | LIB_EXT=.sa |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 144 | echo "Enabling DLL shared libraries" |
| 145 | fi |
| 146 | , |
| 147 | MAKEFILE_DLL=/dev/null |
| 148 | DLL_CMT=# |
| 149 | echo "Disabling DLL shared libraries by default" |
| 150 | ) |
| 151 | AC_SUBST(DLL_CMT) |
| 152 | AC_SUBST_FILE(MAKEFILE_DLL) |
| 153 | dnl |
| 154 | dnl handle --enable-elf-shlibs |
| 155 | dnl |
| 156 | AC_ARG_ENABLE([elf-shlibs], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 157 | [ --enable-elf-shlibs select ELF shared libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 158 | if test "$enableval" = "no" |
| 159 | then |
| 160 | ELF_CMT=# |
| 161 | MAKEFILE_ELF=/dev/null |
| 162 | echo "Disabling ELF shared libraries" |
| 163 | else |
| 164 | ELF_CMT= |
| 165 | MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib |
Theodore Ts'o | f5955dd | 2000-10-25 02:38:39 +0000 | [diff] [blame] | 166 | [case "$host_os" in |
| 167 | solaris2.*) |
| 168 | MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib |
| 169 | ;; |
| 170 | esac] |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 171 | BINARY_TYPE=elfbin |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 172 | LIB_EXT=.so |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 173 | echo "Enabling ELF shared libraries" |
| 174 | fi |
| 175 | , |
| 176 | MAKEFILE_ELF=/dev/null |
| 177 | ELF_CMT=# |
| 178 | echo "Disabling ELF shared libraries by default" |
| 179 | ) |
| 180 | AC_SUBST(ELF_CMT) |
| 181 | AC_SUBST_FILE(MAKEFILE_ELF) |
| 182 | dnl |
| 183 | dnl handle --enable-bsd-shlibs |
| 184 | dnl |
| 185 | AC_ARG_ENABLE([bsd-shlibs], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 186 | [ --enable-bsd-shlibs select BSD shared libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 187 | if test "$enableval" = "no" |
| 188 | then |
| 189 | BSDLIB_CMT=# |
| 190 | MAKEFILE_BSDLIB=/dev/null |
| 191 | echo "Disabling BSD shared libraries" |
| 192 | else |
| 193 | BSDLIB_CMT= |
| 194 | MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 195 | LIB_EXT=.so |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 196 | echo "Enabling BSD shared libraries" |
| 197 | fi |
| 198 | , |
| 199 | MAKEFILE_BSDLIB=/dev/null |
| 200 | BSDLIB_CMT=# |
| 201 | echo "Disabling BSD shared libraries by default" |
| 202 | ) |
| 203 | AC_SUBST(BSDLIB_CMT) |
| 204 | AC_SUBST_FILE(MAKEFILE_BSDLIB) |
| 205 | dnl |
Theodore Ts'o | 80bfaa3 | 2000-08-18 15:08:37 +0000 | [diff] [blame] | 206 | dnl handle --enable-jfs-debug |
| 207 | dnl |
| 208 | AC_ARG_ENABLE([jfs-debug], |
| 209 | [ --enable-jfs-debug enable journal debugging], |
| 210 | if test "$enableval" = "no" |
| 211 | then |
| 212 | echo "Disabling journal debugging" |
| 213 | else |
| 214 | AC_DEFINE(JFS_DEBUG) |
| 215 | echo "Enabling journal debugging" |
| 216 | fi |
| 217 | , |
| 218 | echo "Disabling journal debugging by default" |
| 219 | ) |
| 220 | dnl |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 221 | dnl Add internationalization support, using gettext. |
| 222 | dnl |
| 223 | PACKAGE=e2fsprogs |
| 224 | VERSION="$E2FSPROGS_VERSION" |
| 225 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") |
| 226 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION") |
| 227 | AC_SUBST(PACKAGE) |
| 228 | AC_SUBST(VERSION) |
| 229 | |
Theodore Ts'o | 1917875 | 2000-02-11 15:55:07 +0000 | [diff] [blame] | 230 | ALL_LINGUAS="it nyc" |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 231 | AM_GNU_GETTEXT |
| 232 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 233 | dnl handle --enable-profile |
| 234 | dnl |
| 235 | AC_ARG_ENABLE([profile], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 236 | [ --enable-profile build profiling libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 237 | if test "$enableval" = "no" |
| 238 | then |
| 239 | PROFILE_CMT=# |
| 240 | MAKEFILE_PROFILE=/dev/null |
| 241 | echo "Disabling profiling libraries" |
| 242 | else |
| 243 | PROFILE_CMT= |
| 244 | MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 245 | PROFILED_LIB_EXT=_p.a |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 246 | echo "Building profiling libraries" |
| 247 | fi |
| 248 | , |
| 249 | PROFILE_CMT=# |
| 250 | MAKEFILE_PROFILE=/dev/null |
| 251 | echo "Disabling profiling libraries by default" |
| 252 | ) |
| 253 | AC_SUBST(PROFILE_CMT) |
| 254 | AC_SUBST_FILE(MAKEFILE_PROFILE) |
| 255 | dnl |
| 256 | dnl handle --enable-checker |
| 257 | dnl |
| 258 | AC_ARG_ENABLE([checker], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 259 | [ --enable-checker build checker libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 260 | if test "$enableval" = "no" |
| 261 | then |
| 262 | CHECKER_CMT=# |
| 263 | MAKEFILE_CHECKER=/dev/null |
| 264 | echo "Disabling checker libraries" |
| 265 | else |
| 266 | CHECKER_CMT= |
| 267 | MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker |
| 268 | echo "Building checker libraries" |
| 269 | fi |
| 270 | , |
| 271 | CHECKER_CMT=# |
| 272 | MAKEFILE_CHECKER=/dev/null |
| 273 | echo "Disabling checker libraries by default" |
| 274 | ) |
| 275 | AC_SUBST(CHECKER_CMT) |
| 276 | AC_SUBST_FILE(MAKEFILE_CHECKER) |
| 277 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 278 | dnl Substitute library extensions |
| 279 | dnl |
| 280 | AC_SUBST(LIB_EXT) |
| 281 | AC_SUBST(STATIC_LIB_EXT) |
| 282 | AC_SUBST(PROFILED_LIB_EXT) |
| 283 | dnl |
Theodore Ts'o | 4d0f3e1 | 2001-01-11 15:48:50 +0000 | [diff] [blame] | 284 | dnl handle --enable-dynamic-e2fsck |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 285 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 286 | AC_ARG_ENABLE([dynamic-e2fsck], |
| 287 | [ --enable-dynamic-e2fsck build e2fsck dynamically], |
| 288 | if test "$enableval" = "no" |
| 289 | then |
| 290 | E2FSCK_TYPE=static |
| 291 | echo "Building e2fsck statically" |
| 292 | else |
| 293 | E2FSCK_TYPE=shared |
| 294 | echo "Building e2fsck dynamically" |
| 295 | fi |
| 296 | , |
| 297 | E2FSCK_TYPE=static |
| 298 | echo "Building e2fsck statically by default" |
| 299 | ) |
| 300 | AC_SUBST(E2FSCK_TYPE) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 301 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 302 | dnl See whether to install the `fsck' wrapper program (that calls e2fsck) |
| 303 | dnl |
| 304 | AC_ARG_ENABLE([fsck], |
| 305 | [ --enable-fsck build fsck wrapper program], |
| 306 | [if test "$enableval" = "no" |
| 307 | then |
| 308 | FSCK_PROG='' FSCK_MAN='' |
| 309 | echo "Not building fsck wrapper" |
| 310 | else |
| 311 | FSCK_PROG=fsck FSCK_MAN=fsck.8 |
| 312 | echo "Building fsck wrapper" |
| 313 | fi] |
| 314 | , |
| 315 | [case "$host_os" in |
| 316 | gnu*) |
| 317 | FSCK_PROG='' FSCK_MAN='' |
| 318 | echo "Not building fsck wrapper by default" |
| 319 | ;; |
| 320 | *) |
| 321 | FSCK_PROG=fsck FSCK_MAN=fsck.8 |
| 322 | echo "Building fsck wrapper by default" |
| 323 | esac] |
| 324 | ) |
| 325 | AC_SUBST(FSCK_PROG) |
| 326 | AC_SUBST(FSCK_MAN) |
| 327 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 328 | dnl |
| 329 | MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library |
| 330 | AC_SUBST_FILE(MAKEFILE_LIBRARY) |
| 331 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 332 | dnl |
| 333 | AC_ARG_ENABLE([old-bitops], |
| 334 | [ --enable-old-bitops Use old (non-standard but native) bitmask operations], |
| 335 | if test "$enableval" = "no" |
| 336 | then |
| 337 | echo "Using new (standard) bitmask operations" |
| 338 | else |
| 339 | AC_DEFINE(EXT2_OLD_BITOPS) |
| 340 | echo "Using old (native) bitmask operations" |
| 341 | |
| 342 | fi |
| 343 | , |
| 344 | echo "Using standard bitmask operations by default" |
| 345 | ) |
| 346 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 347 | dnl End of configuration options |
| 348 | dnl |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 349 | AC_SUBST(BINARY_TYPE) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 350 | AC_PROG_MAKE_SET |
| 351 | AC_PATH_PROG(LN, ln, ln) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 352 | AC_PROG_LN_S |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 353 | AC_PATH_PROG(MV, mv, mv) |
| 354 | AC_PATH_PROG(CP, cp, cp) |
| 355 | AC_PATH_PROG(RM, rm, rm) |
| 356 | AC_PATH_PROG(CHMOD, chmod, :) |
| 357 | AC_PATH_PROG(AWK, awk, awk) |
| 358 | AC_PATH_PROG(SED, sed, sed) |
Theodore Ts'o | 9d564f7 | 1999-07-03 20:25:58 +0000 | [diff] [blame] | 359 | AC_PATH_PROG(PERL, perl, perl) |
Theodore Ts'o | 250f79f | 2001-05-19 22:02:22 +0000 | [diff] [blame] | 360 | AC_PATH_PROG(LDCONFIG, ldconfig, :) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 361 | AC_CHECK_TOOL(AR, ar, ar) |
| 362 | AC_CHECK_TOOL(RANLIB, ranlib, :) |
| 363 | AC_CHECK_TOOL(STRIP, strip, :) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 364 | AC_PROG_INSTALL |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 365 | # See if we need a separate native compiler. |
| 366 | if test $cross_compiling = no; then |
| 367 | BUILD_CC="$CC" |
| 368 | AC_SUBST(BUILD_CC) |
| 369 | else |
| 370 | AC_CHECK_PROGS(BUILD_CC, gcc cc) |
| 371 | fi |
Theodore Ts'o | 4d0f3e1 | 2001-01-11 15:48:50 +0000 | [diff] [blame] | 372 | AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.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/mkdev.h sys/mount.h sys/sockio.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h net/if.h netinet/in.h) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 373 | AC_FUNC_VPRINTF |
| 374 | dnl |
| 375 | dnl See if struct dirent has a d_namlen field (like bsd systems), implying |
| 376 | dnl that the actual length of the structure may be grater than the declared |
| 377 | dnl length. |
| 378 | dnl |
| 379 | AC_MSG_CHECKING(whether struct dirent has a d_namlen field) |
| 380 | AC_CACHE_VAL(e2fsprogs_cv_struct_d_namlen, |
| 381 | AC_TRY_COMPILE( |
| 382 | [#include <sys/types.h> |
| 383 | #include <dirent.h>], |
| 384 | [struct dirent de; de.d_namlen = 0;], |
| 385 | [e2fsprogs_cv_struct_d_namlen=yes], |
| 386 | [e2fsprogs_cv_struct_d_namlen=no])) |
| 387 | AC_MSG_RESULT($e2fsprogs_cv_struct_d_namlen) |
| 388 | if test "$e2fsprogs_cv_struct_d_namlen" = yes; then |
| 389 | AC_DEFINE(HAVE_DIRENT_NAMLEN) |
| 390 | fi |
| 391 | dnl |
Theodore Ts'o | b0b9c4d | 1997-10-20 23:36:30 +0000 | [diff] [blame] | 392 | dnl Check to see if llseek() is declared in unistd.h. On some libc's |
| 393 | dnl it is, and on others it isn't..... Thank you glibc developers.... |
| 394 | dnl |
| 395 | dnl Warning! Use of --enable-gcc-wall may throw off this test. |
| 396 | dnl |
| 397 | dnl |
| 398 | AC_MSG_CHECKING(whether llseek declared in unistd.h) |
| 399 | AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype, |
| 400 | AC_TRY_COMPILE( |
| 401 | [#include <unistd.h>], [extern int llseek(int);], |
| 402 | [e2fsprogs_cv_have_llseek_prototype=no], |
| 403 | [e2fsprogs_cv_have_llseek_prototype=yes])) |
| 404 | AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype) |
| 405 | if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then |
| 406 | AC_DEFINE(HAVE_LLSEEK_PROTOTYPE) |
| 407 | fi |
| 408 | dnl |
Theodore Ts'o | 6928adc | 2000-05-25 23:28:50 +0000 | [diff] [blame] | 409 | dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files |
| 410 | dnl are so convoluted that I can't tell whether it will always be defined, |
| 411 | dnl and if it isn't defined while lseek64 is defined in the library, |
| 412 | dnl disaster will strike. |
| 413 | dnl |
| 414 | dnl Warning! Use of --enable-gcc-wall may throw off this test. |
| 415 | dnl |
| 416 | dnl |
| 417 | AC_MSG_CHECKING(whether lseek64 declared in unistd.h) |
| 418 | AC_CACHE_VAL(e2fsprogs_cv_have_lseek64_prototype, |
| 419 | AC_TRY_COMPILE( |
| 420 | [#define _LARGEFILE_SOURCE |
| 421 | #define _LARGEFILE64_SOURCE |
| 422 | #include <unistd.h>], [extern int lseek64(int);], |
| 423 | [e2fsprogs_cv_have_lseek64_prototype=no], |
| 424 | [e2fsprogs_cv_have_lseek64_prototype=yes])) |
| 425 | AC_MSG_RESULT($e2fsprogs_cv_have_lseek64_prototype) |
| 426 | if test "$e2fsprogs_cv_have_lseek64_prototype" = yes; then |
| 427 | AC_DEFINE(HAVE_LSEEK64_PROTOTYPE) |
| 428 | fi |
| 429 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 430 | dnl Word sizes... |
| 431 | dnl |
| 432 | if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then |
| 433 | # if cross-compiling, with no cached values, just assume something common. |
| 434 | ac_cv_sizeof_short=2 |
| 435 | ac_cv_sizeof_int=4 |
| 436 | ac_cv_sizeof_long=4 |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 437 | ac_cv_sizeof_long_long=8 |
| 438 | 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] | 439 | fi |
| 440 | AC_CHECK_SIZEOF(short) |
| 441 | AC_CHECK_SIZEOF(int) |
| 442 | AC_CHECK_SIZEOF(long) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 443 | AC_CHECK_SIZEOF(long long) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 444 | SIZEOF_SHORT=$ac_cv_sizeof_short |
| 445 | SIZEOF_INT=$ac_cv_sizeof_int |
| 446 | SIZEOF_LONG=$ac_cv_sizeof_long |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 447 | SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 448 | AC_SUBST(SIZEOF_SHORT) |
| 449 | AC_SUBST(SIZEOF_INT) |
| 450 | AC_SUBST(SIZEOF_LONG) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 451 | AC_SUBST(SIZEOF_LONG_LONG) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 452 | dnl |
| 453 | dnl See if struct stat has a st_flags field, in which case we can get file |
| 454 | dnl flags somewhat portably. Also check for the analogous setter, chflags(). |
| 455 | dnl |
| 456 | AC_MSG_CHECKING(whether struct stat has a st_flags field) |
| 457 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags, |
| 458 | AC_TRY_COMPILE([#include <sys/stat.h>], |
| 459 | [struct stat stat; stat.st_flags = 0;], |
| 460 | [e2fsprogs_cv_struct_st_flags=yes], |
| 461 | [e2fsprogs_cv_struct_st_flags=no])) |
| 462 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags) |
| 463 | if test "$e2fsprogs_cv_struct_st_flags" = yes; then |
Theodore Ts'o | c03bc4e | 1999-10-20 18:20:36 +0000 | [diff] [blame] | 464 | AC_MSG_CHECKING(whether st_flags field is useful) |
| 465 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut, |
| 466 | AC_TRY_COMPILE([#include <sys/stat.h>], |
| 467 | [struct stat stat; stat.st_flags |= UF_IMMUTABLE;], |
| 468 | [e2fsprogs_cv_struct_st_flags_immut=yes], |
| 469 | [e2fsprogs_cv_struct_st_flags_immut=no])) |
| 470 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut) |
| 471 | if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then |
| 472 | AC_DEFINE(HAVE_STAT_FLAGS) |
| 473 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 474 | fi |
Theodore Ts'o | 6928adc | 2000-05-25 23:28:50 +0000 | [diff] [blame] | 475 | AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 strdup getmntinfo strcasecmp srandom fchown mallinfo fdatasync) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 476 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 477 | dnl Check to see if -lsocket is required (solaris) to make something |
| 478 | dnl that uses socket() to compile; this is needed for the UUID library |
| 479 | dnl |
| 480 | SOCKET_LIB='' |
| 481 | AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket]) |
| 482 | AC_SUBST(SOCKET_LIB) |
| 483 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 484 | dnl See if optreset exists |
| 485 | dnl |
| 486 | AC_MSG_CHECKING(for optreset) |
| 487 | AC_CACHE_VAL(ac_cv_have_optreset, |
| 488 | [AC_EGREP_HEADER(optreset, unistd.h, |
| 489 | ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl |
| 490 | AC_MSG_RESULT($ac_cv_have_optreset) |
| 491 | if test $ac_cv_have_optreset = yes; then |
| 492 | AC_DEFINE(HAVE_OPTRESET) |
| 493 | fi |
| 494 | dnl |
Theodore Ts'o | 8f3f29d | 2000-02-11 05:04:44 +0000 | [diff] [blame] | 495 | dnl We use the EXT2 ioctls only under Linux |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 496 | dnl |
Theodore Ts'o | 8f3f29d | 2000-02-11 05:04:44 +0000 | [diff] [blame] | 497 | case "$host_os" in |
| 498 | linux*) |
| 499 | AC_DEFINE(HAVE_EXT2_IOCTLS) |
| 500 | ;; |
| 501 | esac |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 502 | dnl |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 503 | dnl Linux and Hurd places root files in the / by default |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 504 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 505 | case "$host_os" in |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 506 | linux* | gnu*) |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 507 | if test "$prefix" = NONE -a "$root_prefix" = NONE ; then |
| 508 | root_prefix=""; |
| 509 | echo "On $host_os systems, root_prefix defaults to ''" |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 510 | fi |
| 511 | ;; |
| 512 | esac |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 513 | dnl |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 514 | dnl On Linux/hurd, force the prefix to be /usr |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 515 | dnl |
| 516 | case "$host_os" in |
| 517 | linux* | gnu*) |
| 518 | if test "$prefix" = NONE ; then |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 519 | prefix="/usr"; |
| 520 | echo "On $host_os systems, prefix defaults to /usr" |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 521 | fi |
| 522 | ;; |
| 523 | esac |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 524 | if test "$root_prefix" = NONE ; then |
Theodore Ts'o | ffe1991 | 1998-04-08 06:05:49 +0000 | [diff] [blame] | 525 | if test "$prefix" = NONE ; then |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 526 | root_prefix="$ac_default_prefix" |
| 527 | else |
| 528 | root_prefix="$prefix" |
| 529 | fi |
| 530 | fi |
| 531 | AC_SUBST(root_prefix) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 532 | dnl |
| 533 | dnl See if -static works. |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 534 | dnl |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 535 | AC_MSG_CHECKING([whether linker accepts -static]) |
| 536 | AC_CACHE_VAL(ac_cv_e2fsprogs_use_static, |
| 537 | [SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static" |
| 538 | AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);], |
| 539 | ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no) |
| 540 | LDFLAGS=$SAVE_LDFLAGS]) |
Theodore Ts'o | defde78 | 1999-01-04 07:39:19 +0000 | [diff] [blame] | 541 | dnl |
| 542 | dnl Regardless of how the test turns out, Solaris doesn't handle -static |
| 543 | dnl This is caused by the socket library requiring the nsl library, which |
| 544 | dnl requires the -dl library, which only works for dynamically linked |
| 545 | dnl programs. It basically means you can't have statically linked programs |
| 546 | dnl which use the network under Solaris. |
| 547 | dnl |
| 548 | case "$host_os" in |
| 549 | solaris2.*) |
| 550 | ac_cv_e2fsprogs_use_static=no |
| 551 | ;; |
| 552 | esac |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 553 | AC_MSG_RESULT($ac_cv_e2fsprogs_use_static) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 554 | LDFLAG_STATIC= |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 555 | if test $ac_cv_e2fsprogs_use_static = yes; then |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 556 | LDFLAG_STATIC=-static |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 557 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 558 | AC_SUBST(LDFLAG_STATIC) |
| 559 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 560 | dnl Make the ss and et directories work correctly. |
| 561 | dnl |
| 562 | SS_DIR=`cd ${srcdir}/lib/ss; pwd` |
| 563 | ET_DIR=`cd ${srcdir}/lib/et; pwd` |
| 564 | AC_SUBST(SS_DIR) |
| 565 | AC_SUBST(ET_DIR) |
| 566 | dnl |
| 567 | dnl Only try to run the test suite if we're not cross compiling. |
| 568 | dnl |
| 569 | if test "$cross_compiling" = yes ; then |
| 570 | DO_TEST_SUITE= |
| 571 | else |
| 572 | DO_TEST_SUITE=check |
| 573 | fi |
| 574 | AC_SUBST(DO_TEST_SUITE) |
| 575 | dnl |
| 576 | dnl Make our output files, being sure that we create the some miscellaneous |
| 577 | dnl directories |
| 578 | dnl |
| 579 | test -d lib || mkdir lib |
| 580 | test -d include || mkdir include |
| 581 | test -d include/linux || mkdir include/linux |
Theodore Ts'o | defde78 | 1999-01-04 07:39:19 +0000 | [diff] [blame] | 582 | test -d include/asm || mkdir include/asm |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 583 | rmakefile= |
| 584 | if test -d ${srcdir}/resize ; then |
| 585 | rmakefile=resize/Makefile |
| 586 | fi |
Theodore Ts'o | 44339bd | 1997-10-15 02:47:20 +0000 | [diff] [blame] | 587 | AC_OUTPUT(MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 588 | lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile |
| 589 | misc/Makefile e2fsck/Makefile debugfs/Makefile tests/Makefile |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 590 | tests/progs/Makefile $rmakefile doc/Makefile |
| 591 | intl/Makefile po/Makefile.in) |