]>
Commit | Line | Data |
---|---|---|
50e1e10f | 1 | AC_INIT(version.h) |
a4b2d3ce | 2 | AC_PREREQ(2.12) |
50e1e10f TT |
3 | MCONFIG=./MCONFIG |
4 | AC_SUBST_FILE(MCONFIG) | |
74becf3c TT |
5 | BINARY_TYPE=bin |
6 | dnl | |
7 | dnl This is to figure out the version number and the date.... | |
8 | dnl | |
9 | E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \ | |
10 | | awk '{print $3}' | tr \" " " | awk '{print $1}'` | |
11 | DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \ | |
12 | | tr \" " "` | |
13 | MONTH=`echo $DATE | awk -F- '{print $2}'` | |
14 | YEAR=`echo $DATE | awk -F- '{print $3}'` | |
15 | ||
40fa8cc9 TT |
16 | if expr $YEAR ">" 1900 > /dev/null ; then |
17 | E2FSPROGS_YEAR=$YEAR | |
18 | elif expr $YEAR ">" 90 >/dev/null ; then | |
74becf3c TT |
19 | E2FSPROGS_YEAR=19$YEAR |
20 | else | |
21 | E2FSPROGS_YEAR=20$YEAR | |
22 | fi | |
23 | ||
24 | case $MONTH in | |
25 | Jan) E2FSPROGS_MONTH="January" ;; | |
26 | Feb) E2FSPROGS_MONTH="February" ;; | |
27 | Mar) E2FSPROGS_MONTH="March" ;; | |
28 | Apr) E2FSPROGS_MONTH="April" ;; | |
29 | May) E2FSPROGS_MONTH="May" ;; | |
30 | Jun) E2FSPROGS_MONTH="June" ;; | |
31 | Jul) E2FSPROGS_MONTH="July" ;; | |
32 | Aug) E2FSPROGS_MONTH="August" ;; | |
33 | Sep) E2FSPROGS_MONTH="September" ;; | |
34 | Oct) E2FSPROGS_MONTH="October" ;; | |
35 | Nov) E2FSPROGS_MONTH="November" ;; | |
36 | Dec) E2FSPROGS_MONTH="December" ;; | |
37 | *) echo "Unknown month $MONTH??" ;; | |
38 | esac | |
39 | ||
40 | unset DATE MONTH YEAR | |
41 | echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION" | |
42 | echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}" | |
43 | AC_SUBST(E2FSPROGS_YEAR) | |
44 | AC_SUBST(E2FSPROGS_MONTH) | |
45 | AC_SUBST(E2FSPROGS_VERSION) | |
fc6d9d51 | 46 | AC_REQUIRE([AC_CANONICAL_HOST]) |
74becf3c TT |
47 | dnl |
48 | dnl set $(CC) from --with-cc=value | |
49 | dnl | |
50 | AC_ARG_WITH([cc], | |
51 | [ --with-cc=COMPILER select compiler to use], | |
52 | AC_MSG_RESULT(CC=$withval) | |
53 | CC=$withval, | |
54 | if test -z "$CC" ; then CC=cc; fi | |
55 | [AC_MSG_RESULT(CC defaults to $CC)])dnl | |
56 | export CC | |
57 | AC_SUBST([CC]) | |
73ae2d4a | 58 | AC_PROG_CC |
74becf3c TT |
59 | dnl |
60 | dnl set $(LD) from --with-linker=value | |
61 | dnl | |
62 | AC_ARG_WITH([linker], | |
63 | [ --with-linker=LINKER select linker to use], | |
64 | AC_MSG_RESULT(LD=$withval) | |
65 | LD=$withval, | |
66 | if test -z "$LD" ; then LD=$CC; fi | |
67 | [AC_MSG_RESULT(LD defaults to $LD)])dnl | |
68 | export LD | |
69 | AC_SUBST([LD]) | |
70 | dnl | |
71 | dnl set $(CCOPTS) from --with-ccopts=value | |
72 | dnl | |
73 | AC_ARG_WITH([ccopts], | |
74 | [ --with-ccopts=CCOPTS select compiler command line options], | |
75 | AC_MSG_RESULT(CCOPTS is $withval) | |
877eb6d9 TT |
76 | CFLAGS=$withval, |
77 | )dnl | |
74becf3c | 78 | dnl |
f8bd9807 TT |
79 | dnl On systems without linux header files, we add an extra include directory |
80 | dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here | |
81 | dnl is quoted so that it gets expanded by make, not by configure. | |
82 | dnl | |
83 | AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no]) | |
73ae2d4a TT |
84 | if test "$linux_headers" != yes; then |
85 | LINUX_INCLUDE='-I$(top_builddir)/include' | |
f8bd9807 TT |
86 | fi |
87 | AC_SUBST(LINUX_INCLUDE) | |
88 | dnl | |
a4d09610 TT |
89 | dnl Set default values for library extentions. Will be dealt with after |
90 | dnl parsing configuration opions, which may modify these | |
91 | dnl | |
92 | LIB_EXT=.a | |
93 | STATIC_LIB_EXT=.a | |
94 | PROFILE_LIB_EXT=.a | |
95 | dnl | |
74becf3c TT |
96 | dnl set $(LDFLAGS) from --with-ldopts=value |
97 | dnl | |
98 | AC_ARG_WITH([ldopts], | |
99 | [ --with-ldopts=LDOPTS select linker command line options], | |
100 | AC_MSG_RESULT(LDFLAGS is $withval) | |
101 | LDFLAGS=$withval, | |
102 | LDFLAGS=)dnl | |
103 | AC_SUBST(LDFLAGS) | |
50e1e10f | 104 | dnl |
a4b2d3ce | 105 | dnl Allow separate `root_prefix' to be specified |
fc6d9d51 | 106 | dnl |
a4b2d3ce TT |
107 | AC_ARG_WITH([root-prefix], |
108 | [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root], | |
109 | root_prefix=$withval, | |
110 | root_prefix=NONE)dnl | |
fc6d9d51 | 111 | dnl |
1917875f TT |
112 | dnl handle --enable-compression |
113 | dnl | |
114 | AC_ARG_ENABLE([compression], | |
115 | [ --enable-compression enable EXPERIMENTAL compression support], | |
116 | if test "$enableval" = "no" | |
117 | then | |
118 | echo "Disabling compression support" | |
119 | else | |
120 | AC_DEFINE(ENABLE_COMPRESSION) | |
121 | echo "Enabling compression support" | |
122 | echo "WARNING: Compression support is experimental" | |
123 | fi | |
124 | , | |
125 | echo "Disabling compression support by default" | |
126 | ) | |
127 | dnl | |
50e1e10f TT |
128 | dnl handle --enable-dll-shlibs |
129 | dnl | |
130 | AC_ARG_ENABLE([dll-shlibs], | |
a4d09610 | 131 | [ --enable-dll-shlibs select DLL libraries], |
50e1e10f TT |
132 | if test "$enableval" = "no" |
133 | then | |
134 | DLL_CMT=# | |
135 | MAKEFILE_DLL=/dev/null | |
136 | echo "Disabling DLL shared libraries" | |
137 | else | |
138 | DLL_CMT= | |
139 | MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib | |
74becf3c | 140 | BINARY_TYPE=dllbin |
a4d09610 | 141 | LIB_EXT=.sa |
50e1e10f TT |
142 | echo "Enabling DLL shared libraries" |
143 | fi | |
144 | , | |
145 | MAKEFILE_DLL=/dev/null | |
146 | DLL_CMT=# | |
147 | echo "Disabling DLL shared libraries by default" | |
148 | ) | |
149 | AC_SUBST(DLL_CMT) | |
150 | AC_SUBST_FILE(MAKEFILE_DLL) | |
151 | dnl | |
152 | dnl handle --enable-elf-shlibs | |
153 | dnl | |
154 | AC_ARG_ENABLE([elf-shlibs], | |
a4d09610 | 155 | [ --enable-elf-shlibs select ELF shared libraries], |
50e1e10f TT |
156 | if test "$enableval" = "no" |
157 | then | |
158 | ELF_CMT=# | |
159 | MAKEFILE_ELF=/dev/null | |
160 | echo "Disabling ELF shared libraries" | |
161 | else | |
162 | ELF_CMT= | |
163 | MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib | |
f5955dda TT |
164 | [case "$host_os" in |
165 | solaris2.*) | |
166 | MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib | |
167 | ;; | |
168 | esac] | |
74becf3c | 169 | BINARY_TYPE=elfbin |
a4d09610 | 170 | LIB_EXT=.so |
50e1e10f TT |
171 | echo "Enabling ELF shared libraries" |
172 | fi | |
173 | , | |
174 | MAKEFILE_ELF=/dev/null | |
175 | ELF_CMT=# | |
176 | echo "Disabling ELF shared libraries by default" | |
177 | ) | |
178 | AC_SUBST(ELF_CMT) | |
179 | AC_SUBST_FILE(MAKEFILE_ELF) | |
180 | dnl | |
181 | dnl handle --enable-bsd-shlibs | |
182 | dnl | |
183 | AC_ARG_ENABLE([bsd-shlibs], | |
a4d09610 | 184 | [ --enable-bsd-shlibs select BSD shared libraries], |
50e1e10f TT |
185 | if test "$enableval" = "no" |
186 | then | |
187 | BSDLIB_CMT=# | |
188 | MAKEFILE_BSDLIB=/dev/null | |
189 | echo "Disabling BSD shared libraries" | |
190 | else | |
191 | BSDLIB_CMT= | |
192 | MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib | |
a4d09610 | 193 | LIB_EXT=.so |
50e1e10f TT |
194 | echo "Enabling BSD shared libraries" |
195 | fi | |
196 | , | |
197 | MAKEFILE_BSDLIB=/dev/null | |
198 | BSDLIB_CMT=# | |
199 | echo "Disabling BSD shared libraries by default" | |
200 | ) | |
201 | AC_SUBST(BSDLIB_CMT) | |
202 | AC_SUBST_FILE(MAKEFILE_BSDLIB) | |
203 | dnl | |
80bfaa3e TT |
204 | dnl handle --enable-jfs-debug |
205 | dnl | |
206 | AC_ARG_ENABLE([jfs-debug], | |
207 | [ --enable-jfs-debug enable journal debugging], | |
208 | if test "$enableval" = "no" | |
209 | then | |
210 | echo "Disabling journal debugging" | |
211 | else | |
212 | AC_DEFINE(JFS_DEBUG) | |
213 | echo "Enabling journal debugging" | |
214 | fi | |
215 | , | |
216 | echo "Disabling journal debugging by default" | |
217 | ) | |
218 | dnl | |
877eb6d9 TT |
219 | dnl handle --enable-swapfs |
220 | dnl | |
221 | AC_ARG_ENABLE([swapfs], | |
222 | [ --disable-swapfs disable support of legacy byte-swapped filesystems], | |
223 | if test "$enableval" = "no" | |
224 | then | |
225 | echo "Disabling swapfs support" | |
226 | SWAPFS_CMT="#" | |
227 | else | |
228 | AC_DEFINE(ENABLE_SWAPFS) | |
229 | SWAPFS_CMT= | |
230 | echo "Enabling swapfs support" | |
231 | fi | |
232 | , | |
233 | echo "Enabling swapfs support by default" | |
234 | AC_DEFINE(ENABLE_SWAPFS) | |
235 | SWAPFS_CMT= | |
236 | ) | |
237 | AC_SUBST(SWAPFS_CMT) | |
238 | dnl | |
a64c9c13 TT |
239 | dnl Add internationalization support, using gettext. |
240 | dnl | |
241 | PACKAGE=e2fsprogs | |
242 | VERSION="$E2FSPROGS_VERSION" | |
243 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") | |
244 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION") | |
245 | AC_SUBST(PACKAGE) | |
246 | AC_SUBST(VERSION) | |
247 | ||
1917875f | 248 | ALL_LINGUAS="it nyc" |
a64c9c13 TT |
249 | AM_GNU_GETTEXT |
250 | dnl | |
50e1e10f TT |
251 | dnl handle --enable-profile |
252 | dnl | |
253 | AC_ARG_ENABLE([profile], | |
a4d09610 | 254 | [ --enable-profile build profiling libraries], |
50e1e10f TT |
255 | if test "$enableval" = "no" |
256 | then | |
257 | PROFILE_CMT=# | |
258 | MAKEFILE_PROFILE=/dev/null | |
259 | echo "Disabling profiling libraries" | |
260 | else | |
261 | PROFILE_CMT= | |
262 | MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile | |
a4d09610 | 263 | PROFILED_LIB_EXT=_p.a |
50e1e10f TT |
264 | echo "Building profiling libraries" |
265 | fi | |
266 | , | |
267 | PROFILE_CMT=# | |
268 | MAKEFILE_PROFILE=/dev/null | |
269 | echo "Disabling profiling libraries by default" | |
270 | ) | |
271 | AC_SUBST(PROFILE_CMT) | |
272 | AC_SUBST_FILE(MAKEFILE_PROFILE) | |
273 | dnl | |
274 | dnl handle --enable-checker | |
275 | dnl | |
276 | AC_ARG_ENABLE([checker], | |
a4d09610 | 277 | [ --enable-checker build checker libraries], |
50e1e10f TT |
278 | if test "$enableval" = "no" |
279 | then | |
280 | CHECKER_CMT=# | |
281 | MAKEFILE_CHECKER=/dev/null | |
282 | echo "Disabling checker libraries" | |
283 | else | |
284 | CHECKER_CMT= | |
285 | MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker | |
286 | echo "Building checker libraries" | |
287 | fi | |
288 | , | |
289 | CHECKER_CMT=# | |
290 | MAKEFILE_CHECKER=/dev/null | |
291 | echo "Disabling checker libraries by default" | |
292 | ) | |
293 | AC_SUBST(CHECKER_CMT) | |
294 | AC_SUBST_FILE(MAKEFILE_CHECKER) | |
295 | dnl | |
a4d09610 TT |
296 | dnl Substitute library extensions |
297 | dnl | |
298 | AC_SUBST(LIB_EXT) | |
299 | AC_SUBST(STATIC_LIB_EXT) | |
300 | AC_SUBST(PROFILED_LIB_EXT) | |
301 | dnl | |
4d0f3e17 | 302 | dnl handle --enable-dynamic-e2fsck |
50e1e10f | 303 | dnl |
a4d09610 TT |
304 | AC_ARG_ENABLE([dynamic-e2fsck], |
305 | [ --enable-dynamic-e2fsck build e2fsck dynamically], | |
306 | if test "$enableval" = "no" | |
307 | then | |
308 | E2FSCK_TYPE=static | |
309 | echo "Building e2fsck statically" | |
310 | else | |
311 | E2FSCK_TYPE=shared | |
312 | echo "Building e2fsck dynamically" | |
313 | fi | |
314 | , | |
315 | E2FSCK_TYPE=static | |
316 | echo "Building e2fsck statically by default" | |
317 | ) | |
318 | AC_SUBST(E2FSCK_TYPE) | |
50e1e10f | 319 | dnl |
fc6d9d51 TT |
320 | dnl See whether to install the `fsck' wrapper program (that calls e2fsck) |
321 | dnl | |
322 | AC_ARG_ENABLE([fsck], | |
323 | [ --enable-fsck build fsck wrapper program], | |
324 | [if test "$enableval" = "no" | |
325 | then | |
326 | FSCK_PROG='' FSCK_MAN='' | |
327 | echo "Not building fsck wrapper" | |
328 | else | |
329 | FSCK_PROG=fsck FSCK_MAN=fsck.8 | |
330 | echo "Building fsck wrapper" | |
331 | fi] | |
332 | , | |
333 | [case "$host_os" in | |
334 | gnu*) | |
335 | FSCK_PROG='' FSCK_MAN='' | |
336 | echo "Not building fsck wrapper by default" | |
337 | ;; | |
338 | *) | |
339 | FSCK_PROG=fsck FSCK_MAN=fsck.8 | |
340 | echo "Building fsck wrapper by default" | |
341 | esac] | |
342 | ) | |
343 | AC_SUBST(FSCK_PROG) | |
344 | AC_SUBST(FSCK_MAN) | |
345 | dnl | |
50e1e10f TT |
346 | dnl |
347 | MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library | |
348 | AC_SUBST_FILE(MAKEFILE_LIBRARY) | |
349 | dnl | |
fc6d9d51 TT |
350 | dnl |
351 | AC_ARG_ENABLE([old-bitops], | |
352 | [ --enable-old-bitops Use old (non-standard but native) bitmask operations], | |
353 | if test "$enableval" = "no" | |
354 | then | |
355 | echo "Using new (standard) bitmask operations" | |
356 | else | |
357 | AC_DEFINE(EXT2_OLD_BITOPS) | |
358 | echo "Using old (native) bitmask operations" | |
359 | ||
360 | fi | |
361 | , | |
362 | echo "Using standard bitmask operations by default" | |
363 | ) | |
364 | dnl | |
50e1e10f TT |
365 | dnl End of configuration options |
366 | dnl | |
74becf3c | 367 | AC_SUBST(BINARY_TYPE) |
50e1e10f TT |
368 | AC_PROG_MAKE_SET |
369 | AC_PATH_PROG(LN, ln, ln) | |
fc6d9d51 | 370 | AC_PROG_LN_S |
50e1e10f TT |
371 | AC_PATH_PROG(MV, mv, mv) |
372 | AC_PATH_PROG(CP, cp, cp) | |
373 | AC_PATH_PROG(RM, rm, rm) | |
374 | AC_PATH_PROG(CHMOD, chmod, :) | |
375 | AC_PATH_PROG(AWK, awk, awk) | |
376 | AC_PATH_PROG(SED, sed, sed) | |
9d564f73 | 377 | AC_PATH_PROG(PERL, perl, perl) |
250f79f0 | 378 | AC_PATH_PROG(LDCONFIG, ldconfig, :) |
50e1e10f TT |
379 | AC_CHECK_TOOL(AR, ar, ar) |
380 | AC_CHECK_TOOL(RANLIB, ranlib, :) | |
381 | AC_CHECK_TOOL(STRIP, strip, :) | |
50e1e10f | 382 | AC_PROG_INSTALL |
6c133523 TT |
383 | # See if we need a separate native compiler. |
384 | if test $cross_compiling = no; then | |
385 | BUILD_CC="$CC" | |
386 | AC_SUBST(BUILD_CC) | |
387 | else | |
388 | AC_CHECK_PROGS(BUILD_CC, gcc cc) | |
389 | fi | |
4d0f3e17 | 390 | 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/sysmacros.h sys/time.h sys/stat.h sys/types.h net/if.h netinet/in.h) |
50e1e10f TT |
391 | AC_FUNC_VPRINTF |
392 | dnl | |
393 | dnl See if struct dirent has a d_namlen field (like bsd systems), implying | |
394 | dnl that the actual length of the structure may be grater than the declared | |
395 | dnl length. | |
396 | dnl | |
397 | AC_MSG_CHECKING(whether struct dirent has a d_namlen field) | |
398 | AC_CACHE_VAL(e2fsprogs_cv_struct_d_namlen, | |
399 | AC_TRY_COMPILE( | |
400 | [#include <sys/types.h> | |
401 | #include <dirent.h>], | |
402 | [struct dirent de; de.d_namlen = 0;], | |
403 | [e2fsprogs_cv_struct_d_namlen=yes], | |
404 | [e2fsprogs_cv_struct_d_namlen=no])) | |
405 | AC_MSG_RESULT($e2fsprogs_cv_struct_d_namlen) | |
406 | if test "$e2fsprogs_cv_struct_d_namlen" = yes; then | |
407 | AC_DEFINE(HAVE_DIRENT_NAMLEN) | |
408 | fi | |
409 | dnl | |
b0b9c4de TT |
410 | dnl Check to see if llseek() is declared in unistd.h. On some libc's |
411 | dnl it is, and on others it isn't..... Thank you glibc developers.... | |
412 | dnl | |
413 | dnl Warning! Use of --enable-gcc-wall may throw off this test. | |
414 | dnl | |
415 | dnl | |
416 | AC_MSG_CHECKING(whether llseek declared in unistd.h) | |
417 | AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype, | |
418 | AC_TRY_COMPILE( | |
419 | [#include <unistd.h>], [extern int llseek(int);], | |
420 | [e2fsprogs_cv_have_llseek_prototype=no], | |
421 | [e2fsprogs_cv_have_llseek_prototype=yes])) | |
422 | AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype) | |
423 | if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then | |
424 | AC_DEFINE(HAVE_LLSEEK_PROTOTYPE) | |
425 | fi | |
426 | dnl | |
6928adc9 TT |
427 | dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files |
428 | dnl are so convoluted that I can't tell whether it will always be defined, | |
429 | dnl and if it isn't defined while lseek64 is defined in the library, | |
430 | dnl disaster will strike. | |
431 | dnl | |
432 | dnl Warning! Use of --enable-gcc-wall may throw off this test. | |
433 | dnl | |
434 | dnl | |
435 | AC_MSG_CHECKING(whether lseek64 declared in unistd.h) | |
436 | AC_CACHE_VAL(e2fsprogs_cv_have_lseek64_prototype, | |
437 | AC_TRY_COMPILE( | |
438 | [#define _LARGEFILE_SOURCE | |
439 | #define _LARGEFILE64_SOURCE | |
440 | #include <unistd.h>], [extern int lseek64(int);], | |
441 | [e2fsprogs_cv_have_lseek64_prototype=no], | |
442 | [e2fsprogs_cv_have_lseek64_prototype=yes])) | |
443 | AC_MSG_RESULT($e2fsprogs_cv_have_lseek64_prototype) | |
444 | if test "$e2fsprogs_cv_have_lseek64_prototype" = yes; then | |
445 | AC_DEFINE(HAVE_LSEEK64_PROTOTYPE) | |
446 | fi | |
447 | dnl | |
50e1e10f TT |
448 | dnl Word sizes... |
449 | dnl | |
450 | if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then | |
451 | # if cross-compiling, with no cached values, just assume something common. | |
452 | ac_cv_sizeof_short=2 | |
453 | ac_cv_sizeof_int=4 | |
454 | ac_cv_sizeof_long=4 | |
6c133523 TT |
455 | ac_cv_sizeof_long_long=8 |
456 | AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4, long long=8]) | |
50e1e10f TT |
457 | fi |
458 | AC_CHECK_SIZEOF(short) | |
459 | AC_CHECK_SIZEOF(int) | |
460 | AC_CHECK_SIZEOF(long) | |
fc6d9d51 | 461 | AC_CHECK_SIZEOF(long long) |
50e1e10f TT |
462 | SIZEOF_SHORT=$ac_cv_sizeof_short |
463 | SIZEOF_INT=$ac_cv_sizeof_int | |
464 | SIZEOF_LONG=$ac_cv_sizeof_long | |
fc6d9d51 | 465 | SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long |
50e1e10f TT |
466 | AC_SUBST(SIZEOF_SHORT) |
467 | AC_SUBST(SIZEOF_INT) | |
468 | AC_SUBST(SIZEOF_LONG) | |
fc6d9d51 | 469 | AC_SUBST(SIZEOF_LONG_LONG) |
877eb6d9 | 470 | AC_C_BIGENDIAN |
50e1e10f TT |
471 | dnl |
472 | dnl See if struct stat has a st_flags field, in which case we can get file | |
473 | dnl flags somewhat portably. Also check for the analogous setter, chflags(). | |
474 | dnl | |
475 | AC_MSG_CHECKING(whether struct stat has a st_flags field) | |
476 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags, | |
477 | AC_TRY_COMPILE([#include <sys/stat.h>], | |
478 | [struct stat stat; stat.st_flags = 0;], | |
479 | [e2fsprogs_cv_struct_st_flags=yes], | |
480 | [e2fsprogs_cv_struct_st_flags=no])) | |
481 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags) | |
482 | if test "$e2fsprogs_cv_struct_st_flags" = yes; then | |
c03bc4e8 TT |
483 | AC_MSG_CHECKING(whether st_flags field is useful) |
484 | AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut, | |
485 | AC_TRY_COMPILE([#include <sys/stat.h>], | |
486 | [struct stat stat; stat.st_flags |= UF_IMMUTABLE;], | |
487 | [e2fsprogs_cv_struct_st_flags_immut=yes], | |
488 | [e2fsprogs_cv_struct_st_flags_immut=no])) | |
489 | AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut) | |
490 | if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then | |
491 | AC_DEFINE(HAVE_STAT_FLAGS) | |
492 | fi | |
50e1e10f | 493 | fi |
6928adc9 | 494 | AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 strdup getmntinfo strcasecmp srandom fchown mallinfo fdatasync) |
fc6d9d51 | 495 | dnl |
fc6d9d51 TT |
496 | dnl Check to see if -lsocket is required (solaris) to make something |
497 | dnl that uses socket() to compile; this is needed for the UUID library | |
498 | dnl | |
499 | SOCKET_LIB='' | |
500 | AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket]) | |
501 | AC_SUBST(SOCKET_LIB) | |
502 | dnl | |
50e1e10f TT |
503 | dnl See if optreset exists |
504 | dnl | |
505 | AC_MSG_CHECKING(for optreset) | |
506 | AC_CACHE_VAL(ac_cv_have_optreset, | |
507 | [AC_EGREP_HEADER(optreset, unistd.h, | |
508 | ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl | |
509 | AC_MSG_RESULT($ac_cv_have_optreset) | |
510 | if test $ac_cv_have_optreset = yes; then | |
511 | AC_DEFINE(HAVE_OPTRESET) | |
512 | fi | |
513 | dnl | |
8f3f29d3 TT |
514 | dnl We use the EXT2 ioctls only under Linux |
515 | dnl | |
516 | case "$host_os" in | |
517 | linux*) | |
518 | AC_DEFINE(HAVE_EXT2_IOCTLS) | |
519 | ;; | |
520 | esac | |
50e1e10f | 521 | dnl |
6c133523 | 522 | dnl Linux and Hurd places root files in the / by default |
50e1e10f | 523 | dnl |
50e1e10f | 524 | case "$host_os" in |
6c133523 | 525 | linux* | gnu*) |
a4b2d3ce TT |
526 | if test "$prefix" = NONE -a "$root_prefix" = NONE ; then |
527 | root_prefix=""; | |
528 | echo "On $host_os systems, root_prefix defaults to ''" | |
fc6d9d51 TT |
529 | fi |
530 | ;; | |
531 | esac | |
fc6d9d51 | 532 | dnl |
a4b2d3ce | 533 | dnl On Linux/hurd, force the prefix to be /usr |
fc6d9d51 TT |
534 | dnl |
535 | case "$host_os" in | |
536 | linux* | gnu*) | |
537 | if test "$prefix" = NONE ; then | |
a4b2d3ce TT |
538 | prefix="/usr"; |
539 | echo "On $host_os systems, prefix defaults to /usr" | |
50e1e10f TT |
540 | fi |
541 | ;; | |
542 | esac | |
a4b2d3ce | 543 | if test "$root_prefix" = NONE ; then |
ffe1991f | 544 | if test "$prefix" = NONE ; then |
a4b2d3ce TT |
545 | root_prefix="$ac_default_prefix" |
546 | else | |
547 | root_prefix="$prefix" | |
548 | fi | |
549 | fi | |
550 | AC_SUBST(root_prefix) | |
50e1e10f TT |
551 | dnl |
552 | dnl See if -static works. | |
50e1e10f | 553 | dnl |
ae851482 TT |
554 | AC_MSG_CHECKING([whether linker accepts -static]) |
555 | AC_CACHE_VAL(ac_cv_e2fsprogs_use_static, | |
556 | [SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static" | |
557 | AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);], | |
558 | ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no) | |
559 | LDFLAGS=$SAVE_LDFLAGS]) | |
defde784 TT |
560 | dnl |
561 | dnl Regardless of how the test turns out, Solaris doesn't handle -static | |
562 | dnl This is caused by the socket library requiring the nsl library, which | |
563 | dnl requires the -dl library, which only works for dynamically linked | |
564 | dnl programs. It basically means you can't have statically linked programs | |
565 | dnl which use the network under Solaris. | |
566 | dnl | |
567 | case "$host_os" in | |
568 | solaris2.*) | |
569 | ac_cv_e2fsprogs_use_static=no | |
570 | ;; | |
571 | esac | |
ae851482 | 572 | AC_MSG_RESULT($ac_cv_e2fsprogs_use_static) |
74becf3c | 573 | LDFLAG_STATIC= |
ae851482 | 574 | if test $ac_cv_e2fsprogs_use_static = yes; then |
50e1e10f | 575 | LDFLAG_STATIC=-static |
ae851482 | 576 | fi |
50e1e10f TT |
577 | AC_SUBST(LDFLAG_STATIC) |
578 | dnl | |
50e1e10f TT |
579 | dnl Make the ss and et directories work correctly. |
580 | dnl | |
581 | SS_DIR=`cd ${srcdir}/lib/ss; pwd` | |
582 | ET_DIR=`cd ${srcdir}/lib/et; pwd` | |
583 | AC_SUBST(SS_DIR) | |
584 | AC_SUBST(ET_DIR) | |
585 | dnl | |
586 | dnl Only try to run the test suite if we're not cross compiling. | |
587 | dnl | |
588 | if test "$cross_compiling" = yes ; then | |
589 | DO_TEST_SUITE= | |
590 | else | |
591 | DO_TEST_SUITE=check | |
592 | fi | |
593 | AC_SUBST(DO_TEST_SUITE) | |
594 | dnl | |
595 | dnl Make our output files, being sure that we create the some miscellaneous | |
596 | dnl directories | |
597 | dnl | |
598 | test -d lib || mkdir lib | |
599 | test -d include || mkdir include | |
600 | test -d include/linux || mkdir include/linux | |
defde784 | 601 | test -d include/asm || mkdir include/asm |
24b2c7a7 TT |
602 | rmakefile= |
603 | if test -d ${srcdir}/resize ; then | |
604 | rmakefile=resize/Makefile | |
605 | fi | |
44339bdf | 606 | AC_OUTPUT(MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile |
fc6d9d51 TT |
607 | lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile |
608 | misc/Makefile e2fsck/Makefile debugfs/Makefile tests/Makefile | |
a64c9c13 TT |
609 | tests/progs/Makefile $rmakefile doc/Makefile |
610 | intl/Makefile po/Makefile.in) |