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 | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 166 | BINARY_TYPE=elfbin |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 167 | LIB_EXT=.so |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 168 | echo "Enabling ELF shared libraries" |
| 169 | fi |
| 170 | , |
| 171 | MAKEFILE_ELF=/dev/null |
| 172 | ELF_CMT=# |
| 173 | echo "Disabling ELF shared libraries by default" |
| 174 | ) |
| 175 | AC_SUBST(ELF_CMT) |
| 176 | AC_SUBST_FILE(MAKEFILE_ELF) |
| 177 | dnl |
| 178 | dnl handle --enable-bsd-shlibs |
| 179 | dnl |
| 180 | AC_ARG_ENABLE([bsd-shlibs], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 181 | [ --enable-bsd-shlibs select BSD shared libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 182 | if test "$enableval" = "no" |
| 183 | then |
| 184 | BSDLIB_CMT=# |
| 185 | MAKEFILE_BSDLIB=/dev/null |
| 186 | echo "Disabling BSD shared libraries" |
| 187 | else |
| 188 | BSDLIB_CMT= |
| 189 | MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 190 | LIB_EXT=.so |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 191 | echo "Enabling BSD shared libraries" |
| 192 | fi |
| 193 | , |
| 194 | MAKEFILE_BSDLIB=/dev/null |
| 195 | BSDLIB_CMT=# |
| 196 | echo "Disabling BSD shared libraries by default" |
| 197 | ) |
| 198 | AC_SUBST(BSDLIB_CMT) |
| 199 | AC_SUBST_FILE(MAKEFILE_BSDLIB) |
| 200 | dnl |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 201 | dnl Add internationalization support, using gettext. |
| 202 | dnl |
| 203 | PACKAGE=e2fsprogs |
| 204 | VERSION="$E2FSPROGS_VERSION" |
| 205 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") |
| 206 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION") |
| 207 | AC_SUBST(PACKAGE) |
| 208 | AC_SUBST(VERSION) |
| 209 | |
Theodore Ts'o | 1917875 | 2000-02-11 15:55:07 +0000 | [diff] [blame^] | 210 | ALL_LINGUAS="it nyc" |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 211 | AM_GNU_GETTEXT |
| 212 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 213 | dnl handle --enable-profile |
| 214 | dnl |
| 215 | AC_ARG_ENABLE([profile], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 216 | [ --enable-profile build profiling libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 217 | if test "$enableval" = "no" |
| 218 | then |
| 219 | PROFILE_CMT=# |
| 220 | MAKEFILE_PROFILE=/dev/null |
| 221 | echo "Disabling profiling libraries" |
| 222 | else |
| 223 | PROFILE_CMT= |
| 224 | MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 225 | PROFILED_LIB_EXT=_p.a |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 226 | echo "Building profiling libraries" |
| 227 | fi |
| 228 | , |
| 229 | PROFILE_CMT=# |
| 230 | MAKEFILE_PROFILE=/dev/null |
| 231 | echo "Disabling profiling libraries by default" |
| 232 | ) |
| 233 | AC_SUBST(PROFILE_CMT) |
| 234 | AC_SUBST_FILE(MAKEFILE_PROFILE) |
| 235 | dnl |
| 236 | dnl handle --enable-checker |
| 237 | dnl |
| 238 | AC_ARG_ENABLE([checker], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 239 | [ --enable-checker build checker libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 240 | if test "$enableval" = "no" |
| 241 | then |
| 242 | CHECKER_CMT=# |
| 243 | MAKEFILE_CHECKER=/dev/null |
| 244 | echo "Disabling checker libraries" |
| 245 | else |
| 246 | CHECKER_CMT= |
| 247 | MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker |
| 248 | echo "Building checker libraries" |
| 249 | fi |
| 250 | , |
| 251 | CHECKER_CMT=# |
| 252 | MAKEFILE_CHECKER=/dev/null |
| 253 | echo "Disabling checker libraries by default" |
| 254 | ) |
| 255 | AC_SUBST(CHECKER_CMT) |
| 256 | AC_SUBST_FILE(MAKEFILE_CHECKER) |
| 257 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 258 | dnl Substitute library extensions |
| 259 | dnl |
| 260 | AC_SUBST(LIB_EXT) |
| 261 | AC_SUBST(STATIC_LIB_EXT) |
| 262 | AC_SUBST(PROFILED_LIB_EXT) |
| 263 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 264 | dnl handle --enable-gcc-wall |
| 265 | dnl |
| 266 | AC_ARG_ENABLE([gcc-wall], |
Theodore Ts'o | b0b9c4d | 1997-10-20 23:36:30 +0000 | [diff] [blame] | 267 | [ --enable-gcc-wall enable GCC anal warnings (DON'T USE IN PRODUCTION)], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 268 | if test "$enableval" = "no" |
| 269 | then |
| 270 | W=# |
| 271 | echo "Disabling GCC warnings" |
| 272 | else |
| 273 | W= |
| 274 | echo "Enabling GCC warnings" |
| 275 | fi |
| 276 | , |
| 277 | W=# |
| 278 | echo "Disabling GCC warnings by default" |
| 279 | ) |
| 280 | AC_SUBST(W) |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 281 | AC_ARG_ENABLE([dynamic-e2fsck], |
| 282 | [ --enable-dynamic-e2fsck build e2fsck dynamically], |
| 283 | if test "$enableval" = "no" |
| 284 | then |
| 285 | E2FSCK_TYPE=static |
| 286 | echo "Building e2fsck statically" |
| 287 | else |
| 288 | E2FSCK_TYPE=shared |
| 289 | echo "Building e2fsck dynamically" |
| 290 | fi |
| 291 | , |
| 292 | E2FSCK_TYPE=static |
| 293 | echo "Building e2fsck statically by default" |
| 294 | ) |
| 295 | AC_SUBST(E2FSCK_TYPE) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 296 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 297 | dnl See whether to install the `fsck' wrapper program (that calls e2fsck) |
| 298 | dnl |
| 299 | AC_ARG_ENABLE([fsck], |
| 300 | [ --enable-fsck build fsck wrapper program], |
| 301 | [if test "$enableval" = "no" |
| 302 | then |
| 303 | FSCK_PROG='' FSCK_MAN='' |
| 304 | echo "Not building fsck wrapper" |
| 305 | else |
| 306 | FSCK_PROG=fsck FSCK_MAN=fsck.8 |
| 307 | echo "Building fsck wrapper" |
| 308 | fi] |
| 309 | , |
| 310 | [case "$host_os" in |
| 311 | gnu*) |
| 312 | FSCK_PROG='' FSCK_MAN='' |
| 313 | echo "Not building fsck wrapper by default" |
| 314 | ;; |
| 315 | *) |
| 316 | FSCK_PROG=fsck FSCK_MAN=fsck.8 |
| 317 | echo "Building fsck wrapper by default" |
| 318 | esac] |
| 319 | ) |
| 320 | AC_SUBST(FSCK_PROG) |
| 321 | AC_SUBST(FSCK_MAN) |
| 322 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 323 | dnl |
| 324 | MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library |
| 325 | AC_SUBST_FILE(MAKEFILE_LIBRARY) |
| 326 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 327 | dnl |
| 328 | AC_ARG_ENABLE([old-bitops], |
| 329 | [ --enable-old-bitops Use old (non-standard but native) bitmask operations], |
| 330 | if test "$enableval" = "no" |
| 331 | then |
| 332 | echo "Using new (standard) bitmask operations" |
| 333 | else |
| 334 | AC_DEFINE(EXT2_OLD_BITOPS) |
| 335 | echo "Using old (native) bitmask operations" |
| 336 | |
| 337 | fi |
| 338 | , |
| 339 | echo "Using standard bitmask operations by default" |
| 340 | ) |
| 341 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 342 | dnl End of configuration options |
| 343 | dnl |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 344 | AC_SUBST(BINARY_TYPE) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 345 | AC_PROG_MAKE_SET |
| 346 | AC_PATH_PROG(LN, ln, ln) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 347 | AC_PROG_LN_S |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 348 | AC_PATH_PROG(MV, mv, mv) |
| 349 | AC_PATH_PROG(CP, cp, cp) |
| 350 | AC_PATH_PROG(RM, rm, rm) |
| 351 | AC_PATH_PROG(CHMOD, chmod, :) |
| 352 | AC_PATH_PROG(AWK, awk, awk) |
| 353 | AC_PATH_PROG(SED, sed, sed) |
Theodore Ts'o | 9d564f7 | 1999-07-03 20:25:58 +0000 | [diff] [blame] | 354 | AC_PATH_PROG(PERL, perl, perl) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 355 | AC_CHECK_TOOL(AR, ar, ar) |
| 356 | AC_CHECK_TOOL(RANLIB, ranlib, :) |
| 357 | AC_CHECK_TOOL(STRIP, strip, :) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 358 | AC_PROG_INSTALL |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 359 | # See if we need a separate native compiler. |
| 360 | if test $cross_compiling = no; then |
| 361 | BUILD_CC="$CC" |
| 362 | AC_SUBST(BUILD_CC) |
| 363 | else |
| 364 | AC_CHECK_PROGS(BUILD_CC, gcc cc) |
| 365 | fi |
Theodore Ts'o | c81c6ce | 1999-10-26 04:28:53 +0000 | [diff] [blame] | 366 | 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/sockio.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] | 367 | AC_FUNC_VPRINTF |
| 368 | dnl |
| 369 | dnl See if struct dirent has a d_namlen field (like bsd systems), implying |
| 370 | dnl that the actual length of the structure may be grater than the declared |
| 371 | dnl length. |
| 372 | dnl |
| 373 | AC_MSG_CHECKING(whether struct dirent has a d_namlen field) |
| 374 | AC_CACHE_VAL(e2fsprogs_cv_struct_d_namlen, |
| 375 | AC_TRY_COMPILE( |
| 376 | [#include <sys/types.h> |
| 377 | #include <dirent.h>], |
| 378 | [struct dirent de; de.d_namlen = 0;], |
| 379 | [e2fsprogs_cv_struct_d_namlen=yes], |
| 380 | [e2fsprogs_cv_struct_d_namlen=no])) |
| 381 | AC_MSG_RESULT($e2fsprogs_cv_struct_d_namlen) |
| 382 | if test "$e2fsprogs_cv_struct_d_namlen" = yes; then |
| 383 | AC_DEFINE(HAVE_DIRENT_NAMLEN) |
| 384 | fi |
| 385 | dnl |
Theodore Ts'o | b0b9c4d | 1997-10-20 23:36:30 +0000 | [diff] [blame] | 386 | dnl Check to see if llseek() is declared in unistd.h. On some libc's |
| 387 | dnl it is, and on others it isn't..... Thank you glibc developers.... |
| 388 | dnl |
| 389 | dnl Warning! Use of --enable-gcc-wall may throw off this test. |
| 390 | dnl |
| 391 | dnl |
| 392 | AC_MSG_CHECKING(whether llseek declared in unistd.h) |
| 393 | AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype, |
| 394 | AC_TRY_COMPILE( |
| 395 | [#include <unistd.h>], [extern int llseek(int);], |
| 396 | [e2fsprogs_cv_have_llseek_prototype=no], |
| 397 | [e2fsprogs_cv_have_llseek_prototype=yes])) |
| 398 | AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype) |
| 399 | if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then |
| 400 | AC_DEFINE(HAVE_LLSEEK_PROTOTYPE) |
| 401 | fi |
| 402 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 403 | dnl Word sizes... |
| 404 | dnl |
| 405 | if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then |
| 406 | # if cross-compiling, with no cached values, just assume something common. |
| 407 | ac_cv_sizeof_short=2 |
| 408 | ac_cv_sizeof_int=4 |
| 409 | ac_cv_sizeof_long=4 |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 410 | ac_cv_sizeof_long_long=8 |
| 411 | 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] | 412 | fi |
| 413 | AC_CHECK_SIZEOF(short) |
| 414 | AC_CHECK_SIZEOF(int) |
| 415 | AC_CHECK_SIZEOF(long) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 416 | AC_CHECK_SIZEOF(long long) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 417 | SIZEOF_SHORT=$ac_cv_sizeof_short |
| 418 | SIZEOF_INT=$ac_cv_sizeof_int |
| 419 | SIZEOF_LONG=$ac_cv_sizeof_long |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 420 | SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 421 | AC_SUBST(SIZEOF_SHORT) |
| 422 | AC_SUBST(SIZEOF_INT) |
| 423 | AC_SUBST(SIZEOF_LONG) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 424 | AC_SUBST(SIZEOF_LONG_LONG) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 425 | dnl |
| 426 | dnl See if struct stat has a st_flags field, in which case we can get file |
| 427 | dnl flags somewhat portably. Also check for the analogous setter, chflags(). |
| 428 | dnl |
| 429 | AC_MSG_CHECKING(whether struct stat has a st_flags field) |
| 430 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags, |
| 431 | AC_TRY_COMPILE([#include <sys/stat.h>], |
| 432 | [struct stat stat; stat.st_flags = 0;], |
| 433 | [e2fsprogs_cv_struct_st_flags=yes], |
| 434 | [e2fsprogs_cv_struct_st_flags=no])) |
| 435 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags) |
| 436 | if test "$e2fsprogs_cv_struct_st_flags" = yes; then |
Theodore Ts'o | c03bc4e | 1999-10-20 18:20:36 +0000 | [diff] [blame] | 437 | AC_MSG_CHECKING(whether st_flags field is useful) |
| 438 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut, |
| 439 | AC_TRY_COMPILE([#include <sys/stat.h>], |
| 440 | [struct stat stat; stat.st_flags |= UF_IMMUTABLE;], |
| 441 | [e2fsprogs_cv_struct_st_flags_immut=yes], |
| 442 | [e2fsprogs_cv_struct_st_flags_immut=no])) |
| 443 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut) |
| 444 | if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then |
| 445 | AC_DEFINE(HAVE_STAT_FLAGS) |
| 446 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 447 | fi |
Theodore Ts'o | 6454d84 | 1999-03-16 19:24:34 +0000 | [diff] [blame] | 448 | AC_CHECK_FUNCS(chflags getrusage llseek strdup getmntinfo strcasecmp srandom fchown mallinfo) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 449 | dnl |
| 450 | dnl Check to see if ino_t is defined |
| 451 | dnl |
| 452 | AC_MSG_CHECKING(ino_t defined by sys/types.h) |
| 453 | AC_CACHE_VAL(e2fsprogs_cv_ino_t, |
| 454 | AC_TRY_COMPILE([#include <sys/types.h>], |
| 455 | [ino_t ino; ino = 0;], |
| 456 | [e2fsprogs_cv_ino_t=yes], |
| 457 | [e2fsprogs_cv_ino_t=no])) |
| 458 | AC_MSG_RESULT($e2fsprogs_cv_ino_t) |
| 459 | if test "$e2fsprogs_cv_ino_t" = yes; then |
| 460 | AC_DEFINE(HAVE_INO_T) |
| 461 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 462 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 463 | dnl Check to see if -lsocket is required (solaris) to make something |
| 464 | dnl that uses socket() to compile; this is needed for the UUID library |
| 465 | dnl |
| 466 | SOCKET_LIB='' |
| 467 | AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket]) |
| 468 | AC_SUBST(SOCKET_LIB) |
| 469 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 470 | dnl See if optreset exists |
| 471 | dnl |
| 472 | AC_MSG_CHECKING(for optreset) |
| 473 | AC_CACHE_VAL(ac_cv_have_optreset, |
| 474 | [AC_EGREP_HEADER(optreset, unistd.h, |
| 475 | ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl |
| 476 | AC_MSG_RESULT($ac_cv_have_optreset) |
| 477 | if test $ac_cv_have_optreset = yes; then |
| 478 | AC_DEFINE(HAVE_OPTRESET) |
| 479 | fi |
| 480 | dnl |
Theodore Ts'o | 8f3f29d | 2000-02-11 05:04:44 +0000 | [diff] [blame] | 481 | dnl We use the EXT2 ioctls only under Linux |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 482 | dnl |
Theodore Ts'o | 8f3f29d | 2000-02-11 05:04:44 +0000 | [diff] [blame] | 483 | case "$host_os" in |
| 484 | linux*) |
| 485 | AC_DEFINE(HAVE_EXT2_IOCTLS) |
| 486 | ;; |
| 487 | esac |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 488 | dnl |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 489 | dnl Linux and Hurd places root files in the / by default |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 490 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 491 | case "$host_os" in |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 492 | linux* | gnu*) |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 493 | if test "$prefix" = NONE -a "$root_prefix" = NONE ; then |
| 494 | root_prefix=""; |
| 495 | echo "On $host_os systems, root_prefix defaults to ''" |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 496 | fi |
| 497 | ;; |
| 498 | esac |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 499 | dnl |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 500 | dnl On Linux/hurd, force the prefix to be /usr |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 501 | dnl |
| 502 | case "$host_os" in |
| 503 | linux* | gnu*) |
| 504 | if test "$prefix" = NONE ; then |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 505 | prefix="/usr"; |
| 506 | echo "On $host_os systems, prefix defaults to /usr" |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 507 | fi |
| 508 | ;; |
| 509 | esac |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 510 | if test "$root_prefix" = NONE ; then |
Theodore Ts'o | ffe1991 | 1998-04-08 06:05:49 +0000 | [diff] [blame] | 511 | if test "$prefix" = NONE ; then |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 512 | root_prefix="$ac_default_prefix" |
| 513 | else |
| 514 | root_prefix="$prefix" |
| 515 | fi |
| 516 | fi |
| 517 | AC_SUBST(root_prefix) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 518 | dnl |
| 519 | dnl See if -static works. |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 520 | dnl |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 521 | AC_MSG_CHECKING([whether linker accepts -static]) |
| 522 | AC_CACHE_VAL(ac_cv_e2fsprogs_use_static, |
| 523 | [SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static" |
| 524 | AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);], |
| 525 | ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no) |
| 526 | LDFLAGS=$SAVE_LDFLAGS]) |
Theodore Ts'o | defde78 | 1999-01-04 07:39:19 +0000 | [diff] [blame] | 527 | dnl |
| 528 | dnl Regardless of how the test turns out, Solaris doesn't handle -static |
| 529 | dnl This is caused by the socket library requiring the nsl library, which |
| 530 | dnl requires the -dl library, which only works for dynamically linked |
| 531 | dnl programs. It basically means you can't have statically linked programs |
| 532 | dnl which use the network under Solaris. |
| 533 | dnl |
| 534 | case "$host_os" in |
| 535 | solaris2.*) |
| 536 | ac_cv_e2fsprogs_use_static=no |
| 537 | ;; |
| 538 | esac |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 539 | AC_MSG_RESULT($ac_cv_e2fsprogs_use_static) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 540 | LDFLAG_STATIC= |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 541 | if test $ac_cv_e2fsprogs_use_static = yes; then |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 542 | LDFLAG_STATIC=-static |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 543 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 544 | AC_SUBST(LDFLAG_STATIC) |
| 545 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 546 | dnl Make the ss and et directories work correctly. |
| 547 | dnl |
| 548 | SS_DIR=`cd ${srcdir}/lib/ss; pwd` |
| 549 | ET_DIR=`cd ${srcdir}/lib/et; pwd` |
| 550 | AC_SUBST(SS_DIR) |
| 551 | AC_SUBST(ET_DIR) |
| 552 | dnl |
| 553 | dnl Only try to run the test suite if we're not cross compiling. |
| 554 | dnl |
| 555 | if test "$cross_compiling" = yes ; then |
| 556 | DO_TEST_SUITE= |
| 557 | else |
| 558 | DO_TEST_SUITE=check |
| 559 | fi |
| 560 | AC_SUBST(DO_TEST_SUITE) |
| 561 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 562 | dnl |
| 563 | dnl |
| 564 | DO_SUBSTITUTE_SCRIPT=$srcdir/lib/do_substitute |
| 565 | AC_SUBST_FILE(DO_SUBSTITUTE_SCRIPT) |
| 566 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 567 | dnl Make our output files, being sure that we create the some miscellaneous |
| 568 | dnl directories |
| 569 | dnl |
| 570 | test -d lib || mkdir lib |
| 571 | test -d include || mkdir include |
| 572 | test -d include/linux || mkdir include/linux |
Theodore Ts'o | defde78 | 1999-01-04 07:39:19 +0000 | [diff] [blame] | 573 | test -d include/asm || mkdir include/asm |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 574 | rmakefile= |
| 575 | if test -d ${srcdir}/resize ; then |
| 576 | rmakefile=resize/Makefile |
| 577 | fi |
Theodore Ts'o | 44339bd | 1997-10-15 02:47:20 +0000 | [diff] [blame] | 578 | 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] | 579 | lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile |
| 580 | misc/Makefile e2fsck/Makefile debugfs/Makefile tests/Makefile |
Theodore Ts'o | a64c9c1 | 2000-02-08 20:17:21 +0000 | [diff] [blame] | 581 | tests/progs/Makefile $rmakefile doc/Makefile |
| 582 | intl/Makefile po/Makefile.in) |