You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.2 KiB

  1. #!/bin/sh
  2. PCFILE=libmariadb
  3. command -v pkg-config > /dev/null 2>&1
  4. ret="$?"
  5. if [ "$ret" -ne 0 ]; then
  6. echo pkg-config not found >&2
  7. exit 1
  8. fi
  9. pkg-config $PCFILE > /dev/null 2>&1
  10. ret="$?"
  11. if [ "$ret" -ne 0 ]; then
  12. echo $PCFILE pkg-config file missing >&2
  13. exit 1
  14. fi
  15. cflags=$(pkg-config $PCFILE --cflags)
  16. include=$(pkg-config $PCFILE --cflags)
  17. libs=$(pkg-config $PCFILE --libs)
  18. plugindir=PLUGIN_DIR
  19. socket=SOCKET
  20. port=PORT
  21. version=VERSION
  22. usage () {
  23. cat <<EOF
  24. Usage: $0 [OPTIONS]
  25. Options:
  26. --cflags [$cflags]
  27. --include [$include]
  28. --libs [$libs]
  29. --libs_r [$libs]
  30. --plugindir [$plugindir]
  31. --socket [$socket]
  32. --port [$port]
  33. --version [$version]
  34. EOF
  35. exit "$1"
  36. }
  37. if test $# -le 0; then usage 0 ; fi
  38. while test $# -gt 0; do
  39. case $1 in
  40. --cflags) echo "$cflags" ;;
  41. --include) echo "$include" ;;
  42. --libs) echo "$libs" ;;
  43. --libs_r) echo "$libs" ;;
  44. --plugindir) echo "$plugindir" ;;
  45. --socket) echo "$socket" ;;
  46. --port) echo "$port" ;;
  47. --version) echo "$version" ;;
  48. *) usage 1 >&2 ;;
  49. esac
  50. shift
  51. done
  52. exit 0