Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1 | AC_INIT(version.h) |
| 2 | MCONFIG=./MCONFIG |
| 3 | AC_SUBST_FILE(MCONFIG) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 4 | BINARY_TYPE=bin |
| 5 | dnl |
| 6 | dnl This is to figure out the version number and the date.... |
| 7 | dnl |
| 8 | E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \ |
| 9 | | awk '{print $3}' | tr \" " " | awk '{print $1}'` |
| 10 | DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \ |
| 11 | | tr \" " "` |
| 12 | MONTH=`echo $DATE | awk -F- '{print $2}'` |
| 13 | YEAR=`echo $DATE | awk -F- '{print $3}'` |
| 14 | |
| 15 | if expr $YEAR ">" 90 >/dev/null ; then |
| 16 | E2FSPROGS_YEAR=19$YEAR |
| 17 | else |
| 18 | E2FSPROGS_YEAR=20$YEAR |
| 19 | fi |
| 20 | |
| 21 | case $MONTH in |
| 22 | Jan) E2FSPROGS_MONTH="January" ;; |
| 23 | Feb) E2FSPROGS_MONTH="February" ;; |
| 24 | Mar) E2FSPROGS_MONTH="March" ;; |
| 25 | Apr) E2FSPROGS_MONTH="April" ;; |
| 26 | May) E2FSPROGS_MONTH="May" ;; |
| 27 | Jun) E2FSPROGS_MONTH="June" ;; |
| 28 | Jul) E2FSPROGS_MONTH="July" ;; |
| 29 | Aug) E2FSPROGS_MONTH="August" ;; |
| 30 | Sep) E2FSPROGS_MONTH="September" ;; |
| 31 | Oct) E2FSPROGS_MONTH="October" ;; |
| 32 | Nov) E2FSPROGS_MONTH="November" ;; |
| 33 | Dec) E2FSPROGS_MONTH="December" ;; |
| 34 | *) echo "Unknown month $MONTH??" ;; |
| 35 | esac |
| 36 | |
| 37 | unset DATE MONTH YEAR |
| 38 | echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION" |
| 39 | echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}" |
| 40 | AC_SUBST(E2FSPROGS_YEAR) |
| 41 | AC_SUBST(E2FSPROGS_MONTH) |
| 42 | AC_SUBST(E2FSPROGS_VERSION) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 43 | AC_REQUIRE([AC_CANONICAL_HOST]) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 44 | dnl |
| 45 | dnl set $(CC) from --with-cc=value |
| 46 | dnl |
| 47 | AC_ARG_WITH([cc], |
| 48 | [ --with-cc=COMPILER select compiler to use], |
| 49 | AC_MSG_RESULT(CC=$withval) |
| 50 | CC=$withval, |
| 51 | if test -z "$CC" ; then CC=cc; fi |
| 52 | [AC_MSG_RESULT(CC defaults to $CC)])dnl |
| 53 | export CC |
| 54 | AC_SUBST([CC]) |
| 55 | dnl |
| 56 | dnl set $(LD) from --with-linker=value |
| 57 | dnl |
| 58 | AC_ARG_WITH([linker], |
| 59 | [ --with-linker=LINKER select linker to use], |
| 60 | AC_MSG_RESULT(LD=$withval) |
| 61 | LD=$withval, |
| 62 | if test -z "$LD" ; then LD=$CC; fi |
| 63 | [AC_MSG_RESULT(LD defaults to $LD)])dnl |
| 64 | export LD |
| 65 | AC_SUBST([LD]) |
| 66 | dnl |
| 67 | dnl set $(CCOPTS) from --with-ccopts=value |
| 68 | dnl |
| 69 | AC_ARG_WITH([ccopts], |
| 70 | [ --with-ccopts=CCOPTS select compiler command line options], |
| 71 | AC_MSG_RESULT(CCOPTS is $withval) |
| 72 | CCOPTS=$withval |
| 73 | CFLAGS="$CFLAGS $withval", |
| 74 | CCOPTS=)dnl |
| 75 | AC_SUBST(CCOPTS) |
| 76 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 77 | dnl Set default values for library extentions. Will be dealt with after |
| 78 | dnl parsing configuration opions, which may modify these |
| 79 | dnl |
| 80 | LIB_EXT=.a |
| 81 | STATIC_LIB_EXT=.a |
| 82 | PROFILE_LIB_EXT=.a |
| 83 | dnl |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 84 | dnl set $(LDFLAGS) from --with-ldopts=value |
| 85 | dnl |
| 86 | AC_ARG_WITH([ldopts], |
| 87 | [ --with-ldopts=LDOPTS select linker command line options], |
| 88 | AC_MSG_RESULT(LDFLAGS is $withval) |
| 89 | LDFLAGS=$withval, |
| 90 | LDFLAGS=)dnl |
| 91 | AC_SUBST(LDFLAGS) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 92 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 93 | dnl Allow separate `usr_prefix' to be specified |
| 94 | dnl |
| 95 | AC_ARG_WITH([usr-prefix], |
| 96 | [ --with-usr-prefx=PREFIX specify a prefix corresponding to /usr (default ${prefix})], |
| 97 | usr_prefix=$withval, |
| 98 | usr_prefix=NONE)dnl |
| 99 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 100 | dnl handle --enable-dll-shlibs |
| 101 | dnl |
| 102 | AC_ARG_ENABLE([dll-shlibs], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 103 | [ --enable-dll-shlibs select DLL libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 104 | if test "$enableval" = "no" |
| 105 | then |
| 106 | DLL_CMT=# |
| 107 | MAKEFILE_DLL=/dev/null |
| 108 | echo "Disabling DLL shared libraries" |
| 109 | else |
| 110 | DLL_CMT= |
| 111 | MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 112 | BINARY_TYPE=dllbin |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 113 | LIB_EXT=.sa |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 114 | echo "Enabling DLL shared libraries" |
| 115 | fi |
| 116 | , |
| 117 | MAKEFILE_DLL=/dev/null |
| 118 | DLL_CMT=# |
| 119 | echo "Disabling DLL shared libraries by default" |
| 120 | ) |
| 121 | AC_SUBST(DLL_CMT) |
| 122 | AC_SUBST_FILE(MAKEFILE_DLL) |
| 123 | dnl |
| 124 | dnl handle --enable-elf-shlibs |
| 125 | dnl |
| 126 | AC_ARG_ENABLE([elf-shlibs], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 127 | [ --enable-elf-shlibs select ELF shared libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 128 | if test "$enableval" = "no" |
| 129 | then |
| 130 | ELF_CMT=# |
| 131 | MAKEFILE_ELF=/dev/null |
| 132 | echo "Disabling ELF shared libraries" |
| 133 | else |
| 134 | ELF_CMT= |
| 135 | MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 136 | BINARY_TYPE=elfbin |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 137 | LIB_EXT=.so |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 138 | echo "Enabling ELF shared libraries" |
| 139 | fi |
| 140 | , |
| 141 | MAKEFILE_ELF=/dev/null |
| 142 | ELF_CMT=# |
| 143 | echo "Disabling ELF shared libraries by default" |
| 144 | ) |
| 145 | AC_SUBST(ELF_CMT) |
| 146 | AC_SUBST_FILE(MAKEFILE_ELF) |
| 147 | dnl |
| 148 | dnl handle --enable-bsd-shlibs |
| 149 | dnl |
| 150 | AC_ARG_ENABLE([bsd-shlibs], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 151 | [ --enable-bsd-shlibs select BSD shared libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 152 | if test "$enableval" = "no" |
| 153 | then |
| 154 | BSDLIB_CMT=# |
| 155 | MAKEFILE_BSDLIB=/dev/null |
| 156 | echo "Disabling BSD shared libraries" |
| 157 | else |
| 158 | BSDLIB_CMT= |
| 159 | MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 160 | LIB_EXT=.so |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 161 | echo "Enabling BSD shared libraries" |
| 162 | fi |
| 163 | , |
| 164 | MAKEFILE_BSDLIB=/dev/null |
| 165 | BSDLIB_CMT=# |
| 166 | echo "Disabling BSD shared libraries by default" |
| 167 | ) |
| 168 | AC_SUBST(BSDLIB_CMT) |
| 169 | AC_SUBST_FILE(MAKEFILE_BSDLIB) |
| 170 | dnl |
| 171 | dnl handle --enable-profile |
| 172 | dnl |
| 173 | AC_ARG_ENABLE([profile], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 174 | [ --enable-profile build profiling libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 175 | if test "$enableval" = "no" |
| 176 | then |
| 177 | PROFILE_CMT=# |
| 178 | MAKEFILE_PROFILE=/dev/null |
| 179 | echo "Disabling profiling libraries" |
| 180 | else |
| 181 | PROFILE_CMT= |
| 182 | MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 183 | PROFILED_LIB_EXT=_p.a |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 184 | echo "Building profiling libraries" |
| 185 | fi |
| 186 | , |
| 187 | PROFILE_CMT=# |
| 188 | MAKEFILE_PROFILE=/dev/null |
| 189 | echo "Disabling profiling libraries by default" |
| 190 | ) |
| 191 | AC_SUBST(PROFILE_CMT) |
| 192 | AC_SUBST_FILE(MAKEFILE_PROFILE) |
| 193 | dnl |
| 194 | dnl handle --enable-checker |
| 195 | dnl |
| 196 | AC_ARG_ENABLE([checker], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 197 | [ --enable-checker build checker libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 198 | if test "$enableval" = "no" |
| 199 | then |
| 200 | CHECKER_CMT=# |
| 201 | MAKEFILE_CHECKER=/dev/null |
| 202 | echo "Disabling checker libraries" |
| 203 | else |
| 204 | CHECKER_CMT= |
| 205 | MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker |
| 206 | echo "Building checker libraries" |
| 207 | fi |
| 208 | , |
| 209 | CHECKER_CMT=# |
| 210 | MAKEFILE_CHECKER=/dev/null |
| 211 | echo "Disabling checker libraries by default" |
| 212 | ) |
| 213 | AC_SUBST(CHECKER_CMT) |
| 214 | AC_SUBST_FILE(MAKEFILE_CHECKER) |
| 215 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 216 | dnl Substitute library extensions |
| 217 | dnl |
| 218 | AC_SUBST(LIB_EXT) |
| 219 | AC_SUBST(STATIC_LIB_EXT) |
| 220 | AC_SUBST(PROFILED_LIB_EXT) |
| 221 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 222 | dnl handle --enable-gcc-wall |
| 223 | dnl |
| 224 | AC_ARG_ENABLE([gcc-wall], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 225 | [ --enable-gcc-wall enable GCC anal warnings], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 226 | if test "$enableval" = "no" |
| 227 | then |
| 228 | W=# |
| 229 | echo "Disabling GCC warnings" |
| 230 | else |
| 231 | W= |
| 232 | echo "Enabling GCC warnings" |
| 233 | fi |
| 234 | , |
| 235 | W=# |
| 236 | echo "Disabling GCC warnings by default" |
| 237 | ) |
| 238 | AC_SUBST(W) |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 239 | AC_ARG_ENABLE([dynamic-e2fsck], |
| 240 | [ --enable-dynamic-e2fsck build e2fsck dynamically], |
| 241 | if test "$enableval" = "no" |
| 242 | then |
| 243 | E2FSCK_TYPE=static |
| 244 | echo "Building e2fsck statically" |
| 245 | else |
| 246 | E2FSCK_TYPE=shared |
| 247 | echo "Building e2fsck dynamically" |
| 248 | fi |
| 249 | , |
| 250 | E2FSCK_TYPE=static |
| 251 | echo "Building e2fsck statically by default" |
| 252 | ) |
| 253 | AC_SUBST(E2FSCK_TYPE) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 254 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 255 | dnl See whether to install the `fsck' wrapper program (that calls e2fsck) |
| 256 | dnl |
| 257 | AC_ARG_ENABLE([fsck], |
| 258 | [ --enable-fsck build fsck wrapper program], |
| 259 | [if test "$enableval" = "no" |
| 260 | then |
| 261 | FSCK_PROG='' FSCK_MAN='' |
| 262 | echo "Not building fsck wrapper" |
| 263 | else |
| 264 | FSCK_PROG=fsck FSCK_MAN=fsck.8 |
| 265 | echo "Building fsck wrapper" |
| 266 | fi] |
| 267 | , |
| 268 | [case "$host_os" in |
| 269 | gnu*) |
| 270 | FSCK_PROG='' FSCK_MAN='' |
| 271 | echo "Not building fsck wrapper by default" |
| 272 | ;; |
| 273 | *) |
| 274 | FSCK_PROG=fsck FSCK_MAN=fsck.8 |
| 275 | echo "Building fsck wrapper by default" |
| 276 | esac] |
| 277 | ) |
| 278 | AC_SUBST(FSCK_PROG) |
| 279 | AC_SUBST(FSCK_MAN) |
| 280 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 281 | dnl |
| 282 | MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library |
| 283 | AC_SUBST_FILE(MAKEFILE_LIBRARY) |
| 284 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 285 | dnl |
| 286 | AC_ARG_ENABLE([old-bitops], |
| 287 | [ --enable-old-bitops Use old (non-standard but native) bitmask operations], |
| 288 | if test "$enableval" = "no" |
| 289 | then |
| 290 | echo "Using new (standard) bitmask operations" |
| 291 | else |
| 292 | AC_DEFINE(EXT2_OLD_BITOPS) |
| 293 | echo "Using old (native) bitmask operations" |
| 294 | |
| 295 | fi |
| 296 | , |
| 297 | echo "Using standard bitmask operations by default" |
| 298 | ) |
| 299 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 300 | dnl End of configuration options |
| 301 | dnl |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 302 | AC_SUBST(BINARY_TYPE) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 303 | AC_PROG_MAKE_SET |
| 304 | AC_PATH_PROG(LN, ln, ln) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 305 | AC_PROG_LN_S |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 306 | AC_PATH_PROG(MV, mv, mv) |
| 307 | AC_PATH_PROG(CP, cp, cp) |
| 308 | AC_PATH_PROG(RM, rm, rm) |
| 309 | AC_PATH_PROG(CHMOD, chmod, :) |
| 310 | AC_PATH_PROG(AWK, awk, awk) |
| 311 | AC_PATH_PROG(SED, sed, sed) |
| 312 | AC_CHECK_TOOL(AR, ar, ar) |
| 313 | AC_CHECK_TOOL(RANLIB, ranlib, :) |
| 314 | AC_CHECK_TOOL(STRIP, strip, :) |
| 315 | AC_PROG_CC |
| 316 | AC_PROG_INSTALL |
| 317 | AC_C_CROSS |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 318 | AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h errno.h mntent.h dirent.h getopt.h linux/fd.h linux/major.h sys/disklabel.h sys/sockio.h net/if.h netinet/in.h) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 319 | AC_FUNC_VPRINTF |
| 320 | dnl |
| 321 | dnl See if struct dirent has a d_namlen field (like bsd systems), implying |
| 322 | dnl that the actual length of the structure may be grater than the declared |
| 323 | dnl length. |
| 324 | dnl |
| 325 | AC_MSG_CHECKING(whether struct dirent has a d_namlen field) |
| 326 | AC_CACHE_VAL(e2fsprogs_cv_struct_d_namlen, |
| 327 | AC_TRY_COMPILE( |
| 328 | [#include <sys/types.h> |
| 329 | #include <dirent.h>], |
| 330 | [struct dirent de; de.d_namlen = 0;], |
| 331 | [e2fsprogs_cv_struct_d_namlen=yes], |
| 332 | [e2fsprogs_cv_struct_d_namlen=no])) |
| 333 | AC_MSG_RESULT($e2fsprogs_cv_struct_d_namlen) |
| 334 | if test "$e2fsprogs_cv_struct_d_namlen" = yes; then |
| 335 | AC_DEFINE(HAVE_DIRENT_NAMLEN) |
| 336 | fi |
| 337 | dnl |
| 338 | dnl Word sizes... |
| 339 | dnl |
| 340 | if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then |
| 341 | # if cross-compiling, with no cached values, just assume something common. |
| 342 | ac_cv_sizeof_short=2 |
| 343 | ac_cv_sizeof_int=4 |
| 344 | ac_cv_sizeof_long=4 |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 345 | ac_cv_sizeof_long_long=0 |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 346 | AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4]) |
| 347 | fi |
| 348 | AC_CHECK_SIZEOF(short) |
| 349 | AC_CHECK_SIZEOF(int) |
| 350 | AC_CHECK_SIZEOF(long) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 351 | AC_CHECK_SIZEOF(long long) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 352 | SIZEOF_SHORT=$ac_cv_sizeof_short |
| 353 | SIZEOF_INT=$ac_cv_sizeof_int |
| 354 | SIZEOF_LONG=$ac_cv_sizeof_long |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 355 | SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 356 | AC_SUBST(SIZEOF_SHORT) |
| 357 | AC_SUBST(SIZEOF_INT) |
| 358 | AC_SUBST(SIZEOF_LONG) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 359 | AC_SUBST(SIZEOF_LONG_LONG) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 360 | dnl |
| 361 | dnl See if struct stat has a st_flags field, in which case we can get file |
| 362 | dnl flags somewhat portably. Also check for the analogous setter, chflags(). |
| 363 | dnl |
| 364 | AC_MSG_CHECKING(whether struct stat has a st_flags field) |
| 365 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags, |
| 366 | AC_TRY_COMPILE([#include <sys/stat.h>], |
| 367 | [struct stat stat; stat.st_flags = 0;], |
| 368 | [e2fsprogs_cv_struct_st_flags=yes], |
| 369 | [e2fsprogs_cv_struct_st_flags=no])) |
| 370 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags) |
| 371 | if test "$e2fsprogs_cv_struct_st_flags" = yes; then |
| 372 | AC_DEFINE(HAVE_STAT_FLAGS) |
| 373 | fi |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 374 | AC_CHECK_FUNCS(chflags getrusage llseek strdup getmntinfo strcasecmp srandom fchown) |
| 375 | dnl |
| 376 | dnl Check to see if ino_t is defined |
| 377 | dnl |
| 378 | AC_MSG_CHECKING(ino_t defined by sys/types.h) |
| 379 | AC_CACHE_VAL(e2fsprogs_cv_ino_t, |
| 380 | AC_TRY_COMPILE([#include <sys/types.h>], |
| 381 | [ino_t ino; ino = 0;], |
| 382 | [e2fsprogs_cv_ino_t=yes], |
| 383 | [e2fsprogs_cv_ino_t=no])) |
| 384 | AC_MSG_RESULT($e2fsprogs_cv_ino_t) |
| 385 | if test "$e2fsprogs_cv_ino_t" = yes; then |
| 386 | AC_DEFINE(HAVE_INO_T) |
| 387 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 388 | dnl |
| 389 | dnl On systems without linux header files, we add an extra include directory |
| 390 | dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here |
| 391 | dnl is quoted so that it gets expanded by make, not by configure. |
| 392 | dnl |
| 393 | AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no]) |
| 394 | AC_SUBST(EXTRA_PROGS) |
| 395 | if test "$linux_headers" = yes; then |
| 396 | AC_DEFINE(HAVE_LINUX_FS_H) |
| 397 | # These are some programs that depend on having linux headers around, and |
| 398 | # won't work otherwise. So we only compile them if we can. |
| 399 | EXTRA_PROGS="$EXTRA_PROGS flushb" |
| 400 | else |
| 401 | LINUX_INCLUDE='-I$(top_srcdir)/include -I$(top_builddir)/include' |
| 402 | # Use this include directory with test compiles in the configure script too. |
| 403 | CPPFLAGS="$CPPFLAGS -I$srcdir/include -I./include" |
| 404 | fi |
| 405 | AC_SUBST(LINUX_INCLUDE) |
| 406 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 407 | dnl Check to see if -lsocket is required (solaris) to make something |
| 408 | dnl that uses socket() to compile; this is needed for the UUID library |
| 409 | dnl |
| 410 | SOCKET_LIB='' |
| 411 | AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket]) |
| 412 | AC_SUBST(SOCKET_LIB) |
| 413 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 414 | dnl See if optreset exists |
| 415 | dnl |
| 416 | AC_MSG_CHECKING(for optreset) |
| 417 | AC_CACHE_VAL(ac_cv_have_optreset, |
| 418 | [AC_EGREP_HEADER(optreset, unistd.h, |
| 419 | ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl |
| 420 | AC_MSG_RESULT($ac_cv_have_optreset) |
| 421 | if test $ac_cv_have_optreset = yes; then |
| 422 | AC_DEFINE(HAVE_OPTRESET) |
| 423 | fi |
| 424 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 425 | dnl See if using the EXT2 ioctls causes a compile-time barf (as on the hurd). |
| 426 | dnl |
| 427 | AC_MSG_CHECKING(whether the ext2 ioctls compile) |
| 428 | AC_CACHE_VAL(e2fsprogs_cv_ioctl_ext2, |
| 429 | AC_TRY_COMPILE([#include <linux/ext2_fs.h> |
| 430 | #include <sys/ioctl.h>], |
| 431 | [ioctl (0, EXT2_IOC_SETVERSION, 0);], |
| 432 | [e2fsprogs_cv_ioctl_ext2=yes], |
| 433 | [e2fsprogs_cv_ioctl_ext2=no])) |
| 434 | AC_MSG_RESULT($e2fsprogs_cv_ioctl_ext2) |
| 435 | if test "$e2fsprogs_cv_ioctl_ext2" = yes; then |
| 436 | AC_DEFINE(HAVE_EXT2_IOCTLS) |
| 437 | fi |
| 438 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 439 | dnl Linux uses a separate usr_prefix by default |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 440 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 441 | case "$host_os" in |
| 442 | linux*) |
| 443 | if test "$prefix" = NONE ; then |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 444 | usr_prefix="\${prefix}/usr"; |
| 445 | echo "On $host_os systems, usr_prefix defaults to $usr_prefix" |
| 446 | fi |
| 447 | ;; |
| 448 | esac |
| 449 | if test "$usr_prefix" = NONE ; then |
| 450 | usr_prefix="\${prefix}" |
| 451 | fi |
| 452 | AC_SUBST(usr_prefix) |
| 453 | dnl |
| 454 | dnl On Linux/hurd, force the prefix to be '' |
| 455 | dnl |
| 456 | case "$host_os" in |
| 457 | linux* | gnu*) |
| 458 | if test "$prefix" = NONE ; then |
| 459 | prefix=''; |
| 460 | echo "On $host_os systems, prefix defaults to ''" |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 461 | fi |
| 462 | ;; |
| 463 | esac |
| 464 | dnl |
| 465 | dnl See if -static works. |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 466 | dnl |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 467 | AC_MSG_CHECKING([whether linker accepts -static]) |
| 468 | AC_CACHE_VAL(ac_cv_e2fsprogs_use_static, |
| 469 | [SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static" |
| 470 | AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);], |
| 471 | ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no) |
| 472 | LDFLAGS=$SAVE_LDFLAGS]) |
| 473 | AC_MSG_RESULT($ac_cv_e2fsprogs_use_static) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 474 | LDFLAG_STATIC= |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 475 | if test $ac_cv_e2fsprogs_use_static = yes; then |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 476 | LDFLAG_STATIC=-static |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 477 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 478 | AC_SUBST(LDFLAG_STATIC) |
| 479 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 480 | dnl Make the ss and et directories work correctly. |
| 481 | dnl |
| 482 | SS_DIR=`cd ${srcdir}/lib/ss; pwd` |
| 483 | ET_DIR=`cd ${srcdir}/lib/et; pwd` |
| 484 | AC_SUBST(SS_DIR) |
| 485 | AC_SUBST(ET_DIR) |
| 486 | dnl |
| 487 | dnl Only try to run the test suite if we're not cross compiling. |
| 488 | dnl |
| 489 | if test "$cross_compiling" = yes ; then |
| 490 | DO_TEST_SUITE= |
| 491 | else |
| 492 | DO_TEST_SUITE=check |
| 493 | fi |
| 494 | AC_SUBST(DO_TEST_SUITE) |
| 495 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 496 | dnl |
| 497 | dnl |
| 498 | DO_SUBSTITUTE_SCRIPT=$srcdir/lib/do_substitute |
| 499 | AC_SUBST_FILE(DO_SUBSTITUTE_SCRIPT) |
| 500 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 501 | dnl Make our output files, being sure that we create the some miscellaneous |
| 502 | dnl directories |
| 503 | dnl |
| 504 | test -d lib || mkdir lib |
| 505 | test -d include || mkdir include |
| 506 | test -d include/linux || mkdir include/linux |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 507 | rmakefile= |
| 508 | if test -d ${srcdir}/resize ; then |
| 509 | rmakefile=resize/Makefile |
| 510 | fi |
Theodore Ts'o | 44339bd | 1997-10-15 02:47:20 +0000 | [diff] [blame^] | 511 | 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] | 512 | lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile |
| 513 | misc/Makefile e2fsck/Makefile debugfs/Makefile tests/Makefile |
Theodore Ts'o | 24b2c7a | 1997-06-07 20:42:58 +0000 | [diff] [blame] | 514 | tests/progs/Makefile $rmakefile doc/Makefile) |