Bug fixed for unix error "readlink /proc/self/fd/0" on MacOS.
[Faustine.git] / interpreter / lib / src / libsndfile-1.0.25 / M4 / extra_largefile.m4
1 dnl By default, many hosts won't let programs access large files;
2 dnl one must use special compiler options to get large-file access to work.
3 dnl For more details about this brain damage please see:
4 dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
5
6 dnl Written by Paul Eggert <eggert@twinsun.com>.
7
8 dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE.
9 dnl MN_SYS_EXTRA_LARGEFILE_FLAGS(FLAGSNAME)
10 AC_DEFUN([MN_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 # IRIX 6.2 and later require cc -n32.
18 changequote(, )dnl
19 irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
20 changequote([, ])dnl
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 dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE.
32 dnl AC_SYS_EXTRA_LARGEFILE_SPACE_APPEND(VAR, VAL)
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 dnl Internal subroutine of AC_SYS_EXTRA_LARGEFILE.
44 dnl AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
45 AC_DEFUN([AC_SYS_EXTRA_LARGEFILE_MACRO_VALUE],
46 [AC_CACHE_CHECK([for $1], $2,
47 [$2=no
48 changequote(, )dnl
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([, ])dnl
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 MN_SYS_EXTRA_LARGEFILE_FLAGS(CFLAGS)
71 MN_SYS_EXTRA_LARGEFILE_FLAGS(LDFLAGS)
72 MN_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 # HP-UX 10.20 and later
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 # HP-UX 10.20 and later
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 # AIX 4.2 and later
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