blob: 19cea964e635657f377d99cc8f5d8520e0453084 [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//'`
44pre_vers=`echo $base_ver 0.01 - p | dc`
45
46date_spec=${E2FSPROGS_YEAR}.${MONTH_NUM}.${E2FSPROGS_DAY}
47
48case $E2FSPROGS_VERSION in
49*-WIP|pre-*)
50 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'o4d0f3e12001-01-11 15:48:50 +0000444dnl handle --enable-dynamic-e2fsck
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000445dnl
Theodore Ts'oa4d09611997-04-29 14:28:00 +0000446AC_ARG_ENABLE([dynamic-e2fsck],
447[ --enable-dynamic-e2fsck build e2fsck dynamically],
448if test "$enableval" = "no"
449then
450 E2FSCK_TYPE=static
451 echo "Building e2fsck statically"
452else
453 E2FSCK_TYPE=shared
454 echo "Building e2fsck dynamically"
455fi
456,
457E2FSCK_TYPE=static
458echo "Building e2fsck statically by default"
459)
460AC_SUBST(E2FSCK_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000461dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000462dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
463dnl
464AC_ARG_ENABLE([fsck],
465[ --enable-fsck build fsck wrapper program],
466[if test "$enableval" = "no"
467then
468 FSCK_PROG='' FSCK_MAN=''
469 echo "Not building fsck wrapper"
470else
471 FSCK_PROG=fsck FSCK_MAN=fsck.8
472 echo "Building fsck wrapper"
473fi]
474,
475[case "$host_os" in
Theodore Ts'oe3632402004-05-04 19:39:54 -0400476 gnu*)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000477 FSCK_PROG='' FSCK_MAN=''
478 echo "Not building fsck wrapper by default"
479 ;;
480 *)
481 FSCK_PROG=fsck FSCK_MAN=fsck.8
482 echo "Building fsck wrapper by default"
483esac]
484)
485AC_SUBST(FSCK_PROG)
486AC_SUBST(FSCK_MAN)
487dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400488dnl See whether to install the `e2initrd-helper' program
489dnl
490AC_ARG_ENABLE([e2initrd-helper],
491[ --enable-e2initrd-helper build e2initrd-helper program],
492[if test "$enableval" = "no"
493then
494 E2INITRD_PROG='' E2INITRD_MAN=''
495 echo "Not building e2initrd helper"
496else
497 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
498 echo "Building e2initrd helper"
499fi]
500,
501E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
502echo "Building e2initrd helper by default"
503)
504AC_SUBST(E2INITRD_PROG)
505AC_SUBST(E2INITRD_MAN)
Karel Zak4db2f592006-03-08 14:17:28 -0500506dnl handle --enable-blkid-devmapper
507dnl
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500508STATIC_BLKID_DEVMAPPER_LIBS=''
Karel Zak4db2f592006-03-08 14:17:28 -0500509AC_ARG_ENABLE([blkid-devmapper],
510[ --enable-blkid-devmapper build with device-mapper support],
511[if test "$enableval" = "no"
512then
513 echo "Disabling device-mapper support"
514 DEVMAPPER_REQ=''
515 DEVMAPPER_LIBS=''
516 STATIC_DEVMAPPER_LIBS=''
517else
518 AC_DEFINE(HAVE_DEVMAPPER)
519 echo "Enabling device-mapper support"
520
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500521 PKG_PROG_PKG_CONFIG()
Karel Zak4db2f592006-03-08 14:17:28 -0500522
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500523 if test -z "$PKG_CONFIG"; then
524 echo "pkg-config not installed; please install it."
525 exit 1;
526 fi
527
528 AC_CHECK_LIB(devmapper, dm_tree_create,
529 [DEVMAPPER_LIBS=`$PKG_CONFIG --libs devmapper`;
530 STATIC_DEVMAPPER_LIBS=`$PKG_CONFIG --static --libs devmapper`;
531 DEVMAPPER_REQ="devmapper";
532 DEVMAPPER_PC_LIBS="-ldevmapper"],
533 [AC_MSG_ERROR([device-mapper library not found])],
534 [$DEVMAPPER_LIBS])
535 # work around stupid devmapper.pc bug in Debian
536 case "$STATIC_DEVMAPPER_LIBS" in
537 *pthread*)
538 ;;
539 *)
540 echo "Working around Debian bug #390243..."
541 STATIC_DEVMAPPER_LIBS="-pthread $STATIC_DEVMAPPER_LIBS"
542 ;;
543 esac
544 if test "$E2_PKG_CONFIG_STATIC" = "--static"; then
545 DEVMAPPER_LIBS="$STATIC_DEVMAPPER_LIBS"
546 STATIC_BLKID_DEVMAPPER_LIBS="$STATIC_DEVMAPPER_LIBS"
547 fi
Karel Zak4db2f592006-03-08 14:17:28 -0500548fi]
549,
550echo "Disabling device-mapper support by default"
551)
552AC_SUBST(DEVMAPPER_REQ)
553AC_SUBST(DEVMAPPER_PC_LIBS)
554AC_SUBST(DEVMAPPER_LIBS)
555AC_SUBST(STATIC_DEVMAPPER_LIBS)
Theodore Ts'oa4ece352008-01-01 20:05:04 -0500556AC_SUBST(STATIC_BLKID_DEVMAPPER_LIBS)
Karel Zak4db2f592006-03-08 14:17:28 -0500557dnl
Theodore Ts'o5d407732004-09-18 14:53:14 -0400558dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000559dnl
Theodore Ts'o32493942007-12-31 10:45:01 -0500560AC_ARG_ENABLE([tls],
561[ --disable-tls disable use of thread local support],
562[if test "$enableval" = "no"
563then
564 try_tls=""
565 echo "Disabling thread local support"
566else
567 try_tls="yes"
568 echo "Enabling thread local support"
569fi]
570,
571try_tls="yes"
572echo "Try using thread local support by default"
573)
574if test "$try_tls" = "yes"
575then
576AX_TLS
577fi
578dnl
579dnl
580dnl
Theodore Ts'o5610f992007-12-31 11:16:56 -0500581AC_ARG_ENABLE([uuidd],
582[ --disable-uuidd disable building the uuid daemon],
583[if test "$enableval" = "no"
584then
585 echo "Not building uuidd"
586 UUIDD_CMT="#"
587else
588 AC_DEFINE(USE_UUIDD)
589 UUIDD_CMT=""
590 echo "Building uuidd"
591fi]
592,
593AC_DEFINE(USE_UUIDD)
594UUIDD_CMT=""
595echo "Building uuidd by default"
596)
597AC_SUBST(UUIDD_CMT)
598dnl
599dnl
600dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000601MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
602AC_SUBST_FILE(MAKEFILE_LIBRARY)
603dnl
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000604dnl Add internationalization support, using gettext.
605dnl
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500606GETTEXT_PACKAGE=e2fsprogs
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000607PACKAGE=e2fsprogs
608VERSION="$E2FSPROGS_VERSION"
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500609VERSION=0.14.1
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000610AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
611AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
Theodore Ts'ob0cacab2004-11-30 19:00:19 -0500612AC_SUBST(GETTEXT_PACKAGE)
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000613AC_SUBST(PACKAGE)
614AC_SUBST(VERSION)
615
Theodore Ts'ocdf186e2001-06-13 22:16:47 +0000616AM_GNU_GETTEXT
617dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000618dnl End of configuration options
619dnl
Theodore Ts'o74becf31997-04-26 14:37:06 +0000620AC_SUBST(BINARY_TYPE)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000621AC_PROG_MAKE_SET
622AC_PATH_PROG(LN, ln, ln)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000623AC_PROG_LN_S
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000624AC_PATH_PROG(MV, mv, mv)
625AC_PATH_PROG(CP, cp, cp)
626AC_PATH_PROG(RM, rm, rm)
627AC_PATH_PROG(CHMOD, chmod, :)
Theodore Ts'o32237012005-01-17 19:13:39 -0500628AC_PROG_AWK
629AC_PROG_EGREP
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000630AC_PATH_PROG(SED, sed, sed)
Theodore Ts'o9d564f71999-07-03 20:25:58 +0000631AC_PATH_PROG(PERL, perl, perl)
Theodore Ts'o250f79f2001-05-19 22:02:22 +0000632AC_PATH_PROG(LDCONFIG, ldconfig, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000633AC_CHECK_TOOL(AR, ar, ar)
634AC_CHECK_TOOL(RANLIB, ranlib, :)
635AC_CHECK_TOOL(STRIP, strip, :)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000636AC_PROG_INSTALL
Theodore Ts'o6c133521999-07-03 20:37:03 +0000637# See if we need a separate native compiler.
638if test $cross_compiling = no; then
639 BUILD_CC="$CC"
640 AC_SUBST(BUILD_CC)
641else
642 AC_CHECK_PROGS(BUILD_CC, gcc cc)
643fi
Theodore Ts'o29dd9d12007-12-31 14:36:48 -0500644AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h stdint.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/mman.h sys/mkdev.h sys/prctl.h sys/queue.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 sys/syscall.h net/if_dl.h netinet/in.h utime.h)
Theodore Ts'oda76d6b2005-01-18 23:29:01 -0500645AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
646[[
647#if HAVE_SYS_QUEUE_H
648#include <sys/queue.h>
649#endif
650]])
651AC_CHECK_HEADERS(net/if.h,,,
652[[
653#if HAVE_SYS_TYPES_H
654#include <sys/types.h>
655#endif
656#if HAVE_SYS_SOCKET
657#include <sys/socket.h>
658#endif
659]])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000660AC_FUNC_VPRINTF
Theodore Ts'offf45482003-04-13 00:44:19 -0400661dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
662dnl is not decleared.
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500663AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT)],,
664 [#include <dirent.h>])
Theodore Ts'offf45482003-04-13 00:44:19 -0400665dnl Check to see if ssize_t was decleared
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500666AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T)],,
667 [#include <sys/types.h>])
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000668dnl
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000669dnl Check to see if llseek() is declared in unistd.h. On some libc's
670dnl it is, and on others it isn't..... Thank you glibc developers....
671dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500672AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)],,
673 [#include <unistd.h>])
Theodore Ts'ob0b9c4d1997-10-20 23:36:30 +0000674dnl
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000675dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
676dnl are so convoluted that I can't tell whether it will always be defined,
677dnl and if it isn't defined while lseek64 is defined in the library,
678dnl disaster will strike.
679dnl
680dnl Warning! Use of --enable-gcc-wall may throw off this test.
681dnl
682dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500683AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)],,
684 [#define _LARGEFILE_SOURCE
685 #define _LARGEFILE64_SOURCE
686 #include <unistd.h>])
Theodore Ts'o6928adc2000-05-25 23:28:50 +0000687dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000688dnl Word sizes...
689dnl
690if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
691 # if cross-compiling, with no cached values, just assume something common.
692 ac_cv_sizeof_short=2
693 ac_cv_sizeof_int=4
694 ac_cv_sizeof_long=4
Theodore Ts'o6c133521999-07-03 20:37:03 +0000695 ac_cv_sizeof_long_long=8
696 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 +0000697fi
698AC_CHECK_SIZEOF(short)
699AC_CHECK_SIZEOF(int)
700AC_CHECK_SIZEOF(long)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000701AC_CHECK_SIZEOF(long long)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000702SIZEOF_SHORT=$ac_cv_sizeof_short
703SIZEOF_INT=$ac_cv_sizeof_int
704SIZEOF_LONG=$ac_cv_sizeof_long
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000705SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000706AC_SUBST(SIZEOF_SHORT)
707AC_SUBST(SIZEOF_INT)
708AC_SUBST(SIZEOF_LONG)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000709AC_SUBST(SIZEOF_LONG_LONG)
Theodore Ts'o877eb6d2001-06-11 06:54:13 +0000710AC_C_BIGENDIAN
Theodore Ts'o29a5dee2007-07-04 16:28:47 -0400711BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400712ASM_TYPES_HEADER=./asm_types.h
713AC_SUBST_FILE(ASM_TYPES_HEADER)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000714dnl
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400715dnl See if we have inttypes.h and if intptr_t is defined
716dnl
717AC_CHECK_HEADERS([inttypes.h])
Theodore Ts'od2ee56d2005-01-09 00:57:45 -0500718AC_CHECK_TYPES(intptr_t)
Theodore Ts'o0c193f82003-08-01 14:26:23 -0400719dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000720dnl See if struct stat has a st_flags field, in which case we can get file
721dnl flags somewhat portably. Also check for the analogous setter, chflags().
722dnl
723AC_MSG_CHECKING(whether struct stat has a st_flags field)
724AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
725 AC_TRY_COMPILE([#include <sys/stat.h>],
726 [struct stat stat; stat.st_flags = 0;],
727 [e2fsprogs_cv_struct_st_flags=yes],
728 [e2fsprogs_cv_struct_st_flags=no]))
729AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
730if test "$e2fsprogs_cv_struct_st_flags" = yes; then
Theodore Ts'oc03bc4e1999-10-20 18:20:36 +0000731 AC_MSG_CHECKING(whether st_flags field is useful)
732 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
733 AC_TRY_COMPILE([#include <sys/stat.h>],
734 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
735 [e2fsprogs_cv_struct_st_flags_immut=yes],
736 [e2fsprogs_cv_struct_st_flags_immut=no]))
737 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
738 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
739 AC_DEFINE(HAVE_STAT_FLAGS)
740 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000741fi
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500742dnl
743dnl Check for the presence of SA_LEN
744dnl
Theodore Ts'o6c65d252005-01-19 12:59:48 -0500745AC_CHECK_MEMBER(struct sockaddr.sa_len,
746 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
747 [#include <sys/types.h>
748 #include <sys/socket.h>])
Theodore Ts'o84ea6e72004-03-19 19:29:17 -0500749dnl
Theodore Ts'o740837d2007-12-16 17:21:38 -0500750AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 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 +0000751dnl
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000752dnl Check to see if -lsocket is required (solaris) to make something
753dnl that uses socket() to compile; this is needed for the UUID library
754dnl
755SOCKET_LIB=''
756AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
757AC_SUBST(SOCKET_LIB)
758dnl
Theodore Ts'o3ae497e2003-03-16 06:26:25 -0500759dnl Check to see if libdl exists for the sake of dlopen
760dnl
761DLOPEN_LIB=''
762AC_CHECK_LIB(dl, dlopen,
763[DLOPEN_LIB=-ldl
764AC_DEFINE(HAVE_DLOPEN)])
765AC_SUBST(DLOPEN_LIB)
766dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000767dnl See if optreset exists
768dnl
769AC_MSG_CHECKING(for optreset)
770AC_CACHE_VAL(ac_cv_have_optreset,
771[AC_EGREP_HEADER(optreset, unistd.h,
772 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
773AC_MSG_RESULT($ac_cv_have_optreset)
774if test $ac_cv_have_optreset = yes; then
775 AC_DEFINE(HAVE_OPTRESET)
776fi
777dnl
Theodore Ts'oe54635d2006-08-06 14:33:13 -0400778dnl Check for unified diff
779dnl
780AC_MSG_CHECKING(for unified diff option)
781if diff -u $0 $0 >& /dev/null ; then
782 UNI_DIFF_OPTS=-u
783else
784 UNI_DIFF_OPTS=-c
785fi
786AC_MSG_RESULT($UNI_DIFF_OPTS)
787AC_SUBST(UNI_DIFF_OPTS)
788dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000789dnl We use the EXT2 ioctls only under Linux
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000790dnl
Theodore Ts'o8f3f29d2000-02-11 05:04:44 +0000791case "$host_os" in
792linux*)
793 AC_DEFINE(HAVE_EXT2_IOCTLS)
794 ;;
795esac
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000796dnl
Theodore Ts'offf45482003-04-13 00:44:19 -0400797dnl OS-specific uncomment control
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400798dnl
799LINUX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400800CYGWIN_CMT="#"
801UNIX_CMT=
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400802case "$host_os" in
803linux*)
804 LINUX_CMT=
805 ;;
Theodore Ts'offf45482003-04-13 00:44:19 -0400806cygwin)
807 CYGWIN_CMT=
808 UNIX_CMT="#"
Theodore Ts'offf45482003-04-13 00:44:19 -0400809 ;;
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400810esac
811AC_SUBST(LINUX_CMT)
Theodore Ts'offf45482003-04-13 00:44:19 -0400812AC_SUBST(CYGWIN_CMT)
813AC_SUBST(UNIX_CMT)
Theodore Ts'oe6f2bda2002-08-18 03:37:10 -0400814dnl
Theodore Ts'o6c133521999-07-03 20:37:03 +0000815dnl Linux and Hurd places root files in the / by default
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000816dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000817case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400818linux* | gnu* | k*bsd*-gnu)
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000819 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
820 root_prefix="";
821 echo "On $host_os systems, root_prefix defaults to ''"
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000822 fi
823 ;;
824esac
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000825dnl
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000826dnl On Linux/hurd, force the prefix to be /usr
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000827dnl
828case "$host_os" in
Theodore Ts'o93636bd2003-07-12 02:45:05 -0400829linux* | gnu* | k*bsd*-gnu)
Theodore Ts'ofc6d9d51997-04-29 14:51:31 +0000830 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000831 prefix="/usr";
832 echo "On $host_os systems, prefix defaults to /usr"
Theodore Ts'obff61a72002-05-21 22:21:38 -0400833 if test "$mandir" = '${prefix}/man' ; then
834 echo "...and mandir defaults to /usr/share/man"
835 mandir=/usr/share/man
836 fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000837 fi
838;;
839esac
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000840if test "$root_prefix" = NONE ; then
Theodore Ts'offe19911998-04-08 06:05:49 +0000841 if test "$prefix" = NONE ; then
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000842 root_prefix="$ac_default_prefix"
843 else
844 root_prefix="$prefix"
845 fi
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400846 root_bindir=$bindir
847 root_sbindir=$sbindir
848 root_libdir=$libdir
849 root_sysconfdir=$sysconfdir
850else
851 root_bindir='${root_prefix}/bin'
852 root_sbindir='${root_prefix}/sbin'
853 root_libdir='${root_prefix}/lib'
854 root_sysconfdir='${root_prefix}/etc'
Theodore Ts'oa4b2d3c1998-04-03 16:12:25 +0000855fi
856AC_SUBST(root_prefix)
Theodore Ts'ob5ffead2002-05-11 19:17:00 -0400857AC_SUBST(root_bindir)
858AC_SUBST(root_sbindir)
859AC_SUBST(root_libdir)
860AC_SUBST(root_sysconfdir)
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000861dnl
862dnl See if -static works.
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000863dnl
Theodore Ts'oae851481997-04-29 18:13:24 +0000864AC_MSG_CHECKING([whether linker accepts -static])
865AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
866[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
867AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
868 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
869LDFLAGS=$SAVE_LDFLAGS])
Theodore Ts'odefde781999-01-04 07:39:19 +0000870dnl
871dnl Regardless of how the test turns out, Solaris doesn't handle -static
872dnl This is caused by the socket library requiring the nsl library, which
873dnl requires the -dl library, which only works for dynamically linked
874dnl programs. It basically means you can't have statically linked programs
875dnl which use the network under Solaris.
876dnl
877case "$host_os" in
878solaris2.*)
879 ac_cv_e2fsprogs_use_static=no
880;;
881esac
Theodore Ts'oae851481997-04-29 18:13:24 +0000882AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
Theodore Ts'o74becf31997-04-26 14:37:06 +0000883LDFLAG_STATIC=
Theodore Ts'oae851481997-04-29 18:13:24 +0000884if test $ac_cv_e2fsprogs_use_static = yes; then
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000885 LDFLAG_STATIC=-static
Theodore Ts'oae851481997-04-29 18:13:24 +0000886fi
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000887AC_SUBST(LDFLAG_STATIC)
888dnl
Theodore Ts'o07a0db12003-07-05 14:50:24 -0400889dnl Work around mysterious Darwin / GNU libintl problem
890dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
891dnl Apple hacked gcc somehow?)
892dnl
893case "$host_os" in
894darwin*)
895 echo "Using Apple Darwin / GNU libintl workaround"
896 AC_DEFINE(_INTL_REDIRECT_MACROS)
897 ;;
898esac
899dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000900dnl Make the ss and et directories work correctly.
901dnl
902SS_DIR=`cd ${srcdir}/lib/ss; pwd`
903ET_DIR=`cd ${srcdir}/lib/et; pwd`
904AC_SUBST(SS_DIR)
905AC_SUBST(ET_DIR)
906dnl
907dnl Only try to run the test suite if we're not cross compiling.
908dnl
909if test "$cross_compiling" = yes ; then
910 DO_TEST_SUITE=
911else
912 DO_TEST_SUITE=check
913fi
914AC_SUBST(DO_TEST_SUITE)
915dnl
Theodore Ts'oc6f35b82003-05-17 16:29:27 -0400916dnl Only include the intl include files if we're building with them
917dnl
918INTL_FLAGS=
919if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
920 INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
921fi
922AC_SUBST(INTL_FLAGS)
923dnl
Theodore Ts'odd947da2005-11-09 18:37:07 -0400924dnl Build CFLAGS
925dnl
926if test $cross_compiling = no; then
927 BUILD_CFLAGS="$CFLAGS"
928 BUILD_LDFLAGS="$LDFLAGS"
929else
930 BUILD_CFLAGS=
931 BUILD_LDFLAGS=
932fi
933AC_SUBST(BUILD_CFLAGS)
934AC_SUBST(BUILD_LDFLAGS)
935dnl
Theodore Ts'o50e1e101997-04-26 13:58:21 +0000936dnl Make our output files, being sure that we create the some miscellaneous
937dnl directories
938dnl
939test -d lib || mkdir lib
940test -d include || mkdir include
941test -d include/linux || mkdir include/linux
Theodore Ts'odefde781999-01-04 07:39:19 +0000942test -d include/asm || mkdir include/asm
Theodore Ts'obff0cc92003-03-23 01:37:53 -0500943for i in MCONFIG Makefile e2fsprogs.spec \
944 util/Makefile util/subst.conf util/gen-tarball \
Theodore Ts'o4ea7ea02006-04-09 08:41:55 -0400945 lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
946 lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500947 lib/uuid/Makefile lib/uuid/uuid_types.h \
948 lib/blkid/Makefile lib/blkid/blkid_types.h \
Theodore Ts'oe6441862005-01-26 12:59:25 -0500949 lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
950 lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
Theodore Ts'o921f4ad2004-11-19 17:25:27 -0500951 misc/Makefile ext2ed/Makefile e2fsck/Makefile \
Theodore Ts'o94ba8c72003-03-02 02:07:14 -0500952 debugfs/Makefile tests/Makefile tests/progs/Makefile \
953 resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do
954 if test -d `dirname ${srcdir}/$i` ; then
955 outlist="$outlist $i"
956 fi
957done
958AC_OUTPUT($outlist)
Theodore Ts'oee683a12005-02-05 15:53:56 -0500959if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi
960