Cross-Platform build scripts for audio plugins
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.

144 lines
4.2KB

  1. diff -Naur Python-3.8.0-orig/Misc/python-config.sh.in Python-3.8.0/Misc/python-config.sh.in
  2. --- Python-3.8.0-orig/Misc/python-config.sh.in 2019-10-14 16:34:47.000000000 +0300
  3. +++ Python-3.8.0/Misc/python-config.sh.in 2019-10-22 10:02:24.584090700 +0300
  4. @@ -1,32 +1,44 @@
  5. #!/bin/sh
  6. -# Keep this script in sync with python-config.in
  7. -
  8. exit_with_usage ()
  9. {
  10. echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed"
  11. - exit $1
  12. + exit 1
  13. }
  14. +# Really, python-config.py (and thus .sh) should be called directly, but
  15. +# sometimes software (e.g. GDB) calls python-config.sh as if it were the
  16. +# Python executable, passing python-config.py as the first argument.
  17. +# Work around that oddness by ignoring any .py passed as first arg.
  18. +case "$1" in
  19. + *.py)
  20. + shift
  21. + ;;
  22. +esac
  23. +
  24. if [ "$1" = "" ] ; then
  25. - exit_with_usage 1
  26. + exit_with_usage
  27. fi
  28. # Returns the actual prefix where this script was installed to.
  29. installed_prefix ()
  30. {
  31. - RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
  32. - if which readlink >/dev/null 2>&1 ; then
  33. - if readlink -f "$RESULT" >/dev/null 2>&1; then
  34. - RESULT=$(readlink -f "$RESULT")
  35. - fi
  36. + local RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
  37. + if [ $(which readlink) ] ; then
  38. + RESULT=$(readlink -f "$RESULT")
  39. + fi
  40. + # Since we don't know where the output from this script will end up
  41. + # we keep all paths in Windows-land since MSYS2 can handle that
  42. + # while native tools can't handle paths in MSYS2-land.
  43. + if [ "$OSTYPE" = "msys" ]; then
  44. + RESULT=$(cd "$RESULT" && pwd -W)
  45. fi
  46. echo $RESULT
  47. }
  48. prefix_real=$(installed_prefix "$0")
  49. -# Use sed to fix paths from their built-to locations to their installed-to
  50. +# Use sed to fix paths from their built-to locations to their installed to
  51. # locations. Keep prefix & exec_prefix using their original values in case
  52. # they are referenced in other configure variables, to prevent double
  53. # substitution, issue #22140.
  54. @@ -41,13 +53,17 @@
  55. LIBC="@LIBC@"
  56. SYSLIBS="$LIBM $LIBC"
  57. ABIFLAGS="@ABIFLAGS@"
  58. +# Protect against lack of substitution.
  59. +if [ "$ABIFLAGS" = "@""ABIFLAGS""@" ] ; then
  60. + ABIFLAGS=
  61. +fi
  62. LIBS="@LIBPYTHON@ @LIBS@ $SYSLIBS"
  63. LIBS_EMBED="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS"
  64. BASECFLAGS="@BASECFLAGS@"
  65. -LDLIBRARY="@LDLIBRARY@"
  66. OPT="@OPT@"
  67. PY_ENABLE_SHARED="@PY_ENABLE_SHARED@"
  68. LDVERSION="@LDVERSION@"
  69. +LDLIBRARY="@LDLIBRARY@"
  70. LIBDEST=${prefix_real}/lib/python${VERSION}
  71. LIBPL=$(echo "@LIBPL@" | sed "s#$prefix#$prefix_real#")
  72. SO="@EXT_SUFFIX@"
  73. @@ -61,7 +77,7 @@
  74. do
  75. case $ARG in
  76. --help)
  77. - exit_with_usage 0
  78. + exit_with_usage
  79. ;;
  80. --embed)
  81. PY_EMBED=1
  82. @@ -69,7 +85,7 @@
  83. --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--abiflags|--configdir)
  84. ;;
  85. *)
  86. - exit_with_usage 1
  87. + exit_with_usage
  88. ;;
  89. esac
  90. done
  91. @@ -80,37 +96,37 @@
  92. for ARG in "$@"
  93. do
  94. - case "$ARG" in
  95. + case $ARG in
  96. --prefix)
  97. - echo "$prefix_real"
  98. + echo -ne "$prefix_real"
  99. ;;
  100. --exec-prefix)
  101. - echo "$exec_prefix_real"
  102. + echo -ne "$exec_prefix_real "
  103. ;;
  104. --includes)
  105. - echo "$INCDIR $PLATINCDIR"
  106. + echo -ne "$INCDIR $PLATINCDIR"
  107. ;;
  108. --cflags)
  109. - echo "$INCDIR $PLATINCDIR $BASECFLAGS $CFLAGS $OPT"
  110. + echo -ne "$INCDIR $PLATINCDIR $BASECFLAGS $CFLAGS $OPT"
  111. ;;
  112. --libs)
  113. - echo "$LIBS"
  114. + echo -ne "$LIBS"
  115. ;;
  116. --ldflags)
  117. LIBPLUSED=
  118. if [ "$PY_ENABLE_SHARED" = "0" ] ; then
  119. LIBPLUSED="-L$LIBPL"
  120. fi
  121. - echo "$LIBPLUSED -L$libdir $LIBS"
  122. + echo -ne "$LIBPLUSED -L$libdir $LIBS "
  123. ;;
  124. --extension-suffix)
  125. - echo "$SO"
  126. + echo -ne "$SO "
  127. ;;
  128. --abiflags)
  129. - echo "$ABIFLAGS"
  130. + echo -ne "$ABIFLAGS "
  131. ;;
  132. --configdir)
  133. - echo "$LIBPL"
  134. + echo -ne "$LIBPL "
  135. ;;
  136. esac
  137. done