python3.9-config 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #!/bin/sh
  2. # Keep this script in sync with python-config.in
  3. exit_with_usage ()
  4. {
  5. echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir|--embed"
  6. exit $1
  7. }
  8. if [ "$1" = "" ] ; then
  9. exit_with_usage 1
  10. fi
  11. # Returns the actual prefix where this script was installed to.
  12. installed_prefix ()
  13. {
  14. RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
  15. if which readlink >/dev/null 2>&1 ; then
  16. if readlink -f "$RESULT" >/dev/null 2>&1; then
  17. RESULT=$(readlink -f "$RESULT")
  18. fi
  19. fi
  20. echo $RESULT
  21. }
  22. prefix_real=$(installed_prefix "$0")
  23. # Use sed to fix paths from their built-to locations to their installed-to
  24. # locations. Keep prefix & exec_prefix using their original values in case
  25. # they are referenced in other configure variables, to prevent double
  26. # substitution, issue #22140.
  27. prefix="/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac"
  28. exec_prefix="${prefix}"
  29. exec_prefix_real=${prefix_real}
  30. includedir=$(echo "${prefix}/include" | sed "s#$prefix#$prefix_real#")
  31. libdir=$(echo "${exec_prefix}/lib" | sed "s#$prefix#$prefix_real#")
  32. CFLAGS=$(echo "-march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O3 -ffunction-sections -pipe -isystem /croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include -fdebug-prefix-map=/croot/python-split_1688589050410/work=/usr/local/src/conda/python-3.9.17 -fdebug-prefix-map=/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac=/usr/local/src/conda-prefix -I/croot/python-split_1688589050410/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac/include" | sed "s#$prefix#$prefix_real#")
  33. VERSION="3.9"
  34. LIBM="-lm"
  35. LIBC=""
  36. SYSLIBS="$LIBM $LIBC"
  37. ABIFLAGS=""
  38. LIBS=" -lcrypt -lpthread -ldl -lutil -lm $SYSLIBS"
  39. LIBS_EMBED="-lpython${VERSION}${ABIFLAGS} -lcrypt -lpthread -ldl -lutil -lm $SYSLIBS"
  40. BASECFLAGS=" -Wno-unused-result -Wsign-compare"
  41. LDLIBRARY="libpython${VERSION}${ABIFLAGS}.a"
  42. OPT="-DNDEBUG -O3 -Wall"
  43. PY_ENABLE_SHARED="0"
  44. LDVERSION="${VERSION}${ABIFLAGS}"
  45. LIBDEST=${prefix_real}/lib/python${VERSION}
  46. LIBPL=$(echo "${prefix}/lib/python3.9/config-${VERSION}${ABIFLAGS}-x86_64-linux-gnu" | sed "s#$prefix#$prefix_real#")
  47. SO=".cpython-39-x86_64-linux-gnu.so"
  48. PYTHONFRAMEWORK=""
  49. INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
  50. PLATINCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
  51. PY_EMBED=0
  52. # Scan for --help or unknown argument.
  53. for ARG in $*
  54. do
  55. case $ARG in
  56. --help)
  57. exit_with_usage 0
  58. ;;
  59. --embed)
  60. PY_EMBED=1
  61. ;;
  62. --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--abiflags|--configdir)
  63. ;;
  64. *)
  65. exit_with_usage 1
  66. ;;
  67. esac
  68. done
  69. if [ $PY_EMBED = 1 ] ; then
  70. LIBS="$LIBS_EMBED"
  71. fi
  72. for ARG in "$@"
  73. do
  74. case "$ARG" in
  75. --prefix)
  76. echo "$prefix_real"
  77. ;;
  78. --exec-prefix)
  79. echo "$exec_prefix_real"
  80. ;;
  81. --includes)
  82. echo "$INCDIR $PLATINCDIR"
  83. ;;
  84. --cflags)
  85. echo "$INCDIR $PLATINCDIR $BASECFLAGS $CFLAGS $OPT"
  86. ;;
  87. --libs)
  88. echo "$LIBS"
  89. ;;
  90. --ldflags)
  91. LIBPLUSED=
  92. if [ "$PY_ENABLE_SHARED" = "0" ] ; then
  93. LIBPLUSED="-L$LIBPL"
  94. fi
  95. echo "$LIBPLUSED -L$libdir $LIBS"
  96. ;;
  97. --extension-suffix)
  98. echo "$SO"
  99. ;;
  100. --abiflags)
  101. echo "$ABIFLAGS"
  102. ;;
  103. --configdir)
  104. echo "$LIBPL"
  105. ;;
  106. esac
  107. done