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