added configure support for the large files
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15866 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
edc1d330a5
commit
90dd450cf3
59
acinclude.m4
59
acinclude.m4
@ -409,3 +409,62 @@ size_t iconv();
|
||||
AC_SUBST(LIBICONV)
|
||||
])
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl AC_SYS_LARGEFILE (partly based on the code from autoconf 2.5x)
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
dnl WX_SYS_LARGEFILE_TEST
|
||||
dnl
|
||||
dnl NB: original autoconf test was checking if compiler supported 6 bit off_t
|
||||
dnl arithmetic properly but this failed miserably with gcc under Linux
|
||||
dnl whereas the system still supports 64 bit files, so now simply check
|
||||
dnl that off_t is big enough
|
||||
define(WX_SYS_LARGEFILE_TEST,
|
||||
[typedef struct {
|
||||
unsigned int field: sizeof(off_t) == 8;
|
||||
} wxlf;
|
||||
])
|
||||
|
||||
|
||||
dnl WX_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR)
|
||||
define(WX_SYS_LARGEFILE_MACRO_VALUE,
|
||||
[
|
||||
AC_CACHE_CHECK([for $1 value needed for large files], [$3],
|
||||
[
|
||||
AC_TRY_COMPILE([#define $1 $2
|
||||
#include <sys/types.h>],
|
||||
WX_SYS_LARGEFILE_TEST,
|
||||
[$3=$2],
|
||||
[$3=no])
|
||||
]
|
||||
)
|
||||
|
||||
if test "$$3" != no; then
|
||||
$wx_largefile=yes
|
||||
AC_DEFINE_UNQUOTED([$1], [$$3])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl AC_SYS_LARGEFILE
|
||||
dnl ----------------
|
||||
dnl By default, many hosts won't let programs access large files;
|
||||
dnl one must use special compiler options to get large-file access to work.
|
||||
dnl For more details about this brain damage please see:
|
||||
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
|
||||
AC_DEFUN([AC_SYS_LARGEFILE],
|
||||
[AC_ARG_ENABLE(largefile,
|
||||
[ --disable-largefile omit support for large files])
|
||||
if test "$enable_largefile" != no; then
|
||||
dnl _FILE_OFFSET_BITS==64 is needed for Linux, Solaris, ...
|
||||
dnl _LARGE_FILES -- for AIX
|
||||
WX_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, ac_cv_sys_file_offset_bits)
|
||||
if test "x$wx_largefile" != "xyes"; then
|
||||
WX_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, ac_cv_sys_large_files)
|
||||
fi
|
||||
|
||||
if test "x$wx_largefile" = "xyes"; then
|
||||
AC_DEFINE(HAVE_LARGEFILE_SUPPORT)
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
78
aclocal.m4
vendored
78
aclocal.m4
vendored
@ -1,15 +1,14 @@
|
||||
# aclocal.m4 generated automatically by aclocal 1.6 -*- Autoconf -*-
|
||||
dnl aclocal.m4 generated automatically by aclocal 1.4
|
||||
|
||||
# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
|
||||
# Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||
dnl This file is free software; the Free Software Foundation
|
||||
dnl gives unlimited permission to copy and/or distribute it,
|
||||
dnl with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
dnl This program is distributed in the hope that it will be useful,
|
||||
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
dnl PARTICULAR PURPOSE.
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl
|
||||
@ -422,6 +421,65 @@ size_t iconv();
|
||||
AC_SUBST(LIBICONV)
|
||||
])
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl AC_SYS_LARGEFILE (partly based on the code from autoconf 2.5x)
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
dnl WX_SYS_LARGEFILE_TEST
|
||||
dnl
|
||||
dnl NB: original autoconf test was checking if compiler supported 6 bit off_t
|
||||
dnl arithmetic properly but this failed miserably with gcc under Linux
|
||||
dnl whereas the system still supports 64 bit files, so now simply check
|
||||
dnl that off_t is big enough
|
||||
define(WX_SYS_LARGEFILE_TEST,
|
||||
[typedef struct {
|
||||
unsigned int field: sizeof(off_t) == 8;
|
||||
} wxlf;
|
||||
])
|
||||
|
||||
|
||||
dnl WX_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR)
|
||||
define(WX_SYS_LARGEFILE_MACRO_VALUE,
|
||||
[
|
||||
AC_CACHE_CHECK([for $1 value needed for large files], [$3],
|
||||
[
|
||||
AC_TRY_COMPILE([#define $1 $2
|
||||
#include <sys/types.h>],
|
||||
WX_SYS_LARGEFILE_TEST,
|
||||
[$3=$2],
|
||||
[$3=no])
|
||||
]
|
||||
)
|
||||
|
||||
if test "$$3" != no; then
|
||||
$wx_largefile=yes
|
||||
AC_DEFINE_UNQUOTED([$1], [$$3])
|
||||
fi
|
||||
])
|
||||
|
||||
|
||||
dnl AC_SYS_LARGEFILE
|
||||
dnl ----------------
|
||||
dnl By default, many hosts won't let programs access large files;
|
||||
dnl one must use special compiler options to get large-file access to work.
|
||||
dnl For more details about this brain damage please see:
|
||||
dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
|
||||
AC_DEFUN([AC_SYS_LARGEFILE],
|
||||
[AC_ARG_ENABLE(largefile,
|
||||
[ --disable-largefile omit support for large files])
|
||||
if test "$enable_largefile" != no; then
|
||||
dnl _FILE_OFFSET_BITS==64 is needed for Linux, Solaris, ...
|
||||
dnl _LARGE_FILES -- for AIX
|
||||
WX_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, ac_cv_sys_file_offset_bits)
|
||||
if test "x$wx_largefile" != "xyes"; then
|
||||
WX_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, ac_cv_sys_large_files)
|
||||
fi
|
||||
|
||||
if test "x$wx_largefile" = "xyes"; then
|
||||
AC_DEFINE(HAVE_LARGEFILE_SUPPORT)
|
||||
fi
|
||||
fi
|
||||
])
|
||||
|
||||
# Configure paths for GTK+
|
||||
# Owen Taylor 1997-2001
|
||||
|
141
configure.in
141
configure.in
@ -1274,6 +1274,78 @@ AC_PROG_LEX
|
||||
dnl needed for making link to setup.h
|
||||
AC_PROG_LN_S
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Checks for compiler characteristics
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
dnl defines const to be empty if c-compiler does not support const fully
|
||||
AC_C_CONST
|
||||
dnl defines inline to a sensible value for the c-compiler
|
||||
AC_C_INLINE
|
||||
|
||||
dnl check the sizes of integral types (give some reasonable default values for
|
||||
dnl cross-compiling)
|
||||
dnl defines the size of certain types of variables in SIZEOF_<TYPE>
|
||||
AC_CHECK_SIZEOF(char, 1)
|
||||
AC_CHECK_SIZEOF(short, 2)
|
||||
AC_CHECK_SIZEOF(void *, 4)
|
||||
AC_CHECK_SIZEOF(int, 4)
|
||||
AC_CHECK_SIZEOF(long, 4)
|
||||
|
||||
case "${host}" in
|
||||
arm-*-linux* )
|
||||
AC_CHECK_SIZEOF(long long, 8)
|
||||
;;
|
||||
* )
|
||||
AC_CHECK_SIZEOF(long long, 0)
|
||||
esac
|
||||
|
||||
|
||||
dnl we have to do it ourselves because SGI/Irix's stdio.h does not include
|
||||
dnl wchar_t and AC_CHECK_SIZEOF only includes stdio.h
|
||||
dnl Mac OS X does not provide wchar.h and wchar_t is defined by stdlib.h (GD)
|
||||
AC_CACHE_CHECK([size of wchar_t], wx_cv_sizeof_wchar_t,
|
||||
[
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
#ifdef HAVE_WCHAR_H
|
||||
# ifdef __CYGWIN__
|
||||
# include <stddef.h>
|
||||
# endif
|
||||
# include <wchar.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
int main()
|
||||
{
|
||||
FILE *f=fopen("conftestval", "w");
|
||||
if (!f) exit(1);
|
||||
fprintf(f, "%i", sizeof(wchar_t));
|
||||
exit(0);
|
||||
}
|
||||
],
|
||||
wx_cv_sizeof_wchar_t=`cat conftestval`,
|
||||
wx_cv_sizeof_wchar_t=0,
|
||||
wx_cv_sizeof_wchar_t=4
|
||||
)
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED(SIZEOF_WCHAR_T, $wx_cv_sizeof_wchar_t)
|
||||
|
||||
dnl check for large file support
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
dnl check for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
|
||||
WX_C_BIGENDIAN
|
||||
|
||||
dnl check for iostream (as opposed to iostream.h) standard header
|
||||
WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
|
||||
|
||||
dnl check whether C++ compiler supports bool built-in type
|
||||
WX_CPP_BOOL
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Define search path for includes and libraries: all headers and libs will be
|
||||
dnl looked for in all directories of this path
|
||||
@ -2676,75 +2748,6 @@ if test "$wx_cv_struct_pw_gecos" = "yes"; then
|
||||
AC_DEFINE(HAVE_PW_GECOS)
|
||||
fi
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Checks for compiler characteristics
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
||||
dnl defines const to be empty if c-compiler does not support const fully
|
||||
AC_C_CONST
|
||||
dnl defines inline to a sensible value for the c-compiler
|
||||
AC_C_INLINE
|
||||
|
||||
dnl check the sizes of integral types (give some reasonable default values for
|
||||
dnl cross-compiling)
|
||||
dnl defines the size of certain types of variables in SIZEOF_<TYPE>
|
||||
AC_CHECK_SIZEOF(char, 1)
|
||||
AC_CHECK_SIZEOF(short, 2)
|
||||
AC_CHECK_SIZEOF(void *, 4)
|
||||
AC_CHECK_SIZEOF(int, 4)
|
||||
AC_CHECK_SIZEOF(long, 4)
|
||||
|
||||
case "${host}" in
|
||||
arm-*-linux* )
|
||||
AC_CHECK_SIZEOF(long long, 8)
|
||||
;;
|
||||
* )
|
||||
AC_CHECK_SIZEOF(long long, 0)
|
||||
esac
|
||||
|
||||
|
||||
dnl we have to do it ourselves because SGI/Irix's stdio.h does not include
|
||||
dnl wchar_t and AC_CHECK_SIZEOF only includes stdio.h
|
||||
dnl Mac OS X does not provide wchar.h and wchar_t is defined by stdlib.h (GD)
|
||||
AC_CACHE_CHECK([size of wchar_t], wx_cv_sizeof_wchar_t,
|
||||
[
|
||||
AC_TRY_RUN(
|
||||
[
|
||||
#ifdef HAVE_WCHAR_H
|
||||
# ifdef __CYGWIN__
|
||||
# include <stddef.h>
|
||||
# endif
|
||||
# include <wchar.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
int main()
|
||||
{
|
||||
FILE *f=fopen("conftestval", "w");
|
||||
if (!f) exit(1);
|
||||
fprintf(f, "%i", sizeof(wchar_t));
|
||||
exit(0);
|
||||
}
|
||||
],
|
||||
wx_cv_sizeof_wchar_t=`cat conftestval`,
|
||||
wx_cv_sizeof_wchar_t=0,
|
||||
wx_cv_sizeof_wchar_t=4
|
||||
)
|
||||
])
|
||||
|
||||
AC_DEFINE_UNQUOTED(SIZEOF_WCHAR_T, $wx_cv_sizeof_wchar_t)
|
||||
|
||||
dnl for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
|
||||
WX_C_BIGENDIAN
|
||||
|
||||
dnl check for iostream (as opposed to iostream.h) standard header
|
||||
WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH))
|
||||
|
||||
dnl check whether C++ compiler supports bool built-in type
|
||||
WX_CPP_BOOL
|
||||
|
||||
dnl ---------------------------------------------------------------------------
|
||||
dnl Check for functions
|
||||
dnl ---------------------------------------------------------------------------
|
||||
|
@ -894,6 +894,9 @@
|
||||
/* Define if you have ftime() */
|
||||
#undef HAVE_FTIME
|
||||
|
||||
/* Define if you have support for large (64 bit size) files */
|
||||
#undef HAVE_LARGEFILE_SUPPORT
|
||||
|
||||
/* Define if you have localtime() */
|
||||
#undef HAVE_LOCALTIME
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user