blob: 01e8290041036a83baf7740797c8361b5ba9462c [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 \" " "`
Theodore Ts'obff0cc92003-03-23 01:37:53 -050013E2FSPROGS_DAY=`echo $DATE | awk -F- '{print $1}'`
Theodore Ts'o74becf31997-04-26 14:37:06 +000014MONTH=`echo $DATE | awk -F- '{print $2}'`
15YEAR=`echo $DATE | awk -F- '{print $3}'`
16
Theodore Ts'o40fa8cc1999-01-09 05:06:02 +000017if expr $YEAR ">" 1900 > /dev/null ; then
18 E2FSPROGS_YEAR=$YEAR
19elif expr $YEAR ">" 90 >/dev/null ; then
Theodore Ts'o74becf31997-04-26 14:37:06 +000020 E2FSPROGS_YEAR=19$YEAR
21else
22 E2FSPROGS_YEAR=20$YEAR
23fi
24
25case $MONTH in
26Jan) E2FSPROGS_MONTH="January" ;;
27Feb) E2FSPROGS_MONTH="February" ;;
28Mar) E2FSPROGS_MONTH="March" ;;
29Apr) E2FSPROGS_MONTH="April" ;;
30May) E2FSPROGS_MONTH="May" ;;
31Jun) E2FSPROGS_MONTH="June" ;;
32Jul) E2FSPROGS_MONTH="July" ;;
33Aug) E2FSPROGS_MONTH="August" ;;
34Sep) E2FSPROGS_MONTH="September" ;;
35Oct) E2FSPROGS_MONTH="October" ;;
36Nov) E2FSPROGS_MONTH="November" ;;
37Dec) E2FSPROGS_MONTH="December" ;;
38*) echo "Unknown month $MONTH??" ;;
39esac
40
41unset DATE MONTH YEAR
42echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
43echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
44AC_SUBST(E2FSPROGS_YEAR)
45AC_SUBST(E2FSPROGS_MONTH)
Theodore Ts'obff0cc92003-03-23 01:37:53 -050046AC_SUBST(E2FSPROGS_DAY)
Theodore Ts'o74becf31997-04-26 14:37:06 +000047AC_SUBST(E2FSPROGS_VERSION)
Theodore Ts'oea97be52001-09-19 15:20:12 -040048AC_CANONICAL_HOST
Theodore Ts'o74becf31997-04-26 14:37:06 +000049dnl
50dnl set $(CC) from --with-cc=value
51dnl
52AC_ARG_WITH([cc],
53[ --with-cc=COMPILER select compiler to use],
54AC_MSG_RESULT(CC=$withval)
55CC=$withval,
56if test -z "$CC" ; then CC=cc; fi
57[AC_MSG_RESULT(CC defaults to $CC)])dnl
58export CC
59AC_SUBST([CC])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000060AC_PROG_CC
Theodore Ts'o74becf31997-04-26 14:37:06 +000061dnl
62dnl set $(LD) from --with-linker=value
63dnl
64AC_ARG_WITH([linker],
65[ --with-linker=LINKER select linker to use],
66AC_MSG_RESULT(LD=$withval)
67LD=$withval,
68if test -z "$LD" ; then LD=$CC; fi
69[AC_MSG_RESULT(LD defaults to $LD)])dnl
70export LD
71AC_SUBST([LD])
72dnl
73dnl set $(CCOPTS) from --with-ccopts=value
74dnl
75AC_ARG_WITH([ccopts],
76[ --with-ccopts=CCOPTS select compiler command line options],
77AC_MSG_RESULT(CCOPTS is $withval)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +000078CFLAGS=$withval,
79)dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000080dnl
Theodore Ts'of8bd9801999-10-26 04:19:45 +000081dnl On systems without linux header files, we add an extra include directory
82dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
83dnl is quoted so that it gets expanded by make, not by configure.
84dnl
85AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000086if test "$linux_headers" != yes; then
87 LINUX_INCLUDE='-I$(top_builddir)/include'
Theodore Ts'of8bd9801999-10-26 04:19:45 +000088fi
89AC_SUBST(LINUX_INCLUDE)
90dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +000091dnl Set default values for library extentions. Will be dealt with after
92dnl parsing configuration opions, which may modify these
93dnl
94LIB_EXT=.a
95STATIC_LIB_EXT=.a
96PROFILE_LIB_EXT=.a
97dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000098dnl set $(LDFLAGS) from --with-ldopts=value
99dnl
100AC_ARG_WITH([ldopts],
101[ --with-ldopts=LDOPTS select linker command line options],
102AC_MSG_RESULT(LDFLAGS is $withval)
103LDFLAGS=$withval,
104LDFLAGS=)dnl
105AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000106dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000107dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000108dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000109AC_ARG_WITH([root-prefix],
110[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
111root_prefix=$withval,
112root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000113dnl
Theodore Ts'o19178752000-02-11 15:55:07 +0000114dnl handle --enable-compression
115dnl
116AC_ARG_ENABLE([compression],
117[ --enable-compression enable EXPERIMENTAL compression support],
118if test "$enableval" = "no"
119then
120 echo "Disabling compression support"
121else
122 AC_DEFINE(ENABLE_COMPRESSION)
123 echo "Enabling compression support"
124 echo "WARNING: Compression support is experimental"
125fi
126,
127echo "Disabling compression support by default"
128)
129dnl
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400130dnl handle --enable-htree
131dnl
132AC_ARG_ENABLE([htree],
133[ --enable-htree enable EXPERIMENTAL htree directory support],
134if test "$enableval" = "no"
135then
136 HTREE_CMT=#
137 echo "Disabling htree directory support"
138else
139 HTREE_CMT=
140 AC_DEFINE(ENABLE_HTREE)
141 echo "Enabling htree directory support"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400142fi
143,
Theodore Ts'o559ca6c2002-08-18 03:48:55 -0400144HTREE_CMT=
145AC_DEFINE(ENABLE_HTREE)
146echo "Enabling htree directory support by default"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400147)
148AC_SUBST(HTREE_CMT)
149dnl
150dnl handle --enable-clear-htree
151dnl
152AC_ARG_ENABLE([htree-clear],
153[ --enable-htree-clear clear htree because we don't trust e2fsck],
154if test "$enableval" = "no"
155then
156 HTREE_CLR_CMT=#
157 echo "Disabling htree clearing"
158else
159 HTREE_CLR_CMT=
160 AC_DEFINE(ENABLE_HTREE_CLEAR)
161 echo "Enabling htree clearing"
162fi
163,
164HTREE_CLR_CMT=#
165echo "Disabling htree clearing by default"
166)
167AC_SUBST(HTREE_CLR_CMT)
168dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500169dnl handle --enable-emvs-10
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400170dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500171EVMS_ABI_CODE=120
172AC_ARG_ENABLE([evms-10],
173[ --enable-evms-10 use EVMS 1.0 ABI (instead of EVMS 1.2)],
174if test "$enableval" != "no"
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400175then
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500176 EVMS_ABI_CODE=100
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400177 echo "Enabling EVMS 1.0.0 ABI"
178fi
Theodore Ts'off6dbcc2002-05-24 22:44:42 -0400179)
180dnl
Theodore Ts'oa9d799a2002-11-08 13:50:51 -0500181dnl handle --enable-emvs-11
182dnl
183AC_ARG_ENABLE([evms-11],
184[ --enable-evms-11 use EVMS 1.1 ABI (instead of EVMS 1.1)],
185if test "$enableval" != "no"
186then
187 EVMS_ABI_CODE=110
188 echo "Enabling EVMS 1.1.0 ABI"
189fi
190)
191if test "$EVMS_ABI_CODE" = "120"
192then
193 echo "Using EVMS 1.2.0 ABI by default"
194fi
195AC_SUBST(EVMS_ABI_CODE)
196dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000197dnl handle --enable-dll-shlibs
198dnl
199AC_ARG_ENABLE([dll-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000200[ --enable-dll-shlibs select DLL libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000201if test "$enableval" = "no"
202then
203 DLL_CMT=#
204 MAKEFILE_DLL=/dev/null
205 echo "Disabling DLL shared libraries"
206else
207 DLL_CMT=
208 MAKEFILE_DLL=$srcdir/lib/Makefile.dll-lib
Theodore Ts'o74becf31997-04-26 14:37:06 +0000209 BINARY_TYPE=dllbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000210 LIB_EXT=.sa
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000211 echo "Enabling DLL shared libraries"
212fi
213,
214MAKEFILE_DLL=/dev/null
215DLL_CMT=#
216echo "Disabling DLL shared libraries by default"
217)
218AC_SUBST(DLL_CMT)
219AC_SUBST_FILE(MAKEFILE_DLL)
220dnl
221dnl handle --enable-elf-shlibs
222dnl
223AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000224[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000225if test "$enableval" = "no"
226then
227 ELF_CMT=#
228 MAKEFILE_ELF=/dev/null
229 echo "Disabling ELF shared libraries"
230else
231 ELF_CMT=
232 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000233 [case "$host_os" in
234 solaris2.*)
235 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
236 ;;
237 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000238 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000239 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000240 echo "Enabling ELF shared libraries"
241fi
242,
243MAKEFILE_ELF=/dev/null
244ELF_CMT=#
245echo "Disabling ELF shared libraries by default"
246)
247AC_SUBST(ELF_CMT)
248AC_SUBST_FILE(MAKEFILE_ELF)
249dnl
250dnl handle --enable-bsd-shlibs
251dnl
252AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000253[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000254if test "$enableval" = "no"
255then
256 BSDLIB_CMT=#
257 MAKEFILE_BSDLIB=/dev/null
258 echo "Disabling BSD shared libraries"
259else
260 BSDLIB_CMT=
261 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000262 LIB_EXT=.so
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500263 [case "$host_os" in
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -0500264 darwin*)
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500265 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
266 LIB_EXT=.dylib
267 ;;
268 esac]
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000269 echo "Enabling BSD shared libraries"
270fi
271,
272MAKEFILE_BSDLIB=/dev/null
273BSDLIB_CMT=#
274echo "Disabling BSD shared libraries by default"
275)
276AC_SUBST(BSDLIB_CMT)
277AC_SUBST_FILE(MAKEFILE_BSDLIB)
278dnl
279dnl handle --enable-profile
280dnl
281AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000282[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000283if test "$enableval" = "no"
284then
285 PROFILE_CMT=#
286 MAKEFILE_PROFILE=/dev/null
287 echo "Disabling profiling libraries"
288else
289 PROFILE_CMT=
290 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000291 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000292 echo "Building profiling libraries"
293fi
294,
295PROFILE_CMT=#
296MAKEFILE_PROFILE=/dev/null
297echo "Disabling profiling libraries by default"
298)
299AC_SUBST(PROFILE_CMT)
300AC_SUBST_FILE(MAKEFILE_PROFILE)
301dnl
302dnl handle --enable-checker
303dnl
304AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000305[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000306if test "$enableval" = "no"
307then
308 CHECKER_CMT=#
309 MAKEFILE_CHECKER=/dev/null
310 echo "Disabling checker libraries"
311else
312 CHECKER_CMT=
313 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
314 echo "Building checker libraries"
315fi
316,
317CHECKER_CMT=#
318MAKEFILE_CHECKER=/dev/null
319echo "Disabling checker libraries by default"
320)
321AC_SUBST(CHECKER_CMT)
322AC_SUBST_FILE(MAKEFILE_CHECKER)
323dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000324dnl Substitute library extensions
325dnl
326AC_SUBST(LIB_EXT)
327AC_SUBST(STATIC_LIB_EXT)
328AC_SUBST(PROFILED_LIB_EXT)
329dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500330dnl handle --enable-jbd-debug
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000331dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500332AC_ARG_ENABLE([jbd-debug],
333[ --enable-jbd-debug enable journal debugging],
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000334if test "$enableval" = "no"
335then
336 echo "Disabling journal debugging"
337else
Theodore Ts'o8cf93332001-12-16 02:23:36 -0500338 AC_DEFINE(CONFIG_JBD_DEBUG)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000339 echo "Enabling journal debugging"
340fi
341,
342echo "Disabling journal debugging by default"
343)
344dnl
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500345dnl handle --enable-blkid-debug
346dnl
347AC_ARG_ENABLE([blkid-debug],
348[ --enable-blkid-debug enable blkid debugging],
349if test "$enableval" = "no"
350then
351 echo "Disabling blkid debugging"
352else
353 AC_DEFINE(CONFIG_BLKID_DEBUG)
354 echo "Enabling blkid debugging"
355fi
356,
357echo "Disabling blkid debugging by default"
358)
359dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000360dnl handle --enable-swapfs
361dnl
362AC_ARG_ENABLE([swapfs],
363[ --disable-swapfs disable support of legacy byte-swapped filesystems],
364if test "$enableval" = "no"
365then
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500366 SWAPFS_CMT=#
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000367 echo "Disabling swapfs support"
368else
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500369 SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000370 AC_DEFINE(ENABLE_SWAPFS)
371 echo "Enabling swapfs support"
372fi
373,
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500374SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000375echo "Enabling swapfs support by default"
376AC_DEFINE(ENABLE_SWAPFS)
377)
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500378AC_SUBST(SWAPFS_CMT)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000379dnl
380dnl handle --enable-debugfs
381dnl
382AC_ARG_ENABLE([debugfs],
383[ --disable-debugfs disable support of debugfs program],
384if test "$enableval" = "no"
385then
386 echo "Disabling debugfs support"
387 DEBUGFS_CMT="#"
388else
389 DEBUGFS_CMT=
390 echo "Enabling debugfs support"
391fi
392,
393echo "Enabling debugfs support by default"
394DEBUGFS_CMT=
395)
396AC_SUBST(DEBUGFS_CMT)
397dnl
398dnl handle --enable-imager
399dnl
400AC_ARG_ENABLE([imager],
401[ --disable-imager disable support of e2image program],
402if test "$enableval" = "no"
403then
404 echo "Disabling e2image support"
405 IMAGER_CMT="#"
406else
407 IMAGER_CMT=
408 echo "Enabling e2image support"
409fi
410,
411echo "Enabling e2image support by default"
412IMAGER_CMT=
413)
414AC_SUBST(IMAGER_CMT)
415dnl
416dnl handle --enable-resizer
417dnl
418AC_ARG_ENABLE([resizer],
419[ --disable-resizer disable support of e2resize program],
420if test "$enableval" = "no"
421then
422 echo "Disabling e2resize support"
423 RESIZER_CMT="#"
424else
425 RESIZER_CMT=
426 echo "Enabling e2resize support"
427fi
428,
429echo "Enabling e2resize support by default"
430RESIZER_CMT=
431)
432AC_SUBST(RESIZER_CMT)
433dnl
Theodore Ts'o4d0f3e12001-01-11 15:48:50 +0000434dnl handle --enable-dynamic-e2fsck
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000435dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000436AC_ARG_ENABLE([dynamic-e2fsck],
437[ --enable-dynamic-e2fsck build e2fsck dynamically],
438if test "$enableval" = "no"
439then
440 E2FSCK_TYPE=static
441 echo "Building e2fsck statically"
442else
443 E2FSCK_TYPE=shared
444 echo "Building e2fsck dynamically"
445fi
446,
447E2FSCK_TYPE=static
448echo "Building e2fsck statically by default"
449)
450AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000451dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000452dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
453dnl
454AC_ARG_ENABLE([fsck],
455[ --enable-fsck build fsck wrapper program],
456[if test "$enableval" = "no"
457then
458 FSCK_PROG='' FSCK_MAN=''
459 echo "Not building fsck wrapper"
460else
461 FSCK_PROG=fsck FSCK_MAN=fsck.8
462 echo "Building fsck wrapper"
463fi]
464,
465[case "$host_os" in
466 gnu*)
467 FSCK_PROG='' FSCK_MAN=''
468 echo "Not building fsck wrapper by default"
469 ;;
470 *)
471 FSCK_PROG=fsck FSCK_MAN=fsck.8
472 echo "Building fsck wrapper by default"
473esac]
474)
475AC_SUBST(FSCK_PROG)
476AC_SUBST(FSCK_MAN)
477dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000478dnl
479MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
480AC_SUBST_FILE(MAKEFILE_LIBRARY)
481dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000482dnl
483AC_ARG_ENABLE([old-bitops],
484[ --enable-old-bitops Use old (non-standard but native) bitmask operations],
485if test "$enableval" = "no"
486then
487 echo "Using new (standard) bitmask operations"
488else
489 AC_DEFINE(EXT2_OLD_BITOPS)
490 echo "Using old (native) bitmask operations"
491
492fi
493,
494echo "Using standard bitmask operations by default"
495)
496dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000497dnl Add internationalization support, using gettext.
498dnl
499PACKAGE=e2fsprogs
500VERSION="$E2FSPROGS_VERSION"
501AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
502AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
503AC_SUBST(PACKAGE)
504AC_SUBST(VERSION)
505
Theodore Ts'o0c897a92002-11-09 12:01:18 -0500506ALL_LINGUAS="it nyc tr de de-utf"
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000507AM_GNU_GETTEXT
508dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000509dnl End of configuration options
510dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000511AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000512AC_PROG_MAKE_SET
513AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000514AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000515AC_PATH_PROG(MV, mv, mv)
516AC_PATH_PROG(CP, cp, cp)
517AC_PATH_PROG(RM, rm, rm)
518AC_PATH_PROG(CHMOD, chmod, :)
519AC_PATH_PROG(AWK, awk, awk)
520AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000521AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000522AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000523AC_CHECK_TOOL(AR, ar, ar)
524AC_CHECK_TOOL(RANLIB, ranlib, :)
525AC_CHECK_TOOL(STRIP, strip, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000526AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000527# See if we need a separate native compiler.
528if test $cross_compiling = no; then
529 BUILD_CC="$CC"
530 AC_SUBST(BUILD_CC)
531else
532 AC_CHECK_PROGS(BUILD_CC, gcc cc)
533fi
Theodore Ts'offf45482003-04-13 00:44:19 -0400534AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disklabel.h sys/ioctl.h sys/mkdev.h sys/mount.h sys/sockio.h sys/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h net/if.h netinet/in.h)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000535AC_FUNC_VPRINTF
Theodore Ts'offf45482003-04-13 00:44:19 -0400536dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
537dnl is not decleared.
538AC_MSG_CHECKING(whether d_reclen declared in dirent)
539AC_CACHE_VAL(e2fsprogs_cv_have_d_reclen_dirent,
540 AC_TRY_COMPILE(
541[#include <dirent.h>], [struct dirent de; de.d_reclen = 0; ],
542 [e2fsprogs_cv_have_d_reclen_dirent=yes],
543 [e2fsprogs_cv_have_d_reclen_dirent=no]))
544AC_MSG_RESULT($e2fsprogs_cv_have_d_reclen_dirent)
545if test "$e2fsprogs_cv_have_d_reclen_dirent" = yes; then
546 AC_DEFINE(HAVE_RECLEN_DIRENT)
547fi
548dnl Check to see if ssize_t was decleared
549AC_MSG_CHECKING(whether ssize_t declared)
550AC_CACHE_VAL(e2fsprogs_cv_have_ssize_t,
551 AC_TRY_COMPILE(
552[#include <sys/types.h>], [ssize_t a = 0; ],
553 [e2fsprogs_cv_have_ssize_t=yes],
554 [e2fsprogs_cv_have_ssize_t=no]))
555AC_MSG_RESULT($e2fsprogs_cv_have_ssize_t)
556if test "$e2fsprogs_cv_have_ssize_t" = yes; then
557 AC_DEFINE(HAVE_TYPE_SSIZE_T)
558fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000559dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000560dnl Check to see if llseek() is declared in unistd.h. On some libc's
561dnl it is, and on others it isn't..... Thank you glibc developers....
562dnl
563dnl Warning! Use of --enable-gcc-wall may throw off this test.
564dnl
565dnl
566AC_MSG_CHECKING(whether llseek declared in unistd.h)
567AC_CACHE_VAL(e2fsprogs_cv_have_llseek_prototype,
568 AC_TRY_COMPILE(
569[#include <unistd.h>], [extern int llseek(int);],
570 [e2fsprogs_cv_have_llseek_prototype=no],
571 [e2fsprogs_cv_have_llseek_prototype=yes]))
572AC_MSG_RESULT($e2fsprogs_cv_have_llseek_prototype)
573if test "$e2fsprogs_cv_have_llseek_prototype" = yes; then
574 AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)
575fi
576dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000577dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
578dnl are so convoluted that I can't tell whether it will always be defined,
579dnl and if it isn't defined while lseek64 is defined in the library,
580dnl disaster will strike.
581dnl
582dnl Warning! Use of --enable-gcc-wall may throw off this test.
583dnl
584dnl
585AC_MSG_CHECKING(whether lseek64 declared in unistd.h)
586AC_CACHE_VAL(e2fsprogs_cv_have_lseek64_prototype,
587 AC_TRY_COMPILE(
588[#define _LARGEFILE_SOURCE
589#define _LARGEFILE64_SOURCE
590#include <unistd.h>], [extern int lseek64(int);],
591 [e2fsprogs_cv_have_lseek64_prototype=no],
592 [e2fsprogs_cv_have_lseek64_prototype=yes]))
593AC_MSG_RESULT($e2fsprogs_cv_have_lseek64_prototype)
594if test "$e2fsprogs_cv_have_lseek64_prototype" = yes; then
595 AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)
596fi
597dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000598dnl Word sizes...
599dnl
600if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
601 # if cross-compiling, with no cached values, just assume something common.
602 ac_cv_sizeof_short=2
603 ac_cv_sizeof_int=4
604 ac_cv_sizeof_long=4
Theodore Ts'o6c133521999-07-03 20:37:03 +0000605 ac_cv_sizeof_long_long=8
606 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 +0000607fi
608AC_CHECK_SIZEOF(short)
609AC_CHECK_SIZEOF(int)
610AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000611AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000612SIZEOF_SHORT=$ac_cv_sizeof_short
613SIZEOF_INT=$ac_cv_sizeof_int
614SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000615SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000616AC_SUBST(SIZEOF_SHORT)
617AC_SUBST(SIZEOF_INT)
618AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000619AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000620AC_C_BIGENDIAN
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000621dnl
622dnl See if struct stat has a st_flags field, in which case we can get file
623dnl flags somewhat portably. Also check for the analogous setter, chflags().
624dnl
625AC_MSG_CHECKING(whether struct stat has a st_flags field)
626AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
627 AC_TRY_COMPILE([#include <sys/stat.h>],
628 [struct stat stat; stat.st_flags = 0;],
629 [e2fsprogs_cv_struct_st_flags=yes],
630 [e2fsprogs_cv_struct_st_flags=no]))
631AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
632if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000633 AC_MSG_CHECKING(whether st_flags field is useful)
634 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
635 AC_TRY_COMPILE([#include <sys/stat.h>],
636 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
637 [e2fsprogs_cv_struct_st_flags_immut=yes],
638 [e2fsprogs_cv_struct_st_flags_immut=no]))
639 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
640 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
641 AC_DEFINE(HAVE_STAT_FLAGS)
642 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000643fi
Theodore Ts'oe12f2ae2003-01-23 16:45:16 -0500644AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 getmntinfo strtoull strcasecmp srandom fchown mallinfo fdatasync strnlen sysconf pathconf)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000645dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000646dnl Check to see if -lsocket is required (solaris) to make something
647dnl that uses socket() to compile; this is needed for the UUID library
648dnl
649SOCKET_LIB=''
650AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
651AC_SUBST(SOCKET_LIB)
652dnl
Theodore Ts'o3ae497e2003-03-16 06:26:25 -0500653dnl Check to see if libdl exists for the sake of dlopen
654dnl
655DLOPEN_LIB=''
656AC_CHECK_LIB(dl, dlopen,
657[DLOPEN_LIB=-ldl
658AC_DEFINE(HAVE_DLOPEN)])
659AC_SUBST(DLOPEN_LIB)
660dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000661dnl See if optreset exists
662dnl
663AC_MSG_CHECKING(for optreset)
664AC_CACHE_VAL(ac_cv_have_optreset,
665[AC_EGREP_HEADER(optreset, unistd.h,
666 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
667AC_MSG_RESULT($ac_cv_have_optreset)
668if test $ac_cv_have_optreset = yes; then
669 AC_DEFINE(HAVE_OPTRESET)
670fi
671dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000672dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000673dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000674case "$host_os" in
675linux*)
676 AC_DEFINE(HAVE_EXT2_IOCTLS)
677 ;;
678esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000679dnl
Theodore Ts'offf45482003-04-13 00:44:19 -0400680dnl OS-specific uncomment control
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400681dnl
682LINUX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400683CYGWIN_CMT="#"
684UNIX_CMT=
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400685case "$host_os" in
686linux*)
687 LINUX_CMT=
688 ;;
Theodore Ts'offf45482003-04-13 00:44:19 -0400689cygwin)
690 CYGWIN_CMT=
691 UNIX_CMT="#"
692 AC_DEFINE(CYGWIN)
693 ;;
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400694esac
695AC_SUBST(LINUX_CMT)
Theodore Ts'offf45482003-04-13 00:44:19 -0400696AC_SUBST(CYGWIN_CMT)
697AC_SUBST(UNIX_CMT)
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400698dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000699dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000700dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000701case "$host_os" in
Theodore Ts'o6c133521999-07-03 20:37:03 +0000702linux* | gnu*)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000703 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
704 root_prefix="";
705 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000706 fi
707 ;;
708esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000709dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000710dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000711dnl
712case "$host_os" in
713linux* | gnu*)
714 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000715 prefix="/usr";
716 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'obff61a72002-05-21 22:21:38 -0400717 if test "$mandir" = '${prefix}/man' ; then
718 echo "...and mandir defaults to /usr/share/man"
719 mandir=/usr/share/man
720 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000721 fi
722;;
723esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000724if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000725 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000726 root_prefix="$ac_default_prefix"
727 else
728 root_prefix="$prefix"
729 fi
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400730 root_bindir=$bindir
731 root_sbindir=$sbindir
732 root_libdir=$libdir
733 root_sysconfdir=$sysconfdir
734else
735 root_bindir='${root_prefix}/bin'
736 root_sbindir='${root_prefix}/sbin'
737 root_libdir='${root_prefix}/lib'
738 root_sysconfdir='${root_prefix}/etc'
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000739fi
740AC_SUBST(root_prefix)
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400741AC_SUBST(root_bindir)
742AC_SUBST(root_sbindir)
743AC_SUBST(root_libdir)
744AC_SUBST(root_sysconfdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000745dnl
746dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000747dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000748AC_MSG_CHECKING([whether linker accepts -static])
749AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
750[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
751AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
752 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
753LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000754dnl
755dnl Regardless of how the test turns out, Solaris doesn't handle -static
756dnl This is caused by the socket library requiring the nsl library, which
757dnl requires the -dl library, which only works for dynamically linked
758dnl programs. It basically means you can't have statically linked programs
759dnl which use the network under Solaris.
760dnl
761case "$host_os" in
762solaris2.*)
763 ac_cv_e2fsprogs_use_static=no
764;;
765esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000766AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000767LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000768if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000769 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000770fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000771AC_SUBST(LDFLAG_STATIC)
772dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000773dnl Make the ss and et directories work correctly.
774dnl
775SS_DIR=`cd ${srcdir}/lib/ss; pwd`
776ET_DIR=`cd ${srcdir}/lib/et; pwd`
777AC_SUBST(SS_DIR)
778AC_SUBST(ET_DIR)
779dnl
780dnl Only try to run the test suite if we're not cross compiling.
781dnl
782if test "$cross_compiling" = yes ; then
783 DO_TEST_SUITE=
784else
785 DO_TEST_SUITE=check
786fi
787AC_SUBST(DO_TEST_SUITE)
788dnl
789dnl Make our output files, being sure that we create the some miscellaneous
790dnl directories
791dnl
792test -d lib || mkdir lib
793test -d include || mkdir include
794test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000795test -d include/asm || mkdir include/asm
Theodore Ts'obff0cc92003-03-23 01:37:53 -0500796for i in MCONFIG Makefile e2fsprogs.spec \
797 util/Makefile util/subst.conf util/gen-tarball \
798 lib/et/Makefile lib/ss/Makefile lib/ext2fs/Makefile lib/e2p/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500799 lib/uuid/Makefile lib/uuid/uuid_types.h \
800 lib/blkid/Makefile lib/blkid/blkid_types.h \
801 lib/evms/Makefile misc/Makefile ext2ed/Makefile e2fsck/Makefile \
802 debugfs/Makefile tests/Makefile tests/progs/Makefile \
803 resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do
804 if test -d `dirname ${srcdir}/$i` ; then
805 outlist="$outlist $i"
806 fi
807done
808AC_OUTPUT($outlist)