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