blob: f8a7edff68dbbdc51d526598ed950b35a7d7c049 [file] [log] [blame]
Theodore Ts'o50e1e101997-04-26 13:58:21 +00001AC_INIT(version.h)
Theodore Ts'ob0cacab2004-11-30 19:00:19 -05002AC_PREREQ(2.50)
3AC_CONFIG_AUX_DIR(config)
Theodore Ts'o50e1e101997-04-26 13:58:21 +00004MCONFIG=./MCONFIG
5AC_SUBST_FILE(MCONFIG)
Theodore Ts'o74becf31997-04-26 14:37:06 +00006BINARY_TYPE=bin
7dnl
8dnl This is to figure out the version number and the date....
9dnl
10E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \
11 | awk '{print $3}' | tr \" " " | awk '{print $1}'`
12DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
13 | tr \" " "`
Theodore Ts'obff0cc92003-03-23 01:37:53 -050014E2FSPROGS_DAY=`echo $DATE | awk -F- '{print $1}'`
Theodore Ts'o74becf31997-04-26 14:37:06 +000015MONTH=`echo $DATE | awk -F- '{print $2}'`
16YEAR=`echo $DATE | awk -F- '{print $3}'`
17
Theodore Ts'o40fa8cc1999-01-09 05:06:02 +000018if expr $YEAR ">" 1900 > /dev/null ; then
19 E2FSPROGS_YEAR=$YEAR
20elif expr $YEAR ">" 90 >/dev/null ; then
Theodore Ts'o74becf31997-04-26 14:37:06 +000021 E2FSPROGS_YEAR=19$YEAR
22else
23 E2FSPROGS_YEAR=20$YEAR
24fi
25
26case $MONTH in
Andreas Dilger927566a2006-11-12 19:41:25 -050027Jan) MONTH_NUM=01; E2FSPROGS_MONTH="January" ;;
28Feb) MONTH_NUM=02; E2FSPROGS_MONTH="February" ;;
29Mar) MONTH_NUM=03; E2FSPROGS_MONTH="March" ;;
30Apr) MONTH_NUM=04; E2FSPROGS_MONTH="April" ;;
31May) MONTH_NUM=05; E2FSPROGS_MONTH="May" ;;
32Jun) MONTH_NUM=06; E2FSPROGS_MONTH="June" ;;
33Jul) MONTH_NUM=07; E2FSPROGS_MONTH="July" ;;
34Aug) MONTH_NUM=08; E2FSPROGS_MONTH="August" ;;
35Sep) MONTH_NUM=09; E2FSPROGS_MONTH="September" ;;
36Oct) MONTH_NUM=10; E2FSPROGS_MONTH="October" ;;
37Nov) MONTH_NUM=11; E2FSPROGS_MONTH="November" ;;
38Dec) MONTH_NUM=12; E2FSPROGS_MONTH="December" ;;
Theodore Ts'o74becf31997-04-26 14:37:06 +000039*) echo "Unknown month $MONTH??" ;;
40esac
41
Andreas Dilger927566a2006-11-12 19:41:25 -050042base_ver=`echo $E2FSPROGS_VERSION | \
43 sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'`
Andreas Dilger927566a2006-11-12 19:41:25 -050044
45date_spec=${E2FSPROGS_YEAR}.${MONTH_NUM}.${E2FSPROGS_DAY}
46
47case $E2FSPROGS_VERSION in
48*-WIP|pre-*)
Theodore Ts'oab063962008-07-07 16:07:43 -040049 E2FSPROGS_PKGVER="$base_ver~WIP-$E2FSPROGS_YEAR-$MONTH_NUM-$E2FSPROGS_DAY"
Andreas Dilger927566a2006-11-12 19:41:25 -050050 ;;
51*)
52 E2FSPROGS_PKGVER="$base_ver"
53 ;;
54esac
55
56unset DATE MONTH YEAR base_ver pre_vers date_spec
Theodore Ts'o74becf31997-04-26 14:37:06 +000057echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
58echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
59AC_SUBST(E2FSPROGS_YEAR)
60AC_SUBST(E2FSPROGS_MONTH)
Theodore Ts'obff0cc92003-03-23 01:37:53 -050061AC_SUBST(E2FSPROGS_DAY)
Theodore Ts'o74becf31997-04-26 14:37:06 +000062AC_SUBST(E2FSPROGS_VERSION)
Andreas Dilger927566a2006-11-12 19:41:25 -050063AC_SUBST(E2FSPROGS_PKGVER)
Theodore Ts'oea97be52001-09-19 15:20:12 -040064AC_CANONICAL_HOST
Theodore Ts'o74becf31997-04-26 14:37:06 +000065dnl
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040066dnl Use diet libc
67dnl
Theodore Ts'oeafba6c2008-07-10 10:21:42 -040068WITH_DIET_LIBC=
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040069AC_ARG_WITH([diet-libc],
Theodore Ts'o32493942007-12-31 10:45:01 -050070[ --with-diet-libc use diet libc],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040071CC="diet cc -nostdinc"
Theodore Ts'oeafba6c2008-07-10 10:21:42 -040072WITH_DIET_LIBC=yes
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040073AC_MSG_RESULT(CC=$CC))dnl
74dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000075dnl set $(CC) from --with-cc=value
76dnl
77AC_ARG_WITH([cc],
78[ --with-cc=COMPILER select compiler to use],
79AC_MSG_RESULT(CC=$withval)
80CC=$withval,
81if test -z "$CC" ; then CC=cc; fi
82[AC_MSG_RESULT(CC defaults to $CC)])dnl
83export CC
84AC_SUBST([CC])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000085AC_PROG_CC
Theodore Ts'o29a5dee2007-07-04 16:28:47 -040086AC_PROG_CPP
Theodore Ts'o74becf31997-04-26 14:37:06 +000087dnl
88dnl set $(LD) from --with-linker=value
89dnl
90AC_ARG_WITH([linker],
91[ --with-linker=LINKER select linker to use],
92AC_MSG_RESULT(LD=$withval)
93LD=$withval,
94if test -z "$LD" ; then LD=$CC; fi
95[AC_MSG_RESULT(LD defaults to $LD)])dnl
96export LD
97AC_SUBST([LD])
98dnl
99dnl set $(CCOPTS) from --with-ccopts=value
100dnl
101AC_ARG_WITH([ccopts],
102[ --with-ccopts=CCOPTS select compiler command line options],
103AC_MSG_RESULT(CCOPTS is $withval)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000104CFLAGS=$withval,
105)dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000106dnl
Theodore Ts'of8bd9801999-10-26 04:19:45 +0000107dnl On systems without linux header files, we add an extra include directory
108dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
109dnl is quoted so that it gets expanded by make, not by configure.
110dnl
111AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +0000112if test "$linux_headers" != yes; then
113 LINUX_INCLUDE='-I$(top_builddir)/include'
Theodore Ts'of8bd9801999-10-26 04:19:45 +0000114fi
115AC_SUBST(LINUX_INCLUDE)
116dnl
Matthias Andreeb1c92f92004-02-23 21:30:11 +0100117dnl Alpha computers use fast and imprecise floating point code that may
118dnl miss exceptions by default. Force sane options if we're using GCC.
119AC_MSG_CHECKING(for additional special compiler flags)
120if test "$GCC" = yes
121then
122 case "$host_cpu" in
123 alpha) addcflags="-mieee" ;;
124 esac
125fi
126if test "x$addcflags" != x
127then
128 AC_MSG_RESULT($addcflags)
129 CFLAGS="$addcflags $CFLAGS"
130else
131 AC_MSG_RESULT([[(none)]])
132fi
133dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000134dnl Set default values for library extentions. Will be dealt with after
135dnl parsing configuration opions, which may modify these
136dnl
137LIB_EXT=.a
138STATIC_LIB_EXT=.a
139PROFILE_LIB_EXT=.a
140dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000141dnl set $(LDFLAGS) from --with-ldopts=value
142dnl
143AC_ARG_WITH([ldopts],
144[ --with-ldopts=LDOPTS select linker command line options],
145AC_MSG_RESULT(LDFLAGS is $withval)
146LDFLAGS=$withval,
147LDFLAGS=)dnl
148AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000149dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000150dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000151dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000152AC_ARG_WITH([root-prefix],
153[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
154root_prefix=$withval,
155root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000156dnl
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500157dnl handle --enable-maintainer-mode
158dnl
159AC_ARG_ENABLE([maintainer-mode],
160[ --enable-maintainer-mode enable makefile rules useful for maintainers],
161if test "$enableval" = "no"
162then
163 MAINTAINER_CMT=#
164 echo "Disabling maintainer mode"
165else
166 MAINTAINER_CMT=
167 echo "Enabling maintainer mode"
168fi
169,
170MAINTAINER_CMT=#
171echo "Disabling maintainer mode by default"
172)
173AC_SUBST(MAINTAINER_CMT)
174dnl
Theodore Ts'o19178752000-02-11 15:55:07 +0000175dnl handle --enable-compression
176dnl
177AC_ARG_ENABLE([compression],
178[ --enable-compression enable EXPERIMENTAL compression support],
179if test "$enableval" = "no"
180then
181 echo "Disabling compression support"
182else
183 AC_DEFINE(ENABLE_COMPRESSION)
184 echo "Enabling compression support"
185 echo "WARNING: Compression support is experimental"
186fi
187,
188echo "Disabling compression support by default"
189)
190dnl
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400191dnl handle --enable-htree
192dnl
193AC_ARG_ENABLE([htree],
194[ --enable-htree enable EXPERIMENTAL htree directory support],
195if test "$enableval" = "no"
196then
197 HTREE_CMT=#
198 echo "Disabling htree directory support"
199else
200 HTREE_CMT=
201 AC_DEFINE(ENABLE_HTREE)
202 echo "Enabling htree directory support"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400203fi
204,
Theodore Ts'o559ca6c2002-08-18 03:48:55 -0400205HTREE_CMT=
206AC_DEFINE(ENABLE_HTREE)
207echo "Enabling htree directory support by default"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400208)
209AC_SUBST(HTREE_CMT)
210dnl
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500211dnl This needs to be before all of the --enable-*-shlibs options
212dnl
213E2_PKG_CONFIG_STATIC=--static
214dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000215dnl handle --enable-elf-shlibs
216dnl
217AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000218[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000219if test "$enableval" = "no"
220then
221 ELF_CMT=#
222 MAKEFILE_ELF=/dev/null
223 echo "Disabling ELF shared libraries"
224else
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500225 E2_PKG_CONFIG_STATIC=
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000226 ELF_CMT=
227 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000228 [case "$host_os" in
229 solaris2.*)
230 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
231 ;;
232 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000233 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000234 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000235 echo "Enabling ELF shared libraries"
236fi
237,
238MAKEFILE_ELF=/dev/null
239ELF_CMT=#
240echo "Disabling ELF shared libraries by default"
241)
242AC_SUBST(ELF_CMT)
243AC_SUBST_FILE(MAKEFILE_ELF)
244dnl
245dnl handle --enable-bsd-shlibs
246dnl
247AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000248[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000249if test "$enableval" = "no"
250then
251 BSDLIB_CMT=#
252 MAKEFILE_BSDLIB=/dev/null
253 echo "Disabling BSD shared libraries"
254else
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500255 E2_PKG_CONFIG_STATIC=
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000256 BSDLIB_CMT=
257 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000258 LIB_EXT=.so
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500259 [case "$host_os" in
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -0500260 darwin*)
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500261 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
262 LIB_EXT=.dylib
263 ;;
264 esac]
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000265 echo "Enabling BSD shared libraries"
266fi
267,
268MAKEFILE_BSDLIB=/dev/null
269BSDLIB_CMT=#
270echo "Disabling BSD shared libraries by default"
271)
272AC_SUBST(BSDLIB_CMT)
273AC_SUBST_FILE(MAKEFILE_BSDLIB)
274dnl
275dnl handle --enable-profile
276dnl
277AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000278[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000279if test "$enableval" = "no"
280then
281 PROFILE_CMT=#
282 MAKEFILE_PROFILE=/dev/null
283 echo "Disabling profiling libraries"
284else
285 PROFILE_CMT=
286 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000287 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000288 echo "Building profiling libraries"
289fi
290,
291PROFILE_CMT=#
292MAKEFILE_PROFILE=/dev/null
293echo "Disabling profiling libraries by default"
294)
295AC_SUBST(PROFILE_CMT)
296AC_SUBST_FILE(MAKEFILE_PROFILE)
297dnl
298dnl handle --enable-checker
299dnl
300AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000301[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000302if test "$enableval" = "no"
303then
304 CHECKER_CMT=#
305 MAKEFILE_CHECKER=/dev/null
306 echo "Disabling checker libraries"
307else
308 CHECKER_CMT=
309 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
310 echo "Building checker libraries"
311fi
312,
313CHECKER_CMT=#
314MAKEFILE_CHECKER=/dev/null
315echo "Disabling checker libraries by default"
316)
317AC_SUBST(CHECKER_CMT)
318AC_SUBST_FILE(MAKEFILE_CHECKER)
319dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000320dnl Substitute library extensions
321dnl
322AC_SUBST(LIB_EXT)
323AC_SUBST(STATIC_LIB_EXT)
324AC_SUBST(PROFILED_LIB_EXT)
325dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500326dnl handle --enable-jbd-debug
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000327dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500328AC_ARG_ENABLE([jbd-debug],
329[ --enable-jbd-debug enable journal debugging],
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000330if test "$enableval" = "no"
331then
332 echo "Disabling journal debugging"
333else
Theodore Ts'o8cf93332001-12-16 02:23:36 -0500334 AC_DEFINE(CONFIG_JBD_DEBUG)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000335 echo "Enabling journal debugging"
336fi
337,
338echo "Disabling journal debugging by default"
339)
340dnl
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500341dnl handle --enable-blkid-debug
342dnl
343AC_ARG_ENABLE([blkid-debug],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400344[ --enable-blkid-debug enable blkid debugging],
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500345if test "$enableval" = "no"
346then
347 echo "Disabling blkid debugging"
348else
349 AC_DEFINE(CONFIG_BLKID_DEBUG)
350 echo "Enabling blkid debugging"
351fi
352,
353echo "Disabling blkid debugging by default"
354)
355dnl
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400356dnl handle --enable-testio-debug
357dnl
358AC_ARG_ENABLE([testio-debug],
359[ --enable-testio-debug enable the use of the test I/O manager for debugging],
360if test "$enableval" = "no"
361then
362 echo "Disabling testio debugging"
363else
364 AC_DEFINE(CONFIG_TESTIO_DEBUG)
365 echo "Enabling testio debugging"
366fi
367,
368echo "Disabling testio debugging by default"
369)
370dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000371dnl handle --enable-debugfs
372dnl
373AC_ARG_ENABLE([debugfs],
374[ --disable-debugfs disable support of debugfs program],
375if test "$enableval" = "no"
376then
377 echo "Disabling debugfs support"
378 DEBUGFS_CMT="#"
379else
380 DEBUGFS_CMT=
381 echo "Enabling debugfs support"
382fi
383,
384echo "Enabling debugfs support by default"
385DEBUGFS_CMT=
386)
387AC_SUBST(DEBUGFS_CMT)
388dnl
389dnl handle --enable-imager
390dnl
391AC_ARG_ENABLE([imager],
392[ --disable-imager disable support of e2image program],
393if test "$enableval" = "no"
394then
395 echo "Disabling e2image support"
396 IMAGER_CMT="#"
397else
398 IMAGER_CMT=
399 echo "Enabling e2image support"
400fi
401,
402echo "Enabling e2image support by default"
403IMAGER_CMT=
404)
405AC_SUBST(IMAGER_CMT)
406dnl
407dnl handle --enable-resizer
408dnl
409AC_ARG_ENABLE([resizer],
410[ --disable-resizer disable support of e2resize program],
411if test "$enableval" = "no"
412then
413 echo "Disabling e2resize support"
414 RESIZER_CMT="#"
415else
416 RESIZER_CMT=
417 echo "Enabling e2resize support"
418fi
419,
420echo "Enabling e2resize support by default"
421RESIZER_CMT=
422)
423AC_SUBST(RESIZER_CMT)
424dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000425dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
426dnl
427AC_ARG_ENABLE([fsck],
428[ --enable-fsck build fsck wrapper program],
429[if test "$enableval" = "no"
430then
431 FSCK_PROG='' FSCK_MAN=''
432 echo "Not building fsck wrapper"
433else
434 FSCK_PROG=fsck FSCK_MAN=fsck.8
435 echo "Building fsck wrapper"
436fi]
437,
438[case "$host_os" in
Theodore Ts'oe3632402004-05-04 19:39:54 -0400439 gnu*)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000440 FSCK_PROG='' FSCK_MAN=''
441 echo "Not building fsck wrapper by default"
442 ;;
443 *)
444 FSCK_PROG=fsck FSCK_MAN=fsck.8
445 echo "Building fsck wrapper by default"
446esac]
447)
448AC_SUBST(FSCK_PROG)
449AC_SUBST(FSCK_MAN)
450dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400451dnl See whether to install the `e2initrd-helper' program
452dnl
453AC_ARG_ENABLE([e2initrd-helper],
454[ --enable-e2initrd-helper build e2initrd-helper program],
455[if test "$enableval" = "no"
456then
457 E2INITRD_PROG='' E2INITRD_MAN=''
458 echo "Not building e2initrd helper"
459else
460 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
461 echo "Building e2initrd helper"
462fi]
463,
464E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
465echo "Building e2initrd helper by default"
466)
467AC_SUBST(E2INITRD_PROG)
468AC_SUBST(E2INITRD_MAN)
Karel Zak4db2f592006-03-08 14:17:28 -0500469dnl handle --enable-blkid-devmapper
470dnl
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500471STATIC_BLKID_DEVMAPPER_LIBS=''
Karel Zak4db2f592006-03-08 14:17:28 -0500472AC_ARG_ENABLE([blkid-devmapper],
473[ --enable-blkid-devmapper build with device-mapper support],
474[if test "$enableval" = "no"
475then
476 echo "Disabling device-mapper support"
477 DEVMAPPER_REQ=''
478 DEVMAPPER_LIBS=''
479 STATIC_DEVMAPPER_LIBS=''
480else
481 AC_DEFINE(HAVE_DEVMAPPER)
482 echo "Enabling device-mapper support"
483
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500484 PKG_PROG_PKG_CONFIG()
Karel Zak4db2f592006-03-08 14:17:28 -0500485
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500486 if test -z "$PKG_CONFIG"; then
487 echo "pkg-config not installed; please install it."
488 exit 1;
489 fi
490
491 AC_CHECK_LIB(devmapper, dm_tree_create,
492 [DEVMAPPER_LIBS=`$PKG_CONFIG --libs devmapper`;
493 STATIC_DEVMAPPER_LIBS=`$PKG_CONFIG --static --libs devmapper`;
494 DEVMAPPER_REQ="devmapper";
495 DEVMAPPER_PC_LIBS="-ldevmapper"],
496 [AC_MSG_ERROR([device-mapper library not found])],
497 [$DEVMAPPER_LIBS])
498 # work around stupid devmapper.pc bug in Debian
499 case "$STATIC_DEVMAPPER_LIBS" in
500 *pthread*)
501 ;;
502 *)
503 echo "Working around Debian bug #390243..."
504 STATIC_DEVMAPPER_LIBS="-pthread $STATIC_DEVMAPPER_LIBS"
505 ;;
506 esac
507 if test "$E2_PKG_CONFIG_STATIC" = "--static"; then
508 DEVMAPPER_LIBS="$STATIC_DEVMAPPER_LIBS"
509 STATIC_BLKID_DEVMAPPER_LIBS="$STATIC_DEVMAPPER_LIBS"
510 fi
Karel Zak4db2f592006-03-08 14:17:28 -0500511fi]
512,
513echo "Disabling device-mapper support by default"
514)
515AC_SUBST(DEVMAPPER_REQ)
516AC_SUBST(DEVMAPPER_PC_LIBS)
517AC_SUBST(DEVMAPPER_LIBS)
518AC_SUBST(STATIC_DEVMAPPER_LIBS)
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500519AC_SUBST(STATIC_BLKID_DEVMAPPER_LIBS)
Karel Zak4db2f592006-03-08 14:17:28 -0500520dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400521dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000522dnl
Theodore Ts'o32493942007-12-31 10:45:01 -0500523AC_ARG_ENABLE([tls],
524[ --disable-tls disable use of thread local support],
525[if test "$enableval" = "no"
526then
527 try_tls=""
528 echo "Disabling thread local support"
529else
530 try_tls="yes"
531 echo "Enabling thread local support"
532fi]
533,
Theodore Ts'oeafba6c2008-07-10 10:21:42 -0400534if test -n "$WITH_DIET_LIBC"
535then
536 try_tls=""
537 echo "Diet libc does not support thread local support"
538else
539 try_tls="yes"
540 echo "Try using thread local support by default"
541fi
Theodore Ts'o32493942007-12-31 10:45:01 -0500542)
543if test "$try_tls" = "yes"
544then
545AX_TLS
546fi
547dnl
548dnl
549dnl
Theodore Ts'o5610f992007-12-31 11:16:56 -0500550AC_ARG_ENABLE([uuidd],
551[ --disable-uuidd disable building the uuid daemon],
552[if test "$enableval" = "no"
553then
554 echo "Not building uuidd"
555 UUIDD_CMT="#"
556else
557 AC_DEFINE(USE_UUIDD)
558 UUIDD_CMT=""
559 echo "Building uuidd"
560fi]
561,
562AC_DEFINE(USE_UUIDD)
563UUIDD_CMT=""
564echo "Building uuidd by default"
565)
566AC_SUBST(UUIDD_CMT)
567dnl
568dnl
569dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000570MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
571AC_SUBST_FILE(MAKEFILE_LIBRARY)
572dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000573dnl Add internationalization support, using gettext.
574dnl
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500575GETTEXT_PACKAGE=e2fsprogs
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000576PACKAGE=e2fsprogs
577VERSION="$E2FSPROGS_VERSION"
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500578VERSION=0.14.1
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000579AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
580AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500581AC_SUBST(GETTEXT_PACKAGE)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000582AC_SUBST(PACKAGE)
583AC_SUBST(VERSION)
584
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000585AM_GNU_GETTEXT
586dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000587dnl End of configuration options
588dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000589AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000590AC_PROG_MAKE_SET
591AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000592AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000593AC_PATH_PROG(MV, mv, mv)
594AC_PATH_PROG(CP, cp, cp)
595AC_PATH_PROG(RM, rm, rm)
596AC_PATH_PROG(CHMOD, chmod, :)
Theodore Ts'o32237012005-01-17 19:13:39 -0500597AC_PROG_AWK
598AC_PROG_EGREP
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000599AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000600AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000601AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000602AC_CHECK_TOOL(AR, ar, ar)
603AC_CHECK_TOOL(RANLIB, ranlib, :)
604AC_CHECK_TOOL(STRIP, strip, :)
Manish Katiyar7321d942008-04-14 17:20:03 +0530605AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, )
606if test "_$MAKEINFO" = "_"; then
607 MAKEINFO="@echo Makeinfo is missing. Info documentation will not be built.;true"
608else
609 case "$MAKEINFO" in
610 */missing.*)
611 AC_MSG_WARN([
612*** Makeinfo is missing. Info documentation will not be built.])
613 ;;
614 *)
615 ;;
616 esac
617fi
618AC_SUBST(MAKEINFO)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000619AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000620# See if we need a separate native compiler.
621if test $cross_compiling = no; then
622 BUILD_CC="$CC"
623 AC_SUBST(BUILD_CC)
624else
625 AC_CHECK_PROGS(BUILD_CC, gcc cc)
626fi
Christophe GRENIERe7cc6f72008-02-16 12:10:56 +0100627AC_CHECK_HEADERS(dirent.h errno.h getopt.h malloc.h mntent.h paths.h setjmp.h signal.h stdarg.h stdint.h stdlib.h termios.h unistd.h utime.h linux/fd.h linux/major.h net/if_dl.h netinet/in.h sys/disklabel.h sys/ioctl.h sys/mkdev.h sys/mman.h sys/prctl.h sys/queue.h sys/resource.h sys/select.h sys/socket.h sys/sockio.h sys/stat.h sys/syscall.h sys/sysmacros.h sys/time.h sys/types.h sys/un.h sys/wait.h)
Theodore Ts'oda76d6b2005-01-18 23:29:01 -0500628AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
629[[
630#if HAVE_SYS_QUEUE_H
631#include <sys/queue.h>
632#endif
633]])
634AC_CHECK_HEADERS(net/if.h,,,
635[[
636#if HAVE_SYS_TYPES_H
637#include <sys/types.h>
638#endif
639#if HAVE_SYS_SOCKET
640#include <sys/socket.h>
641#endif
642]])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000643AC_FUNC_VPRINTF
Theodore Ts'offf45482003-04-13 00:44:19 -0400644dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
645dnl is not decleared.
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500646AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT)],,
647 [#include <dirent.h>])
Theodore Ts'offf45482003-04-13 00:44:19 -0400648dnl Check to see if ssize_t was decleared
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500649AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T)],,
650 [#include <sys/types.h>])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000651dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000652dnl Check to see if llseek() is declared in unistd.h. On some libc's
653dnl it is, and on others it isn't..... Thank you glibc developers....
654dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500655AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)],,
656 [#include <unistd.h>])
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000657dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000658dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
659dnl are so convoluted that I can't tell whether it will always be defined,
660dnl and if it isn't defined while lseek64 is defined in the library,
661dnl disaster will strike.
662dnl
663dnl Warning! Use of --enable-gcc-wall may throw off this test.
664dnl
665dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500666AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)],,
667 [#define _LARGEFILE_SOURCE
668 #define _LARGEFILE64_SOURCE
669 #include <unistd.h>])
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000670dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000671dnl Word sizes...
672dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000673AC_CHECK_SIZEOF(short)
674AC_CHECK_SIZEOF(int)
675AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000676AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000677SIZEOF_SHORT=$ac_cv_sizeof_short
678SIZEOF_INT=$ac_cv_sizeof_int
679SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000680SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000681AC_SUBST(SIZEOF_SHORT)
682AC_SUBST(SIZEOF_INT)
683AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000684AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000685AC_C_BIGENDIAN
Theodore Ts'o29a5dee2007-07-04 16:28:47 -0400686BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400687ASM_TYPES_HEADER=./asm_types.h
688AC_SUBST_FILE(ASM_TYPES_HEADER)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000689dnl
Theodore Ts'o488c75a2008-06-07 08:55:21 -0400690dnl Save the configuration #defines needed for the public ext2fs.h
691dnl header file
692dnl
693echo "/* These defines are needed for the public ext2fs.h header file */" \
694 > public_config.h
695if grep HAVE_SYS_TYPES_H confdefs.h > tmp_config.$$; then
696 uniq tmp_config.$$ >> public_config.h
697else
698 echo "#undef HAVE_SYS_TYPES_H" >> public_config.h
699fi
700if grep WORDS_BIGENDIAN confdefs.h > tmp_config.$$; then
701 uniq tmp_config.$$ >> public_config.h
702else
703 echo "#undef WORDS_BIGENDIAN" >> public_config.h
704fi
705rm -f tmp_config.$$
706PUBLIC_CONFIG_HEADER=./public_config.h
707AC_SUBST_FILE(PUBLIC_CONFIG_HEADER)
708dnl
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400709dnl See if we have inttypes.h and if intptr_t is defined
710dnl
711AC_CHECK_HEADERS([inttypes.h])
Theodore Ts'od2ee56d2005-01-09 00:57:45 -0500712AC_CHECK_TYPES(intptr_t)
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400713dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000714dnl See if struct stat has a st_flags field, in which case we can get file
715dnl flags somewhat portably. Also check for the analogous setter, chflags().
716dnl
717AC_MSG_CHECKING(whether struct stat has a st_flags field)
718AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
719 AC_TRY_COMPILE([#include <sys/stat.h>],
720 [struct stat stat; stat.st_flags = 0;],
721 [e2fsprogs_cv_struct_st_flags=yes],
722 [e2fsprogs_cv_struct_st_flags=no]))
723AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
724if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000725 AC_MSG_CHECKING(whether st_flags field is useful)
726 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
727 AC_TRY_COMPILE([#include <sys/stat.h>],
728 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
729 [e2fsprogs_cv_struct_st_flags_immut=yes],
730 [e2fsprogs_cv_struct_st_flags_immut=no]))
731 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
732 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
733 AC_DEFINE(HAVE_STAT_FLAGS)
734 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000735fi
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500736dnl
737dnl Check for the presence of SA_LEN
738dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500739AC_CHECK_MEMBER(struct sockaddr.sa_len,
740 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
741 [#include <sys/types.h>
742 #include <sys/socket.h>])
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500743dnl
Theodore Ts'o261cd392008-01-21 13:45:00 -0500744AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000745dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000746dnl Check to see if -lsocket is required (solaris) to make something
747dnl that uses socket() to compile; this is needed for the UUID library
748dnl
749SOCKET_LIB=''
750AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
751AC_SUBST(SOCKET_LIB)
752dnl
Theodore Ts'o3ae497e2003-03-16 06:26:25 -0500753dnl Check to see if libdl exists for the sake of dlopen
754dnl
755DLOPEN_LIB=''
756AC_CHECK_LIB(dl, dlopen,
757[DLOPEN_LIB=-ldl
758AC_DEFINE(HAVE_DLOPEN)])
759AC_SUBST(DLOPEN_LIB)
760dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000761dnl See if optreset exists
762dnl
763AC_MSG_CHECKING(for optreset)
764AC_CACHE_VAL(ac_cv_have_optreset,
765[AC_EGREP_HEADER(optreset, unistd.h,
766 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
767AC_MSG_RESULT($ac_cv_have_optreset)
768if test $ac_cv_have_optreset = yes; then
769 AC_DEFINE(HAVE_OPTRESET)
770fi
771dnl
Theodore Ts'oe54635d2006-08-06 14:33:13 -0400772dnl Check for unified diff
773dnl
774AC_MSG_CHECKING(for unified diff option)
Theodore Ts'o27f991b2008-04-01 20:32:55 -0400775if diff -u $0 $0 > /dev/null 2>&1 ; then
Theodore Ts'oe54635d2006-08-06 14:33:13 -0400776 UNI_DIFF_OPTS=-u
777else
778 UNI_DIFF_OPTS=-c
779fi
780AC_MSG_RESULT($UNI_DIFF_OPTS)
781AC_SUBST(UNI_DIFF_OPTS)
782dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000783dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000784dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000785case "$host_os" in
786linux*)
787 AC_DEFINE(HAVE_EXT2_IOCTLS)
788 ;;
789esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000790dnl
Theodore Ts'offf45482003-04-13 00:44:19 -0400791dnl OS-specific uncomment control
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400792dnl
793LINUX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400794CYGWIN_CMT="#"
795UNIX_CMT=
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400796case "$host_os" in
797linux*)
798 LINUX_CMT=
799 ;;
Theodore Ts'offf45482003-04-13 00:44:19 -0400800cygwin)
801 CYGWIN_CMT=
802 UNIX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400803 ;;
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400804esac
805AC_SUBST(LINUX_CMT)
Theodore Ts'offf45482003-04-13 00:44:19 -0400806AC_SUBST(CYGWIN_CMT)
807AC_SUBST(UNIX_CMT)
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400808dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000809dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000810dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000811case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400812linux* | gnu* | k*bsd*-gnu)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000813 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
814 root_prefix="";
815 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000816 fi
817 ;;
818esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000819dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000820dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000821dnl
822case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400823linux* | gnu* | k*bsd*-gnu)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000824 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000825 prefix="/usr";
826 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'obff61a72002-05-21 22:21:38 -0400827 if test "$mandir" = '${prefix}/man' ; then
828 echo "...and mandir defaults to /usr/share/man"
829 mandir=/usr/share/man
830 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000831 fi
832;;
833esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000834if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000835 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000836 root_prefix="$ac_default_prefix"
837 else
838 root_prefix="$prefix"
839 fi
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400840 root_bindir=$bindir
841 root_sbindir=$sbindir
842 root_libdir=$libdir
843 root_sysconfdir=$sysconfdir
844else
845 root_bindir='${root_prefix}/bin'
846 root_sbindir='${root_prefix}/sbin'
847 root_libdir='${root_prefix}/lib'
848 root_sysconfdir='${root_prefix}/etc'
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000849fi
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500850if test "$bindir" != '${exec_prefix}/bin'; then
851 root_bindir=$bindir
852 echo "Setting root_bindir to $root_bindir"
853fi
854if test "$sbindir" != '${exec_prefix}/sbin'; then
855 root_sbindir=$sbindir
856 echo "Setting root_sbindir to $root_sbindir"
857fi
858if test "$libdir" != '${exec_prefix}/lib'; then
859 root_libdir=$libdir
860 echo "Setting root_libdir to $root_libdir"
861fi
862if test "$sysconfdir" != '${prefix}/etc'; then
863 root_sysconfdir=$sysconfdir
864 echo "Setting root_sysconfdir to $root_sysconfdir"
865fi
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000866AC_SUBST(root_prefix)
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400867AC_SUBST(root_bindir)
868AC_SUBST(root_sbindir)
869AC_SUBST(root_libdir)
870AC_SUBST(root_sysconfdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000871dnl
872dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000873dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000874AC_MSG_CHECKING([whether linker accepts -static])
875AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
876[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
877AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
878 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
879LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000880dnl
881dnl Regardless of how the test turns out, Solaris doesn't handle -static
882dnl This is caused by the socket library requiring the nsl library, which
883dnl requires the -dl library, which only works for dynamically linked
884dnl programs. It basically means you can't have statically linked programs
885dnl which use the network under Solaris.
886dnl
887case "$host_os" in
888solaris2.*)
889 ac_cv_e2fsprogs_use_static=no
890;;
891esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000892AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000893LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000894if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000895 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000896fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000897AC_SUBST(LDFLAG_STATIC)
898dnl
Theodore Ts'o07a0db12003-07-05 14:50:24 -0400899dnl Work around mysterious Darwin / GNU libintl problem
900dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
901dnl Apple hacked gcc somehow?)
902dnl
903case "$host_os" in
904darwin*)
905 echo "Using Apple Darwin / GNU libintl workaround"
906 AC_DEFINE(_INTL_REDIRECT_MACROS)
907 ;;
908esac
909dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000910dnl Make the ss and et directories work correctly.
911dnl
912SS_DIR=`cd ${srcdir}/lib/ss; pwd`
913ET_DIR=`cd ${srcdir}/lib/et; pwd`
914AC_SUBST(SS_DIR)
915AC_SUBST(ET_DIR)
916dnl
917dnl Only try to run the test suite if we're not cross compiling.
918dnl
919if test "$cross_compiling" = yes ; then
920 DO_TEST_SUITE=
921else
922 DO_TEST_SUITE=check
923fi
924AC_SUBST(DO_TEST_SUITE)
925dnl
Theodore Ts'oc6f35b82003-05-17 16:29:27 -0400926dnl Only include the intl include files if we're building with them
927dnl
928INTL_FLAGS=
929if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
930 INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
931fi
932AC_SUBST(INTL_FLAGS)
933dnl
Theodore Ts'odd947da2005-11-09 18:37:07 -0400934dnl Build CFLAGS
935dnl
936if test $cross_compiling = no; then
937 BUILD_CFLAGS="$CFLAGS"
938 BUILD_LDFLAGS="$LDFLAGS"
939else
940 BUILD_CFLAGS=
941 BUILD_LDFLAGS=
942fi
943AC_SUBST(BUILD_CFLAGS)
944AC_SUBST(BUILD_LDFLAGS)
945dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000946dnl Make our output files, being sure that we create the some miscellaneous
947dnl directories
948dnl
949test -d lib || mkdir lib
950test -d include || mkdir include
951test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000952test -d include/asm || mkdir include/asm
Theodore Ts'obff0cc92003-03-23 01:37:53 -0500953for i in MCONFIG Makefile e2fsprogs.spec \
954 util/Makefile util/subst.conf util/gen-tarball \
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400955 lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
956 lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500957 lib/uuid/Makefile lib/uuid/uuid_types.h \
958 lib/blkid/Makefile lib/blkid/blkid_types.h \
Theodore Ts'oe6441862005-01-26 12:59:25 -0500959 lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
960 lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
Theodore Ts'o921f4ad2004-11-19 17:25:27 -0500961 misc/Makefile ext2ed/Makefile e2fsck/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500962 debugfs/Makefile tests/Makefile tests/progs/Makefile \
963 resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do
964 if test -d `dirname ${srcdir}/$i` ; then
965 outlist="$outlist $i"
966 fi
967done
968AC_OUTPUT($outlist)
Theodore Ts'oee683a12005-02-05 15:53:56 -0500969if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi
970