113
|
1 #serial 4
|
|
2
|
|
3 dnl By default, many hosts won't let programs access large files;
|
|
4 dnl one must use special compiler options to get large-file access to work.
|
|
5 dnl For more details about this brain damage please see:
|
|
6 dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html
|
|
7
|
|
8 dnl Written by Paul Eggert <eggert@twinsun.com>.
|
|
9
|
|
10 dnl Internal subroutine of AC_SYS_LARGEFILE.
|
|
11 dnl AC_SYS_LARGEFILE_FLAGS(FLAGSNAME)
|
|
12 AC_DEFUN(AC_SYS_LARGEFILE_FLAGS,
|
|
13 [AC_CACHE_CHECK([for $1 value to request large file support],
|
|
14 ac_cv_sys_largefile_$1,
|
|
15 [ac_cv_sys_largefile_$1=`($GETCONF LFS_$1) 2>/dev/null` || {
|
|
16 ac_cv_sys_largefile_$1=no
|
|
17 ifelse($1, CFLAGS,
|
|
18 [case "$host_os" in
|
|
19 # IRIX 6.2 and later require cc -n32.
|
|
20 changequote(, )dnl
|
|
21 irix6.[2-9]* | irix6.1[0-9]* | irix[7-9].* | irix[1-9][0-9]*)
|
|
22 changequote([, ])dnl
|
|
23 if test "$GCC" != yes; then
|
|
24 ac_cv_sys_largefile_CFLAGS=-n32
|
|
25 fi
|
|
26 ac_save_CC="$CC"
|
|
27 CC="$CC $ac_cv_sys_largefile_CFLAGS"
|
|
28 AC_TRY_LINK(, , , ac_cv_sys_largefile_CFLAGS=no)
|
|
29 CC="$ac_save_CC"
|
|
30 esac])
|
|
31 }])])
|
|
32
|
|
33 dnl Internal subroutine of AC_SYS_LARGEFILE.
|
|
34 dnl AC_SYS_LARGEFILE_SPACE_APPEND(VAR, VAL)
|
|
35 AC_DEFUN(AC_SYS_LARGEFILE_SPACE_APPEND,
|
|
36 [case $2 in
|
|
37 no) ;;
|
|
38 ?*)
|
|
39 case "[$]$1" in
|
|
40 '') $1=$2 ;;
|
|
41 *) $1=[$]$1' '$2 ;;
|
|
42 esac ;;
|
|
43 esac])
|
|
44
|
|
45 dnl Internal subroutine of AC_SYS_LARGEFILE.
|
|
46 dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, CACHE-VAR, COMMENT, CODE-TO-SET-DEFAULT)
|
|
47 AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE,
|
|
48 [AC_CACHE_CHECK([for $1], $2,
|
|
49 [$2=no
|
|
50 changequote(, )dnl
|
|
51 $4
|
|
52 for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
|
|
53 case "$ac_flag" in
|
|
54 -D$1)
|
|
55 $2=1 ;;
|
|
56 -D$1=*)
|
|
57 $2=`expr " $ac_flag" : '[^=]*=\(.*\)'` ;;
|
|
58 esac
|
|
59 done
|
|
60 changequote([, ])dnl
|
|
61 ])
|
|
62 if test "[$]$2" != no; then
|
|
63 AC_DEFINE_UNQUOTED([$1], [$]$2, [$3])
|
|
64 fi])
|
|
65
|
|
66 AC_DEFUN(AC_SYS_LARGEFILE,
|
|
67 [AC_REQUIRE([AC_CANONICAL_HOST])
|
|
68 AC_ARG_ENABLE(largefile,
|
|
69 [ --disable-largefile omit support for large files])
|
|
70 if test "$enable_largefile" != no; then
|
|
71 AC_CHECK_TOOL(GETCONF, getconf)
|
|
72 AC_SYS_LARGEFILE_FLAGS(CFLAGS)
|
|
73 AC_SYS_LARGEFILE_FLAGS(LDFLAGS)
|
|
74 AC_SYS_LARGEFILE_FLAGS(LIBS)
|
|
75
|
|
76 for ac_flag in $ac_cv_sys_largefile_CFLAGS no; do
|
|
77 case "$ac_flag" in
|
|
78 no) ;;
|
|
79 -D_FILE_OFFSET_BITS=*) ;;
|
|
80 -D_LARGEFILE_SOURCE | -D_LARGEFILE_SOURCE=*) ;;
|
|
81 -D_LARGE_FILES | -D_LARGE_FILES=*) ;;
|
|
82 -D?* | -I?*)
|
|
83 AC_SYS_LARGEFILE_SPACE_APPEND(CPPFLAGS, "$ac_flag") ;;
|
|
84 *)
|
|
85 AC_SYS_LARGEFILE_SPACE_APPEND(CFLAGS, "$ac_flag") ;;
|
|
86 esac
|
|
87 done
|
|
88 AC_SYS_LARGEFILE_SPACE_APPEND(LDFLAGS, "$ac_cv_sys_largefile_LDFLAGS")
|
|
89 AC_SYS_LARGEFILE_SPACE_APPEND(LIBS, "$ac_cv_sys_largefile_LIBS")
|
|
90 AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS,
|
|
91 ac_cv_sys_file_offset_bits,
|
|
92 [Number of bits in a file offset, on hosts where this is settable.]
|
|
93 [case "$host_os" in
|
|
94 # HP-UX 10.20 and later
|
|
95 hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
|
|
96 ac_cv_sys_file_offset_bits=64 ;;
|
|
97 esac])
|
|
98 AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE,
|
|
99 ac_cv_sys_largefile_source,
|
|
100 [Define to make fseeko etc. visible, on some hosts.],
|
|
101 [case "$host_os" in
|
|
102 # HP-UX 10.20 and later
|
|
103 hpux10.[2-9][0-9]* | hpux1[1-9]* | hpux[2-9][0-9]*)
|
|
104 ac_cv_sys_largefile_source=1 ;;
|
|
105 esac])
|
|
106 AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES,
|
|
107 ac_cv_sys_large_files,
|
|
108 [Define for large files, on AIX-style hosts.],
|
|
109 [case "$host_os" in
|
|
110 # AIX 4.2 and later
|
|
111 aix4.[2-9]* | aix4.1[0-9]* | aix[5-9].* | aix[1-9][0-9]*)
|
|
112 ac_cv_sys_large_files=1 ;;
|
|
113 esac])
|
|
114 fi
|
|
115 ])
|
202
|
116
|
|
117 # serial 1
|
|
118
|
328
|
119 dnl This function is derived from
|
|
120 dnl http://savannah.gnu.org/cgi-bin/viewcvs/gcc/gcc/libjava/configure.in?rev=1.142.2.7&content-type=text/vnd.viewcvs-markup
|
202
|
121
|
|
122 AC_DEFUN(AC_TYPE_SOCKLEN_T,
|
|
123 [AC_MSG_CHECKING([for socklen_t in sys/socket.h])
|
|
124 AC_TRY_COMPILE([#define _POSIX_PII_SOCKET
|
|
125 #include <sys/types.h>
|
|
126 #include <sys/socket.h>], [socklen_t x = 5;],
|
|
127 [AC_MSG_RESULT(yes)],
|
207
|
128 [AC_DEFINE(socklen_t,int,Need to define socklen_t as an int because it should be in sys/socket.h)
|
202
|
129 AC_MSG_RESULT(no)])
|
|
130 ])
|
|
131
|
328
|
132 # serial 1
|
|
133
|
|
134 dnl This macro checks to see if the printf family of functions supports the
|
|
135 dnl %'ld format.
|
|
136
|
|
137 dnl Brian Masney <masneyb@gftp.org>
|
|
138
|
|
139 dnl
|
|
140 AC_DEFUN(AC_INTL_PRINTF,
|
|
141 [AC_MSG_CHECKING([whether the printf family of functions supports %'ld])
|
|
142 AC_TRY_RUN([#include <stdio.h>
|
|
143 #include <string.h>
|
|
144
|
|
145 int main(void) {
|
|
146 char buf[20];
|
|
147 sprintf (buf, "%'ld", (long) 1);
|
330
|
148 if (strchr (buf, '1') == NULL)
|
328
|
149 return (1);
|
|
150 return (0);
|
|
151 }],
|
|
152 [AC_DEFINE(HAVE_INTL_PRINTF,1,Define if printf supports %'ld)
|
|
153 AC_MSG_RESULT(yes)],
|
|
154 [AC_MSG_RESULT(no)])
|
|
155 ])
|
|
156
|
478
|
157 # serial 1
|
|
158
|
|
159 dnl Brian Masney <masneyb@gftp.org>
|
|
160
|
|
161 AC_DEFUN(AC_TYPE_INTPTR_T,
|
|
162 [AC_MSG_CHECKING([for intptr_t in stdint.h])
|
|
163 AC_TRY_COMPILE([#include <stdint.h>],
|
|
164 [intptr_t i = 0;],
|
|
165 [AC_MSG_RESULT(yes)],
|
|
166 [AC_DEFINE(intptr_t,long,Need to define intptr_t as a long because it should be in stdint.h)
|
|
167 AC_MSG_RESULT(no)])
|
|
168 ])
|
|
169
|