Lines Matching +full:- +full:- +full:include +full:- +full:cat
3 set -e
5 cc=${CC:-gcc}
6 cxx=${CXX:-g++}
11 --help|-h) show_help=yes
13 --prefix=*) prefix="$optarg"
15 --includedir=*) includedir="$optarg"
17 --libdir=*) libdir="$optarg"
19 --libdevdir=*) libdevdir="$optarg"
21 --mandir=*) mandir="$optarg"
23 --datadir=*) datadir="$optarg"
25 --cc=*) cc="$optarg"
27 --cxx=*) cxx="$optarg"
29 --nolibc) liburing_nolibc="yes"
33 echo "Try '$0 --help' for more information"
39 if test -z "$prefix"; then
42 if test -z "$includedir"; then
43 includedir="$prefix/include"
45 if test -z "$libdir"; then
48 if test -z "$libdevdir"; then
51 if test -z "$mandir"; then
54 if test -z "$datadir"; then
65 cat <<EOF
69 --help print this message
70 --prefix=PATH install in PATH [$prefix]
71 --includedir=PATH install headers in PATH [$includedir]
72 --libdir=PATH install runtime libraries in PATH [$libdir]
73 --libdevdir=PATH install development libraries in PATH [$libdevdir]
74 --mandir=PATH install man pages in PATH [$mandir]
75 --datadir=PATH install shared data in PATH [$datadir]
76 --cc=CMD use CMD as the C compiler
77 --cxx=CMD use CMD as the C++ compiler
78 --nolibc build liburing without libc
83 TMP_DIRECTORY="$(mktemp -d)"
84 TMPC="$TMP_DIRECTORY/liburing-conf.c"
85 TMPC2="$TMP_DIRECTORY/liburing-conf-2.c"
86 TMPCXX="$TMP_DIRECTORY/liburing-conf-2.cpp"
87 TMPO="$TMP_DIRECTORY/liburing-conf.o"
88 TMPE="$TMP_DIRECTORY/liburing-conf.exe"
93 # see <1285349658-3122-1-git-send-email-[email protected]>
94 trap "rm -rf $TMP_DIRECTORY" EXIT INT QUIT TERM
96 rm -rf config.log
98 config_host_mak="config-host.mak"
99 config_host_h="config-host.h"
101 rm -rf $config_host_mak
102 rm -rf $config_host_h
107 rm -rf $config_host_mak
108 rm -rf $config_host_h
114 printf "%-30s%s\n" "$1" "$2"
118 CFLAGS="-D_GNU_SOURCE -include config-host.h"
123 echo " * Automatically generated by configure - do not modify" >> $config_host_h
129 echo "# Automatically generated by configure - do not modify" > $config_host_mak
145 # Test passed. If this is an --enable-werror build, rerun
146 # the test with -Werror and bail out if it fails. This
147 # makes warning-generating-errors in configure test code
152 # Don't bother rerunning the compile if we were already using -Werror
154 *-Werror*)
158 echo $cc -Werror "$@" >> config.log
159 $cc -Werror "$@" >> config.log 2>&1 && return $?
160 echo "ERROR: configure test passed without -Werror but failed with -Werror."
163 fatal "You can run configure with --disable-werror to bypass this check."
170 do_cc $CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
177 do_cxx $CFLAGS $local_cflags -o $TMPE $TMPCXX $LDFLAGS $local_ldflags
206 # check for compiler -Wstringop-overflow
208 cat > $TMPC << EOF
209 #include <linux/fs.h>
215 if compile_prog "-Werror -Wstringop-overflow=0" "" "stringop_overflow"; then
221 # check for compiler -Warryr-bounds
223 cat > $TMPC << EOF
224 #include <linux/fs.h>
230 if compile_prog "-Werror -Warray-bounds=0" "" "array_bounds"; then
239 cat > $TMPC << EOF
240 #include <linux/fs.h>
256 cat > $TMPC << EOF
257 #include <linux/time.h>
258 #include <linux/time_types.h>
275 cat > $TMPC << EOF
276 #include <sys/types.h>
277 #include <fcntl.h>
278 #include <string.h>
279 #include <linux/openat2.h>
297 cat > $TMPC << EOF
298 #include <sys/types.h>
299 #include <sys/stat.h>
300 #include <unistd.h>
301 #include <fcntl.h>
302 #include <string.h>
318 cat > $TMPC << EOF
319 #include <sys/types.h>
320 #include <unistd.h>
321 #include <fcntl.h>
322 #include <string.h>
323 #include <sys/stat.h>
339 cat > $TMPCXX << EOF
340 #include <iostream>
355 cat > $TMPC << EOF
356 #include <ucontext.h>
373 cat > $TMPC << EOF
374 #include <sys/mman.h>
381 if compile_prog "-Werror=implicit-function-declaration" "" "has_memfd_create"; then
432 compat_h="src/include/liburing/compat.h"
433 cat > $compat_h << EOF
434 /* SPDX-License-Identifier: MIT */
441 cat >> $compat_h << EOF
447 cat >> $compat_h << EOF
448 #include <stdint.h>
457 cat >> $compat_h << EOF
458 #include <linux/time_types.h>
463 cat >> $compat_h << EOF
464 #include <inttypes.h>
473 else cat >> $compat_h << EOF
474 #include <linux/openat2.h>
479 cat >> $compat_h << EOF
480 #include <sys/stat.h>
485 cat >> $compat_h << EOF