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