python3.5m-config 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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_build="/usr"
  23. prefix_real=$(installed_prefix "$0")
  24. # Use sed to fix paths from their built-to locations to their installed-to
  25. # locations.
  26. prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#")
  27. exec_prefix_build="/usr"
  28. exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real#")
  29. includedir=$(echo "/usr/include" | sed "s#$prefix_build#$prefix_real#")
  30. libdir=$(echo "/usr/lib" | sed "s#$prefix_build#$prefix_real#")
  31. CFLAGS=$(echo " -isystem/home/gtbldadm/tools/linaro-2016.11/arm-linux-gnueabihf/include -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/oe/bld/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/armv7ahf-neon-linux-gnueabi/python3/3.5.2-r1.0=/usr/src/debug/python3/3.5.2-r1.0 -fdebug-prefix-map=/oe/bld/build-CORTEX_1/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux= -fdebug-prefix-map=/oe/bld/build-CORTEX_1/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm= " | sed "s#$prefix_build#$prefix_real#")
  32. VERSION="3.5"
  33. LIBM="-lm"
  34. LIBC=""
  35. SYSLIBS="$LIBM $LIBC"
  36. ABIFLAGS="m"
  37. LIBS="-lpython${VERSION}${ABIFLAGS} -lpthread -ldl -lpthread -lutil $SYSLIBS"
  38. BASECFLAGS=" -Wno-unused-result -Wsign-compare"
  39. LDLIBRARY="libpython${LDVERSION}.so"
  40. LINKFORSHARED="-Xlinker -export-dynamic"
  41. OPT="-DNDEBUG -g -O3 -Wall -Wstrict-prototypes"
  42. PY_ENABLE_SHARED="1"
  43. LDVERSION="${VERSION}${ABIFLAGS}"
  44. LIBDEST=${prefix}/lib/python${VERSION}
  45. LIBPL=$(echo "${LIBDIR}/python3.5/config-${VERSION}${ABIFLAGS}" | sed "s#$prefix_build#$prefix_real#")
  46. SO=".cpython-35m-arm-linux-gnueabihf.so"
  47. PYTHONFRAMEWORK=""
  48. INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
  49. PLATINCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
  50. # Scan for --help or unknown argument.
  51. for ARG in $*
  52. do
  53. case $ARG in
  54. --help)
  55. exit_with_usage 0
  56. ;;
  57. --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--abiflags|--configdir)
  58. ;;
  59. *)
  60. exit_with_usage 1
  61. ;;
  62. esac
  63. done
  64. for ARG in "$@"
  65. do
  66. case "$ARG" in
  67. --prefix)
  68. echo "$prefix"
  69. ;;
  70. --exec-prefix)
  71. echo "$exec_prefix"
  72. ;;
  73. --includes)
  74. echo "$INCDIR $PLATINCDIR"
  75. ;;
  76. --cflags)
  77. echo "$INCDIR $PLATINCDIR $BASECFLAGS $CFLAGS $OPT"
  78. ;;
  79. --libs)
  80. echo "$LIBS"
  81. ;;
  82. --ldflags)
  83. LINKFORSHAREDUSED=
  84. if [ -z "$PYTHONFRAMEWORK" ] ; then
  85. LINKFORSHAREDUSED=$LINKFORSHARED
  86. fi
  87. LIBPLUSED=
  88. if [ "$PY_ENABLE_SHARED" = "0" ] ; then
  89. LIBPLUSED="-L$LIBPL"
  90. fi
  91. echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED"
  92. ;;
  93. --extension-suffix)
  94. echo "$SO"
  95. ;;
  96. --abiflags)
  97. echo "$ABIFLAGS"
  98. ;;
  99. --configdir)
  100. echo "$LIBPL"
  101. ;;
  102. esac
  103. done