1 #!/bin/sh 1 #!/bin/sh 2 # SPDX-License-Identifier: GPL-2.0 2 # SPDX-License-Identifier: GPL-2.0 3 # 3 # 4 # Probe for libraries and create header files 4 # Probe for libraries and create header files to record the results. Both C 5 # header files and Makefile include fragments 5 # header files and Makefile include fragments are created. 6 6 7 OUTPUT_H_FILE=local_config.h 7 OUTPUT_H_FILE=local_config.h 8 OUTPUT_MKFILE=local_config.mk 8 OUTPUT_MKFILE=local_config.mk 9 9 10 tmpname=$(mktemp) 10 tmpname=$(mktemp) 11 tmpfile_c=${tmpname}.c 11 tmpfile_c=${tmpname}.c 12 tmpfile_o=${tmpname}.o 12 tmpfile_o=${tmpname}.o 13 13 14 # liburing 14 # liburing 15 echo "#include <sys/types.h>" > $tmpfil 15 echo "#include <sys/types.h>" > $tmpfile_c 16 echo "#include <liburing.h>" >> $tmpfil 16 echo "#include <liburing.h>" >> $tmpfile_c 17 echo "int func(void) { return 0; }" >> $tmpfil 17 echo "int func(void) { return 0; }" >> $tmpfile_c 18 18 19 CC=${1:?"Usage: $0 <compiler> # example compil 19 CC=${1:?"Usage: $0 <compiler> # example compiler: gcc"} 20 $CC -c $tmpfile_c -o $tmpfile_o >/dev/null 2>& 20 $CC -c $tmpfile_c -o $tmpfile_o >/dev/null 2>&1 21 21 22 if [ -f $tmpfile_o ]; then 22 if [ -f $tmpfile_o ]; then 23 echo "#define LOCAL_CONFIG_HAVE_LIBURING 1 23 echo "#define LOCAL_CONFIG_HAVE_LIBURING 1" > $OUTPUT_H_FILE 24 echo "IOURING_EXTRA_LIBS = -luring" !! 24 echo "COW_EXTRA_LIBS = -luring" > $OUTPUT_MKFILE 25 else 25 else 26 echo "// No liburing support found" 26 echo "// No liburing support found" > $OUTPUT_H_FILE 27 echo "# No liburing support found, so:" 27 echo "# No liburing support found, so:" > $OUTPUT_MKFILE 28 echo "IOURING_EXTRA_LIBS = " !! 28 echo "COW_EXTRA_LIBS = " >> $OUTPUT_MKFILE 29 fi 29 fi 30 30 31 rm ${tmpname}.* 31 rm ${tmpname}.*
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.