python3.7m-config 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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"
  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="/home/chan/Downloads/Python-3.7.0/install"
  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 "-fPIC -Wl,-rpath,$ORIGIN:$ORIGIN/../lib" | sed "s#$prefix#$prefix_real#")
  33. VERSION="3.7"
  34. LIBM="-lm"
  35. LIBC=""
  36. SYSLIBS="$LIBM $LIBC"
  37. ABIFLAGS="m"
  38. LIBS="-lpython${VERSION}${ABIFLAGS} -lpthread -ldl -lutil $SYSLIBS"
  39. BASECFLAGS=" -Wno-unused-result -Wsign-compare"
  40. LDLIBRARY="libpython${LDVERSION}.so"
  41. LINKFORSHARED="-Xlinker -export-dynamic"
  42. OPT="-DNDEBUG -g -fwrapv -O3 -Wall"
  43. PY_ENABLE_SHARED="1"
  44. LDVERSION="${VERSION}${ABIFLAGS}"
  45. LIBDEST=${prefix_real}/lib/python${VERSION}
  46. LIBPL=$(echo "${prefix}/lib/python3.7/config-${VERSION}${ABIFLAGS}-x86_64-linux-gnu" | sed "s#$prefix#$prefix_real#")
  47. SO=".cpython-37m-x86_64-linux-gnu.so"
  48. PYTHONFRAMEWORK=""
  49. INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
  50. PLATINCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
  51. # Scan for --help or unknown argument.
  52. for ARG in $*
  53. do
  54. case $ARG in
  55. --help)
  56. exit_with_usage 0
  57. ;;
  58. --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--abiflags|--configdir)
  59. ;;
  60. *)
  61. exit_with_usage 1
  62. ;;
  63. esac
  64. done
  65. for ARG in "$@"
  66. do
  67. case "$ARG" in
  68. --prefix)
  69. echo "$prefix_real"
  70. ;;
  71. --exec-prefix)
  72. echo "$exec_prefix_real"
  73. ;;
  74. --includes)
  75. echo "$INCDIR $PLATINCDIR"
  76. ;;
  77. --cflags)
  78. echo "$INCDIR $PLATINCDIR $BASECFLAGS $CFLAGS $OPT"
  79. ;;
  80. --libs)
  81. echo "$LIBS"
  82. ;;
  83. --ldflags)
  84. LINKFORSHAREDUSED=
  85. if [ -z "$PYTHONFRAMEWORK" ] ; then
  86. LINKFORSHAREDUSED=$LINKFORSHARED
  87. fi
  88. LIBPLUSED=
  89. if [ "$PY_ENABLE_SHARED" = "0" ] ; then
  90. LIBPLUSED="-L$LIBPL"
  91. fi
  92. echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED"
  93. ;;
  94. --extension-suffix)
  95. echo "$SO"
  96. ;;
  97. --abiflags)
  98. echo "$ABIFLAGS"
  99. ;;
  100. --configdir)
  101. echo "$LIBPL"
  102. ;;
  103. esac
  104. done