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