3 AC_CONFIG_AUX_DIR(config)
8 dnl This is to figure out the version number and the date....
10 E2FSPROGS_VERSION=`grep E2FSPROGS_VERSION ${srcdir}/version.h \
11 | awk '{print $3}' | tr \" " " | awk '{print $1}'`
12 DATE=`grep E2FSPROGS_DATE ${srcdir}/version.h | awk '{print $3}' \
14 E2FSPROGS_DAY=`echo $DATE | awk -F- '{print $1}'`
15 MONTH=`echo $DATE | awk -F- '{print $2}'`
16 YEAR=`echo $DATE | awk -F- '{print $3}'`
18 if expr $YEAR ">" 1900 > /dev/null ; then
20 elif expr $YEAR ">" 90 >/dev/null ; then
21 E2FSPROGS_YEAR=19$YEAR
23 E2FSPROGS_YEAR=20$YEAR
27 Jan) MONTH_NUM=01; E2FSPROGS_MONTH="January" ;;
28 Feb) MONTH_NUM=02; E2FSPROGS_MONTH="February" ;;
29 Mar) MONTH_NUM=03; E2FSPROGS_MONTH="March" ;;
30 Apr) MONTH_NUM=04; E2FSPROGS_MONTH="April" ;;
31 May) MONTH_NUM=05; E2FSPROGS_MONTH="May" ;;
32 Jun) MONTH_NUM=06; E2FSPROGS_MONTH="June" ;;
33 Jul) MONTH_NUM=07; E2FSPROGS_MONTH="July" ;;
34 Aug) MONTH_NUM=08; E2FSPROGS_MONTH="August" ;;
35 Sep) MONTH_NUM=09; E2FSPROGS_MONTH="September" ;;
36 Oct) MONTH_NUM=10; E2FSPROGS_MONTH="October" ;;
37 Nov) MONTH_NUM=11; E2FSPROGS_MONTH="November" ;;
38 Dec) MONTH_NUM=12; E2FSPROGS_MONTH="December" ;;
39 *) echo "Unknown month $MONTH??" ;;
42 base_ver=`echo $E2FSPROGS_VERSION | \
43 sed -e 's/-WIP//' -e 's/pre-//' -e 's/-PLUS//'`
44 pre_vers=`echo $base_ver 0.01 - p | dc`
46 date_spec=${E2FSPROGS_YEAR}.${MONTH_NUM}.${E2FSPROGS_DAY}
48 case $E2FSPROGS_VERSION in
50 E2FSPROGS_PKGVER="$pre_vers+${base_ver}_WIP_$date_spec"
53 E2FSPROGS_PKGVER="$base_ver"
57 unset DATE MONTH YEAR base_ver pre_vers date_spec
58 echo "Generating configuration file for e2fsprogs version $E2FSPROGS_VERSION"
59 echo "Release date is ${E2FSPROGS_MONTH}, ${E2FSPROGS_YEAR}"
60 AC_SUBST(E2FSPROGS_YEAR)
61 AC_SUBST(E2FSPROGS_MONTH)
62 AC_SUBST(E2FSPROGS_DAY)
63 AC_SUBST(E2FSPROGS_VERSION)
64 AC_SUBST(E2FSPROGS_PKGVER)
69 AC_ARG_WITH([diet-libc],
70 [ --with-diet-libc use diet libc],
71 CC="diet cc -nostdinc"
72 AC_MSG_RESULT(CC=$CC))dnl
74 dnl set $(CC) from --with-cc=value
77 [ --with-cc=COMPILER select compiler to use],
78 AC_MSG_RESULT(CC=$withval)
80 if test -z "$CC" ; then CC=cc; fi
81 [AC_MSG_RESULT(CC defaults to $CC)])dnl
87 dnl set $(LD) from --with-linker=value
90 [ --with-linker=LINKER select linker to use],
91 AC_MSG_RESULT(LD=$withval)
93 if test -z "$LD" ; then LD=$CC; fi
94 [AC_MSG_RESULT(LD defaults to $LD)])dnl
98 dnl set $(CCOPTS) from --with-ccopts=value
100 AC_ARG_WITH([ccopts],
101 [ --with-ccopts=CCOPTS select compiler command line options],
102 AC_MSG_RESULT(CCOPTS is $withval)
106 dnl On systems without linux header files, we add an extra include directory
107 dnl that holds enough to fake it (hopefully). Note that the $(top_srcdir) here
108 dnl is quoted so that it gets expanded by make, not by configure.
110 AC_CHECK_HEADER(linux/fs.h, [linux_headers=yes], [linux_headers=no])
111 if test "$linux_headers" != yes; then
112 LINUX_INCLUDE='-I$(top_builddir)/include'
114 AC_SUBST(LINUX_INCLUDE)
116 dnl Alpha computers use fast and imprecise floating point code that may
117 dnl miss exceptions by default. Force sane options if we're using GCC.
118 AC_MSG_CHECKING(for additional special compiler flags)
122 alpha) addcflags="-mieee" ;;
125 if test "x$addcflags" != x
127 AC_MSG_RESULT($addcflags)
128 CFLAGS="$addcflags $CFLAGS"
130 AC_MSG_RESULT([[(none)]])
133 dnl Set default values for library extentions. Will be dealt with after
134 dnl parsing configuration opions, which may modify these
140 dnl set $(LDFLAGS) from --with-ldopts=value
142 AC_ARG_WITH([ldopts],
143 [ --with-ldopts=LDOPTS select linker command line options],
144 AC_MSG_RESULT(LDFLAGS is $withval)
149 dnl Allow separate `root_prefix' to be specified
151 AC_ARG_WITH([root-prefix],
152 [ --with-root-prefix=PREFIX override prefix variable for files to be placed in the root],
153 root_prefix=$withval,
156 dnl handle --enable-maintainer-mode
158 AC_ARG_ENABLE([maintainer-mode],
159 [ --enable-maintainer-mode enable makefile rules useful for maintainers],
160 if test "$enableval" = "no"
163 echo "Disabling maintainer mode"
166 echo "Enabling maintainer mode"
170 echo "Disabling maintainer mode by default"
172 AC_SUBST(MAINTAINER_CMT)
174 dnl handle --enable-compression
176 AC_ARG_ENABLE([compression],
177 [ --enable-compression enable EXPERIMENTAL compression support],
178 if test "$enableval" = "no"
180 echo "Disabling compression support"
182 AC_DEFINE(ENABLE_COMPRESSION)
183 echo "Enabling compression support"
184 echo "WARNING: Compression support is experimental"
187 echo "Disabling compression support by default"
190 dnl handle --enable-htree
192 AC_ARG_ENABLE([htree],
193 [ --enable-htree enable EXPERIMENTAL htree directory support],
194 if test "$enableval" = "no"
197 echo "Disabling htree directory support"
200 AC_DEFINE(ENABLE_HTREE)
201 echo "Enabling htree directory support"
205 AC_DEFINE(ENABLE_HTREE)
206 echo "Enabling htree directory support by default"
210 dnl handle --enable-elf-shlibs
212 AC_ARG_ENABLE([elf-shlibs],
213 [ --enable-elf-shlibs select ELF shared libraries],
214 if test "$enableval" = "no"
217 MAKEFILE_ELF=/dev/null
218 echo "Disabling ELF shared libraries"
221 MAKEFILE_ELF=$srcdir/lib/Makefile.elf-lib
224 MAKEFILE_ELF=$srcdir/lib/Makefile.solaris-lib
229 echo "Enabling ELF shared libraries"
232 MAKEFILE_ELF=/dev/null
234 echo "Disabling ELF shared libraries by default"
237 AC_SUBST_FILE(MAKEFILE_ELF)
239 dnl handle --enable-bsd-shlibs
241 AC_ARG_ENABLE([bsd-shlibs],
242 [ --enable-bsd-shlibs select BSD shared libraries],
243 if test "$enableval" = "no"
246 MAKEFILE_BSDLIB=/dev/null
247 echo "Disabling BSD shared libraries"
250 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.bsd-lib
254 MAKEFILE_BSDLIB=$srcdir/lib/Makefile.darwin-lib
258 echo "Enabling BSD shared libraries"
261 MAKEFILE_BSDLIB=/dev/null
263 echo "Disabling BSD shared libraries by default"
266 AC_SUBST_FILE(MAKEFILE_BSDLIB)
268 dnl handle --enable-profile
270 AC_ARG_ENABLE([profile],
271 [ --enable-profile build profiling libraries],
272 if test "$enableval" = "no"
275 MAKEFILE_PROFILE=/dev/null
276 echo "Disabling profiling libraries"
279 MAKEFILE_PROFILE=$srcdir/lib/Makefile.profile
280 PROFILED_LIB_EXT=_p.a
281 echo "Building profiling libraries"
285 MAKEFILE_PROFILE=/dev/null
286 echo "Disabling profiling libraries by default"
288 AC_SUBST(PROFILE_CMT)
289 AC_SUBST_FILE(MAKEFILE_PROFILE)
291 dnl handle --enable-checker
293 AC_ARG_ENABLE([checker],
294 [ --enable-checker build checker libraries],
295 if test "$enableval" = "no"
298 MAKEFILE_CHECKER=/dev/null
299 echo "Disabling checker libraries"
302 MAKEFILE_CHECKER=$srcdir/lib/Makefile.checker
303 echo "Building checker libraries"
307 MAKEFILE_CHECKER=/dev/null
308 echo "Disabling checker libraries by default"
310 AC_SUBST(CHECKER_CMT)
311 AC_SUBST_FILE(MAKEFILE_CHECKER)
313 dnl Substitute library extensions
316 AC_SUBST(STATIC_LIB_EXT)
317 AC_SUBST(PROFILED_LIB_EXT)
319 dnl handle --enable-jbd-debug
321 AC_ARG_ENABLE([jbd-debug],
322 [ --enable-jbd-debug enable journal debugging],
323 if test "$enableval" = "no"
325 echo "Disabling journal debugging"
327 AC_DEFINE(CONFIG_JBD_DEBUG)
328 echo "Enabling journal debugging"
331 echo "Disabling journal debugging by default"
334 dnl handle --enable-blkid-debug
336 AC_ARG_ENABLE([blkid-debug],
337 [ --enable-blkid-debug enable blkid debugging],
338 if test "$enableval" = "no"
340 echo "Disabling blkid debugging"
342 AC_DEFINE(CONFIG_BLKID_DEBUG)
343 echo "Enabling blkid debugging"
346 echo "Disabling blkid debugging by default"
349 dnl handle --enable-testio-debug
351 AC_ARG_ENABLE([testio-debug],
352 [ --enable-testio-debug enable the use of the test I/O manager for debugging],
353 if test "$enableval" = "no"
355 echo "Disabling testio debugging"
357 AC_DEFINE(CONFIG_TESTIO_DEBUG)
358 echo "Enabling testio debugging"
361 echo "Disabling testio debugging by default"
364 dnl handle --enable-debugfs
366 AC_ARG_ENABLE([debugfs],
367 [ --disable-debugfs disable support of debugfs program],
368 if test "$enableval" = "no"
370 echo "Disabling debugfs support"
374 echo "Enabling debugfs support"
377 echo "Enabling debugfs support by default"
380 AC_SUBST(DEBUGFS_CMT)
382 dnl handle --enable-imager
384 AC_ARG_ENABLE([imager],
385 [ --disable-imager disable support of e2image program],
386 if test "$enableval" = "no"
388 echo "Disabling e2image support"
392 echo "Enabling e2image support"
395 echo "Enabling e2image support by default"
400 dnl handle --enable-resizer
402 AC_ARG_ENABLE([resizer],
403 [ --disable-resizer disable support of e2resize program],
404 if test "$enableval" = "no"
406 echo "Disabling e2resize support"
410 echo "Enabling e2resize support"
413 echo "Enabling e2resize support by default"
416 AC_SUBST(RESIZER_CMT)
418 dnl handle --enable-dynamic-e2fsck
420 AC_ARG_ENABLE([dynamic-e2fsck],
421 [ --enable-dynamic-e2fsck build e2fsck dynamically],
422 if test "$enableval" = "no"
425 echo "Building e2fsck statically"
428 echo "Building e2fsck dynamically"
432 echo "Building e2fsck statically by default"
434 AC_SUBST(E2FSCK_TYPE)
436 dnl See whether to install the `fsck' wrapper program (that calls e2fsck)
438 AC_ARG_ENABLE([fsck],
439 [ --enable-fsck build fsck wrapper program],
440 [if test "$enableval" = "no"
442 FSCK_PROG='' FSCK_MAN=''
443 echo "Not building fsck wrapper"
445 FSCK_PROG=fsck FSCK_MAN=fsck.8
446 echo "Building fsck wrapper"
451 FSCK_PROG='' FSCK_MAN=''
452 echo "Not building fsck wrapper by default"
455 FSCK_PROG=fsck FSCK_MAN=fsck.8
456 echo "Building fsck wrapper by default"
462 dnl See whether to install the `e2initrd-helper' program
464 AC_ARG_ENABLE([e2initrd-helper],
465 [ --enable-e2initrd-helper build e2initrd-helper program],
466 [if test "$enableval" = "no"
468 E2INITRD_PROG='' E2INITRD_MAN=''
469 echo "Not building e2initrd helper"
471 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
472 echo "Building e2initrd helper"
475 E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
476 echo "Building e2initrd helper by default"
478 AC_SUBST(E2INITRD_PROG)
479 AC_SUBST(E2INITRD_MAN)
480 dnl handle --enable-blkid-devmapper
482 AC_ARG_ENABLE([blkid-devmapper],
483 [ --enable-blkid-devmapper build with device-mapper support],
484 [if test "$enableval" = "no"
486 echo "Disabling device-mapper support"
489 STATIC_DEVMAPPER_LIBS=''
491 AC_DEFINE(HAVE_DEVMAPPER)
492 echo "Enabling device-mapper support"
494 DEVMAPPER_REQ='libselinux libsepol'
495 DEVMAPPER_PC_LIBS='-ldevmapper'
496 DEVMAPPER_LIBS='-ldevmapper -lselinux -lsepol -lpthread'
497 STATIC_DEVMAPPER_LIBS='/usr/lib/libdevmapper.a /usr/lib/libselinux.a /usr/lib/libsepol.a -lpthread'
501 echo "Disabling device-mapper support by default"
503 AC_SUBST(DEVMAPPER_REQ)
504 AC_SUBST(DEVMAPPER_PC_LIBS)
505 AC_SUBST(DEVMAPPER_LIBS)
506 AC_SUBST(STATIC_DEVMAPPER_LIBS)
511 [ --disable-tls disable use of thread local support],
512 [if test "$enableval" = "no"
515 echo "Disabling thread local support"
518 echo "Enabling thread local support"
522 echo "Try using thread local support by default"
524 if test "$try_tls" = "yes"
531 AC_ARG_ENABLE([uuidd],
532 [ --disable-uuidd disable building the uuid daemon],
533 [if test "$enableval" = "no"
535 echo "Not building uuidd"
540 echo "Building uuidd"
545 echo "Building uuidd by default"
551 MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
552 AC_SUBST_FILE(MAKEFILE_LIBRARY)
554 dnl Add internationalization support, using gettext.
556 GETTEXT_PACKAGE=e2fsprogs
558 VERSION="$E2FSPROGS_VERSION"
560 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
561 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
562 AC_SUBST(GETTEXT_PACKAGE)
568 dnl End of configuration options
570 AC_SUBST(BINARY_TYPE)
572 AC_PATH_PROG(LN, ln, ln)
574 AC_PATH_PROG(MV, mv, mv)
575 AC_PATH_PROG(CP, cp, cp)
576 AC_PATH_PROG(RM, rm, rm)
577 AC_PATH_PROG(CHMOD, chmod, :)
580 AC_PATH_PROG(SED, sed, sed)
581 AC_PATH_PROG(PERL, perl, perl)
582 AC_PATH_PROG(LDCONFIG, ldconfig, :)
583 AC_CHECK_TOOL(AR, ar, ar)
584 AC_CHECK_TOOL(RANLIB, ranlib, :)
585 AC_CHECK_TOOL(STRIP, strip, :)
587 # See if we need a separate native compiler.
588 if test $cross_compiling = no; then
592 AC_CHECK_PROGS(BUILD_CC, gcc cc)
594 AC_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)
595 AC_CHECK_HEADERS(sys/disk.h sys/mount.h,,,
598 #include <sys/queue.h>
601 AC_CHECK_HEADERS(net/if.h,,,
604 #include <sys/types.h>
607 #include <sys/socket.h>
611 dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
612 dnl is not decleared.
613 AC_CHECK_MEMBER(struct dirent.d_reclen,[AC_DEFINE(HAVE_RECLEN_DIRENT)],,
614 [#include <dirent.h>])
615 dnl Check to see if ssize_t was decleared
616 AC_CHECK_TYPE(ssize_t,[AC_DEFINE(HAVE_TYPE_SSIZE_T)],,
617 [#include <sys/types.h>])
619 dnl Check to see if llseek() is declared in unistd.h. On some libc's
620 dnl it is, and on others it isn't..... Thank you glibc developers....
622 AC_CHECK_DECL(llseek,[AC_DEFINE(HAVE_LLSEEK_PROTOTYPE)],,
623 [#include <unistd.h>])
625 dnl Check to see if lseek64() is declared in unistd.h. Glibc's header files
626 dnl are so convoluted that I can't tell whether it will always be defined,
627 dnl and if it isn't defined while lseek64 is defined in the library,
628 dnl disaster will strike.
630 dnl Warning! Use of --enable-gcc-wall may throw off this test.
633 AC_CHECK_DECL(lseek64,[AC_DEFINE(HAVE_LSEEK64_PROTOTYPE)],,
634 [#define _LARGEFILE_SOURCE
635 #define _LARGEFILE64_SOURCE
636 #include <unistd.h>])
640 if test "$cross_compiling" = yes -a "$ac_cv_sizeof_long" = ""; then
641 # if cross-compiling, with no cached values, just assume something common.
645 ac_cv_sizeof_long_long=8
646 AC_MSG_WARN([Cross-compiling, so cannot check type sizes; assuming short=2, int=4, long=4, long long=8])
648 AC_CHECK_SIZEOF(short)
650 AC_CHECK_SIZEOF(long)
651 AC_CHECK_SIZEOF(long long)
652 SIZEOF_SHORT=$ac_cv_sizeof_short
653 SIZEOF_INT=$ac_cv_sizeof_int
654 SIZEOF_LONG=$ac_cv_sizeof_long
655 SIZEOF_LONG_LONG=$ac_cv_sizeof_long_long
656 AC_SUBST(SIZEOF_SHORT)
658 AC_SUBST(SIZEOF_LONG)
659 AC_SUBST(SIZEOF_LONG_LONG)
661 BUILD_CC="$BUILD_CC" CPP="$CPP" /bin/sh $ac_aux_dir/parse-types.sh
662 ASM_TYPES_HEADER=./asm_types.h
663 AC_SUBST_FILE(ASM_TYPES_HEADER)
665 dnl See if we have inttypes.h and if intptr_t is defined
667 AC_CHECK_HEADERS([inttypes.h])
668 AC_CHECK_TYPES(intptr_t)
670 dnl See if struct stat has a st_flags field, in which case we can get file
671 dnl flags somewhat portably. Also check for the analogous setter, chflags().
673 AC_MSG_CHECKING(whether struct stat has a st_flags field)
674 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags,
675 AC_TRY_COMPILE([#include <sys/stat.h>],
676 [struct stat stat; stat.st_flags = 0;],
677 [e2fsprogs_cv_struct_st_flags=yes],
678 [e2fsprogs_cv_struct_st_flags=no]))
679 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags)
680 if test "$e2fsprogs_cv_struct_st_flags" = yes; then
681 AC_MSG_CHECKING(whether st_flags field is useful)
682 AC_CACHE_VAL(e2fsprogs_cv_struct_st_flags_immut,
683 AC_TRY_COMPILE([#include <sys/stat.h>],
684 [struct stat stat; stat.st_flags |= UF_IMMUTABLE;],
685 [e2fsprogs_cv_struct_st_flags_immut=yes],
686 [e2fsprogs_cv_struct_st_flags_immut=no]))
687 AC_MSG_RESULT($e2fsprogs_cv_struct_st_flags_immut)
688 if test "$e2fsprogs_cv_struct_st_flags_immut" = yes; then
689 AC_DEFINE(HAVE_STAT_FLAGS)
693 dnl Check for the presence of SA_LEN
695 AC_CHECK_MEMBER(struct sockaddr.sa_len,
696 AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len]),,
697 [#include <sys/types.h>
698 #include <sys/socket.h>])
700 AC_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)
702 dnl Check to see if -lsocket is required (solaris) to make something
703 dnl that uses socket() to compile; this is needed for the UUID library
706 AC_CHECK_LIB(socket, socket, [SOCKET_LIB=-lsocket])
709 dnl Check to see if libdl exists for the sake of dlopen
712 AC_CHECK_LIB(dl, dlopen,
714 AC_DEFINE(HAVE_DLOPEN)])
717 dnl See if optreset exists
719 AC_MSG_CHECKING(for optreset)
720 AC_CACHE_VAL(ac_cv_have_optreset,
721 [AC_EGREP_HEADER(optreset, unistd.h,
722 ac_cv_have_optreset=yes, ac_cv_have_optreset=no)])dnl
723 AC_MSG_RESULT($ac_cv_have_optreset)
724 if test $ac_cv_have_optreset = yes; then
725 AC_DEFINE(HAVE_OPTRESET)
728 dnl Check for unified diff
730 AC_MSG_CHECKING(for unified diff option)
731 if diff -u $0 $0 >& /dev/null ; then
736 AC_MSG_RESULT($UNI_DIFF_OPTS)
737 AC_SUBST(UNI_DIFF_OPTS)
739 dnl We use the EXT2 ioctls only under Linux
743 AC_DEFINE(HAVE_EXT2_IOCTLS)
747 dnl OS-specific uncomment control
765 dnl Linux and Hurd places root files in the / by default
768 linux* | gnu* | k*bsd*-gnu)
769 if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
771 echo "On $host_os systems, root_prefix defaults to ''"
776 dnl On Linux/hurd, force the prefix to be /usr
779 linux* | gnu* | k*bsd*-gnu)
780 if test "$prefix" = NONE ; then
782 echo "On $host_os systems, prefix defaults to /usr"
783 if test "$mandir" = '${prefix}/man' ; then
784 echo "...and mandir defaults to /usr/share/man"
785 mandir=/usr/share/man
790 if test "$root_prefix" = NONE ; then
791 if test "$prefix" = NONE ; then
792 root_prefix="$ac_default_prefix"
794 root_prefix="$prefix"
797 root_sbindir=$sbindir
799 root_sysconfdir=$sysconfdir
801 root_bindir='${root_prefix}/bin'
802 root_sbindir='${root_prefix}/sbin'
803 root_libdir='${root_prefix}/lib'
804 root_sysconfdir='${root_prefix}/etc'
806 AC_SUBST(root_prefix)
807 AC_SUBST(root_bindir)
808 AC_SUBST(root_sbindir)
809 AC_SUBST(root_libdir)
810 AC_SUBST(root_sysconfdir)
812 dnl See if -static works.
814 AC_MSG_CHECKING([whether linker accepts -static])
815 AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
816 [SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
817 AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
818 ac_cv_e2fsprogs_use_static=yes, ac_cv_e2fsprogs_use_static=no)
819 LDFLAGS=$SAVE_LDFLAGS])
821 dnl Regardless of how the test turns out, Solaris doesn't handle -static
822 dnl This is caused by the socket library requiring the nsl library, which
823 dnl requires the -dl library, which only works for dynamically linked
824 dnl programs. It basically means you can't have statically linked programs
825 dnl which use the network under Solaris.
829 ac_cv_e2fsprogs_use_static=no
832 AC_MSG_RESULT($ac_cv_e2fsprogs_use_static)
834 if test $ac_cv_e2fsprogs_use_static = yes; then
835 LDFLAG_STATIC=-static
837 AC_SUBST(LDFLAG_STATIC)
839 dnl Work around mysterious Darwin / GNU libintl problem
840 dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
841 dnl Apple hacked gcc somehow?)
845 echo "Using Apple Darwin / GNU libintl workaround"
846 AC_DEFINE(_INTL_REDIRECT_MACROS)
850 dnl Make the ss and et directories work correctly.
852 SS_DIR=`cd ${srcdir}/lib/ss; pwd`
853 ET_DIR=`cd ${srcdir}/lib/et; pwd`
857 dnl Only try to run the test suite if we're not cross compiling.
859 if test "$cross_compiling" = yes ; then
864 AC_SUBST(DO_TEST_SUITE)
866 dnl Only include the intl include files if we're building with them
869 if test "$USE_INCLUDED_LIBINTL" = "yes" ; then
870 INTL_FLAGS='-I$(top_builddir)/intl -I$(top_srcdir)/intl'
876 if test $cross_compiling = no; then
877 BUILD_CFLAGS="$CFLAGS"
878 BUILD_LDFLAGS="$LDFLAGS"
883 AC_SUBST(BUILD_CFLAGS)
884 AC_SUBST(BUILD_LDFLAGS)
886 dnl Make our output files, being sure that we create the some miscellaneous
889 test -d lib || mkdir lib
890 test -d include || mkdir include
891 test -d include/linux || mkdir include/linux
892 test -d include/asm || mkdir include/asm
893 for i in MCONFIG Makefile e2fsprogs.spec \
894 util/Makefile util/subst.conf util/gen-tarball \
895 lib/et/Makefile lib/ss/Makefile lib/e2p/Makefile \
896 lib/ext2fs/Makefile lib/ext2fs/ext2_types.h \
897 lib/uuid/Makefile lib/uuid/uuid_types.h \
898 lib/blkid/Makefile lib/blkid/blkid_types.h \
899 lib/ss/ss.pc lib/uuid/uuid.pc lib/et/com_err.pc \
900 lib/e2p/e2p.pc lib/blkid/blkid.pc lib/ext2fs/ext2fs.pc \
901 misc/Makefile ext2ed/Makefile e2fsck/Makefile \
902 debugfs/Makefile tests/Makefile tests/progs/Makefile \
903 resize/Makefile doc/Makefile intl/Makefile po/Makefile.in ; do
904 if test -d `dirname ${srcdir}/$i` ; then
905 outlist="$outlist $i"
909 if test -f util/gen-tarball; then chmod +x util/gen-tarball; fi