blob: a9ad429f13b35f286fe2b38669e2abcd1d507bb9 [file] [log] [blame]
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001AC_INIT(version.h)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +00002AC_PREREQ(2.12)
Theodore Ts'o50e1e101997-04-26 13:58:21 +00003MCONFIG=./MCONFIG
4AC_SUBST_FILE(MCONFIG)
Theodore Ts'o74becf31997-04-26 14:37:06 +00005BINARY_TYPE=bin
6dnl
7dnl This is to figure out the version number and the date....
8dnl
9E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \
10 | awk '{print $3}' | tr \" " " | awk '{print $1}'`
11DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
12 | tr \" " "`
13MONTH=`echo $DATE | awk -F- '{print $2}'`
14YEAR=`echo $DATE | awk -F- '{print $3}'`
15
Theodore Ts'o40fa8cc1999-01-09 05:06:02 +000016if expr $YEAR ">" 1900 > /dev/null ; then
17 E2FSPROGS_YEAR=$YEAR
18elif expr $YEAR ">" 90 >/dev/null ; then
Theodore Ts'o74becf31997-04-26 14:37:06 +000019 E2FSPROGS_YEAR=19$YEAR
20else
21 E2FSPROGS_YEAR=20$YEAR
22fi
23
24case $MONTH in
25Jan) E2FSPROGS_MONTH="January" ;;
26Feb) E2FSPROGS_MONTH="February" ;;
27Mar) E2FSPROGS_MONTH="March" ;;
28Apr) E2FSPROGS_MONTH="April" ;;
29May) E2FSPROGS_MONTH="May" ;;
30Jun) E2FSPROGS_MONTH="June" ;;
31Jul) E2FSPROGS_MONTH="July" ;;
32Aug) E2FSPROGS_MONTH="August" ;;
33Sep) E2FSPROGS_MONTH="September" ;;
34Oct) E2FSPROGS_MONTH="October" ;;
35Nov) E2FSPROGS_MONTH="November" ;;
36Dec) E2FSPROGS_MONTH="December" ;;
37*) echo "Unknown month $MONTH??" ;;
38esac
39
40unset DATE MONTH YEAR
41echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
42echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
43AC_SUBST(E2FSPROGS_YEAR)
44AC_SUBST(E2FSPROGS_MONTH)
45AC_SUBST(E2FSPROGS_VERSION)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +000046AC_REQUIRE([AC_CANONICAL_HOST])
Theodore Ts'o74becf31997-04-26 14:37:06 +000047dnl
48dnl set $(CC) from --with-cc=value
49dnl
50AC_ARG_WITH([cc],
51[ --with-cc=COMPILER select compiler to use],
52AC_MSG_RESULT(CC=$withval)
53CC=$withval,
54if test -z "$CC" ; then CC=cc; fi
55[AC_MSG_RESULT(CC defaults to $CC)])dnl
56export CC
57AC_SUBST([CC])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000058AC_PROG_CC
Theodore Ts'o74becf31997-04-26 14:37:06 +000059dnl
60dnl set $(LD) from --with-linker=value
61dnl
62AC_ARG_WITH([linker],
63[ --with-linker=LINKER select linker to use],
64AC_MSG_RESULT(LD=$withval)
65LD=$withval,
66if test -z "$LD" ; then LD=$CC; fi
67[AC_MSG_RESULT(LD defaults to $LD)])dnl
68export LD
69AC_SUBST([LD])
70dnl
71dnl set $(CCOPTS) from --with-ccopts=value
72dnl
73AC_ARG_WITH([ccopts],
74[ --with-ccopts=CCOPTS select compiler command line options],
75AC_MSG_RESULT(CCOPTS is $withval)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +000076CFLAGS=$withval,
77)dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000078dnl
Theodore Ts'of8bd9801999-10-26 04:19:45 +000079dnl On systems without linux header files, we add an extra include directory
80dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
81dnl is quoted so that it gets expanded by make, not by configure.
82dnl
83AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000084if test "$linux_headers" != yes; then
85 LINUX_INCLUDE='-I$(top_builddir)/include'
Theodore Ts'of8bd9801999-10-26 04:19:45 +000086fi
87AC_SUBST(LINUX_INCLUDE)
88dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +000089dnl Set default values for library extentions. Will be dealt with after
90dnl parsing configuration opions, which may modify these
91dnl
92LIB_EXT=.a
93STATIC_LIB_EXT=.a
94PROFILE_LIB_EXT=.a
95dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000096dnl set $(LDFLAGS) from --with-ldopts=value
97dnl
98AC_ARG_WITH([ldopts],
99[ --with-ldopts=LDOPTS select linker command line options],
100AC_MSG_RESULT(LDFLAGS is $withval)
101LDFLAGS=$withval,
102LDFLAGS=)dnl
103AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000104dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000105dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000106dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000107AC_ARG_WITH([root-prefix],
108[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
109root_prefix=$withval,
110root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000111dnl
Theodore Ts'o19178752000-02-11 15:55:07 +0000112dnl handle --enable-compression
113dnl
114AC_ARG_ENABLE([compression],
115[ --enable-compression enable EXPERIMENTAL compression support],
116if test "$enableval" = "no"
117then
118 echo "Disabling compression support"
119else
120 AC_DEFINE(ENABLE_COMPRESSION)
121 echo "Enabling compression support"
122 echo "WARNING: Compression support is experimental"
123fi
124,
125echo "Disabling compression support by default"
126)
127dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000128dnl handle --enable-dll-shlibs
129dnl
130AC_ARG_ENABLE([dll-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000131[ --enable-dll-shlibs select DLL libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000132if test "$enableval" = "no"
133then
134 DLL_CMT=#
135 MAKEFILE_DLL=/dev/null
136 echo "Disabling DLL shared libraries"
137else
138 DLL_CMT=
139 MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000140 BINARY_TYPE=dllbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000141 LIB_EXT=.sa
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000142 echo "Enabling DLL shared libraries"
143fi
144,
145MAKEFILE_DLL=/dev/null
146DLL_CMT=#
147echo "Disabling DLL shared libraries by default"
148)
149AC_SUBST(DLL_CMT)
150AC_SUBST_FILE(MAKEFILE_DLL)
151dnl
152dnl handle --enable-elf-shlibs
153dnl
154AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000155[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000156if test "$enableval" = "no"
157then
158 ELF_CMT=#
159 MAKEFILE_ELF=/dev/null
160 echo "Disabling ELF shared libraries"
161else
162 ELF_CMT=
163 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000164 [case "$host_os" in
165 solaris2.*)
166 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
167 ;;
168 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000169 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000170 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000171 echo "Enabling ELF shared libraries"
172fi
173,
174MAKEFILE_ELF=/dev/null
175ELF_CMT=#
176echo "Disabling ELF shared libraries by default"
177)
178AC_SUBST(ELF_CMT)
179AC_SUBST_FILE(MAKEFILE_ELF)
180dnl
181dnl handle --enable-bsd-shlibs
182dnl
183AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000184[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000185if test "$enableval" = "no"
186then
187 BSDLIB_CMT=#
188 MAKEFILE_BSDLIB=/dev/null
189 echo "Disabling BSD shared libraries"
190else
191 BSDLIB_CMT=
192 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000193 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000194 echo "Enabling BSD shared libraries"
195fi
196,
197MAKEFILE_BSDLIB=/dev/null
198BSDLIB_CMT=#
199echo "Disabling BSD shared libraries by default"
200)
201AC_SUBST(BSDLIB_CMT)
202AC_SUBST_FILE(MAKEFILE_BSDLIB)
203dnl
204dnl handle --enable-profile
205dnl
206AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000207[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000208if test "$enableval" = "no"
209then
210 PROFILE_CMT=#
211 MAKEFILE_PROFILE=/dev/null
212 echo "Disabling profiling libraries"
213else
214 PROFILE_CMT=
215 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000216 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000217 echo "Building profiling libraries"
218fi
219,
220PROFILE_CMT=#
221MAKEFILE_PROFILE=/dev/null
222echo "Disabling profiling libraries by default"
223)
224AC_SUBST(PROFILE_CMT)
225AC_SUBST_FILE(MAKEFILE_PROFILE)
226dnl
227dnl handle --enable-checker
228dnl
229AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000230[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000231if test "$enableval" = "no"
232then
233 CHECKER_CMT=#
234 MAKEFILE_CHECKER=/dev/null
235 echo "Disabling checker libraries"
236else
237 CHECKER_CMT=
238 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
239 echo "Building checker libraries"
240fi
241,
242CHECKER_CMT=#
243MAKEFILE_CHECKER=/dev/null
244echo "Disabling checker libraries by default"
245)
246AC_SUBST(CHECKER_CMT)
247AC_SUBST_FILE(MAKEFILE_CHECKER)
248dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000249dnl Substitute library extensions
250dnl
251AC_SUBST(LIB_EXT)
252AC_SUBST(STATIC_LIB_EXT)
253AC_SUBST(PROFILED_LIB_EXT)
254dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000255dnl handle --enable-jfs-debug
256dnl
257AC_ARG_ENABLE([jfs-debug],
258[ --enable-jfs-debug enable journal debugging],
259if test "$enableval" = "no"
260then
261 echo "Disabling journal debugging"
262else
263 AC_DEFINE(JFS_DEBUG)
264 echo "Enabling journal debugging"
265fi
266,
267echo "Disabling journal debugging by default"
268)
269dnl
270dnl handle --enable-swapfs
271dnl
272AC_ARG_ENABLE([swapfs],
273[ --disable-swapfs disable support of legacy byte-swapped filesystems],
274if test "$enableval" = "no"
275then
276 echo "Disabling swapfs support"
277else
278 AC_DEFINE(ENABLE_SWAPFS)
279 echo "Enabling swapfs support"
280fi
281,
282echo "Enabling swapfs support by default"
283AC_DEFINE(ENABLE_SWAPFS)
284)
285dnl
286dnl handle --enable-debugfs
287dnl
288AC_ARG_ENABLE([debugfs],
289[ --disable-debugfs disable support of debugfs program],
290if test "$enableval" = "no"
291then
292 echo "Disabling debugfs support"
293 DEBUGFS_CMT="#"
294else
295 DEBUGFS_CMT=
296 echo "Enabling debugfs support"
297fi
298,
299echo "Enabling debugfs support by default"
300DEBUGFS_CMT=
301)
302AC_SUBST(DEBUGFS_CMT)
303dnl
304dnl handle --enable-imager
305dnl
306AC_ARG_ENABLE([imager],
307[ --disable-imager disable support of e2image program],
308if test "$enableval" = "no"
309then
310 echo "Disabling e2image support"
311 IMAGER_CMT="#"
312else
313 IMAGER_CMT=
314 echo "Enabling e2image support"
315fi
316,
317echo "Enabling e2image support by default"
318IMAGER_CMT=
319)
320AC_SUBST(IMAGER_CMT)
321dnl
322dnl handle --enable-resizer
323dnl
324AC_ARG_ENABLE([resizer],
325[ --disable-resizer disable support of e2resize program],
326if test "$enableval" = "no"
327then
328 echo "Disabling e2resize support"
329 RESIZER_CMT="#"
330else
331 RESIZER_CMT=
332 echo "Enabling e2resize support"
333fi
334,
335echo "Enabling e2resize support by default"
336RESIZER_CMT=
337)
338AC_SUBST(RESIZER_CMT)
339dnl
Theodore Ts'o4d0f3e12001-01-11 15:48:50 +0000340dnl handle --enable-dynamic-e2fsck
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000341dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000342AC_ARG_ENABLE([dynamic-e2fsck],
343[ --enable-dynamic-e2fsck build e2fsck dynamically],
344if test "$enableval" = "no"
345then
346 E2FSCK_TYPE=static
347 echo "Building e2fsck statically"
348else
349 E2FSCK_TYPE=shared
350 echo "Building e2fsck dynamically"
351fi
352,
353E2FSCK_TYPE=static
354echo "Building e2fsck statically by default"
355)
356AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000357dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000358dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
359dnl
360AC_ARG_ENABLE([fsck],
361[ --enable-fsck build fsck wrapper program],
362[if test "$enableval" = "no"
363then
364 FSCK_PROG='' FSCK_MAN=''
365 echo "Not building fsck wrapper"
366else
367 FSCK_PROG=fsck FSCK_MAN=fsck.8
368 echo "Building fsck wrapper"
369fi]
370,
371[case "$host_os" in
372 gnu*)
373 FSCK_PROG='' FSCK_MAN=''
374 echo "Not building fsck wrapper by default"
375 ;;
376 *)
377 FSCK_PROG=fsck FSCK_MAN=fsck.8
378 echo "Building fsck wrapper by default"
379esac]
380)
381AC_SUBST(FSCK_PROG)
382AC_SUBST(FSCK_MAN)
383dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000384dnl
385MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
386AC_SUBST_FILE(MAKEFILE_LIBRARY)
387dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000388dnl
389AC_ARG_ENABLE([old-bitops],
390[ --enable-old-bitops Use old (non-standard but native) bitmask operations],
391if test "$enableval" = "no"
392then
393 echo "Using new (standard) bitmask operations"
394else
395 AC_DEFINE(EXT2_OLD_BITOPS)
396 echo "Using old (native) bitmask operations"
397
398fi
399,
400echo "Using standard bitmask operations by default"
401)
402dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000403dnl Add internationalization support, using gettext.
404dnl
405PACKAGE=e2fsprogs
406VERSION="$E2FSPROGS_VERSION"
407AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
408AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
409AC_SUBST(PACKAGE)
410AC_SUBST(VERSION)
411
412ALL_LINGUAS="it nyc"
413AM_GNU_GETTEXT
414dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000415dnl End of configuration options
416dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000417AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000418AC_PROG_MAKE_SET
419AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000420AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000421AC_PATH_PROG(MV, mv, mv)
422AC_PATH_PROG(CP, cp, cp)
423AC_PATH_PROG(RM, rm, rm)
424AC_PATH_PROG(CHMOD, chmod, :)
425AC_PATH_PROG(AWK, awk, awk)
426AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000427AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000428AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000429AC_CHECK_TOOL(AR, ar, ar)
430AC_CHECK_TOOL(RANLIB, ranlib, :)
431AC_CHECK_TOOL(STRIP, strip, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000432AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000433# See if we need a separate native compiler.
434if test $cross_compiling = no; then
435 BUILD_CC="$CC"
436 AC_SUBST(BUILD_CC)
437else
438 AC_CHECK_PROGS(BUILD_CC, gcc cc)
439fi
Theodore Ts'o4d0f3e12001-01-11 15:48:50 +0000440AC_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)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000441AC_FUNC_VPRINTF
442dnl
443dnl See if struct dirent has a d_namlen field (like bsd systems), implying
444dnl that the actual length of the structure may be grater than the declared
445dnl length.
446dnl
447AC_MSG_CHECKING(whether struct dirent has a d_namlen field)
448AC_CACHE_VAL(e2fsprogs_cv_struct_d_namlen,
449 AC_TRY_COMPILE(
450[#include <sys/types.h>
451#include <dirent.h>],
452 [struct dirent de; de.d_namlen = 0;],
453 [e2fsprogs_cv_struct_d_namlen=yes],
454 [e2fsprogs_cv_struct_d_namlen=no]))
455AC_MSG_RESULT($e2fsprogs_cv_struct_d_namlen)
456if test "$e2fsprogs_cv_struct_d_namlen" = yes; then
457 AC_DEFINE(HAVE_DIRENT_NAMLEN)
458fi
459dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000460dnl Check to see if llseek() is declared in unistd.h. On some libc's
461dnl it is, and on others it isn't..... Thank you glibc developers....
462dnl
463dnl Warning! Use of --enable-gcc-wall may throw off this test.
464dnl
465dnl
466AC_MSG_CHECKING(whether llseek declared in unistd.h)
467AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype,
468 AC_TRY_COMPILE(
469[#include <unistd.h>], [extern int llseek(int);],
470 [e2fsprogs_cv_have_llseek_prototype=no],
471 [e2fsprogs_cv_have_llseek_prototype=yes]))
472AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
473if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
474 AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
475fi
476dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000477dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
478dnl are so convoluted that I can't tell whether it will always be defined,
479dnl and if it isn't defined while lseek64 is defined in the library,
480dnl disaster will strike.
481dnl
482dnl Warning! Use of --enable-gcc-wall may throw off this test.
483dnl
484dnl
485AC_MSG_CHECKING(whether lseek64 declared in unistd.h)
486AC_CACHE_VAL(e2fsprogs_cv_have_lseek64_prototype,
487 AC_TRY_COMPILE(
488[#define _LARGEFILE_SOURCE
489#define _LARGEFILE64_SOURCE
490#include <unistd.h>], [extern int lseek64(int);],
491 [e2fsprogs_cv_have_lseek64_prototype=no],
492 [e2fsprogs_cv_have_lseek64_prototype=yes]))
493AC_MSG_RESULT($e2fsprogs_cv_have_lseek64_prototype)
494if test "$e2fsprogs_cv_have_lseek64_prototype" = yes; then
495 AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)
496fi
497dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000498dnl Word sizes...
499dnl
500if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
501 # if cross-compiling, with no cached values, just assume something common.
502 ac_cv_sizeof_short=2
503 ac_cv_sizeof_int=4
504 ac_cv_sizeof_long=4
Theodore Ts'o6c133521999-07-03 20:37:03 +0000505 ac_cv_sizeof_long_long=8
506 AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4, long long=8])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000507fi
508AC_CHECK_SIZEOF(short)
509AC_CHECK_SIZEOF(int)
510AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000511AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000512SIZEOF_SHORT=$ac_cv_sizeof_short
513SIZEOF_INT=$ac_cv_sizeof_int
514SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000515SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000516AC_SUBST(SIZEOF_SHORT)
517AC_SUBST(SIZEOF_INT)
518AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000519AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000520AC_C_BIGENDIAN
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000521dnl
522dnl See if struct stat has a st_flags field, in which case we can get file
523dnl flags somewhat portably. Also check for the analogous setter, chflags().
524dnl
525AC_MSG_CHECKING(whether struct stat has a st_flags field)
526AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
527 AC_TRY_COMPILE([#include <sys/stat.h>],
528 [struct stat stat; stat.st_flags = 0;],
529 [e2fsprogs_cv_struct_st_flags=yes],
530 [e2fsprogs_cv_struct_st_flags=no]))
531AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
532if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000533 AC_MSG_CHECKING(whether st_flags field is useful)
534 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
535 AC_TRY_COMPILE([#include <sys/stat.h>],
536 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
537 [e2fsprogs_cv_struct_st_flags_immut=yes],
538 [e2fsprogs_cv_struct_st_flags_immut=no]))
539 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
540 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
541 AC_DEFINE(HAVE_STAT_FLAGS)
542 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000543fi
Theodore Ts'o53abed02001-08-27 12:18:16 -0400544AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 getmntinfo strcasecmp srandom fchown mallinfo fdatasync strnlen)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000545dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000546dnl Check to see if -lsocket is required (solaris) to make something
547dnl that uses socket() to compile; this is needed for the UUID library
548dnl
549SOCKET_LIB=''
550AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
551AC_SUBST(SOCKET_LIB)
552dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000553dnl See if optreset exists
554dnl
555AC_MSG_CHECKING(for optreset)
556AC_CACHE_VAL(ac_cv_have_optreset,
557[AC_EGREP_HEADER(optreset, unistd.h,
558 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
559AC_MSG_RESULT($ac_cv_have_optreset)
560if test $ac_cv_have_optreset = yes; then
561 AC_DEFINE(HAVE_OPTRESET)
562fi
563dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000564dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000565dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000566case "$host_os" in
567linux*)
568 AC_DEFINE(HAVE_EXT2_IOCTLS)
569 ;;
570esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000571dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000572dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000573dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000574case "$host_os" in
Theodore Ts'o6c133521999-07-03 20:37:03 +0000575linux* | gnu*)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000576 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
577 root_prefix="";
578 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000579 fi
580 ;;
581esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000582dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000583dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000584dnl
585case "$host_os" in
586linux* | gnu*)
587 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000588 prefix="/usr";
589 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000590 fi
591;;
592esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000593if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000594 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000595 root_prefix="$ac_default_prefix"
596 else
597 root_prefix="$prefix"
598 fi
599fi
600AC_SUBST(root_prefix)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000601dnl
602dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000603dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000604AC_MSG_CHECKING([whether linker accepts -static])
605AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
606[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
607AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
608 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
609LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000610dnl
611dnl Regardless of how the test turns out, Solaris doesn't handle -static
612dnl This is caused by the socket library requiring the nsl library, which
613dnl requires the -dl library, which only works for dynamically linked
614dnl programs. It basically means you can't have statically linked programs
615dnl which use the network under Solaris.
616dnl
617case "$host_os" in
618solaris2.*)
619 ac_cv_e2fsprogs_use_static=no
620;;
621esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000622AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000623LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000624if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000625 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000626fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000627AC_SUBST(LDFLAG_STATIC)
628dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000629dnl Make the ss and et directories work correctly.
630dnl
631SS_DIR=`cd ${srcdir}/lib/ss; pwd`
632ET_DIR=`cd ${srcdir}/lib/et; pwd`
633AC_SUBST(SS_DIR)
634AC_SUBST(ET_DIR)
635dnl
636dnl Only try to run the test suite if we're not cross compiling.
637dnl
638if test "$cross_compiling" = yes ; then
639 DO_TEST_SUITE=
640else
641 DO_TEST_SUITE=check
642fi
643AC_SUBST(DO_TEST_SUITE)
644dnl
645dnl Make our output files, being sure that we create the some miscellaneous
646dnl directories
647dnl
648test -d lib || mkdir lib
649test -d include || mkdir include
650test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000651test -d include/asm || mkdir include/asm
Theodore Ts'o24b2c7a1997-06-07 20:42:58 +0000652rmakefile=
653if test -d ${srcdir}/resize ; then
654 rmakefile=resize/Makefile
655fi
Theodore Ts'o44339bd1997-10-15 02:47:20 +0000656AC_OUTPUT(MCONFIG Makefile util/Makefile util/subst.conf lib/et/Makefile
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000657 lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile lib/uuid/Makefile
658 misc/Makefile e2fsck/Makefile debugfs/Makefile tests/Makefile
Theodore Ts'oa64c9c12000-02-08 20:17:21 +0000659 tests/progs/Makefile $rmakefile doc/Makefile
660 intl/Makefile po/Makefile.in)