blob: 333d158579b9764ac901a57c75abda88daa9292c [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'od69e7e22008-02-15 21:28:48 -050049 pre_vers=`echo $base_ver 0.01 - p | dc`
Andreas Dilger927566a2006-11-12 19:41:25 -050050 E2FSPROGS_PKGVER="$pre_vers+${base_ver}_WIP_$date_spec"
51 ;;
52*)
53 E2FSPROGS_PKGVER="$base_ver"
54 ;;
55esac
56
57unset DATE MONTH YEAR base_ver pre_vers date_spec
Theodore Ts'o74becf31997-04-26 14:37:06 +000058echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
59echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
60AC_SUBST(E2FSPROGS_YEAR)
61AC_SUBST(E2FSPROGS_MONTH)
Theodore Ts'obff0cc92003-03-23 01:37:53 -050062AC_SUBST(E2FSPROGS_DAY)
Theodore Ts'o74becf31997-04-26 14:37:06 +000063AC_SUBST(E2FSPROGS_VERSION)
Andreas Dilger927566a2006-11-12 19:41:25 -050064AC_SUBST(E2FSPROGS_PKGVER)
Theodore Ts'oea97be52001-09-19 15:20:12 -040065AC_CANONICAL_HOST
Theodore Ts'o74becf31997-04-26 14:37:06 +000066dnl
Theodore Ts'od21ae6c2003-05-05 09:00:24 -040067dnl Use diet libc
68dnl
69AC_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'od21ae6c2003-05-05 09:00:24 -040072AC_MSG_RESULT(CC=$CC))dnl
73dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +000074dnl set $(CC) from --with-cc=value
75dnl
76AC_ARG_WITH([cc],
77[ --with-cc=COMPILER select compiler to use],
78AC_MSG_RESULT(CC=$withval)
79CC=$withval,
80if test -z "$CC" ; then CC=cc; fi
81[AC_MSG_RESULT(CC defaults to $CC)])dnl
82export CC
83AC_SUBST([CC])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +000084AC_PROG_CC
Theodore Ts'o29a5dee2007-07-04 16:28:47 -040085AC_PROG_CPP
Theodore Ts'o74becf31997-04-26 14:37:06 +000086dnl
87dnl set $(LD) from --with-linker=value
88dnl
89AC_ARG_WITH([linker],
90[ --with-linker=LINKER select linker to use],
91AC_MSG_RESULT(LD=$withval)
92LD=$withval,
93if test -z "$LD" ; then LD=$CC; fi
94[AC_MSG_RESULT(LD defaults to $LD)])dnl
95export LD
96AC_SUBST([LD])
97dnl
98dnl set $(CCOPTS) from --with-ccopts=value
99dnl
100AC_ARG_WITH([ccopts],
101[ --with-ccopts=CCOPTS select compiler command line options],
102AC_MSG_RESULT(CCOPTS is $withval)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000103CFLAGS=$withval,
104)dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000105dnl
Theodore Ts'of8bd9801999-10-26 04:19:45 +0000106dnl On systems without linux header files, we add an extra include directory
107dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
108dnl is quoted so that it gets expanded by make, not by configure.
109dnl
110AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
Theodore Ts'o73ae2d42000-02-02 16:13:14 +0000111if test "$linux_headers" != yes; then
112 LINUX_INCLUDE='-I$(top_builddir)/include'
Theodore Ts'of8bd9801999-10-26 04:19:45 +0000113fi
114AC_SUBST(LINUX_INCLUDE)
115dnl
Matthias Andreeb1c92f92004-02-23 21:30:11 +0100116dnl Alpha computers use fast and imprecise floating point code that may
117dnl miss exceptions by default. Force sane options if we're using GCC.
118AC_MSG_CHECKING(for additional special compiler flags)
119if test "$GCC" = yes
120then
121 case "$host_cpu" in
122 alpha) addcflags="-mieee" ;;
123 esac
124fi
125if test "x$addcflags" != x
126then
127 AC_MSG_RESULT($addcflags)
128 CFLAGS="$addcflags $CFLAGS"
129else
130 AC_MSG_RESULT([[(none)]])
131fi
132dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000133dnl Set default values for library extentions. Will be dealt with after
134dnl parsing configuration opions, which may modify these
135dnl
136LIB_EXT=.a
137STATIC_LIB_EXT=.a
138PROFILE_LIB_EXT=.a
139dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000140dnl set $(LDFLAGS) from --with-ldopts=value
141dnl
142AC_ARG_WITH([ldopts],
143[ --with-ldopts=LDOPTS select linker command line options],
144AC_MSG_RESULT(LDFLAGS is $withval)
145LDFLAGS=$withval,
146LDFLAGS=)dnl
147AC_SUBST(LDFLAGS)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000148dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000149dnl Allow separate `root_prefix' to be specified
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000150dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000151AC_ARG_WITH([root-prefix],
152[ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
153root_prefix=$withval,
154root_prefix=NONE)dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000155dnl
Theodore Ts'o98919bd2005-02-04 10:43:58 -0500156dnl handle --enable-maintainer-mode
157dnl
158AC_ARG_ENABLE([maintainer-mode],
159[ --enable-maintainer-mode enable makefile rules useful for maintainers],
160if test "$enableval" = "no"
161then
162 MAINTAINER_CMT=#
163 echo "Disabling maintainer mode"
164else
165 MAINTAINER_CMT=
166 echo "Enabling maintainer mode"
167fi
168,
169MAINTAINER_CMT=#
170echo "Disabling maintainer mode by default"
171)
172AC_SUBST(MAINTAINER_CMT)
173dnl
Theodore Ts'o19178752000-02-11 15:55:07 +0000174dnl handle --enable-compression
175dnl
176AC_ARG_ENABLE([compression],
177[ --enable-compression enable EXPERIMENTAL compression support],
178if test "$enableval" = "no"
179then
180 echo "Disabling compression support"
181else
182 AC_DEFINE(ENABLE_COMPRESSION)
183 echo "Enabling compression support"
184 echo "WARNING: Compression support is experimental"
185fi
186,
187echo "Disabling compression support by default"
188)
189dnl
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400190dnl handle --enable-htree
191dnl
192AC_ARG_ENABLE([htree],
193[ --enable-htree enable EXPERIMENTAL htree directory support],
194if test "$enableval" = "no"
195then
196 HTREE_CMT=#
197 echo "Disabling htree directory support"
198else
199 HTREE_CMT=
200 AC_DEFINE(ENABLE_HTREE)
201 echo "Enabling htree directory support"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400202fi
203,
Theodore Ts'o559ca6c2002-08-18 03:48:55 -0400204HTREE_CMT=
205AC_DEFINE(ENABLE_HTREE)
206echo "Enabling htree directory support by default"
Theodore Ts'o8fdc9982002-06-25 23:26:34 -0400207)
208AC_SUBST(HTREE_CMT)
209dnl
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500210dnl This needs to be before all of the --enable-*-shlibs options
211dnl
212E2_PKG_CONFIG_STATIC=--static
213dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000214dnl handle --enable-elf-shlibs
215dnl
216AC_ARG_ENABLE([elf-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000217[ --enable-elf-shlibs select ELF shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000218if test "$enableval" = "no"
219then
220 ELF_CMT=#
221 MAKEFILE_ELF=/dev/null
222 echo "Disabling ELF shared libraries"
223else
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500224 E2_PKG_CONFIG_STATIC=
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000225 ELF_CMT=
226 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
Theodore Ts'of5955dd2000-10-25 02:38:39 +0000227 [case "$host_os" in
228 solaris2.*)
229 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
230 ;;
231 esac]
Theodore Ts'o74becf31997-04-26 14:37:06 +0000232 BINARY_TYPE=elfbin
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000233 LIB_EXT=.so
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000234 echo "Enabling ELF shared libraries"
235fi
236,
237MAKEFILE_ELF=/dev/null
238ELF_CMT=#
239echo "Disabling ELF shared libraries by default"
240)
241AC_SUBST(ELF_CMT)
242AC_SUBST_FILE(MAKEFILE_ELF)
243dnl
244dnl handle --enable-bsd-shlibs
245dnl
246AC_ARG_ENABLE([bsd-shlibs],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000247[ --enable-bsd-shlibs select BSD shared libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000248if test "$enableval" = "no"
249then
250 BSDLIB_CMT=#
251 MAKEFILE_BSDLIB=/dev/null
252 echo "Disabling BSD shared libraries"
253else
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500254 E2_PKG_CONFIG_STATIC=
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000255 BSDLIB_CMT=
256 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000257 LIB_EXT=.so
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500258 [case "$host_os" in
Theodore Ts'oaa75ecc2003-03-17 10:01:22 -0500259 darwin*)
Theodore Ts'oe71d8732003-03-14 02:13:48 -0500260 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
261 LIB_EXT=.dylib
262 ;;
263 esac]
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000264 echo "Enabling BSD shared libraries"
265fi
266,
267MAKEFILE_BSDLIB=/dev/null
268BSDLIB_CMT=#
269echo "Disabling BSD shared libraries by default"
270)
271AC_SUBST(BSDLIB_CMT)
272AC_SUBST_FILE(MAKEFILE_BSDLIB)
273dnl
274dnl handle --enable-profile
275dnl
276AC_ARG_ENABLE([profile],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000277[ --enable-profile build profiling libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000278if test "$enableval" = "no"
279then
280 PROFILE_CMT=#
281 MAKEFILE_PROFILE=/dev/null
282 echo "Disabling profiling libraries"
283else
284 PROFILE_CMT=
285 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000286 PROFILED_LIB_EXT=_p.a
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000287 echo "Building profiling libraries"
288fi
289,
290PROFILE_CMT=#
291MAKEFILE_PROFILE=/dev/null
292echo "Disabling profiling libraries by default"
293)
294AC_SUBST(PROFILE_CMT)
295AC_SUBST_FILE(MAKEFILE_PROFILE)
296dnl
297dnl handle --enable-checker
298dnl
299AC_ARG_ENABLE([checker],
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000300[ --enable-checker build checker libraries],
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000301if test "$enableval" = "no"
302then
303 CHECKER_CMT=#
304 MAKEFILE_CHECKER=/dev/null
305 echo "Disabling checker libraries"
306else
307 CHECKER_CMT=
308 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
309 echo "Building checker libraries"
310fi
311,
312CHECKER_CMT=#
313MAKEFILE_CHECKER=/dev/null
314echo "Disabling checker libraries by default"
315)
316AC_SUBST(CHECKER_CMT)
317AC_SUBST_FILE(MAKEFILE_CHECKER)
318dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000319dnl Substitute library extensions
320dnl
321AC_SUBST(LIB_EXT)
322AC_SUBST(STATIC_LIB_EXT)
323AC_SUBST(PROFILED_LIB_EXT)
324dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500325dnl handle --enable-jbd-debug
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000326dnl
Theodore Ts'o782bebf2002-11-08 18:46:45 -0500327AC_ARG_ENABLE([jbd-debug],
328[ --enable-jbd-debug enable journal debugging],
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000329if test "$enableval" = "no"
330then
331 echo "Disabling journal debugging"
332else
Theodore Ts'o8cf93332001-12-16 02:23:36 -0500333 AC_DEFINE(CONFIG_JBD_DEBUG)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000334 echo "Enabling journal debugging"
335fi
336,
337echo "Disabling journal debugging by default"
338)
339dnl
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500340dnl handle --enable-blkid-debug
341dnl
342AC_ARG_ENABLE([blkid-debug],
Theodore Ts'od21ae6c2003-05-05 09:00:24 -0400343[ --enable-blkid-debug enable blkid debugging],
Theodore Ts'of0a22d02003-02-22 13:19:53 -0500344if test "$enableval" = "no"
345then
346 echo "Disabling blkid debugging"
347else
348 AC_DEFINE(CONFIG_BLKID_DEBUG)
349 echo "Enabling blkid debugging"
350fi
351,
352echo "Disabling blkid debugging by default"
353)
354dnl
Theodore Ts'o2a29f132003-05-05 12:08:47 -0400355dnl handle --enable-testio-debug
356dnl
357AC_ARG_ENABLE([testio-debug],
358[ --enable-testio-debug enable the use of the test I/O manager for debugging],
359if test "$enableval" = "no"
360then
361 echo "Disabling testio debugging"
362else
363 AC_DEFINE(CONFIG_TESTIO_DEBUG)
364 echo "Enabling testio debugging"
365fi
366,
367echo "Disabling testio debugging by default"
368)
369dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000370dnl handle --enable-swapfs
371dnl
372AC_ARG_ENABLE([swapfs],
373[ --disable-swapfs disable support of legacy byte-swapped filesystems],
374if test "$enableval" = "no"
375then
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500376 SWAPFS_CMT=#
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000377 echo "Disabling swapfs support"
378else
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500379 SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000380 AC_DEFINE(ENABLE_SWAPFS)
381 echo "Enabling swapfs support"
382fi
383,
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500384SWAPFS_CMT=
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000385echo "Enabling swapfs support by default"
386AC_DEFINE(ENABLE_SWAPFS)
387)
Theodore Ts'ofeb44c62002-11-08 14:55:38 -0500388AC_SUBST(SWAPFS_CMT)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000389dnl
390dnl handle --enable-debugfs
391dnl
392AC_ARG_ENABLE([debugfs],
393[ --disable-debugfs disable support of debugfs program],
394if test "$enableval" = "no"
395then
396 echo "Disabling debugfs support"
397 DEBUGFS_CMT="#"
398else
399 DEBUGFS_CMT=
400 echo "Enabling debugfs support"
401fi
402,
403echo "Enabling debugfs support by default"
404DEBUGFS_CMT=
405)
406AC_SUBST(DEBUGFS_CMT)
407dnl
408dnl handle --enable-imager
409dnl
410AC_ARG_ENABLE([imager],
411[ --disable-imager disable support of e2image program],
412if test "$enableval" = "no"
413then
414 echo "Disabling e2image support"
415 IMAGER_CMT="#"
416else
417 IMAGER_CMT=
418 echo "Enabling e2image support"
419fi
420,
421echo "Enabling e2image support by default"
422IMAGER_CMT=
423)
424AC_SUBST(IMAGER_CMT)
425dnl
426dnl handle --enable-resizer
427dnl
428AC_ARG_ENABLE([resizer],
429[ --disable-resizer disable support of e2resize program],
430if test "$enableval" = "no"
431then
432 echo "Disabling e2resize support"
433 RESIZER_CMT="#"
434else
435 RESIZER_CMT=
436 echo "Enabling e2resize support"
437fi
438,
439echo "Enabling e2resize support by default"
440RESIZER_CMT=
441)
442AC_SUBST(RESIZER_CMT)
443dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000444dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
445dnl
446AC_ARG_ENABLE([fsck],
447[ --enable-fsck build fsck wrapper program],
448[if test "$enableval" = "no"
449then
450 FSCK_PROG='' FSCK_MAN=''
451 echo "Not building fsck wrapper"
452else
453 FSCK_PROG=fsck FSCK_MAN=fsck.8
454 echo "Building fsck wrapper"
455fi]
456,
457[case "$host_os" in
Theodore Ts'oe3632402004-05-04 19:39:54 -0400458 gnu*)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000459 FSCK_PROG='' FSCK_MAN=''
460 echo "Not building fsck wrapper by default"
461 ;;
462 *)
463 FSCK_PROG=fsck FSCK_MAN=fsck.8
464 echo "Building fsck wrapper by default"
465esac]
466)
467AC_SUBST(FSCK_PROG)
468AC_SUBST(FSCK_MAN)
469dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400470dnl See whether to install the `e2initrd-helper' program
471dnl
472AC_ARG_ENABLE([e2initrd-helper],
473[ --enable-e2initrd-helper build e2initrd-helper program],
474[if test "$enableval" = "no"
475then
476 E2INITRD_PROG='' E2INITRD_MAN=''
477 echo "Not building e2initrd helper"
478else
479 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
480 echo "Building e2initrd helper"
481fi]
482,
483E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
484echo "Building e2initrd helper by default"
485)
486AC_SUBST(E2INITRD_PROG)
487AC_SUBST(E2INITRD_MAN)
Karel Zak4db2f592006-03-08 14:17:28 -0500488dnl handle --enable-blkid-devmapper
489dnl
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500490STATIC_BLKID_DEVMAPPER_LIBS=''
Karel Zak4db2f592006-03-08 14:17:28 -0500491AC_ARG_ENABLE([blkid-devmapper],
492[ --enable-blkid-devmapper build with device-mapper support],
493[if test "$enableval" = "no"
494then
495 echo "Disabling device-mapper support"
496 DEVMAPPER_REQ=''
497 DEVMAPPER_LIBS=''
498 STATIC_DEVMAPPER_LIBS=''
499else
500 AC_DEFINE(HAVE_DEVMAPPER)
501 echo "Enabling device-mapper support"
502
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500503 PKG_PROG_PKG_CONFIG()
Karel Zak4db2f592006-03-08 14:17:28 -0500504
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500505 if test -z "$PKG_CONFIG"; then
506 echo "pkg-config not installed; please install it."
507 exit 1;
508 fi
509
510 AC_CHECK_LIB(devmapper, dm_tree_create,
511 [DEVMAPPER_LIBS=`$PKG_CONFIG --libs devmapper`;
512 STATIC_DEVMAPPER_LIBS=`$PKG_CONFIG --static --libs devmapper`;
513 DEVMAPPER_REQ="devmapper";
514 DEVMAPPER_PC_LIBS="-ldevmapper"],
515 [AC_MSG_ERROR([device-mapper library not found])],
516 [$DEVMAPPER_LIBS])
517 # work around stupid devmapper.pc bug in Debian
518 case "$STATIC_DEVMAPPER_LIBS" in
519 *pthread*)
520 ;;
521 *)
522 echo "Working around Debian bug #390243..."
523 STATIC_DEVMAPPER_LIBS="-pthread $STATIC_DEVMAPPER_LIBS"
524 ;;
525 esac
526 if test "$E2_PKG_CONFIG_STATIC" = "--static"; then
527 DEVMAPPER_LIBS="$STATIC_DEVMAPPER_LIBS"
528 STATIC_BLKID_DEVMAPPER_LIBS="$STATIC_DEVMAPPER_LIBS"
529 fi
Karel Zak4db2f592006-03-08 14:17:28 -0500530fi]
531,
532echo "Disabling device-mapper support by default"
533)
534AC_SUBST(DEVMAPPER_REQ)
535AC_SUBST(DEVMAPPER_PC_LIBS)
536AC_SUBST(DEVMAPPER_LIBS)
537AC_SUBST(STATIC_DEVMAPPER_LIBS)
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500538AC_SUBST(STATIC_BLKID_DEVMAPPER_LIBS)
Karel Zak4db2f592006-03-08 14:17:28 -0500539dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400540dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000541dnl
Theodore Ts'o32493942007-12-31 10:45:01 -0500542AC_ARG_ENABLE([tls],
543[ --disable-tls disable use of thread local support],
544[if test "$enableval" = "no"
545then
546 try_tls=""
547 echo "Disabling thread local support"
548else
549 try_tls="yes"
550 echo "Enabling thread local support"
551fi]
552,
553try_tls="yes"
554echo "Try using thread local support by default"
555)
556if test "$try_tls" = "yes"
557then
558AX_TLS
559fi
560dnl
561dnl
562dnl
Theodore Ts'o5610f992007-12-31 11:16:56 -0500563AC_ARG_ENABLE([uuidd],
564[ --disable-uuidd disable building the uuid daemon],
565[if test "$enableval" = "no"
566then
567 echo "Not building uuidd"
568 UUIDD_CMT="#"
569else
570 AC_DEFINE(USE_UUIDD)
571 UUIDD_CMT=""
572 echo "Building uuidd"
573fi]
574,
575AC_DEFINE(USE_UUIDD)
576UUIDD_CMT=""
577echo "Building uuidd by default"
578)
579AC_SUBST(UUIDD_CMT)
580dnl
581dnl
582dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000583MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
584AC_SUBST_FILE(MAKEFILE_LIBRARY)
585dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000586dnl Add internationalization support, using gettext.
587dnl
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500588GETTEXT_PACKAGE=e2fsprogs
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000589PACKAGE=e2fsprogs
590VERSION="$E2FSPROGS_VERSION"
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500591VERSION=0.14.1
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000592AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
593AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500594AC_SUBST(GETTEXT_PACKAGE)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000595AC_SUBST(PACKAGE)
596AC_SUBST(VERSION)
597
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000598AM_GNU_GETTEXT
599dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000600dnl End of configuration options
601dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000602AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000603AC_PROG_MAKE_SET
604AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000605AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000606AC_PATH_PROG(MV, mv, mv)
607AC_PATH_PROG(CP, cp, cp)
608AC_PATH_PROG(RM, rm, rm)
609AC_PATH_PROG(CHMOD, chmod, :)
Theodore Ts'o32237012005-01-17 19:13:39 -0500610AC_PROG_AWK
611AC_PROG_EGREP
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000612AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000613AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000614AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000615AC_CHECK_TOOL(AR, ar, ar)
616AC_CHECK_TOOL(RANLIB, ranlib, :)
617AC_CHECK_TOOL(STRIP, strip, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000618AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000619# See if we need a separate native compiler.
620if test $cross_compiling = no; then
621 BUILD_CC="$CC"
622 AC_SUBST(BUILD_CC)
623else
624 AC_CHECK_PROGS(BUILD_CC, gcc cc)
625fi
Christophe GRENIERe7cc6f72008-02-16 12:10:56 +0100626AC_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 -0500627AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
628[[
629#if HAVE_SYS_QUEUE_H
630#include <sys/queue.h>
631#endif
632]])
633AC_CHECK_HEADERS(net/if.h,,,
634[[
635#if HAVE_SYS_TYPES_H
636#include <sys/types.h>
637#endif
638#if HAVE_SYS_SOCKET
639#include <sys/socket.h>
640#endif
641]])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000642AC_FUNC_VPRINTF
Theodore Ts'offf45482003-04-13 00:44:19 -0400643dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
644dnl is not decleared.
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500645AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT)],,
646 [#include <dirent.h>])
Theodore Ts'offf45482003-04-13 00:44:19 -0400647dnl Check to see if ssize_t was decleared
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500648AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T)],,
649 [#include <sys/types.h>])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000650dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000651dnl Check to see if llseek() is declared in unistd.h. On some libc's
652dnl it is, and on others it isn't..... Thank you glibc developers....
653dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500654AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)],,
655 [#include <unistd.h>])
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000656dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000657dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
658dnl are so convoluted that I can't tell whether it will always be defined,
659dnl and if it isn't defined while lseek64 is defined in the library,
660dnl disaster will strike.
661dnl
662dnl Warning! Use of --enable-gcc-wall may throw off this test.
663dnl
664dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500665AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)],,
666 [#define _LARGEFILE_SOURCE
667 #define _LARGEFILE64_SOURCE
668 #include <unistd.h>])
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000669dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000670dnl Word sizes...
671dnl
672if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
673 # if cross-compiling, with no cached values, just assume something common.
674 ac_cv_sizeof_short=2
675 ac_cv_sizeof_int=4
676 ac_cv_sizeof_long=4
Theodore Ts'o6c133521999-07-03 20:37:03 +0000677 ac_cv_sizeof_long_long=8
678 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 +0000679fi
680AC_CHECK_SIZEOF(short)
681AC_CHECK_SIZEOF(int)
682AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000683AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000684SIZEOF_SHORT=$ac_cv_sizeof_short
685SIZEOF_INT=$ac_cv_sizeof_int
686SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000687SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000688AC_SUBST(SIZEOF_SHORT)
689AC_SUBST(SIZEOF_INT)
690AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000691AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000692AC_C_BIGENDIAN
Theodore Ts'o29a5dee2007-07-04 16:28:47 -0400693BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400694ASM_TYPES_HEADER=./asm_types.h
695AC_SUBST_FILE(ASM_TYPES_HEADER)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000696dnl
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400697dnl See if we have inttypes.h and if intptr_t is defined
698dnl
699AC_CHECK_HEADERS([inttypes.h])
Theodore Ts'od2ee56d2005-01-09 00:57:45 -0500700AC_CHECK_TYPES(intptr_t)
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400701dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000702dnl See if struct stat has a st_flags field, in which case we can get file
703dnl flags somewhat portably. Also check for the analogous setter, chflags().
704dnl
705AC_MSG_CHECKING(whether struct stat has a st_flags field)
706AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
707 AC_TRY_COMPILE([#include <sys/stat.h>],
708 [struct stat stat; stat.st_flags = 0;],
709 [e2fsprogs_cv_struct_st_flags=yes],
710 [e2fsprogs_cv_struct_st_flags=no]))
711AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
712if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000713 AC_MSG_CHECKING(whether st_flags field is useful)
714 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
715 AC_TRY_COMPILE([#include <sys/stat.h>],
716 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
717 [e2fsprogs_cv_struct_st_flags_immut=yes],
718 [e2fsprogs_cv_struct_st_flags_immut=no]))
719 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
720 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
721 AC_DEFINE(HAVE_STAT_FLAGS)
722 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000723fi
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500724dnl
725dnl Check for the presence of SA_LEN
726dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500727AC_CHECK_MEMBER(struct sockaddr.sa_len,
728 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
729 [#include <sys/types.h>
730 #include <sys/socket.h>])
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500731dnl
Theodore Ts'o261cd392008-01-21 13:45:00 -0500732AC_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 +0000733dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000734dnl Check to see if -lsocket is required (solaris) to make something
735dnl that uses socket() to compile; this is needed for the UUID library
736dnl
737SOCKET_LIB=''
738AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
739AC_SUBST(SOCKET_LIB)
740dnl
Theodore Ts'o3ae497e2003-03-16 06:26:25 -0500741dnl Check to see if libdl exists for the sake of dlopen
742dnl
743DLOPEN_LIB=''
744AC_CHECK_LIB(dl, dlopen,
745[DLOPEN_LIB=-ldl
746AC_DEFINE(HAVE_DLOPEN)])
747AC_SUBST(DLOPEN_LIB)
748dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000749dnl See if optreset exists
750dnl
751AC_MSG_CHECKING(for optreset)
752AC_CACHE_VAL(ac_cv_have_optreset,
753[AC_EGREP_HEADER(optreset, unistd.h,
754 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
755AC_MSG_RESULT($ac_cv_have_optreset)
756if test $ac_cv_have_optreset = yes; then
757 AC_DEFINE(HAVE_OPTRESET)
758fi
759dnl
Theodore Ts'oe54635d2006-08-06 14:33:13 -0400760dnl Check for unified diff
761dnl
762AC_MSG_CHECKING(for unified diff option)
763if diff -u $0 $0 >& /dev/null ; then
764 UNI_DIFF_OPTS=-u
765else
766 UNI_DIFF_OPTS=-c
767fi
768AC_MSG_RESULT($UNI_DIFF_OPTS)
769AC_SUBST(UNI_DIFF_OPTS)
770dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000771dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000772dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000773case "$host_os" in
774linux*)
775 AC_DEFINE(HAVE_EXT2_IOCTLS)
776 ;;
777esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000778dnl
Theodore Ts'offf45482003-04-13 00:44:19 -0400779dnl OS-specific uncomment control
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400780dnl
781LINUX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400782CYGWIN_CMT="#"
783UNIX_CMT=
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400784case "$host_os" in
785linux*)
786 LINUX_CMT=
787 ;;
Theodore Ts'offf45482003-04-13 00:44:19 -0400788cygwin)
789 CYGWIN_CMT=
790 UNIX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400791 ;;
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400792esac
793AC_SUBST(LINUX_CMT)
Theodore Ts'offf45482003-04-13 00:44:19 -0400794AC_SUBST(CYGWIN_CMT)
795AC_SUBST(UNIX_CMT)
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400796dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000797dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000798dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000799case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400800linux* | gnu* | k*bsd*-gnu)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000801 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
802 root_prefix="";
803 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000804 fi
805 ;;
806esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000807dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000808dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000809dnl
810case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400811linux* | gnu* | k*bsd*-gnu)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000812 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000813 prefix="/usr";
814 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'obff61a72002-05-21 22:21:38 -0400815 if test "$mandir" = '${prefix}/man' ; then
816 echo "...and mandir defaults to /usr/share/man"
817 mandir=/usr/share/man
818 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000819 fi
820;;
821esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000822if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000823 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000824 root_prefix="$ac_default_prefix"
825 else
826 root_prefix="$prefix"
827 fi
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400828 root_bindir=$bindir
829 root_sbindir=$sbindir
830 root_libdir=$libdir
831 root_sysconfdir=$sysconfdir
832else
833 root_bindir='${root_prefix}/bin'
834 root_sbindir='${root_prefix}/sbin'
835 root_libdir='${root_prefix}/lib'
836 root_sysconfdir='${root_prefix}/etc'
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000837fi
Theodore Ts'oc4ef11c2008-01-04 16:55:37 -0500838if test "$bindir" != '${exec_prefix}/bin'; then
839 root_bindir=$bindir
840 echo "Setting root_bindir to $root_bindir"
841fi
842if test "$sbindir" != '${exec_prefix}/sbin'; then
843 root_sbindir=$sbindir
844 echo "Setting root_sbindir to $root_sbindir"
845fi
846if test "$libdir" != '${exec_prefix}/lib'; then
847 root_libdir=$libdir
848 echo "Setting root_libdir to $root_libdir"
849fi
850if test "$sysconfdir" != '${prefix}/etc'; then
851 root_sysconfdir=$sysconfdir
852 echo "Setting root_sysconfdir to $root_sysconfdir"
853fi
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000854AC_SUBST(root_prefix)
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400855AC_SUBST(root_bindir)
856AC_SUBST(root_sbindir)
857AC_SUBST(root_libdir)
858AC_SUBST(root_sysconfdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000859dnl
860dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000861dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000862AC_MSG_CHECKING([whether linker accepts -static])
863AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
864[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
865AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
866 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
867LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000868dnl
869dnl Regardless of how the test turns out, Solaris doesn't handle -static
870dnl This is caused by the socket library requiring the nsl library, which
871dnl requires the -dl library, which only works for dynamically linked
872dnl programs. It basically means you can't have statically linked programs
873dnl which use the network under Solaris.
874dnl
875case "$host_os" in
876solaris2.*)
877 ac_cv_e2fsprogs_use_static=no
878;;
879esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000880AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000881LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000882if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000883 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000884fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000885AC_SUBST(LDFLAG_STATIC)
886dnl
Theodore Ts'o07a0db12003-07-05 14:50:24 -0400887dnl Work around mysterious Darwin / GNU libintl problem
888dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
889dnl Apple hacked gcc somehow?)
890dnl
891case "$host_os" in
892darwin*)
893 echo "Using Apple Darwin / GNU libintl workaround"
894 AC_DEFINE(_INTL_REDIRECT_MACROS)
895 ;;
896esac
897dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000898dnl Make the ss and et directories work correctly.
899dnl
900SS_DIR=`cd ${srcdir}/lib/ss; pwd`
901ET_DIR=`cd ${srcdir}/lib/et; pwd`
902AC_SUBST(SS_DIR)
903AC_SUBST(ET_DIR)
904dnl
905dnl Only try to run the test suite if we're not cross compiling.
906dnl
907if test "$cross_compiling" = yes ; then
908 DO_TEST_SUITE=
909else
910 DO_TEST_SUITE=check
911fi
912AC_SUBST(DO_TEST_SUITE)
913dnl
Theodore Ts'oc6f35b82003-05-17 16:29:27 -0400914dnl Only include the intl include files if we're building with them
915dnl
916INTL_FLAGS=
917if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
918 INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
919fi
920AC_SUBST(INTL_FLAGS)
921dnl
Theodore Ts'odd947da2005-11-09 18:37:07 -0400922dnl Build CFLAGS
923dnl
924if test $cross_compiling = no; then
925 BUILD_CFLAGS="$CFLAGS"
926 BUILD_LDFLAGS="$LDFLAGS"
927else
928 BUILD_CFLAGS=
929 BUILD_LDFLAGS=
930fi
931AC_SUBST(BUILD_CFLAGS)
932AC_SUBST(BUILD_LDFLAGS)
933dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000934dnl Make our output files, being sure that we create the some miscellaneous
935dnl directories
936dnl
937test -d lib || mkdir lib
938test -d include || mkdir include
939test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000940test -d include/asm || mkdir include/asm
Theodore Ts'obff0cc92003-03-23 01:37:53 -0500941for i in MCONFIG Makefile e2fsprogs.spec \
942 util/Makefile util/subst.conf util/gen-tarball \
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400943 lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
944 lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500945 lib/uuid/Makefile lib/uuid/uuid_types.h \
946 lib/blkid/Makefile lib/blkid/blkid_types.h \
Theodore Ts'oe6441862005-01-26 12:59:25 -0500947 lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
948 lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
Theodore Ts'o921f4ad2004-11-19 17:25:27 -0500949 misc/Makefile ext2ed/Makefile e2fsck/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500950 debugfs/Makefile tests/Makefile tests/progs/Makefile \
951 resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do
952 if test -d `dirname ${srcdir}/$i` ; then
953 outlist="$outlist $i"
954 fi
955done
956AC_OUTPUT($outlist)
Theodore Ts'oee683a12005-02-05 15:53:56 -0500957if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi
958