ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/IO-AIO/configure.ac
(Generate patch)

Comparing IO-AIO/configure.ac (file contents):
Revision 1.2 by root, Wed Dec 1 04:43:13 2010 UTC vs.
Revision 1.8 by root, Tue Aug 14 11:44:52 2018 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines