Skip to content

Commit

Permalink
Fixes for MinGW cross compilation: clear GEOS_CFLAGS and XERCES_CFLAG…
Browse files Browse the repository at this point in the history
…S if headers found in /usr/include, do not use Unix 64 bit IO

git-svn-id: https://svn.osgeo.org/gdal/trunk/gdal@23370 f0d54148-0727-0410-94bb-9a71ac55c965
  • Loading branch information
rouault committed Nov 13, 2011
1 parent d0c441f commit 94a8666
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
21 changes: 21 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -16725,6 +16725,22 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64bit file io" >&5
$as_echo_n "checking for 64bit file io... " >&6; }

case "${host_os}" in
*mingw*)
with_unix_stdio_64=no

cat >>confdefs.h <<_ACEOF
#define VSI_STAT64 _stat64
_ACEOF


cat >>confdefs.h <<_ACEOF
#define VSI_STAT64_T __stat64
_ACEOF

;;
esac

if test x"$with_unix_stdio_64" = x"yes" ; then
VSI_FTELL64=ftell64
VSI_FSEEK64=fseek64
Expand Down Expand Up @@ -22751,6 +22767,7 @@ $as_echo_n "checking for Xerces C++ Parser... " >&6; }

HAVE_XERCES="yes"
else
XERCES_CFLAGS=""
HAVE_XERCES="no"
fi

Expand Down Expand Up @@ -25676,6 +25693,10 @@ else
fi


if test x"$HAVE_GEOS" = "xno"; then
GEOS_CFLAGS=""
fi

CFLAGS="${ax_save_CFLAGS}"
LIBS="${ax_save_LIBS}"

Expand Down
9 changes: 9 additions & 0 deletions m4/acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@ AC_DEFUN([AC_UNIX_STDIO_64],
AC_MSG_CHECKING([for 64bit file io])
dnl Special case when using mingw cross compiler.
case "${host_os}" in
*mingw*)
with_unix_stdio_64=no
AC_DEFINE_UNQUOTED(VSI_STAT64,_stat64, [Define to name of 64bit stat function])
AC_DEFINE_UNQUOTED(VSI_STAT64_T,__stat64, [Define to name of 64bit stat structure])
;;
esac
if test x"$with_unix_stdio_64" = x"yes" ; then
VSI_FTELL64=ftell64
VSI_FSEEK64=fseek64
Expand Down
3 changes: 2 additions & 1 deletion m4/ax_lib_xerces.m4
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ XMLPlatformUtils::Initialize();
AC_SUBST([XERCES_LDFLAGS])
HAVE_XERCES="yes"
else
else
XERCES_CFLAGS=""
HAVE_XERCES="no"
fi
Expand Down
4 changes: 4 additions & 0 deletions m4/geos.m4
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ AC_DEFUN([GEOS_INIT],[
[]
)
if test x"$HAVE_GEOS" = "xno"; then
GEOS_CFLAGS=""
fi
CFLAGS="${ax_save_CFLAGS}"
LIBS="${ax_save_LIBS}"
Expand Down

0 comments on commit 94a8666

Please sign in to comment.