dummy-pkg-config.sh 520 B

1234567891011121314151617181920212223
  1. #!/bin/sh
  2. # This is a replacement for pkg-config that compares the string passed
  3. # to the --exists argument with the PKG_CONFIG_PATH environment variable
  4. # and returns 1 if they are different.
  5. while [ $# -gt 0 ]; do
  6. case $1 in
  7. --version)
  8. echo "0.0-cmake-dummy"
  9. exit 0
  10. ;;
  11. --exists)
  12. shift
  13. eval last=\${$#}
  14. echo "Expected: ${last}"
  15. echo "Found: ${PKG_CONFIG_PATH}"
  16. [ "${last}" = "${PKG_CONFIG_PATH}" ] && exit 0 || exit 1
  17. ;;
  18. esac
  19. shift
  20. done
  21. exit 255