ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/configure.ac
Revision: 1.11
Committed: Sun Mar 10 12:11:46 2019 UTC (5 years, 2 months ago) by root
Branch: MAIN
CVS Tags: rel-4_71
Changes since 1.10: +1 -0 lines
Log Message:
4.71

File Contents

# User Rev Content
1 root 1.1 AC_INIT
2     AC_CONFIG_SRCDIR([libeio/eio.h])
3 root 1.6 AC_CONFIG_HEADERS([config.h])
4 root 1.1
5 root 1.5 AC_PREREQ(2.60)
6     AC_USE_SYSTEM_EXTENSIONS
7    
8 root 1.1 AC_PROG_CC
9    
10     m4_include([libeio/libeio.m4])
11    
12 root 1.6 # for these to work, you need to run autoheader in IO::AIO, not libeio :(
13    
14     AC_CACHE_CHECK(for set/getrlimit, ac_cv_rlimits, [AC_LINK_IFELSE([AC_LANG_SOURCE([[
15     #include <sys/time.h>
16     #include <sys/resource.h>
17     int res;
18     int main (void)
19     {
20     struct rlimit srl;
21     srl.rlim_cur = srl.rlim_max = RLIM_INFINITY;
22     res = getrlimit (RLIMIT_NOFILE, &srl);
23     res = setrlimit (RLIMIT_NOFILE, &srl);
24     return 0;
25     }
26     ]])],ac_cv_rlimits=yes,ac_cv_rlimits=no)])
27     test $ac_cv_rlimits = yes && AC_DEFINE(HAVE_RLIMITS, 1, setrlimit/getrlimit is available)
28    
29     dnl at least uclibc defines _POSIX_ADVISORY_INFO without *any* of the required
30     dnl functionality actually being present. ugh.
31     AC_CACHE_CHECK(for posix_madvise, ac_cv_posix_madvise, [AC_LINK_IFELSE([AC_LANG_SOURCE([
32     #include <sys/mman.h>
33     int main (void)
34     {
35     int res = posix_madvise ((void *)0, (size_t)0, POSIX_MADV_NORMAL);
36     int a = POSIX_MADV_SEQUENTIAL;
37     int b = POSIX_MADV_RANDOM;
38     int c = POSIX_MADV_WILLNEED;
39     int d = POSIX_MADV_DONTNEED;
40     return 0;
41     }
42     ])],ac_cv_posix_madvise=yes,ac_cv_posix_madvise=no)])
43     test $ac_cv_posix_madvise = yes && AC_DEFINE(HAVE_POSIX_MADVISE, 1, posix_madvise(2) is available)
44    
45     AC_CACHE_CHECK(for posix_fadvise, ac_cv_posix_fadvise, [AC_LINK_IFELSE([AC_LANG_SOURCE([
46     #define _XOPEN_SOURCE 600
47     #include <fcntl.h>
48     int main (void)
49     {
50     int res = posix_fadvise ((int)0, (off_t)0, (off_t)0, POSIX_FADV_NORMAL);
51     int a = POSIX_FADV_SEQUENTIAL;
52     int b = POSIX_FADV_NOREUSE;
53     int c = POSIX_FADV_RANDOM;
54     int d = POSIX_FADV_WILLNEED;
55     int e = POSIX_FADV_DONTNEED;
56     return 0;
57     }
58     ])],ac_cv_posix_fadvise=yes,ac_cv_posix_fadvise=no)])
59     test $ac_cv_posix_fadvise = yes && AC_DEFINE(HAVE_POSIX_FADVISE, 1, posix_fadvise(2) is available)
60    
61     dnl lots of linux specifics
62     AC_CHECK_HEADERS([linux/fs.h linux/fiemap.h])
63    
64 root 1.8 dnl glibc major/minor macros
65     AC_CHECK_HEADERS([sys/sysmacros.h])
66    
67 root 1.9 dnl solaris major/minor
68     AC_CHECK_HEADERS([sys/mkdev.h])
69    
70 root 1.6 AC_CACHE_CHECK([for splice, vmsplice and tee], ac_cv_linux_splice, [AC_LINK_IFELSE([AC_LANG_SOURCE([
71 root 1.11 #include <sys/types.h>
72 root 1.6 #include <fcntl.h>
73     int main (void)
74     {
75     ssize_t res;
76     res = splice ((int)0, (loff_t)0, (int)0, (loff_t *)0, (size_t)0, SPLICE_F_MOVE | SPLICE_F_NONBLOCK | SPLICE_F_MORE);
77     res = tee ((int)0, (int)0, (size_t)0, SPLICE_F_NONBLOCK);
78     res = vmsplice ((int)0, (struct iovec *)0, 0, SPLICE_F_NONBLOCK | SPLICE_F_GIFT);
79     return 0;
80     }
81     ])],ac_cv_linux_splice=yes,ac_cv_linux_splice=no)])
82     test $ac_cv_linux_splice = yes && AC_DEFINE(HAVE_LINUX_SPLICE, 1, splice/vmsplice/tee(2) are available)
83    
84     AC_CACHE_CHECK(for pipe2, ac_cv_pipe2, [AC_LINK_IFELSE([AC_LANG_SOURCE([[
85     #include <fcntl.h>
86     #include <unistd.h>
87     int res;
88     int main (void)
89     {
90     res = pipe2 (0, 0);
91     return 0;
92     }
93     ]])],ac_cv_pipe2=yes,ac_cv_pipe2=no)])
94     test $ac_cv_pipe2 = yes && AC_DEFINE(HAVE_PIPE2, 1, pipe2(2) is available)
95    
96     AC_CACHE_CHECK(for eventfd, ac_cv_eventfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[
97     #include <sys/eventfd.h>
98     int res;
99     int main (void)
100     {
101     res = eventfd (1, EFD_CLOEXEC | EFD_NONBLOCK);
102     return 0;
103     }
104     ]])],ac_cv_eventfd=yes,ac_cv_eventfd=no)])
105     test $ac_cv_eventfd = yes && AC_DEFINE(HAVE_EVENTFD, 1, eventfd(2) is available)
106    
107     AC_CACHE_CHECK(for timerfd, ac_cv_timerfd, [AC_LINK_IFELSE([AC_LANG_SOURCE([[
108     #include <sys/timerfd.h>
109     int res;
110     int main (void)
111     {
112     struct itimerspec its;
113     res = timerfd_create (CLOCK_REALTIME, TFD_CLOEXEC | TFD_NONBLOCK);
114     res = timerfd_settime (res, TFD_TIMER_ABSTIME /*| TFD_TIMER_CANCEL_ON_SET*/, &its, 0);
115     res = timerfd_gettime (res, &its);
116     return 0;
117     }
118     ]])],ac_cv_timerfd=yes,ac_cv_timerfd=no)])
119     test $ac_cv_timerfd = yes && AC_DEFINE(HAVE_TIMERFD, 1, timerfd_*(2) are available)
120    
121     AC_CACHE_CHECK(for copy_file_range, ac_cv_copy_file_range, [AC_LINK_IFELSE([AC_LANG_SOURCE([[
122     #include <unistd.h>
123     #include <sys/syscall.h>
124     /*#include <linux/copy.h>*/
125     int res;
126     int main (void)
127     {
128     /*res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, COPY_FR_REFLINK | COPY_FR_DEDUP | COPY_FR_COPY);*/
129     res = syscall (SYS_copy_file_range, 0, 0, 0, 0, 0, 0);
130     return 0;
131     }
132     ]])],ac_cv_copy_file_range=yes,ac_cv_copy_file_range=no)])
133     test $ac_cv_copy_file_range = yes && AC_DEFINE(HAVE_COPY_FILE_RANGE, 1, copy_file_range(2) is available)
134    
135     AC_CACHE_CHECK(for st_xtimensec, ac_cv_xtimensec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
136     #include "EXTERN.h"
137     #include "perl.h"
138     #include "XSUB.h"
139    
140     int main (void)
141     {
142     return PL_statcache.st_atimensec
143     + PL_statcache.st_mtimensec
144     + PL_statcache.st_ctimensec;
145     }
146     ]])],ac_cv_xtimensec=yes,ac_cv_xtimensec=no)])
147     test $ac_cv_xtimensec = yes && AC_DEFINE(HAVE_ST_XTIMENSEC, 1, stat nanosecond access by st_xtimensec)
148    
149     AC_CACHE_CHECK(for st_xtimespec, ac_cv_xtimespec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
150     #include "EXTERN.h"
151     #include "perl.h"
152     #include "XSUB.h"
153    
154     int main (void)
155     {
156     return PL_statcache.st_atim.tv_nsec
157     + PL_statcache.st_mtim.tv_nsec
158     + PL_statcache.st_ctim.tv_nsec;
159     }
160     ]])],ac_cv_xtimespec=yes,ac_cv_xtimespec=no)])
161     test $ac_cv_xtimespec = yes && AC_DEFINE(HAVE_ST_XTIMESPEC, 1, stat nanosecond access by st_xtimespec)
162    
163 root 1.7 # apparently, True64 uses st_u[amc]time, aix uses at_[amc]time_n and apple uses st_[amc,birth]timespec?
164    
165 root 1.10 AC_CACHE_CHECK(for st_birthtimensec, ac_cv_birthtimensec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
166     #include "EXTERN.h"
167     #include "perl.h"
168     #include "XSUB.h"
169    
170     int main (void)
171     {
172     return PL_statcache.st_birthtime + PL_statcache.st_birthtimensec;
173     }
174     ]])],ac_cv_birthtimensec=yes,ac_cv_birthtimensec=no)])
175     test $ac_cv_birthtimensec = yes && AC_DEFINE(HAVE_ST_BIRTHTIMENSEC, 1, birthtime nanosecond access by st_birthtimensec)
176    
177     AC_CACHE_CHECK(for st_birthtimespec, ac_cv_birthtimespec, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
178     #include "EXTERN.h"
179     #include "perl.h"
180     #include "XSUB.h"
181    
182     int main (void)
183     {
184     return PL_statcache.st_birthtim.tv_sec + PL_statcache.st_birthtim.tv_nsec;
185     }
186     ]])],ac_cv_birthtimespec=yes,ac_cv_birthtimespec=no)])
187     test $ac_cv_birthtimespec = yes && AC_DEFINE(HAVE_ST_BIRTHTIMESPEC, 1, birthtime nanosecond access by st_birthtimespec)
188    
189     AC_CACHE_CHECK(for st_gen, ac_cv_st_gen, [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
190     #include "EXTERN.h"
191     #include "perl.h"
192     #include "XSUB.h"
193    
194     int main (void)
195     {
196     return PL_statcache.st_gen;
197     }
198     ]])],ac_cv_st_gen=yes,ac_cv_st_gen=no)])
199     test $ac_cv_st_gen = yes && AC_DEFINE(HAVE_ST_GEN, 1, stat st_gen member)
200    
201 root 1.1 AC_OUTPUT
202 root 1.6