check_config.sh 893 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. # SPDX-License-Identifier: GPL-2.0
  3. #
  4. # Probe for libraries and create header files to record the results. Both C
  5. # header files and Makefile include fragments are created.
  6. OUTPUT_H_FILE=local_config.h
  7. OUTPUT_MKFILE=local_config.mk
  8. tmpname=$(mktemp)
  9. tmpfile_c=${tmpname}.c
  10. tmpfile_o=${tmpname}.o
  11. # liburing
  12. echo "#include <sys/types.h>" > $tmpfile_c
  13. echo "#include <liburing.h>" >> $tmpfile_c
  14. echo "int func(void) { return 0; }" >> $tmpfile_c
  15. $CC $CFLAGS -c $tmpfile_c -o $tmpfile_o
  16. if [ -f $tmpfile_o ]; then
  17. echo "#define LOCAL_CONFIG_HAVE_LIBURING 1" > $OUTPUT_H_FILE
  18. echo "IOURING_EXTRA_LIBS = -luring" > $OUTPUT_MKFILE
  19. else
  20. echo "// No liburing support found" > $OUTPUT_H_FILE
  21. echo "# No liburing support found, so:" > $OUTPUT_MKFILE
  22. echo "IOURING_EXTRA_LIBS = " >> $OUTPUT_MKFILE
  23. fi
  24. rm ${tmpname}.*