1
0

sdl2-config.in 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #!/bin/sh
  2. # Get the canonical path of the folder containing this script
  3. bindir=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
  4. # Calculate the canonical path of the prefix, relative to the folder of this script
  5. prefix=$(cd -P -- "$bindir/@bin_prefix_relpath@" && printf '%s\n' "$(pwd -P)")
  6. exec_prefix=@exec_prefix@
  7. exec_prefix_set=no
  8. libdir=@libdir@
  9. @ENABLE_STATIC_FALSE@usage="\
  10. @ENABLE_STATIC_FALSE@Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
  11. @ENABLE_STATIC_TRUE@usage="\
  12. @ENABLE_STATIC_TRUE@Usage: $0 [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs] [--static-libs]"
  13. if test $# -eq 0; then
  14. echo "${usage}" 1>&2
  15. exit 1
  16. fi
  17. echo "sdl2-config: This script is deprecated" >&2
  18. echo "sdl2-config: In Autotools builds, use PKG_CHECK_MODULES([SDL], [sdl2 >= 2.x.y])" >&2
  19. echo "sdl2-config: In CMake builds, use find_package(SDL2 CONFIG)" >&2
  20. echo "sdl2-config: In other build systems, look for 'sdl2' with pkg-config(1) or pkgconf(1)" >&2
  21. while test $# -gt 0; do
  22. case "$1" in
  23. -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  24. *) optarg= ;;
  25. esac
  26. case $1 in
  27. --prefix=*)
  28. prefix=$optarg
  29. if test $exec_prefix_set = no ; then
  30. exec_prefix=$optarg
  31. fi
  32. ;;
  33. --prefix)
  34. echo $prefix
  35. ;;
  36. --exec-prefix=*)
  37. exec_prefix=$optarg
  38. exec_prefix_set=yes
  39. ;;
  40. --exec-prefix)
  41. echo $exec_prefix
  42. ;;
  43. --version)
  44. echo @SDL_VERSION@
  45. ;;
  46. --cflags)
  47. echo -I@includedir@/SDL2 @SDL_CFLAGS@
  48. ;;
  49. @ENABLE_SHARED_TRUE@ --libs)
  50. @ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
  51. @ENABLE_SHARED_TRUE@ ;;
  52. @ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs)
  53. @ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs)
  54. @ENABLE_STATIC_TRUE@ sdl_static_libs=$(echo "@SDL_LIBS@ @SDL_STATIC_LIBS@" | sed -E "s#-lSDL2[ $]#$libdir/libSDL2.a #g")
  55. @ENABLE_STATIC_TRUE@ echo -L@libdir@ $sdl_static_libs
  56. @ENABLE_STATIC_TRUE@ ;;
  57. *)
  58. echo "${usage}" 1>&2
  59. exit 1
  60. ;;
  61. esac
  62. shift
  63. done