From fff45483ede7fe38a31b3364a9c07e2418776dee Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Sun, 13 Apr 2003 00:44:19 -0400 Subject: Add portability enhancements for Cygwin32 environment. --- configure.in | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index 368fc4c5..01e82900 100644 --- a/configure.in +++ b/configure.in @@ -531,8 +531,31 @@ if test $cross_compiling = no; then 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/sysmacros.h sys/time.h sys/stat.h sys/types.h net/if.h netinet/in.h) +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_FUNC_VPRINTF +dnl Check to see if dirent has member d_reclen. On cygwin those d_reclen +dnl is not decleared. +AC_MSG_CHECKING(whether d_reclen declared in dirent) +AC_CACHE_VAL(e2fsprogs_cv_have_d_reclen_dirent, + AC_TRY_COMPILE( +[#include ], [struct dirent de; de.d_reclen = 0; ], + [e2fsprogs_cv_have_d_reclen_dirent=yes], + [e2fsprogs_cv_have_d_reclen_dirent=no])) +AC_MSG_RESULT($e2fsprogs_cv_have_d_reclen_dirent) +if test "$e2fsprogs_cv_have_d_reclen_dirent" = yes; then + AC_DEFINE(HAVE_RECLEN_DIRENT) +fi +dnl Check to see if ssize_t was decleared +AC_MSG_CHECKING(whether ssize_t declared) +AC_CACHE_VAL(e2fsprogs_cv_have_ssize_t, + AC_TRY_COMPILE( +[#include ], [ssize_t a = 0; ], + [e2fsprogs_cv_have_ssize_t=yes], + [e2fsprogs_cv_have_ssize_t=no])) +AC_MSG_RESULT($e2fsprogs_cv_have_ssize_t) +if test "$e2fsprogs_cv_have_ssize_t" = yes; then + AC_DEFINE(HAVE_TYPE_SSIZE_T) +fi dnl dnl Check to see if llseek() is declared in unistd.h. On some libc's dnl it is, and on others it isn't..... Thank you glibc developers.... @@ -654,15 +677,24 @@ linux*) ;; esac dnl -dnl Uncomment only if Linux +dnl OS-specific uncomment control dnl LINUX_CMT="#" +CYGWIN_CMT="#" +UNIX_CMT= case "$host_os" in linux*) LINUX_CMT= ;; +cygwin) + CYGWIN_CMT= + UNIX_CMT="#" + AC_DEFINE(CYGWIN) + ;; esac AC_SUBST(LINUX_CMT) +AC_SUBST(CYGWIN_CMT) +AC_SUBST(UNIX_CMT) dnl dnl Linux and Hurd places root files in the / by default dnl -- cgit v1.2.3