dnl over several different command-line options...
dnl
EVMS_CMT=
-AC_SUBST([EVMS_CMT])
dnl
dnl Use diet libc
dnl
fi
AC_SUBST(LINUX_INCLUDE)
dnl
+dnl Alpha computers use fast and imprecise floating point code that may
+dnl miss exceptions by default. Force sane options if we're using GCC.
+AC_MSG_CHECKING(for additional special compiler flags)
+if test "$GCC" = yes
+then
+ case "$host_cpu" in
+ alpha) addcflags="-mieee" ;;
+ esac
+fi
+if test "x$addcflags" != x
+then
+ AC_MSG_RESULT($addcflags)
+ CFLAGS="$addcflags $CFLAGS"
+else
+ AC_MSG_RESULT([[(none)]])
+fi
+dnl
dnl Set default values for library extentions. Will be dealt with after
dnl parsing configuration opions, which may modify these
dnl
dnl
AC_ARG_ENABLE([evms],
[ --disable-evms don't build EVMS plugin],
-if test "$enableval" != "no"
+if test "$enableval" == "no"
then
EVMS_CMT="#"
echo "Disabling EVMS plugin"
AC_SUBST(FSCK_PROG)
AC_SUBST(FSCK_MAN)
dnl
+dnl See whether to install the `e2initrd-helper' program
+dnl
+AC_ARG_ENABLE([e2initrd-helper],
+[ --enable-e2initrd-helper build e2initrd-helper program],
+[if test "$enableval" = "no"
+then
+ E2INITRD_PROG='' E2INITRD_MAN=''
+ echo "Not building e2initrd helper"
+else
+ E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
+ echo "Building e2initrd helper"
+fi]
+,
+E2INITRD_PROG=e2initrd_helper E2INITRD_MAN=e2initrd_helper.8
+echo "Building e2initrd helper by default"
+)
+AC_SUBST(E2INITRD_PROG)
+AC_SUBST(E2INITRD_MAN)
+dnl
dnl
MAKEFILE_LIBRARY=$srcdir/lib/Makefile.library
AC_SUBST_FILE(MAKEFILE_LIBRARY)
else
AC_CHECK_PROGS(BUILD_CC, gcc cc)
fi
-AC_CHECK_HEADERS(stdlib.h unistd.h stdarg.h errno.h malloc.h mntent.h paths.h dirent.h getopt.h setjmp.h signal.h termios.h linux/fd.h linux/major.h sys/disklabel.h sys/ioctl.h sys/mkdev.h sys/mount.h sys/sockio.h sys/socket.h sys/sysmacros.h sys/time.h sys/stat.h sys/types.h sys/wait.h sys/resource.h net/if.h netinet/in.h)
+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/disk.h sys/disklabel.h sys/ioctl.h sys/mkdev.h sys/mount.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 net/if.h net/if_dl.h netinet/in.h)
AC_FUNC_VPRINTF
dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen
dnl is not decleared.
AC_SUBST(SIZEOF_LONG_LONG)
AC_C_BIGENDIAN
dnl
+dnl See if we have inttypes.h and if intptr_t is defined
+dnl
+AC_CHECK_HEADERS([inttypes.h])
+AC_CHECK_TYPE(intptr_t,long)
+dnl
dnl See if struct stat has a st_flags field, in which case we can get file
dnl flags somewhat portably. Also check for the analogous setter, chflags().
dnl
AC_DEFINE(HAVE_STAT_FLAGS)
fi
fi
-AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 getmntinfo strtoull strcasecmp srandom fchown mallinfo fdatasync strnlen strptime sysconf pathconf)
+dnl
+dnl Check for the presence of SA_LEN
+dnl
+AC_MSG_CHECKING(whether struct sockaddr contains sa_len)
+AC_CACHE_VAL(e2fsprogs_cv_sockaddr_sa_len,
+[AC_TRY_COMPILE([#include <sys/types.h>
+#include <sys/socket.h>
+],
+[struct sockaddr sa;
+sa.sa_len;],
+e2fsprogs_cv_sockaddr_sa_len=yes,e2fsprogs_cv_sockaddr_sa_len=no)])
+AC_MSG_RESULT([$]e2fsprogs_cv_sockaddr_sa_len)
+if test $e2fsprogs_cv_sockaddr_sa_len = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_SA_LEN,1,[Define if struct sockaddr contains sa_len])
+fi
+dnl
+AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 getmntinfo strtoull strcasecmp srandom fchown mallinfo fdatasync strnlen strptime sysconf pathconf posix_memalign memalign valloc)
dnl
dnl Check to see if -lsocket is required (solaris) to make something
dnl that uses socket() to compile; this is needed for the UUID library
AC_SUBST(LINUX_CMT)
AC_SUBST(CYGWIN_CMT)
AC_SUBST(UNIX_CMT)
+AC_SUBST([EVMS_CMT])
dnl
dnl Linux and Hurd places root files in the / by default
dnl
case "$host_os" in
-linux* | gnu*)
+linux* | gnu* | k*bsd*-gnu)
if test "$prefix" = NONE -a "$root_prefix" = NONE ; then
root_prefix="";
echo "On $host_os systems, root_prefix defaults to ''"
dnl On Linux/hurd, force the prefix to be /usr
dnl
case "$host_os" in
-linux* | gnu*)
+linux* | gnu* | k*bsd*-gnu)
if test "$prefix" = NONE ; then
prefix="/usr";
echo "On $host_os systems, prefix defaults to /usr"
fi
AC_SUBST(LDFLAG_STATIC)
dnl
+dnl Work around mysterious Darwin / GNU libintl problem
+dnl (__asm__ redirection doesn't work for some mysterious reason. Looks like
+dnl Apple hacked gcc somehow?)
+dnl
+case "$host_os" in
+darwin*)
+ echo "Using Apple Darwin / GNU libintl workaround"
+ AC_DEFINE(_INTL_REDIRECT_MACROS)
+ ;;
+esac
+dnl
dnl Make the ss and et directories work correctly.
dnl
SS_DIR=`cd ${srcdir}/lib/ss; pwd`