| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_FLAGS], |
|---|
| 11 |
[AC_CACHE_CHECK([for $1 value to request large file support], |
|---|
| 12 |
ac_cv_sys_largefile_$1, |
|---|
| 13 |
[ac_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || { |
|---|
| 14 |
ac_cv_sys_largefile_$1=no |
|---|
| 15 |
ifelse($1, CFLAGS, |
|---|
| 16 |
[case "$host_os" in |
|---|
| 17 |
|
|---|
| 18 |
changequote(, ) |
|---|
| 19 |
irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*) |
|---|
| 20 |
changequote([, ]) |
|---|
| 21 |
if test "$GCC" != yes; then |
|---|
| 22 |
ac_cv_sys_largefile_CFLAGS=-n32 |
|---|
| 23 |
fi |
|---|
| 24 |
ac_save_CC="$CC" |
|---|
| 25 |
CC="$CC $ac_cv_sys_largefile_CFLAGS" |
|---|
| 26 |
AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no) |
|---|
| 27 |
CC="$ac_save_CC" |
|---|
| 28 |
esac]) |
|---|
| 29 |
}])]) |
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND], |
|---|
| 34 |
[case $2 in |
|---|
| 35 |
no) ;; |
|---|
| 36 |
?*) |
|---|
| 37 |
case "[$]$1" in |
|---|
| 38 |
'') $1=$2 ;; |
|---|
| 39 |
*) $1=[$]$1' '$2 ;; |
|---|
| 40 |
esac ;; |
|---|
| 41 |
esac]) |
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE], |
|---|
| 46 |
[AC_CACHE_CHECK([for $1], $2, |
|---|
| 47 |
[$2=no |
|---|
| 48 |
changequote(, ) |
|---|
| 49 |
$4 |
|---|
| 50 |
for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do |
|---|
| 51 |
case "$ac_flag" in |
|---|
| 52 |
-D$1) |
|---|
| 53 |
$2=1 ;; |
|---|
| 54 |
-D$1=*) |
|---|
| 55 |
$2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;; |
|---|
| 56 |
esac |
|---|
| 57 |
done |
|---|
| 58 |
changequote([, ]) |
|---|
| 59 |
]) |
|---|
| 60 |
if test "[$]$2" != no; then |
|---|
| 61 |
AC_DEFINE_UNQUOTED([$1], [$]$2, [$3]) |
|---|
| 62 |
fi]) |
|---|
| 63 |
|
|---|
| 64 |
AC_DEFUN([AC_SYS_EXTRA_LARGEFILE], |
|---|
| 65 |
[AC_REQUIRE([AC_CANONICAL_HOST]) |
|---|
| 66 |
AC_ARG_ENABLE(largefile, |
|---|
| 67 |
[ --disable-largefile omit support for large files]) |
|---|
| 68 |
if test "$enable_largefile" != no; then |
|---|
| 69 |
AC_CHECK_TOOL(GETCONF, getconf) |
|---|
| 70 |
AC_SYS_EXTRA_LARGEFILE_FLAGS(CFLAGS) |
|---|
| 71 |
AC_SYS_EXTRA_LARGEFILE_FLAGS(LDFLAGS) |
|---|
| 72 |
AC_SYS_EXTRA_LARGEFILE_FLAGS(LIBS) |
|---|
| 73 |
|
|---|
| 74 |
for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do |
|---|
| 75 |
case "$ac_flag" in |
|---|
| 76 |
no) ;; |
|---|
| 77 |
-D_FILE_OFFSET_BITS=*) ;; |
|---|
| 78 |
-D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;; |
|---|
| 79 |
-D_LARGE_FILES | -D_LARGE_FILES=*) ;; |
|---|
| 80 |
-D?* | -I?*) |
|---|
| 81 |
AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;; |
|---|
| 82 |
*) |
|---|
| 83 |
AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;; |
|---|
| 84 |
esac |
|---|
| 85 |
done |
|---|
| 86 |
AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS") |
|---|
| 87 |
AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS") |
|---|
| 88 |
AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, |
|---|
| 89 |
ac_cv_sys_file_offset_bits, |
|---|
| 90 |
[Number of bits in a file offset, on hosts where this is settable.]) |
|---|
| 91 |
[case "$host_os" in |
|---|
| 92 |
|
|---|
| 93 |
hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) |
|---|
| 94 |
ac_cv_sys_file_offset_bits=64 ;; |
|---|
| 95 |
esac] |
|---|
| 96 |
AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, |
|---|
| 97 |
ac_cv_sys_largefile_source, |
|---|
| 98 |
[Define to make fseeko etc. visible, on some hosts.], |
|---|
| 99 |
[case "$host_os" in |
|---|
| 100 |
|
|---|
| 101 |
hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*) |
|---|
| 102 |
ac_cv_sys_largefile_source=1 ;; |
|---|
| 103 |
esac]) |
|---|
| 104 |
AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(_LARGE_FILES, |
|---|
| 105 |
ac_cv_sys_large_files, |
|---|
| 106 |
[Define for large files, on AIX-style hosts.], |
|---|
| 107 |
[case "$host_os" in |
|---|
| 108 |
|
|---|
| 109 |
aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*) |
|---|
| 110 |
ac_cv_sys_large_files=1 ;; |
|---|
| 111 |
esac]) |
|---|
| 112 |
fi |
|---|
| 113 |
]) |
|---|
| 114 |
|
|---|