Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1 | AC_INIT(version.h) |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 2 | AC_PREREQ(2.50) |
| 3 | AC_CONFIG_AUX_DIR(config) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 4 | MCONFIG=./MCONFIG |
| 5 | AC_SUBST_FILE(MCONFIG) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 6 | BINARY_TYPE=bin |
| 7 | dnl |
| 8 | dnl This is to figure out the version number and the date.... |
| 9 | dnl |
| 10 | E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \ |
| 11 | | awk '{print $3}' | tr \" " " | awk '{print $1}'` |
| 12 | DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \ |
| 13 | | tr \" " "` |
Theodore Ts'o | bff0cc9 | 2003-03-23 01:37:53 -0500 | [diff] [blame] | 14 | E2FSPROGS_DAY=`echo $DATE | awk -F- '{print $1}'` |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 15 | MONTH=`echo $DATE | awk -F- '{print $2}'` |
| 16 | YEAR=`echo $DATE | awk -F- '{print $3}'` |
| 17 | |
Theodore Ts'o | 40fa8cc | 1999-01-09 05:06:02 +0000 | [diff] [blame] | 18 | if expr $YEAR ">" 1900 > /dev/null ; then |
| 19 | E2FSPROGS_YEAR=$YEAR |
| 20 | elif expr $YEAR ">" 90 >/dev/null ; then |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 21 | E2FSPROGS_YEAR=19$YEAR |
| 22 | else |
| 23 | E2FSPROGS_YEAR=20$YEAR |
| 24 | fi |
| 25 | |
| 26 | case $MONTH in |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 27 | Jan) MONTH_NUM=01; E2FSPROGS_MONTH="January" ;; |
| 28 | Feb) MONTH_NUM=02; E2FSPROGS_MONTH="February" ;; |
| 29 | Mar) MONTH_NUM=03; E2FSPROGS_MONTH="March" ;; |
| 30 | Apr) MONTH_NUM=04; E2FSPROGS_MONTH="April" ;; |
| 31 | May) MONTH_NUM=05; E2FSPROGS_MONTH="May" ;; |
| 32 | Jun) MONTH_NUM=06; E2FSPROGS_MONTH="June" ;; |
| 33 | Jul) MONTH_NUM=07; E2FSPROGS_MONTH="July" ;; |
| 34 | Aug) MONTH_NUM=08; E2FSPROGS_MONTH="August" ;; |
| 35 | Sep) MONTH_NUM=09; E2FSPROGS_MONTH="September" ;; |
| 36 | Oct) MONTH_NUM=10; E2FSPROGS_MONTH="October" ;; |
| 37 | Nov) MONTH_NUM=11; E2FSPROGS_MONTH="November" ;; |
| 38 | Dec) MONTH_NUM=12; E2FSPROGS_MONTH="December" ;; |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 39 | *) AC_MSG_WARN([Unknown month $MONTH??]) ;; |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 40 | esac |
| 41 | |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 42 | base_ver=`echo $E2FSPROGS_VERSION | \ |
| 43 | sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'` |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 44 | |
| 45 | date_spec=${E2FSPROGS_YEAR}.${MONTH_NUM}.${E2FSPROGS_DAY} |
| 46 | |
| 47 | case $E2FSPROGS_VERSION in |
| 48 | *-WIP|pre-*) |
Theodore Ts'o | ab06396 | 2008-07-07 16:07:43 -0400 | [diff] [blame] | 49 | E2FSPROGS_PKGVER="$base_ver~WIP-$E2FSPROGS_YEAR-$MONTH_NUM-$E2FSPROGS_DAY" |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 50 | ;; |
| 51 | *) |
| 52 | E2FSPROGS_PKGVER="$base_ver" |
| 53 | ;; |
| 54 | esac |
| 55 | |
| 56 | unset DATE MONTH YEAR base_ver pre_vers date_spec |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 57 | AC_MSG_RESULT([Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION]) |
| 58 | AC_MSG_RESULT([Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}]) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 59 | AC_SUBST(E2FSPROGS_YEAR) |
| 60 | AC_SUBST(E2FSPROGS_MONTH) |
Theodore Ts'o | bff0cc9 | 2003-03-23 01:37:53 -0500 | [diff] [blame] | 61 | AC_SUBST(E2FSPROGS_DAY) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 62 | AC_SUBST(E2FSPROGS_VERSION) |
Andreas Dilger | 927566a | 2006-11-12 19:41:25 -0500 | [diff] [blame] | 63 | AC_SUBST(E2FSPROGS_PKGVER) |
Theodore Ts'o | ea97be5 | 2001-09-19 15:20:12 -0400 | [diff] [blame] | 64 | AC_CANONICAL_HOST |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 65 | dnl |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 66 | dnl Use diet libc |
| 67 | dnl |
Theodore Ts'o | eafba6c | 2008-07-10 10:21:42 -0400 | [diff] [blame] | 68 | WITH_DIET_LIBC= |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 69 | AC_ARG_WITH([diet-libc], |
Theodore Ts'o | 3249394 | 2007-12-31 10:45:01 -0500 | [diff] [blame] | 70 | [ --with-diet-libc use diet libc], |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 71 | CC="diet cc -nostdinc" |
Theodore Ts'o | eafba6c | 2008-07-10 10:21:42 -0400 | [diff] [blame] | 72 | WITH_DIET_LIBC=yes |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 73 | AC_MSG_RESULT(CC=$CC))dnl |
| 74 | dnl |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 75 | AC_ARG_WITH([cc], |
Theodore Ts'o | 0b5b9f9 | 2009-09-06 21:28:47 -0400 | [diff] [blame] | 76 | AC_HELP_STRING([--with-cc],[no longer supported, use CC= instead]), |
| 77 | AC_MSG_ERROR([--with-cc no longer supported; use CC= instead])) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 78 | dnl |
| 79 | AC_ARG_WITH([ccopts], |
Theodore Ts'o | 0b5b9f9 | 2009-09-06 21:28:47 -0400 | [diff] [blame] | 80 | AC_HELP_STRING([--with-ccopts],[no longer supported, use CFLAGS= instead]), |
| 81 | AC_MSG_ERROR([--with-ccopts no longer supported; use CFLAGS= instead])) |
| 82 | dnl |
| 83 | AC_ARG_WITH([ldopts], |
| 84 | AC_HELP_STRING([--with-ldopts],[no longer supported, use LDFLAGS= instead]), |
| 85 | AC_MSG_ERROR([--with-ldopts no longer supported; use LDFLAGS= instead])) |
| 86 | dnl |
| 87 | AC_PROG_CC |
| 88 | AC_PROG_CPP |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 89 | dnl |
Theodore Ts'o | f8bd980 | 1999-10-26 04:19:45 +0000 | [diff] [blame] | 90 | dnl On systems without linux header files, we add an extra include directory |
| 91 | dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here |
| 92 | dnl is quoted so that it gets expanded by make, not by configure. |
| 93 | dnl |
| 94 | 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] | 95 | if test "$linux_headers" != yes; then |
| 96 | LINUX_INCLUDE='-I$(top_builddir)/include' |
Theodore Ts'o | f8bd980 | 1999-10-26 04:19:45 +0000 | [diff] [blame] | 97 | fi |
| 98 | AC_SUBST(LINUX_INCLUDE) |
| 99 | dnl |
Matthias Andree | b1c92f9 | 2004-02-23 21:30:11 +0100 | [diff] [blame] | 100 | dnl Alpha computers use fast and imprecise floating point code that may |
| 101 | dnl miss exceptions by default. Force sane options if we're using GCC. |
| 102 | AC_MSG_CHECKING(for additional special compiler flags) |
| 103 | if test "$GCC" = yes |
| 104 | then |
| 105 | case "$host_cpu" in |
| 106 | alpha) addcflags="-mieee" ;; |
| 107 | esac |
| 108 | fi |
| 109 | if test "x$addcflags" != x |
| 110 | then |
| 111 | AC_MSG_RESULT($addcflags) |
| 112 | CFLAGS="$addcflags $CFLAGS" |
| 113 | else |
| 114 | AC_MSG_RESULT([[(none)]]) |
| 115 | fi |
| 116 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 117 | dnl Set default values for library extentions. Will be dealt with after |
| 118 | dnl parsing configuration opions, which may modify these |
| 119 | dnl |
| 120 | LIB_EXT=.a |
| 121 | STATIC_LIB_EXT=.a |
Theodore Ts'o | 14b596d | 2009-04-22 09:18:30 -0400 | [diff] [blame] | 122 | PROFILED_LIB_EXT=.a |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 123 | dnl |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 124 | dnl Allow separate `root_prefix' to be specified |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 125 | dnl |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 126 | AC_ARG_WITH([root-prefix], |
| 127 | [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root], |
| 128 | root_prefix=$withval, |
| 129 | root_prefix=NONE)dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 130 | dnl |
Theodore Ts'o | 98919bd | 2005-02-04 10:43:58 -0500 | [diff] [blame] | 131 | dnl handle --enable-maintainer-mode |
| 132 | dnl |
| 133 | AC_ARG_ENABLE([maintainer-mode], |
| 134 | [ --enable-maintainer-mode enable makefile rules useful for maintainers], |
| 135 | if test "$enableval" = "no" |
| 136 | then |
| 137 | MAINTAINER_CMT=# |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 138 | AC_MSG_RESULT([Disabling maintainer mode]) |
Theodore Ts'o | 98919bd | 2005-02-04 10:43:58 -0500 | [diff] [blame] | 139 | else |
| 140 | MAINTAINER_CMT= |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 141 | AC_MSG_RESULT([Enabling maintainer mode]) |
Theodore Ts'o | 98919bd | 2005-02-04 10:43:58 -0500 | [diff] [blame] | 142 | fi |
| 143 | , |
| 144 | MAINTAINER_CMT=# |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 145 | AC_MSG_RESULT([Disabling maintainer mode by default]) |
Theodore Ts'o | 98919bd | 2005-02-04 10:43:58 -0500 | [diff] [blame] | 146 | ) |
| 147 | AC_SUBST(MAINTAINER_CMT) |
| 148 | dnl |
Theodore Ts'o | c13351f | 2009-07-02 00:11:17 -0400 | [diff] [blame] | 149 | dnl handle --enable-verbose-makecmds |
| 150 | dnl |
| 151 | AC_ARG_ENABLE([verbose-makecmds], |
| 152 | [ --enable-verbose-makecmds enable verbose make command output], |
| 153 | if test "$enableval" = "no" |
| 154 | then |
| 155 | AC_MSG_RESULT([Disabling verbose make commands]) |
| 156 | E=@echo |
| 157 | Q=@ |
| 158 | else |
| 159 | AC_MSG_RESULT([Enabling verbose make commands]) |
| 160 | E=@\\# |
| 161 | Q= |
| 162 | fi |
| 163 | , |
| 164 | AC_MSG_RESULT([Disabling verbose make commands]) |
| 165 | E=@echo |
| 166 | Q=@ |
| 167 | ) |
| 168 | AC_SUBST(E) |
| 169 | AC_SUBST(Q) |
| 170 | dnl |
Theodore Ts'o | 1917875 | 2000-02-11 15:55:07 +0000 | [diff] [blame] | 171 | dnl handle --enable-compression |
| 172 | dnl |
| 173 | AC_ARG_ENABLE([compression], |
| 174 | [ --enable-compression enable EXPERIMENTAL compression support], |
| 175 | if test "$enableval" = "no" |
| 176 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 177 | AC_MSG_RESULT([Disabling compression support]) |
Theodore Ts'o | 1917875 | 2000-02-11 15:55:07 +0000 | [diff] [blame] | 178 | else |
| 179 | AC_DEFINE(ENABLE_COMPRESSION) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 180 | AC_MSG_RESULT([Enabling compression support]) |
| 181 | AC_MSG_WARN([Compression support is experimental]) |
Theodore Ts'o | 1917875 | 2000-02-11 15:55:07 +0000 | [diff] [blame] | 182 | fi |
| 183 | , |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 184 | AC_MSG_RESULT([Disabling compression support by default]) |
Theodore Ts'o | 1917875 | 2000-02-11 15:55:07 +0000 | [diff] [blame] | 185 | ) |
| 186 | dnl |
Theodore Ts'o | 8fdc998 | 2002-06-25 23:26:34 -0400 | [diff] [blame] | 187 | dnl handle --enable-htree |
| 188 | dnl |
| 189 | AC_ARG_ENABLE([htree], |
| 190 | [ --enable-htree enable EXPERIMENTAL htree directory support], |
| 191 | if test "$enableval" = "no" |
| 192 | then |
| 193 | HTREE_CMT=# |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 194 | AC_MSG_RESULT([Disabling htree directory support]) |
Theodore Ts'o | 8fdc998 | 2002-06-25 23:26:34 -0400 | [diff] [blame] | 195 | else |
| 196 | HTREE_CMT= |
| 197 | AC_DEFINE(ENABLE_HTREE) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 198 | AC_MSG_RESULT([Enabling htree directory support]) |
Theodore Ts'o | 8fdc998 | 2002-06-25 23:26:34 -0400 | [diff] [blame] | 199 | fi |
| 200 | , |
Theodore Ts'o | 559ca6c | 2002-08-18 03:48:55 -0400 | [diff] [blame] | 201 | HTREE_CMT= |
| 202 | AC_DEFINE(ENABLE_HTREE) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 203 | AC_MSG_RESULT([Enabling htree directory support by default]) |
Theodore Ts'o | 8fdc998 | 2002-06-25 23:26:34 -0400 | [diff] [blame] | 204 | ) |
| 205 | AC_SUBST(HTREE_CMT) |
| 206 | dnl |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 207 | dnl This needs to be before all of the --enable-*-shlibs options |
| 208 | dnl |
| 209 | E2_PKG_CONFIG_STATIC=--static |
Theodore Ts'o | 55da987 | 2008-09-02 23:12:38 -0400 | [diff] [blame] | 210 | LDFLAG_DYNAMIC= |
| 211 | PRIVATE_LIBS_CMT= |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 212 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 213 | dnl handle --enable-elf-shlibs |
| 214 | dnl |
| 215 | AC_ARG_ENABLE([elf-shlibs], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 216 | [ --enable-elf-shlibs select ELF shared libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 217 | if test "$enableval" = "no" |
| 218 | then |
| 219 | ELF_CMT=# |
| 220 | MAKEFILE_ELF=/dev/null |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 221 | AC_MSG_RESULT([Disabling ELF shared libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 222 | else |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 223 | E2_PKG_CONFIG_STATIC= |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 224 | ELF_CMT= |
| 225 | MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib |
Theodore Ts'o | f5955dd | 2000-10-25 02:38:39 +0000 | [diff] [blame] | 226 | [case "$host_os" in |
| 227 | solaris2.*) |
| 228 | MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib |
| 229 | ;; |
| 230 | esac] |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 231 | BINARY_TYPE=elfbin |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 232 | LIB_EXT=.so |
Theodore Ts'o | 55da987 | 2008-09-02 23:12:38 -0400 | [diff] [blame] | 233 | PRIVATE_LIBS_CMT=# |
| 234 | LDFLAG_DYNAMIC=['-Wl,-rpath-link,$(top_builddir)/lib'] |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 235 | AC_MSG_RESULT([Enabling ELF shared libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 236 | fi |
| 237 | , |
| 238 | MAKEFILE_ELF=/dev/null |
| 239 | ELF_CMT=# |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 240 | AC_MSG_RESULT([Disabling ELF shared libraries by default]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 241 | ) |
| 242 | AC_SUBST(ELF_CMT) |
| 243 | AC_SUBST_FILE(MAKEFILE_ELF) |
| 244 | dnl |
| 245 | dnl handle --enable-bsd-shlibs |
| 246 | dnl |
| 247 | AC_ARG_ENABLE([bsd-shlibs], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 248 | [ --enable-bsd-shlibs select BSD shared libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 249 | if test "$enableval" = "no" |
| 250 | then |
| 251 | BSDLIB_CMT=# |
| 252 | MAKEFILE_BSDLIB=/dev/null |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 253 | AC_MSG_RESULT([Disabling BSD shared libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 254 | else |
Theodore Ts'o | a4ece35 | 2008-01-01 20:05:04 -0500 | [diff] [blame] | 255 | E2_PKG_CONFIG_STATIC= |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 256 | BSDLIB_CMT= |
| 257 | MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 258 | LIB_EXT=.so |
Theodore Ts'o | e71d873 | 2003-03-14 02:13:48 -0500 | [diff] [blame] | 259 | [case "$host_os" in |
Theodore Ts'o | aa75ecc | 2003-03-17 10:01:22 -0500 | [diff] [blame] | 260 | darwin*) |
Theodore Ts'o | e71d873 | 2003-03-14 02:13:48 -0500 | [diff] [blame] | 261 | MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib |
| 262 | LIB_EXT=.dylib |
| 263 | ;; |
| 264 | esac] |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 265 | AC_MSG_RESULT([Enabling BSD shared libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 266 | fi |
| 267 | , |
| 268 | MAKEFILE_BSDLIB=/dev/null |
| 269 | BSDLIB_CMT=# |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 270 | AC_MSG_RESULT([Disabling BSD shared libraries by default]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 271 | ) |
| 272 | AC_SUBST(BSDLIB_CMT) |
| 273 | AC_SUBST_FILE(MAKEFILE_BSDLIB) |
| 274 | dnl |
| 275 | dnl handle --enable-profile |
| 276 | dnl |
| 277 | AC_ARG_ENABLE([profile], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 278 | [ --enable-profile build profiling libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 279 | if test "$enableval" = "no" |
| 280 | then |
| 281 | PROFILE_CMT=# |
| 282 | MAKEFILE_PROFILE=/dev/null |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 283 | AC_MSG_RESULT([Disabling profiling libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 284 | else |
| 285 | PROFILE_CMT= |
| 286 | MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 287 | PROFILED_LIB_EXT=_p.a |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 288 | AC_MSG_RESULT([Building profiling libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 289 | fi |
| 290 | , |
| 291 | PROFILE_CMT=# |
| 292 | MAKEFILE_PROFILE=/dev/null |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 293 | AC_MSG_RESULT([Disabling profiling libraries by default]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 294 | ) |
| 295 | AC_SUBST(PROFILE_CMT) |
| 296 | AC_SUBST_FILE(MAKEFILE_PROFILE) |
| 297 | dnl |
| 298 | dnl handle --enable-checker |
| 299 | dnl |
| 300 | AC_ARG_ENABLE([checker], |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 301 | [ --enable-checker build checker libraries], |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 302 | if test "$enableval" = "no" |
| 303 | then |
| 304 | CHECKER_CMT=# |
| 305 | MAKEFILE_CHECKER=/dev/null |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 306 | AC_MSG_RESULT([Disabling checker libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 307 | else |
| 308 | CHECKER_CMT= |
| 309 | MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 310 | AC_MSG_RESULT([Building checker libraries]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 311 | fi |
| 312 | , |
| 313 | CHECKER_CMT=# |
| 314 | MAKEFILE_CHECKER=/dev/null |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 315 | AC_MSG_RESULT([Disabling checker libraries by default]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 316 | ) |
| 317 | AC_SUBST(CHECKER_CMT) |
| 318 | AC_SUBST_FILE(MAKEFILE_CHECKER) |
| 319 | dnl |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 320 | dnl Substitute library extensions |
| 321 | dnl |
| 322 | AC_SUBST(LIB_EXT) |
| 323 | AC_SUBST(STATIC_LIB_EXT) |
| 324 | AC_SUBST(PROFILED_LIB_EXT) |
Theodore Ts'o | 55da987 | 2008-09-02 23:12:38 -0400 | [diff] [blame] | 325 | AC_SUBST(LDFLAG_DYNAMIC) |
| 326 | AC_SUBST(PRIVATE_LIBS_CMT) |
Theodore Ts'o | a4d0961 | 1997-04-29 14:28:00 +0000 | [diff] [blame] | 327 | dnl |
Theodore Ts'o | 782bebf | 2002-11-08 18:46:45 -0500 | [diff] [blame] | 328 | dnl handle --enable-jbd-debug |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 329 | dnl |
Theodore Ts'o | 782bebf | 2002-11-08 18:46:45 -0500 | [diff] [blame] | 330 | AC_ARG_ENABLE([jbd-debug], |
| 331 | [ --enable-jbd-debug enable journal debugging], |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 332 | if test "$enableval" = "no" |
| 333 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 334 | AC_MSG_RESULT([Disabling journal debugging]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 335 | else |
Theodore Ts'o | 8cf9333 | 2001-12-16 02:23:36 -0500 | [diff] [blame] | 336 | AC_DEFINE(CONFIG_JBD_DEBUG) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 337 | AC_MSG_RESULT([Enabling journal debugging]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 338 | fi |
| 339 | , |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 340 | AC_MSG_RESULT([Disabling journal debugging by default]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 341 | ) |
| 342 | dnl |
Theodore Ts'o | f0a22d0 | 2003-02-22 13:19:53 -0500 | [diff] [blame] | 343 | dnl handle --enable-blkid-debug |
| 344 | dnl |
| 345 | AC_ARG_ENABLE([blkid-debug], |
Theodore Ts'o | d21ae6c | 2003-05-05 09:00:24 -0400 | [diff] [blame] | 346 | [ --enable-blkid-debug enable blkid debugging], |
Theodore Ts'o | f0a22d0 | 2003-02-22 13:19:53 -0500 | [diff] [blame] | 347 | if test "$enableval" = "no" |
| 348 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 349 | AC_MSG_RESULT([Disabling blkid debugging]) |
Theodore Ts'o | f0a22d0 | 2003-02-22 13:19:53 -0500 | [diff] [blame] | 350 | else |
| 351 | AC_DEFINE(CONFIG_BLKID_DEBUG) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 352 | AC_MSG_RESULT([Enabling blkid debugging]) |
Theodore Ts'o | f0a22d0 | 2003-02-22 13:19:53 -0500 | [diff] [blame] | 353 | fi |
| 354 | , |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 355 | AC_MSG_RESULT([Disabling blkid debugging by default]) |
Theodore Ts'o | f0a22d0 | 2003-02-22 13:19:53 -0500 | [diff] [blame] | 356 | ) |
| 357 | dnl |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 358 | dnl handle --enable-testio-debug |
| 359 | dnl |
| 360 | AC_ARG_ENABLE([testio-debug], |
Theodore Ts'o | af77365 | 2008-09-01 11:27:27 -0400 | [diff] [blame] | 361 | [ --disable-testio-debug disable the use of the test I/O manager for debugging], |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 362 | if test "$enableval" = "no" |
| 363 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 364 | AC_MSG_RESULT([Disabling testio debugging]) |
Theodore Ts'o | af77365 | 2008-09-01 11:27:27 -0400 | [diff] [blame] | 365 | TEST_IO_CMT="#" |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 366 | else |
Theodore Ts'o | af77365 | 2008-09-01 11:27:27 -0400 | [diff] [blame] | 367 | TEST_IO_CMT= |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 368 | AC_DEFINE(CONFIG_TESTIO_DEBUG) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 369 | AC_MSG_RESULT([Enabling testio debugging]) |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 370 | fi |
| 371 | , |
Theodore Ts'o | af77365 | 2008-09-01 11:27:27 -0400 | [diff] [blame] | 372 | AC_MSG_RESULT([Enabling testio debugging by default]) |
| 373 | AC_DEFINE(CONFIG_TESTIO_DEBUG) |
| 374 | TEST_IO_CMT= |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 375 | ) |
Theodore Ts'o | af77365 | 2008-09-01 11:27:27 -0400 | [diff] [blame] | 376 | AC_SUBST(TEST_IO_CMT) |
Theodore Ts'o | 2a29f13 | 2003-05-05 12:08:47 -0400 | [diff] [blame] | 377 | dnl |
Scott James Remnant | 39fd3d4 | 2009-05-14 13:03:25 +0100 | [diff] [blame] | 378 | dnl handle --disable-libuuid |
| 379 | dnl |
| 380 | PKG_PROG_PKG_CONFIG |
| 381 | LIBUUID= |
| 382 | DEPLIBUUID= |
| 383 | STATIC_LIBUUID= |
| 384 | DEPSTATIC_LIBUUID= |
| 385 | PROFILED_LIBUUID= |
| 386 | DEPPROFILED_LIBUUID= |
| 387 | UUID_CMT= |
| 388 | AC_ARG_ENABLE([libuuid], |
| 389 | [ --disable-libuuid do not build private uuid library], |
| 390 | if test "$enableval" = "no" |
| 391 | then |
| 392 | if test -z "$PKG_CONFIG"; then |
| 393 | AC_MSG_ERROR([pkg-config not installed; please install it.]) |
| 394 | fi |
| 395 | |
| 396 | AC_CHECK_LIB(uuid, uuid_generate, |
| 397 | [LIBUUID=`$PKG_CONFIG --libs uuid`; |
| 398 | STATIC_LIBUUID=`$PKG_CONFIG --static --libs uuid`], |
| 399 | [AC_MSG_ERROR([external uuid library not found])], |
| 400 | [$LIBUUID]) |
| 401 | UUID_CMT=# |
| 402 | AC_MSG_RESULT([Disabling private uuid library]) |
| 403 | else |
| 404 | LIBUUID='$(LIB)/libuuid'$LIB_EXT |
| 405 | DEPLIBUUID=$LIBUUID |
| 406 | STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT |
| 407 | DEPSTATIC_LIBUUID=$STATIC_LIBUUID |
| 408 | PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT |
| 409 | DEPPROFILED_LIBUUID=$PROFILED_LIBUUID |
| 410 | AC_MSG_RESULT([Enabling private uuid library]) |
| 411 | fi |
| 412 | , |
| 413 | LIBUUID='$(LIB)/libuuid'$LIB_EXT |
| 414 | DEPLIBUUID=$LIBUUID |
| 415 | STATIC_LIBUUID='$(LIB)/libuuid'$STATIC_LIB_EXT |
| 416 | DEPSTATIC_LIBUUID=$STATIC_LIBUUID |
| 417 | PROFILED_LIBUUID='$(LIB)/libuuid'$PROFILED_LIB_EXT |
| 418 | DEPPROFILED_LIBUUID=$PROFILED_LIBUUID |
| 419 | AC_MSG_RESULT([Enabling private uuid library by default]) |
| 420 | ) |
| 421 | AC_SUBST(LIBUUID) |
| 422 | AC_SUBST(DEPLIBUUID) |
| 423 | AC_SUBST(STATIC_LIBUUID) |
| 424 | AC_SUBST(DEPSTATIC_LIBUUID) |
| 425 | AC_SUBST(PROFILED_LIBUUID) |
| 426 | AC_SUBST(DEPPROFILED_LIBUUID) |
| 427 | AC_SUBST(UUID_CMT) |
| 428 | dnl |
Theodore Ts'o | 14b596d | 2009-04-22 09:18:30 -0400 | [diff] [blame] | 429 | dnl handle --disable-libblkid |
| 430 | dnl |
| 431 | PKG_PROG_PKG_CONFIG |
| 432 | LIBBLKID= |
| 433 | DEPLIBBLKID= |
| 434 | STATIC_LIBBLKID= |
| 435 | DEPSTATIC_LIBBLKID= |
| 436 | PROFILED_LIBBLKID= |
| 437 | DEPPROFILED_LIBBLKID= |
| 438 | BLKID_CMT= |
| 439 | AC_ARG_ENABLE([libblkid], |
| 440 | [ --disable-libblkid do not build private blkid library], |
| 441 | if test "$enableval" = "no" |
| 442 | then |
| 443 | if test -z "$PKG_CONFIG"; then |
| 444 | AC_MSG_ERROR([pkg-config not installed; please install it.]) |
| 445 | fi |
| 446 | |
| 447 | AC_CHECK_LIB(blkid, blkid_get_cache, |
| 448 | [LIBBLKID=`$PKG_CONFIG --libs blkid`; |
| 449 | STATIC_LIBBLKID=`$PKG_CONFIG --static --libs blkid`], |
| 450 | [AC_MSG_ERROR([external blkid library not found])], |
| 451 | [$LIBBLKID]) |
| 452 | BLKID_CMT=# |
| 453 | AC_MSG_RESULT([Disabling private blkid library]) |
| 454 | else |
| 455 | LIBBLKID='$(LIB)/libblkid'$LIB_EXT |
| 456 | DEPLIBBLKID=$LIBBLKID |
| 457 | STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT |
| 458 | DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID |
| 459 | PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT |
| 460 | DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID |
| 461 | AC_DEFINE(CONFIG_BUILD_FINDFS) |
| 462 | AC_MSG_RESULT([Enabling private blkid library]) |
| 463 | fi |
| 464 | , |
| 465 | LIBBLKID='$(LIB)/libblkid'$LIB_EXT |
| 466 | DEPLIBBLKID=$LIBBLKID |
| 467 | STATIC_LIBBLKID='$(LIB)/libblkid'$STATIC_LIB_EXT |
| 468 | DEPSTATIC_LIBBLKID=$STATIC_LIBBLKID |
| 469 | PROFILED_LIBBLKID='$(LIB)/libblkid'$PROFILED_LIB_EXT |
| 470 | DEPPROFILED_LIBBLKID=$PROFILED_LIBBLKID |
| 471 | AC_DEFINE(CONFIG_BUILD_FINDFS) |
| 472 | AC_MSG_RESULT([Enabling private blkid library by default]) |
| 473 | ) |
| 474 | AC_SUBST(LIBBLKID) |
| 475 | AC_SUBST(DEPLIBBLKID) |
| 476 | AC_SUBST(STATIC_LIBBLKID) |
| 477 | AC_SUBST(DEPSTATIC_LIBBLKID) |
| 478 | AC_SUBST(PROFILED_LIBBLKID) |
| 479 | AC_SUBST(DEPPROFILED_LIBBLKID) |
| 480 | AC_SUBST(BLKID_CMT) |
| 481 | dnl |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 482 | dnl handle --enable-debugfs |
| 483 | dnl |
| 484 | AC_ARG_ENABLE([debugfs], |
| 485 | [ --disable-debugfs disable support of debugfs program], |
| 486 | if test "$enableval" = "no" |
| 487 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 488 | AC_MSG_RESULT([Disabling debugfs support]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 489 | DEBUGFS_CMT="#" |
| 490 | else |
| 491 | DEBUGFS_CMT= |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 492 | AC_MSG_RESULT([Enabling debugfs support]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 493 | fi |
| 494 | , |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 495 | AC_MSG_RESULT([Enabling debugfs support by default]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 496 | DEBUGFS_CMT= |
| 497 | ) |
| 498 | AC_SUBST(DEBUGFS_CMT) |
| 499 | dnl |
| 500 | dnl handle --enable-imager |
| 501 | dnl |
| 502 | AC_ARG_ENABLE([imager], |
| 503 | [ --disable-imager disable support of e2image program], |
| 504 | if test "$enableval" = "no" |
| 505 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 506 | AC_MSG_RESULT([Disabling e2image support]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 507 | IMAGER_CMT="#" |
| 508 | else |
| 509 | IMAGER_CMT= |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 510 | AC_MSG_RESULT([Enabling e2image support]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 511 | fi |
| 512 | , |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 513 | AC_MSG_RESULT([Enabling e2image support by default]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 514 | IMAGER_CMT= |
| 515 | ) |
| 516 | AC_SUBST(IMAGER_CMT) |
| 517 | dnl |
| 518 | dnl handle --enable-resizer |
| 519 | dnl |
| 520 | AC_ARG_ENABLE([resizer], |
| 521 | [ --disable-resizer disable support of e2resize program], |
| 522 | if test "$enableval" = "no" |
| 523 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 524 | AC_MSG_RESULT([Disabling e2resize support]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 525 | RESIZER_CMT="#" |
| 526 | else |
| 527 | RESIZER_CMT= |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 528 | AC_MSG_RESULT([Enabling e2resize support]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 529 | fi |
| 530 | , |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 531 | AC_MSG_RESULT([Enabling e2resize support by default]) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 532 | RESIZER_CMT= |
| 533 | ) |
| 534 | AC_SUBST(RESIZER_CMT) |
| 535 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 536 | dnl See whether to install the `fsck' wrapper program (that calls e2fsck) |
| 537 | dnl |
| 538 | AC_ARG_ENABLE([fsck], |
| 539 | [ --enable-fsck build fsck wrapper program], |
| 540 | [if test "$enableval" = "no" |
| 541 | then |
| 542 | FSCK_PROG='' FSCK_MAN='' |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 543 | AC_MSG_RESULT([Not building fsck wrapper]) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 544 | else |
| 545 | FSCK_PROG=fsck FSCK_MAN=fsck.8 |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 546 | AC_MSG_RESULT([Building fsck wrapper]) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 547 | fi] |
| 548 | , |
| 549 | [case "$host_os" in |
Theodore Ts'o | e363240 | 2004-05-04 19:39:54 -0400 | [diff] [blame] | 550 | gnu*) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 551 | FSCK_PROG='' FSCK_MAN='' |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 552 | AC_MSG_RESULT([Not building fsck wrapper by default]) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 553 | ;; |
| 554 | *) |
| 555 | FSCK_PROG=fsck FSCK_MAN=fsck.8 |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 556 | AC_MSG_RESULT([Building fsck wrapper by default]) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 557 | esac] |
| 558 | ) |
| 559 | AC_SUBST(FSCK_PROG) |
| 560 | AC_SUBST(FSCK_MAN) |
| 561 | dnl |
Theodore Ts'o | 5d40773 | 2004-09-18 14:53:14 -0400 | [diff] [blame] | 562 | dnl See whether to install the `e2initrd-helper' program |
| 563 | dnl |
| 564 | AC_ARG_ENABLE([e2initrd-helper], |
| 565 | [ --enable-e2initrd-helper build e2initrd-helper program], |
| 566 | [if test "$enableval" = "no" |
| 567 | then |
| 568 | E2INITRD_PROG='' E2INITRD_MAN='' |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 569 | AC_MSG_RESULT([Not building e2initrd helper]) |
Theodore Ts'o | 5d40773 | 2004-09-18 14:53:14 -0400 | [diff] [blame] | 570 | else |
| 571 | E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8 |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 572 | AC_MSG_RESULT([Building e2initrd helper]) |
Theodore Ts'o | 5d40773 | 2004-09-18 14:53:14 -0400 | [diff] [blame] | 573 | fi] |
| 574 | , |
| 575 | E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8 |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 576 | AC_MSG_RESULT([Building e2initrd helper by default]) |
Theodore Ts'o | 5d40773 | 2004-09-18 14:53:14 -0400 | [diff] [blame] | 577 | ) |
| 578 | AC_SUBST(E2INITRD_PROG) |
| 579 | AC_SUBST(E2INITRD_MAN) |
Karel Zak | 4db2f59 | 2006-03-08 14:17:28 -0500 | [diff] [blame] | 580 | dnl |
Theodore Ts'o | 5d40773 | 2004-09-18 14:53:14 -0400 | [diff] [blame] | 581 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 582 | dnl |
Theodore Ts'o | 3249394 | 2007-12-31 10:45:01 -0500 | [diff] [blame] | 583 | AC_ARG_ENABLE([tls], |
| 584 | [ --disable-tls disable use of thread local support], |
| 585 | [if test "$enableval" = "no" |
| 586 | then |
| 587 | try_tls="" |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 588 | AC_MSG_RESULT([Disabling thread local support]) |
Theodore Ts'o | 3249394 | 2007-12-31 10:45:01 -0500 | [diff] [blame] | 589 | else |
| 590 | try_tls="yes" |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 591 | AC_MSG_RESULT([Enabling thread local support]) |
Theodore Ts'o | 3249394 | 2007-12-31 10:45:01 -0500 | [diff] [blame] | 592 | fi] |
| 593 | , |
Theodore Ts'o | eafba6c | 2008-07-10 10:21:42 -0400 | [diff] [blame] | 594 | if test -n "$WITH_DIET_LIBC" |
| 595 | then |
| 596 | try_tls="" |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 597 | AC_MSG_RESULT([Diet libc does not support thread local support]) |
Theodore Ts'o | eafba6c | 2008-07-10 10:21:42 -0400 | [diff] [blame] | 598 | else |
| 599 | try_tls="yes" |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 600 | AC_MSG_RESULT([Try using thread local support by default]) |
Theodore Ts'o | eafba6c | 2008-07-10 10:21:42 -0400 | [diff] [blame] | 601 | fi |
Theodore Ts'o | 3249394 | 2007-12-31 10:45:01 -0500 | [diff] [blame] | 602 | ) |
| 603 | if test "$try_tls" = "yes" |
| 604 | then |
| 605 | AX_TLS |
| 606 | fi |
| 607 | dnl |
| 608 | dnl |
| 609 | dnl |
Theodore Ts'o | 5610f99 | 2007-12-31 11:16:56 -0500 | [diff] [blame] | 610 | AC_ARG_ENABLE([uuidd], |
| 611 | [ --disable-uuidd disable building the uuid daemon], |
| 612 | [if test "$enableval" = "no" |
| 613 | then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 614 | AC_MSG_RESULT([Not building uuidd]) |
Theodore Ts'o | 5610f99 | 2007-12-31 11:16:56 -0500 | [diff] [blame] | 615 | UUIDD_CMT="#" |
| 616 | else |
| 617 | AC_DEFINE(USE_UUIDD) |
| 618 | UUIDD_CMT="" |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 619 | AC_MSG_RESULT([Building uuidd]) |
Theodore Ts'o | 5610f99 | 2007-12-31 11:16:56 -0500 | [diff] [blame] | 620 | fi] |
| 621 | , |
| 622 | AC_DEFINE(USE_UUIDD) |
| 623 | UUIDD_CMT="" |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 624 | AC_MSG_RESULT([Building uuidd by default]) |
Theodore Ts'o | 5610f99 | 2007-12-31 11:16:56 -0500 | [diff] [blame] | 625 | ) |
| 626 | AC_SUBST(UUIDD_CMT) |
| 627 | dnl |
| 628 | dnl |
| 629 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 630 | MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library |
| 631 | AC_SUBST_FILE(MAKEFILE_LIBRARY) |
| 632 | dnl |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 633 | dnl Add internationalization support, using gettext. |
| 634 | dnl |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 635 | GETTEXT_PACKAGE=e2fsprogs |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 636 | PACKAGE=e2fsprogs |
| 637 | VERSION="$E2FSPROGS_VERSION" |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 638 | VERSION=0.14.1 |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 639 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") |
| 640 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION") |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 641 | AC_SUBST(GETTEXT_PACKAGE) |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 642 | AC_SUBST(PACKAGE) |
| 643 | AC_SUBST(VERSION) |
| 644 | |
Theodore Ts'o | cdf186e | 2001-06-13 22:16:47 +0000 | [diff] [blame] | 645 | AM_GNU_GETTEXT |
| 646 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 647 | dnl End of configuration options |
| 648 | dnl |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 649 | AC_SUBST(BINARY_TYPE) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 650 | AC_PROG_MAKE_SET |
Theodore Ts'o | bcb915b | 2009-07-02 18:19:10 -0400 | [diff] [blame] | 651 | CHECK_GNU_MAKE |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 652 | AC_PATH_PROG(LN, ln, ln) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 653 | AC_PROG_LN_S |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 654 | AC_PATH_PROG(MV, mv, mv) |
| 655 | AC_PATH_PROG(CP, cp, cp) |
| 656 | AC_PATH_PROG(RM, rm, rm) |
| 657 | AC_PATH_PROG(CHMOD, chmod, :) |
Theodore Ts'o | 3223701 | 2005-01-17 19:13:39 -0500 | [diff] [blame] | 658 | AC_PROG_AWK |
| 659 | AC_PROG_EGREP |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 660 | AC_PATH_PROG(SED, sed, sed) |
Theodore Ts'o | 9d564f7 | 1999-07-03 20:25:58 +0000 | [diff] [blame] | 661 | AC_PATH_PROG(PERL, perl, perl) |
Theodore Ts'o | 250f79f | 2001-05-19 22:02:22 +0000 | [diff] [blame] | 662 | AC_PATH_PROG(LDCONFIG, ldconfig, :) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 663 | AC_CHECK_TOOL(AR, ar, ar) |
| 664 | AC_CHECK_TOOL(RANLIB, ranlib, :) |
| 665 | AC_CHECK_TOOL(STRIP, strip, :) |
Manish Katiyar | 7321d94 | 2008-04-14 17:20:03 +0530 | [diff] [blame] | 666 | AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, ) |
| 667 | if test "_$MAKEINFO" = "_"; then |
| 668 | MAKEINFO="@echo Makeinfo is missing. Info documentation will not be built.;true" |
| 669 | else |
| 670 | case "$MAKEINFO" in |
| 671 | */missing.*) |
| 672 | AC_MSG_WARN([ |
| 673 | *** Makeinfo is missing. Info documentation will not be built.]) |
| 674 | ;; |
| 675 | *) |
| 676 | ;; |
| 677 | esac |
| 678 | fi |
| 679 | AC_SUBST(MAKEINFO) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 680 | AC_PROG_INSTALL |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 681 | # See if we need a separate native compiler. |
| 682 | if test $cross_compiling = no; then |
| 683 | BUILD_CC="$CC" |
| 684 | AC_SUBST(BUILD_CC) |
| 685 | else |
| 686 | AC_CHECK_PROGS(BUILD_CC, gcc cc) |
| 687 | fi |
Theodore Ts'o | d7f45af | 2008-09-12 10:15:26 -0400 | [diff] [blame] | 688 | AC_CHECK_HEADERS(dirent.h errno.h getopt.h malloc.h mntent.h paths.h semaphore.h setjmp.h signal.h stdarg.h stdint.h stdlib.h termios.h termio.h unistd.h utime.h linux/fd.h linux/major.h net/if_dl.h netinet/in.h sys/disklabel.h sys/file.h sys/ioctl.h sys/mkdev.h sys/mman.h sys/prctl.h sys/queue.h sys/resource.h sys/select.h sys/socket.h sys/sockio.h sys/stat.h sys/syscall.h sys/sysmacros.h sys/time.h sys/types.h sys/un.h sys/wait.h) |
Theodore Ts'o | da76d6b | 2005-01-18 23:29:01 -0500 | [diff] [blame] | 689 | AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,, |
| 690 | [[ |
| 691 | #if HAVE_SYS_QUEUE_H |
| 692 | #include <sys/queue.h> |
| 693 | #endif |
| 694 | ]]) |
| 695 | AC_CHECK_HEADERS(net/if.h,,, |
| 696 | [[ |
| 697 | #if HAVE_SYS_TYPES_H |
| 698 | #include <sys/types.h> |
| 699 | #endif |
| 700 | #if HAVE_SYS_SOCKET |
| 701 | #include <sys/socket.h> |
| 702 | #endif |
| 703 | ]]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 704 | AC_FUNC_VPRINTF |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 705 | dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen |
| 706 | dnl is not decleared. |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 707 | AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT)],, |
| 708 | [#include <dirent.h>]) |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 709 | dnl Check to see if ssize_t was decleared |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 710 | AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T)],, |
| 711 | [#include <sys/types.h>]) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 712 | dnl |
Theodore Ts'o | b0b9c4d | 1997-10-20 23:36:30 +0000 | [diff] [blame] | 713 | dnl Check to see if llseek() is declared in unistd.h. On some libc's |
| 714 | dnl it is, and on others it isn't..... Thank you glibc developers.... |
| 715 | dnl |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 716 | AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)],, |
| 717 | [#include <unistd.h>]) |
Theodore Ts'o | b0b9c4d | 1997-10-20 23:36:30 +0000 | [diff] [blame] | 718 | dnl |
Theodore Ts'o | 6928adc | 2000-05-25 23:28:50 +0000 | [diff] [blame] | 719 | dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files |
| 720 | dnl are so convoluted that I can't tell whether it will always be defined, |
| 721 | dnl and if it isn't defined while lseek64 is defined in the library, |
| 722 | dnl disaster will strike. |
| 723 | dnl |
| 724 | dnl Warning! Use of --enable-gcc-wall may throw off this test. |
| 725 | dnl |
| 726 | dnl |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 727 | AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)],, |
| 728 | [#define _LARGEFILE_SOURCE |
| 729 | #define _LARGEFILE64_SOURCE |
| 730 | #include <unistd.h>]) |
Theodore Ts'o | 6928adc | 2000-05-25 23:28:50 +0000 | [diff] [blame] | 731 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 732 | dnl Word sizes... |
| 733 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 734 | AC_CHECK_SIZEOF(short) |
| 735 | AC_CHECK_SIZEOF(int) |
| 736 | AC_CHECK_SIZEOF(long) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 737 | AC_CHECK_SIZEOF(long long) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 738 | SIZEOF_SHORT=$ac_cv_sizeof_short |
| 739 | SIZEOF_INT=$ac_cv_sizeof_int |
| 740 | SIZEOF_LONG=$ac_cv_sizeof_long |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 741 | SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 742 | AC_SUBST(SIZEOF_SHORT) |
| 743 | AC_SUBST(SIZEOF_INT) |
| 744 | AC_SUBST(SIZEOF_LONG) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 745 | AC_SUBST(SIZEOF_LONG_LONG) |
Theodore Ts'o | 877eb6d | 2001-06-11 06:54:13 +0000 | [diff] [blame] | 746 | AC_C_BIGENDIAN |
Theodore Ts'o | 29a5dee | 2007-07-04 16:28:47 -0400 | [diff] [blame] | 747 | BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh |
Theodore Ts'o | 4ea7ea0 | 2006-04-09 08:41:55 -0400 | [diff] [blame] | 748 | ASM_TYPES_HEADER=./asm_types.h |
| 749 | AC_SUBST_FILE(ASM_TYPES_HEADER) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 750 | dnl |
Theodore Ts'o | 488c75a | 2008-06-07 08:55:21 -0400 | [diff] [blame] | 751 | dnl Save the configuration #defines needed for the public ext2fs.h |
| 752 | dnl header file |
| 753 | dnl |
| 754 | echo "/* These defines are needed for the public ext2fs.h header file */" \ |
| 755 | > public_config.h |
| 756 | if grep HAVE_SYS_TYPES_H confdefs.h > tmp_config.$$; then |
| 757 | uniq tmp_config.$$ >> public_config.h |
| 758 | else |
| 759 | echo "#undef HAVE_SYS_TYPES_H" >> public_config.h |
| 760 | fi |
| 761 | if grep WORDS_BIGENDIAN confdefs.h > tmp_config.$$; then |
| 762 | uniq tmp_config.$$ >> public_config.h |
| 763 | else |
| 764 | echo "#undef WORDS_BIGENDIAN" >> public_config.h |
| 765 | fi |
| 766 | rm -f tmp_config.$$ |
| 767 | PUBLIC_CONFIG_HEADER=./public_config.h |
| 768 | AC_SUBST_FILE(PUBLIC_CONFIG_HEADER) |
| 769 | dnl |
Theodore Ts'o | 0c193f8 | 2003-08-01 14:26:23 -0400 | [diff] [blame] | 770 | dnl See if we have inttypes.h and if intptr_t is defined |
| 771 | dnl |
| 772 | AC_CHECK_HEADERS([inttypes.h]) |
Theodore Ts'o | d2ee56d | 2005-01-09 00:57:45 -0500 | [diff] [blame] | 773 | AC_CHECK_TYPES(intptr_t) |
Theodore Ts'o | 0c193f8 | 2003-08-01 14:26:23 -0400 | [diff] [blame] | 774 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 775 | dnl See if struct stat has a st_flags field, in which case we can get file |
| 776 | dnl flags somewhat portably. Also check for the analogous setter, chflags(). |
| 777 | dnl |
| 778 | AC_MSG_CHECKING(whether struct stat has a st_flags field) |
| 779 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags, |
| 780 | AC_TRY_COMPILE([#include <sys/stat.h>], |
| 781 | [struct stat stat; stat.st_flags = 0;], |
| 782 | [e2fsprogs_cv_struct_st_flags=yes], |
| 783 | [e2fsprogs_cv_struct_st_flags=no])) |
| 784 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags) |
| 785 | if test "$e2fsprogs_cv_struct_st_flags" = yes; then |
Theodore Ts'o | c03bc4e | 1999-10-20 18:20:36 +0000 | [diff] [blame] | 786 | AC_MSG_CHECKING(whether st_flags field is useful) |
| 787 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut, |
| 788 | AC_TRY_COMPILE([#include <sys/stat.h>], |
| 789 | [struct stat stat; stat.st_flags |= UF_IMMUTABLE;], |
| 790 | [e2fsprogs_cv_struct_st_flags_immut=yes], |
| 791 | [e2fsprogs_cv_struct_st_flags_immut=no])) |
| 792 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut) |
| 793 | if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then |
| 794 | AC_DEFINE(HAVE_STAT_FLAGS) |
| 795 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 796 | fi |
Theodore Ts'o | 84ea6e7 | 2004-03-19 19:29:17 -0500 | [diff] [blame] | 797 | dnl |
| 798 | dnl Check for the presence of SA_LEN |
| 799 | dnl |
Theodore Ts'o | 6c65d25 | 2005-01-19 12:59:48 -0500 | [diff] [blame] | 800 | AC_CHECK_MEMBER(struct sockaddr.sa_len, |
| 801 | AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),, |
| 802 | [#include <sys/types.h> |
| 803 | #include <sys/socket.h>]) |
Theodore Ts'o | 84ea6e7 | 2004-03-19 19:29:17 -0500 | [diff] [blame] | 804 | dnl |
Eric Sandeen | 9ed8e5f | 2009-10-02 11:32:42 -0500 | [diff] [blame^] | 805 | dnl This will add -lblkid to the AC_CHECK_FUNCS search if we are using |
| 806 | dnl the system-provided blkid library |
| 807 | dnl |
| 808 | if test -n "$BLKID_CMT"; then |
| 809 | AC_SEARCH_LIBS([blkid_probe_all], [blkid]) |
| 810 | fi |
| 811 | dnl |
| 812 | AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid usleep nanosleep getdtablesize getrlimit blkid_probe_get_topology2) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 813 | dnl |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 814 | dnl Check to see if -lsocket is required (solaris) to make something |
| 815 | dnl that uses socket() to compile; this is needed for the UUID library |
| 816 | dnl |
| 817 | SOCKET_LIB='' |
| 818 | AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket]) |
| 819 | AC_SUBST(SOCKET_LIB) |
| 820 | dnl |
Theodore Ts'o | 3ae497e | 2003-03-16 06:26:25 -0500 | [diff] [blame] | 821 | dnl Check to see if libdl exists for the sake of dlopen |
| 822 | dnl |
| 823 | DLOPEN_LIB='' |
| 824 | AC_CHECK_LIB(dl, dlopen, |
| 825 | [DLOPEN_LIB=-ldl |
| 826 | AC_DEFINE(HAVE_DLOPEN)]) |
| 827 | AC_SUBST(DLOPEN_LIB) |
| 828 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 829 | dnl See if optreset exists |
| 830 | dnl |
| 831 | AC_MSG_CHECKING(for optreset) |
| 832 | AC_CACHE_VAL(ac_cv_have_optreset, |
| 833 | [AC_EGREP_HEADER(optreset, unistd.h, |
| 834 | ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl |
| 835 | AC_MSG_RESULT($ac_cv_have_optreset) |
| 836 | if test $ac_cv_have_optreset = yes; then |
| 837 | AC_DEFINE(HAVE_OPTRESET) |
| 838 | fi |
| 839 | dnl |
Theodore Ts'o | d7f45af | 2008-09-12 10:15:26 -0400 | [diff] [blame] | 840 | dnl Test for sem_init, and which library it might require: |
| 841 | dnl |
| 842 | SEM_INIT_LIB='' |
| 843 | AC_CHECK_FUNC(sem_init, , |
| 844 | AC_CHECK_LIB(pthread, sem_init, |
| 845 | AC_DEFINE(HAVE_SEM_INIT) |
| 846 | SEM_INIT_LIB=-lpthread, |
| 847 | AC_CHECK_LIB(rt, sem_init, |
| 848 | AC_DEFINE(HAVE_SEM_INIT) |
| 849 | SEM_INIT_LIB=-lrt, |
| 850 | AC_CHECK_LIB(posix4, sem_init, |
| 851 | AC_DEFINE(HAVE_SEM_INIT) |
| 852 | SEM_INIT_LIB=-lposix4))))dnl |
| 853 | AC_SUBST(SEM_INIT_LIB) |
| 854 | dnl |
Theodore Ts'o | e54635d | 2006-08-06 14:33:13 -0400 | [diff] [blame] | 855 | dnl Check for unified diff |
| 856 | dnl |
| 857 | AC_MSG_CHECKING(for unified diff option) |
Theodore Ts'o | 27f991b | 2008-04-01 20:32:55 -0400 | [diff] [blame] | 858 | if diff -u $0 $0 > /dev/null 2>&1 ; then |
Theodore Ts'o | e54635d | 2006-08-06 14:33:13 -0400 | [diff] [blame] | 859 | UNI_DIFF_OPTS=-u |
| 860 | else |
| 861 | UNI_DIFF_OPTS=-c |
| 862 | fi |
| 863 | AC_MSG_RESULT($UNI_DIFF_OPTS) |
| 864 | AC_SUBST(UNI_DIFF_OPTS) |
| 865 | dnl |
Theodore Ts'o | 8f3f29d | 2000-02-11 05:04:44 +0000 | [diff] [blame] | 866 | dnl We use the EXT2 ioctls only under Linux |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 867 | dnl |
Theodore Ts'o | 8f3f29d | 2000-02-11 05:04:44 +0000 | [diff] [blame] | 868 | case "$host_os" in |
| 869 | linux*) |
| 870 | AC_DEFINE(HAVE_EXT2_IOCTLS) |
| 871 | ;; |
| 872 | esac |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 873 | dnl |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 874 | dnl OS-specific uncomment control |
Theodore Ts'o | e6f2bda | 2002-08-18 03:37:10 -0400 | [diff] [blame] | 875 | dnl |
| 876 | LINUX_CMT="#" |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 877 | CYGWIN_CMT="#" |
| 878 | UNIX_CMT= |
Theodore Ts'o | e6f2bda | 2002-08-18 03:37:10 -0400 | [diff] [blame] | 879 | case "$host_os" in |
| 880 | linux*) |
| 881 | LINUX_CMT= |
| 882 | ;; |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 883 | cygwin) |
| 884 | CYGWIN_CMT= |
| 885 | UNIX_CMT="#" |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 886 | ;; |
Theodore Ts'o | e6f2bda | 2002-08-18 03:37:10 -0400 | [diff] [blame] | 887 | esac |
| 888 | AC_SUBST(LINUX_CMT) |
Theodore Ts'o | fff4548 | 2003-04-13 00:44:19 -0400 | [diff] [blame] | 889 | AC_SUBST(CYGWIN_CMT) |
| 890 | AC_SUBST(UNIX_CMT) |
Theodore Ts'o | e6f2bda | 2002-08-18 03:37:10 -0400 | [diff] [blame] | 891 | dnl |
Theodore Ts'o | 6c13352 | 1999-07-03 20:37:03 +0000 | [diff] [blame] | 892 | dnl Linux and Hurd places root files in the / by default |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 893 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 894 | case "$host_os" in |
Theodore Ts'o | 93636bd | 2003-07-12 02:45:05 -0400 | [diff] [blame] | 895 | linux* | gnu* | k*bsd*-gnu) |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 896 | if test "$prefix" = NONE -a "$root_prefix" = NONE ; then |
| 897 | root_prefix=""; |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 898 | AC_MSG_RESULT([On $host_os systems, root_prefix defaults to '']) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 899 | fi |
| 900 | ;; |
| 901 | esac |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 902 | dnl |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 903 | dnl On Linux/hurd, force the prefix to be /usr |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 904 | dnl |
| 905 | case "$host_os" in |
Theodore Ts'o | 93636bd | 2003-07-12 02:45:05 -0400 | [diff] [blame] | 906 | linux* | gnu* | k*bsd*-gnu) |
Theodore Ts'o | fc6d9d5 | 1997-04-29 14:51:31 +0000 | [diff] [blame] | 907 | if test "$prefix" = NONE ; then |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 908 | prefix="/usr"; |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 909 | AC_MSG_RESULT([On $host_os systems, prefix defaults to /usr]) |
Theodore Ts'o | bff61a7 | 2002-05-21 22:21:38 -0400 | [diff] [blame] | 910 | if test "$mandir" = '${prefix}/man' ; then |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 911 | AC_MSG_RESULT([...and mandir defaults to /usr/share/man]) |
Theodore Ts'o | bff61a7 | 2002-05-21 22:21:38 -0400 | [diff] [blame] | 912 | mandir=/usr/share/man |
| 913 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 914 | fi |
| 915 | ;; |
| 916 | esac |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 917 | if test "$root_prefix" = NONE ; then |
Theodore Ts'o | ffe1991 | 1998-04-08 06:05:49 +0000 | [diff] [blame] | 918 | if test "$prefix" = NONE ; then |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 919 | root_prefix="$ac_default_prefix" |
| 920 | else |
| 921 | root_prefix="$prefix" |
| 922 | fi |
Theodore Ts'o | b5ffead | 2002-05-11 19:17:00 -0400 | [diff] [blame] | 923 | root_bindir=$bindir |
| 924 | root_sbindir=$sbindir |
| 925 | root_libdir=$libdir |
| 926 | root_sysconfdir=$sysconfdir |
| 927 | else |
| 928 | root_bindir='${root_prefix}/bin' |
| 929 | root_sbindir='${root_prefix}/sbin' |
| 930 | root_libdir='${root_prefix}/lib' |
| 931 | root_sysconfdir='${root_prefix}/etc' |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 932 | fi |
Theodore Ts'o | c4ef11c | 2008-01-04 16:55:37 -0500 | [diff] [blame] | 933 | if test "$bindir" != '${exec_prefix}/bin'; then |
| 934 | root_bindir=$bindir |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 935 | AC_MSG_RESULT([Setting root_bindir to $root_bindir]) |
Theodore Ts'o | c4ef11c | 2008-01-04 16:55:37 -0500 | [diff] [blame] | 936 | fi |
| 937 | if test "$sbindir" != '${exec_prefix}/sbin'; then |
| 938 | root_sbindir=$sbindir |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 939 | AC_MSG_RESULT([Setting root_sbindir to $root_sbindir]) |
Theodore Ts'o | c4ef11c | 2008-01-04 16:55:37 -0500 | [diff] [blame] | 940 | fi |
| 941 | if test "$libdir" != '${exec_prefix}/lib'; then |
| 942 | root_libdir=$libdir |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 943 | AC_MSG_RESULT([Setting root_libdir to $root_libdir]) |
Theodore Ts'o | c4ef11c | 2008-01-04 16:55:37 -0500 | [diff] [blame] | 944 | fi |
| 945 | if test "$sysconfdir" != '${prefix}/etc'; then |
| 946 | root_sysconfdir=$sysconfdir |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 947 | AC_MSG_RESULT([Setting root_sysconfdir to $root_sysconfdir]) |
Theodore Ts'o | c4ef11c | 2008-01-04 16:55:37 -0500 | [diff] [blame] | 948 | fi |
Theodore Ts'o | a4b2d3c | 1998-04-03 16:12:25 +0000 | [diff] [blame] | 949 | AC_SUBST(root_prefix) |
Theodore Ts'o | b5ffead | 2002-05-11 19:17:00 -0400 | [diff] [blame] | 950 | AC_SUBST(root_bindir) |
| 951 | AC_SUBST(root_sbindir) |
| 952 | AC_SUBST(root_libdir) |
| 953 | AC_SUBST(root_sysconfdir) |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 954 | dnl |
| 955 | dnl See if -static works. |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 956 | dnl |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 957 | AC_MSG_CHECKING([whether linker accepts -static]) |
| 958 | AC_CACHE_VAL(ac_cv_e2fsprogs_use_static, |
| 959 | [SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static" |
| 960 | AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);], |
| 961 | ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no) |
| 962 | LDFLAGS=$SAVE_LDFLAGS]) |
Theodore Ts'o | defde78 | 1999-01-04 07:39:19 +0000 | [diff] [blame] | 963 | dnl |
| 964 | dnl Regardless of how the test turns out, Solaris doesn't handle -static |
| 965 | dnl This is caused by the socket library requiring the nsl library, which |
| 966 | dnl requires the -dl library, which only works for dynamically linked |
| 967 | dnl programs. It basically means you can't have statically linked programs |
| 968 | dnl which use the network under Solaris. |
| 969 | dnl |
| 970 | case "$host_os" in |
| 971 | solaris2.*) |
| 972 | ac_cv_e2fsprogs_use_static=no |
| 973 | ;; |
| 974 | esac |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 975 | AC_MSG_RESULT($ac_cv_e2fsprogs_use_static) |
Theodore Ts'o | 74becf3 | 1997-04-26 14:37:06 +0000 | [diff] [blame] | 976 | LDFLAG_STATIC= |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 977 | if test $ac_cv_e2fsprogs_use_static = yes; then |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 978 | LDFLAG_STATIC=-static |
Theodore Ts'o | ae85148 | 1997-04-29 18:13:24 +0000 | [diff] [blame] | 979 | fi |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 980 | AC_SUBST(LDFLAG_STATIC) |
| 981 | dnl |
Theodore Ts'o | 07a0db1 | 2003-07-05 14:50:24 -0400 | [diff] [blame] | 982 | dnl Work around mysterious Darwin / GNU libintl problem |
| 983 | dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like |
| 984 | dnl Apple hacked gcc somehow?) |
| 985 | dnl |
| 986 | case "$host_os" in |
| 987 | darwin*) |
Theodore Ts'o | 02d04db | 2008-08-22 10:52:42 -0400 | [diff] [blame] | 988 | AC_MSG_RESULT([Using Apple Darwin / GNU libintl workaround]) |
Theodore Ts'o | 07a0db1 | 2003-07-05 14:50:24 -0400 | [diff] [blame] | 989 | AC_DEFINE(_INTL_REDIRECT_MACROS) |
| 990 | ;; |
| 991 | esac |
| 992 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 993 | dnl Make the ss and et directories work correctly. |
| 994 | dnl |
| 995 | SS_DIR=`cd ${srcdir}/lib/ss; pwd` |
| 996 | ET_DIR=`cd ${srcdir}/lib/et; pwd` |
| 997 | AC_SUBST(SS_DIR) |
| 998 | AC_SUBST(ET_DIR) |
| 999 | dnl |
| 1000 | dnl Only try to run the test suite if we're not cross compiling. |
| 1001 | dnl |
| 1002 | if test "$cross_compiling" = yes ; then |
| 1003 | DO_TEST_SUITE= |
| 1004 | else |
| 1005 | DO_TEST_SUITE=check |
| 1006 | fi |
| 1007 | AC_SUBST(DO_TEST_SUITE) |
| 1008 | dnl |
Theodore Ts'o | c6f35b8 | 2003-05-17 16:29:27 -0400 | [diff] [blame] | 1009 | dnl Only include the intl include files if we're building with them |
| 1010 | dnl |
| 1011 | INTL_FLAGS= |
| 1012 | if test "$USE_INCLUDED_LIBINTL" = "yes" ; then |
| 1013 | INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl' |
| 1014 | fi |
| 1015 | AC_SUBST(INTL_FLAGS) |
| 1016 | dnl |
Theodore Ts'o | dd947da | 2005-11-09 18:37:07 -0400 | [diff] [blame] | 1017 | dnl Build CFLAGS |
| 1018 | dnl |
| 1019 | if test $cross_compiling = no; then |
| 1020 | BUILD_CFLAGS="$CFLAGS" |
| 1021 | BUILD_LDFLAGS="$LDFLAGS" |
| 1022 | else |
| 1023 | BUILD_CFLAGS= |
| 1024 | BUILD_LDFLAGS= |
| 1025 | fi |
| 1026 | AC_SUBST(BUILD_CFLAGS) |
| 1027 | AC_SUBST(BUILD_LDFLAGS) |
| 1028 | dnl |
Theodore Ts'o | 50e1e10 | 1997-04-26 13:58:21 +0000 | [diff] [blame] | 1029 | dnl Make our output files, being sure that we create the some miscellaneous |
| 1030 | dnl directories |
| 1031 | dnl |
| 1032 | test -d lib || mkdir lib |
| 1033 | test -d include || mkdir include |
| 1034 | test -d include/linux || mkdir include/linux |
Theodore Ts'o | defde78 | 1999-01-04 07:39:19 +0000 | [diff] [blame] | 1035 | test -d include/asm || mkdir include/asm |
Theodore Ts'o | bff0cc9 | 2003-03-23 01:37:53 -0500 | [diff] [blame] | 1036 | for i in MCONFIG Makefile e2fsprogs.spec \ |
| 1037 | util/Makefile util/subst.conf util/gen-tarball \ |
Theodore Ts'o | 4ea7ea0 | 2006-04-09 08:41:55 -0400 | [diff] [blame] | 1038 | lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \ |
| 1039 | lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \ |
Theodore Ts'o | 94ba8c7 | 2003-03-02 02:07:14 -0500 | [diff] [blame] | 1040 | lib/uuid/Makefile lib/uuid/uuid_types.h \ |
| 1041 | lib/blkid/Makefile lib/blkid/blkid_types.h \ |
Theodore Ts'o | e644186 | 2005-01-26 12:59:25 -0500 | [diff] [blame] | 1042 | lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \ |
| 1043 | lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \ |
Theodore Ts'o | 921f4ad | 2004-11-19 17:25:27 -0500 | [diff] [blame] | 1044 | misc/Makefile ext2ed/Makefile e2fsck/Makefile \ |
Theodore Ts'o | 94ba8c7 | 2003-03-02 02:07:14 -0500 | [diff] [blame] | 1045 | debugfs/Makefile tests/Makefile tests/progs/Makefile \ |
Matthias Andree | 98a5ad6 | 2009-07-15 17:37:52 +0200 | [diff] [blame] | 1046 | resize/Makefile doc/Makefile intl/Makefile \ |
| 1047 | intl/libgnuintl.h po/Makefile.in ; do |
Theodore Ts'o | 94ba8c7 | 2003-03-02 02:07:14 -0500 | [diff] [blame] | 1048 | if test -d `dirname ${srcdir}/$i` ; then |
| 1049 | outlist="$outlist $i" |
| 1050 | fi |
| 1051 | done |
| 1052 | AC_OUTPUT($outlist) |
Theodore Ts'o | ee683a1 | 2005-02-05 15:53:56 -0500 | [diff] [blame] | 1053 | if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi |