| [c59712e] | 1 | #                                               -*- Autoconf -*-
 | 
|---|
 | 2 | # Process this file with autoconf to produce a configure script.
 | 
|---|
 | 3 | 
 | 
|---|
 | 4 | AC_PREREQ([2.68])
 | 
|---|
| [08ce416] | 5 | AC_INIT([cfa-cc],[1.0.0],[cforall@plg.uwaterloo.ca])
 | 
|---|
| [38d12e7] | 6 | AC_CONFIG_AUX_DIR([automake])
 | 
|---|
 | 7 | AC_CONFIG_MACRO_DIRS([automake])
 | 
|---|
| [575a6e5] | 8 | AM_SILENT_RULES([yes])
 | 
|---|
| [c59712e] | 9 | 
 | 
|---|
| [bcadb26] | 10 | m4_include([../tools/build/cfa.m4])
 | 
|---|
| [37fe352] | 11 | 
 | 
|---|
| [c59712e] | 12 | AM_INIT_AUTOMAKE([subdir-objects])
 | 
|---|
 | 13 | 
 | 
|---|
| [575a6e5] | 14 | # don't use the default CFLAGS as they unconditonnaly add -O2
 | 
|---|
 | 15 | : ${CFLAGS=""}
 | 
|---|
 | 16 | 
 | 
|---|
| [2b3d6ff] | 17 | # define this to override
 | 
|---|
 | 18 | AR_FLAGS="cr"
 | 
|---|
 | 19 | 
 | 
|---|
| [c59712e] | 20 | # Allow program name tansformation
 | 
|---|
 | 21 | # will fill program_transform_name with appropriate sed regex
 | 
|---|
 | 22 | AC_ARG_PROGRAM
 | 
|---|
 | 23 | 
 | 
|---|
| [37fe352] | 24 | AC_ARG_VAR(ARCHITECTURE,  [The architecture  to use when building libcfa])
 | 
|---|
| [c59712e] | 25 | AC_ARG_VAR(CONFIGURATION, [The configuration to use when building libcfa, options are: deubg, nodebug, nolib (prelude-only)])
 | 
|---|
| [ff1e0f38] | 26 | AC_ARG_VAR(DRIVER_DIR, [The path to the cforall driver directory])
 | 
|---|
| [c6bbcdb] | 27 | AC_ARG_VAR(CFA_VERSION, [The long version of cfa])
 | 
|---|
| [ff1e0f38] | 28 | 
 | 
|---|
| [bbfd0e0] | 29 | AC_ARG_ENABLE(distcc,
 | 
|---|
 | 30 |         [  --enable-distcc     whether or not to enable distributed compilation],
 | 
|---|
 | 31 |         enable_distcc=$enableval, enable_distcc=no)
 | 
|---|
 | 32 | 
 | 
|---|
| [7c6b262] | 33 | AC_ARG_WITH(bwlimit,
 | 
|---|
 | 34 |         [  --with-bwlimit=RATE     RATE the maximum rate at which rsync will be limited when using distributed builds],
 | 
|---|
 | 35 |         DIST_BWLIMIT=$withval, DIST_BWLIMIT=0)
 | 
|---|
 | 36 | 
 | 
|---|
| [bbfd0e0] | 37 | echo -n "checking for distributated build... "
 | 
|---|
 | 38 | if test x$enable_distcc = xno; then
 | 
|---|
 | 39 |         CFACC=${DRIVER_DIR}cfa
 | 
|---|
 | 40 |         echo "no"
 | 
|---|
 | 41 | else
 | 
|---|
| [d65f92c] | 42 |         tools="$(readlink -m $ac_confdir/)/../tools/build"
 | 
|---|
 | 43 |         config=$(basename $(readlink -f .))
 | 
|---|
 | 44 |         echo "$tools/distcc_hash $config"
 | 
|---|
 | 45 |         CFADIR_HASH=$($tools/distcc_hash $config)
 | 
|---|
| [14347ac] | 46 |         CFACC="distcc ~/.cfadistcc/${CFADIR_HASH}/cfa"
 | 
|---|
| [bbfd0e0] | 47 |         echo "yes (hash=${CFADIR_HASH})"
 | 
|---|
 | 48 | fi
 | 
|---|
| [14347ac] | 49 | CFACPP=${DRIVER_DIR}cfa-cpp
 | 
|---|
| [bbfd0e0] | 50 | LOCAL_CFACC=${DRIVER_DIR}cfa
 | 
|---|
| [81e60f7] | 51 | LOCAL_CC1=${DRIVER_DIR}cc1
 | 
|---|
| [bbfd0e0] | 52 | 
 | 
|---|
 | 53 | AM_CONDITIONAL([ENABLE_DISTCC], [test x$enable_distcc = xyes])
 | 
|---|
 | 54 | 
 | 
|---|
| [ff1e0f38] | 55 | AC_SUBST(CFACC)
 | 
|---|
 | 56 | AC_SUBST(CFACPP)
 | 
|---|
| [bbfd0e0] | 57 | AC_SUBST(LOCAL_CFACC)
 | 
|---|
| [81e60f7] | 58 | AC_SUBST(LOCAL_CC1)
 | 
|---|
| [bbfd0e0] | 59 | AC_SUBST(CFADIR_HASH)
 | 
|---|
| [c6bbcdb] | 60 | AC_SUBST(CFA_VERSION)
 | 
|---|
| [7c6b262] | 61 | AC_SUBST(DIST_BWLIMIT)
 | 
|---|
| [ff1e0f38] | 62 | 
 | 
|---|
| [575a6e5] | 63 | #==============================================================================
 | 
|---|
 | 64 | #Handle specific flags
 | 
|---|
| [37fe352] | 65 | case $ARCHITECTURE in
 | 
|---|
 | 66 |         "x64"        ) ARCH_FLAGS="-m64";;
 | 
|---|
 | 67 |         "x86"        ) ARCH_FLAGS="-m32";;
 | 
|---|
 | 68 |         "arm"        ) ARCH_FLAGS="";;
 | 
|---|
 | 69 | esac
 | 
|---|
| [ff1e0f38] | 70 | 
 | 
|---|
| [37fe352] | 71 | AC_SUBST(ARCH_FLAGS)
 | 
|---|
| [ff1e0f38] | 72 | 
 | 
|---|
| [575a6e5] | 73 | case $CONFIGURATION in
 | 
|---|
 | 74 |         "debug"   )
 | 
|---|
| [c8c0c7c5] | 75 |                 CONFIG_CFLAGS="-O0 -g"
 | 
|---|
| [575a6e5] | 76 |                 CONFIG_CFAFLAGS="-debug"
 | 
|---|
| [e523b07] | 77 |                 CONFIG_BUILDLIB="yes"
 | 
|---|
| [575a6e5] | 78 |         ;;
 | 
|---|
 | 79 |         "nodebug" )
 | 
|---|
| [3fcbdca1] | 80 |                 CONFIG_CFLAGS="-O3 -s"
 | 
|---|
| [575a6e5] | 81 |                 CONFIG_CFAFLAGS="-nodebug"
 | 
|---|
| [e523b07] | 82 |                 CONFIG_BUILDLIB="yes"
 | 
|---|
| [575a6e5] | 83 |         ;;
 | 
|---|
 | 84 |         "nolib"   )
 | 
|---|
| [3fcbdca1] | 85 |                 CONFIG_CFLAGS="-O3 -s"
 | 
|---|
| [c9e640e] | 86 |                 CONFIG_CFAFLAGS="-nolib"
 | 
|---|
| [e523b07] | 87 |                 CONFIG_BUILDLIB="no"
 | 
|---|
| [575a6e5] | 88 |         ;;
 | 
|---|
| [3fcbdca1] | 89 |         "profile" )
 | 
|---|
 | 90 |                 CONFIG_CFLAGS="-O3 -g -fno-omit-frame-pointer"
 | 
|---|
 | 91 |                 CONFIG_CFAFLAGS="-nodebug"
 | 
|---|
 | 92 |                 CONFIG_BUILDLIB="yes"
 | 
|---|
 | 93 |         ;;
 | 
|---|
| [d119b984] | 94 |         *)
 | 
|---|
 | 95 |         AC_MSG_ERROR('Invalid value $CONFIGURATION for \$CONFIGURATION')
 | 
|---|
 | 96 |         ;;
 | 
|---|
| [575a6e5] | 97 | esac
 | 
|---|
 | 98 | 
 | 
|---|
| [13363f4] | 99 | CONFIG_CFAFLAGS="${CONFIG_CFAFLAGS} ${CFAFLAGS}"
 | 
|---|
 | 100 | 
 | 
|---|
| [575a6e5] | 101 | AC_SUBST(CONFIG_CFLAGS)
 | 
|---|
 | 102 | AC_SUBST(CONFIG_CFAFLAGS)
 | 
|---|
| [e523b07] | 103 | AC_SUBST(CONFIG_BUILDLIB)
 | 
|---|
 | 104 | 
 | 
|---|
 | 105 | AM_CONDITIONAL([BUILDLIB], [test "x${CONFIG_BUILDLIB}" = "xyes"])
 | 
|---|
| [575a6e5] | 106 | 
 | 
|---|
| [3ac8b9f] | 107 | AM_T='$(T)'
 | 
|---|
 | 108 | AC_SUBST(AM_T)
 | 
|---|
 | 109 | 
 | 
|---|
| [37fe352] | 110 | #==============================================================================
 | 
|---|
 | 111 | #Trasforming cc1 will break compilation
 | 
|---|
 | 112 | M4CFA_PROGRAM_NAME
 | 
|---|
| [ff1e0f38] | 113 | 
 | 
|---|
| [37fe352] | 114 | #==============================================================================
 | 
|---|
 | 115 | # Installation paths
 | 
|---|
 | 116 | M4CFA_PARSE_PREFIX
 | 
|---|
| [c59712e] | 117 | 
 | 
|---|
 | 118 | # Checks for programs.
 | 
|---|
| [04bc1c0] | 119 | LT_INIT([disable-static])
 | 
|---|
| [38d12e7] | 120 | 
 | 
|---|
| [c59712e] | 121 | AC_PROG_CXX
 | 
|---|
 | 122 | AC_PROG_CC
 | 
|---|
 | 123 | AM_PROG_AS
 | 
|---|
| [107b01a] | 124 | AC_PROG_LIBTOOL
 | 
|---|
| [c59712e] | 125 | AC_PROG_INSTALL
 | 
|---|
 | 126 | AC_PROG_MAKE_SET
 | 
|---|
 | 127 | 
 | 
|---|
| [5751a56] | 128 | 
 | 
|---|
 | 129 | 
 | 
|---|
 | 130 | #io_uring 5.4 and earlier uses defines
 | 
|---|
 | 131 | #io_uring 5.5 uses enum values
 | 
|---|
 | 132 | #io_uring 5.6 and later uses probes
 | 
|---|
| [d3a518c] | 133 | 
 | 
|---|
| [dad9c9f] | 134 | AH_TEMPLATE([CFA_HAVE_LINUX_RSEQ_H],[Defined if rseq support is present when compiling libcfathread.])
 | 
|---|
 | 135 | AC_CHECK_HEADERS([linux/rseq.h], [AC_DEFINE(CFA_HAVE_LINUX_RSEQ_H)])
 | 
|---|
 | 136 | 
 | 
|---|
 | 137 | AH_TEMPLATE([CFA_HAVE_LINUX_LIBRSEQ],[Defined if librseq support is present when compiling libcfathread.])
 | 
|---|
 | 138 | AC_CHECK_LIB([rseq], [rseq_available], [AC_DEFINE(CFA_HAVE_LINUX_RSEQ_H)], [])
 | 
|---|
 | 139 | 
 | 
|---|
| [d3a518c] | 140 | AH_TEMPLATE([CFA_HAVE_LINUX_IO_URING_H],[Defined if io_uring support is present when compiling libcfathread.])
 | 
|---|
 | 141 | AH_TEMPLATE([CFA_HAVE_IORING_OP_NOP],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_NOP.])
 | 
|---|
 | 142 | AH_TEMPLATE([CFA_HAVE_IORING_OP_READV],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_READV.])
 | 
|---|
 | 143 | AH_TEMPLATE([CFA_HAVE_IORING_OP_WRITEV],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_WRITEV.])
 | 
|---|
 | 144 | AH_TEMPLATE([CFA_HAVE_IORING_OP_FSYNC],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_FSYNC.])
 | 
|---|
 | 145 | AH_TEMPLATE([CFA_HAVE_IORING_OP_READ_FIXED],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_READ_FIXED.])
 | 
|---|
 | 146 | AH_TEMPLATE([CFA_HAVE_IORING_OP_WRITE_FIXED],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_WRITE_FIXED.])
 | 
|---|
 | 147 | AH_TEMPLATE([CFA_HAVE_IORING_OP_POLL_ADD],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_POLL_ADD.])
 | 
|---|
 | 148 | AH_TEMPLATE([CFA_HAVE_IORING_OP_POLL_REMOVE],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_POLL_REMOVE.])
 | 
|---|
 | 149 | AH_TEMPLATE([CFA_HAVE_IORING_OP_SYNC_FILE_RANGE],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_SYNC_FILE_RANGE.])
 | 
|---|
 | 150 | AH_TEMPLATE([CFA_HAVE_IORING_OP_SENDMSG],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_SENDMSG.])
 | 
|---|
 | 151 | AH_TEMPLATE([CFA_HAVE_IORING_OP_RECVMSG],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_RECVMSG.])
 | 
|---|
 | 152 | AH_TEMPLATE([CFA_HAVE_IORING_OP_TIMEOUT],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_TIMEOUT.])
 | 
|---|
 | 153 | AH_TEMPLATE([CFA_HAVE_IORING_OP_TIMEOUT_REMOVE],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_TIMEOUT_REMOVE.])
 | 
|---|
 | 154 | AH_TEMPLATE([CFA_HAVE_IORING_OP_ACCEPT],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_ACCEPT.])
 | 
|---|
 | 155 | AH_TEMPLATE([CFA_HAVE_IORING_OP_ASYNC_CANCEL],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_ASYNC_CANCEL.])
 | 
|---|
 | 156 | AH_TEMPLATE([CFA_HAVE_IORING_OP_LINK_TIMEOUT],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_LINK_TIMEOUT.])
 | 
|---|
 | 157 | AH_TEMPLATE([CFA_HAVE_IORING_OP_CONNECT],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_CONNECT.])
 | 
|---|
 | 158 | AH_TEMPLATE([CFA_HAVE_IORING_OP_FALLOCATE],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_FALLOCATE.])
 | 
|---|
 | 159 | AH_TEMPLATE([CFA_HAVE_IORING_OP_OPENAT],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_OPENAT.])
 | 
|---|
 | 160 | AH_TEMPLATE([CFA_HAVE_IORING_OP_CLOSE],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_CLOSE.])
 | 
|---|
 | 161 | AH_TEMPLATE([CFA_HAVE_IORING_OP_FILES_UPDATE],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_FILES_UPDATE.])
 | 
|---|
 | 162 | AH_TEMPLATE([CFA_HAVE_IORING_OP_STATX],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_STATX.])
 | 
|---|
 | 163 | AH_TEMPLATE([CFA_HAVE_IORING_OP_READ],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_READ.])
 | 
|---|
 | 164 | AH_TEMPLATE([CFA_HAVE_IORING_OP_WRITE],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_WRITE.])
 | 
|---|
 | 165 | AH_TEMPLATE([CFA_HAVE_IORING_OP_FADVISE],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_FADVISE.])
 | 
|---|
 | 166 | AH_TEMPLATE([CFA_HAVE_IORING_OP_MADVISE],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_MADVISE.])
 | 
|---|
 | 167 | AH_TEMPLATE([CFA_HAVE_IORING_OP_SEND],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_SEND.])
 | 
|---|
 | 168 | AH_TEMPLATE([CFA_HAVE_IORING_OP_RECV],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_RECV.])
 | 
|---|
 | 169 | AH_TEMPLATE([CFA_HAVE_IORING_OP_OPENAT2],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_OPENAT2.])
 | 
|---|
 | 170 | AH_TEMPLATE([CFA_HAVE_IORING_OP_EPOLL_CTL],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_EPOLL_CTL.])
 | 
|---|
 | 171 | AH_TEMPLATE([CFA_HAVE_IORING_OP_SPLICE],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_SPLICE.])
 | 
|---|
 | 172 | AH_TEMPLATE([CFA_HAVE_IORING_OP_PROVIDE_BUFFERS],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_PROVIDE_BUFFERS.])
 | 
|---|
 | 173 | AH_TEMPLATE([CFA_HAVE_IORING_OP_REMOVE_BUFFER],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_REMOVE_BUFFER.])
 | 
|---|
| [c402739f] | 174 | AH_TEMPLATE([CFA_HAVE_IORING_OP_TEE],[Defined if io_uring support is present when compiling libcfathread and supports the operation IORING_OP_TEE.])
 | 
|---|
| [d3a518c] | 175 | AH_TEMPLATE([CFA_HAVE_IOSQE_FIXED_FILE],[Defined if io_uring support is present when compiling libcfathread and supports the flag FIXED_FILE.])
 | 
|---|
 | 176 | AH_TEMPLATE([CFA_HAVE_IOSQE_IO_DRAIN],[Defined if io_uring support is present when compiling libcfathread and supports the flag IO_DRAIN.])
 | 
|---|
 | 177 | AH_TEMPLATE([CFA_HAVE_IOSQE_IO_LINK],[Defined if io_uring support is present when compiling libcfathread and supports the flag IO_LINK.])
 | 
|---|
 | 178 | AH_TEMPLATE([CFA_HAVE_IOSQE_IO_HARDLINK],[Defined if io_uring support is present when compiling libcfathread and supports the flag IO_HARDLINK.])
 | 
|---|
| [5e99a9a] | 179 | AH_TEMPLATE([CFA_HAVE_IOSQE_ASYNC],[Defined if io_uring support is present when compiling libcfathread and supports the flag ASYNC.])
 | 
|---|
 | 180 | AH_TEMPLATE([CFA_HAVE_IOSQE_BUFFER_SELECT],[Defined if io_uring support is present when compiling libcfathread and supports the flag BUFFER_SELEC.])
 | 
|---|
| [d3a518c] | 181 | AH_TEMPLATE([CFA_HAVE_SPLICE_F_FD_IN_FIXED],[Defined if io_uring support is present when compiling libcfathread and supports the flag SPLICE_F_FD_IN_FIXED.])
 | 
|---|
| [85f19eb] | 182 | AH_TEMPLATE([CFA_HAVE_IORING_SETUP_ATTACH_WQ],[Defined if io_uring support is present when compiling libcfathread and supports the flag IORING_SETUP_ATTACH_WQ.])
 | 
|---|
| [1158180] | 183 | AH_TEMPLATE([CFA_HAVE_IORING_REGISTER_IOWQ_MAX_WORKERS],[Defined if io_uring support is present when compiling libcfathread and supports the flag IORING_REGISTER_IOWQ_MAX_WORKERS.])
 | 
|---|
| [c402739f] | 184 | AH_TEMPLATE([CFA_HAVE_PREADV2],[Defined if preadv2 support is present when compiling libcfathread.])
 | 
|---|
 | 185 | AH_TEMPLATE([CFA_HAVE_PWRITEV2],[Defined if pwritev2 support is present when compiling libcfathread.])
 | 
|---|
 | 186 | AH_TEMPLATE([CFA_HAVE_PWRITEV2],[Defined if pwritev2 support is present when compiling libcfathread.])
 | 
|---|
 | 187 | AH_TEMPLATE([CFA_HAVE_STATX],[Defined if statx support is present when compiling libcfathread.])
 | 
|---|
 | 188 | AH_TEMPLATE([CFA_HAVE_OPENAT2],[Defined if openat2 support is present when compiling libcfathread.])
 | 
|---|
| [d3a518c] | 189 | AH_TEMPLATE([__CFA_NO_STATISTICS__],[Defined if libcfathread was compiled without support for statistics.])
 | 
|---|
 | 190 | 
 | 
|---|
| [c402739f] | 191 | define(ioring_ops, [IORING_OP_NOP,IORING_OP_READV,IORING_OP_WRITEV,IORING_OP_FSYNC,IORING_OP_READ_FIXED,IORING_OP_WRITE_FIXED,IORING_OP_POLL_ADD,IORING_OP_POLL_REMOVE,IORING_OP_SYNC_FILE_RANGE,IORING_OP_SENDMSG,IORING_OP_RECVMSG,IORING_OP_TIMEOUT,IORING_OP_TIMEOUT_REMOVE,IORING_OP_ACCEPT,IORING_OP_ASYNC_CANCEL,IORING_OP_LINK_TIMEOUT,IORING_OP_CONNECT,IORING_OP_FALLOCATE,IORING_OP_OPENAT,IORING_OP_CLOSE,IORING_OP_FILES_UPDATE,IORING_OP_STATX,IORING_OP_READ,IORING_OP_WRITE,IORING_OP_FADVISE,IORING_OP_MADVISE,IORING_OP_SEND,IORING_OP_RECV,IORING_OP_OPENAT2,IORING_OP_EPOLL_CTL,IORING_OP_SPLICE,IORING_OP_PROVIDE_BUFFERS,IORING_OP_REMOVE_BUFFER,IORING_OP_TEE])
 | 
|---|
| [1158180] | 192 | define(ioring_flags, [IOSQE_FIXED_FILE,IOSQE_IO_DRAIN,IOSQE_IO_LINK,IOSQE_IO_HARDLINK,IOSQE_ASYNC,IOSQE_BUFFER_SELECT,SPLICE_F_FD_IN_FIXED,IORING_SETUP_ATTACH_WQ,IORING_REGISTER_IOWQ_MAX_WORKERS])
 | 
|---|
| [f854ee32] | 193 | 
 | 
|---|
 | 194 | define(ioring_from_decls, [
 | 
|---|
 | 195 |         m4_foreach([op], [ioring_ops], [
 | 
|---|
 | 196 |                 AC_CHECK_DECL(op, [AC_DEFINE([CFA_HAVE_]op)], [], [[#include <linux/io_uring.h>]])
 | 
|---|
 | 197 |         ])
 | 
|---|
 | 198 | ])
 | 
|---|
| [5751a56] | 199 | 
 | 
|---|
 | 200 | AC_CHECK_HEADERS([linux/io_uring.h], [
 | 
|---|
 | 201 |         AC_DEFINE(CFA_HAVE_LINUX_IO_URING_H)
 | 
|---|
| [f854ee32] | 202 |         AC_CHECK_HEADER([liburing.h], [
 | 
|---|
 | 203 |                 AC_CHECK_LIB([uring], [io_uring_get_probe], [
 | 
|---|
 | 204 |                         m4_foreach([op], [ioring_ops], [
 | 
|---|
 | 205 |                                 AC_CHECK_DECL(op, [
 | 
|---|
 | 206 |                                         AC_RUN_IFELSE([
 | 
|---|
 | 207 |                                                 AC_LANG_PROGRAM(
 | 
|---|
 | 208 |                                                         [[#include <liburing.h>]],
 | 
|---|
 | 209 |                                                         [[int main() {]]
 | 
|---|
 | 210 |                                                         [[      struct io_uring_probe *probe = io_uring_get_probe();]]
 | 
|---|
 | 211 |                                                         [[      if(io_uring_opcode_supported(probe, ]]op[[))]]
 | 
|---|
 | 212 |                                                         [[              return 0;]]
 | 
|---|
 | 213 |                                                         [[      else]]
 | 
|---|
 | 214 |                                                         [[              return 1;]]
 | 
|---|
 | 215 |                                                         [[}]]
 | 
|---|
 | 216 |                                                 )
 | 
|---|
 | 217 |                                         ],[
 | 
|---|
 | 218 |                                                 AC_DEFINE([CFA_HAVE_]op)
 | 
|---|
 | 219 |                                         ],[
 | 
|---|
 | 220 |                                                 AC_MSG_FAILURE([Check support for] op [ with liburing failed])
 | 
|---|
 | 221 |                                         ])
 | 
|---|
 | 222 |                                 ], [], [[#include <linux/io_uring.h>]])
 | 
|---|
 | 223 |                         ])
 | 
|---|
 | 224 |                 ], [
 | 
|---|
 | 225 |                         ioring_from_decls
 | 
|---|
 | 226 |                 ])
 | 
|---|
 | 227 |         ], [
 | 
|---|
 | 228 |                 ioring_from_decls
 | 
|---|
| [5751a56] | 229 |         ])
 | 
|---|
| [22ddade] | 230 | 
 | 
|---|
 | 231 |         # check support for various io_uring flags
 | 
|---|
 | 232 |         m4_foreach([op], [ioring_flags], [
 | 
|---|
 | 233 |                 AC_CHECK_DECL(op, [AC_DEFINE([CFA_HAVE_]op)], [], [[#include <linux/io_uring.h>]])
 | 
|---|
 | 234 |         ])
 | 
|---|
| [5751a56] | 235 | ])
 | 
|---|
| [c402739f] | 236 | AC_CHECK_FUNC([preadv2], [AC_DEFINE([CFA_HAVE_PREADV2])])
 | 
|---|
 | 237 | AC_CHECK_FUNC([pwritev2], [AC_DEFINE([CFA_HAVE_PWRITEV2])])
 | 
|---|
| [27273f9] | 238 | 
 | 
|---|
| [c59712e] | 239 | AC_CONFIG_FILES([
 | 
|---|
 | 240 |         Makefile
 | 
|---|
 | 241 |         src/Makefile
 | 
|---|
 | 242 |         prelude/Makefile
 | 
|---|
 | 243 |         ])
 | 
|---|
| [c402739f] | 244 | AC_CONFIG_FILES([src/concurrency/io/call.cfa], [python3 ${srcdir}/src/concurrency/io/call.cfa.in > src/concurrency/io/call.cfa])
 | 
|---|
| [c59712e] | 245 | 
 | 
|---|
| [c680a4b] | 246 | AC_CONFIG_HEADERS(prelude/defines.hfa)
 | 
|---|
 | 247 | 
 | 
|---|
| [c59712e] | 248 | AC_OUTPUT()
 | 
|---|
 | 249 | 
 | 
|---|
 | 250 | # Final text
 | 
|---|
| [27273f9] | 251 | AC_MSG_RESULT(Cforall library configuraton completed. Type "make -j 8 install".)
 | 
|---|