123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- #!/bin/sh
- # Keep this script in sync with python-config.in
- exit_with_usage ()
- {
- echo "Usage: $0 --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--help|--abiflags|--configdir"
- exit $1
- }
- if [ "$1" = "" ] ; then
- exit_with_usage 1
- fi
- # Returns the actual prefix where this script was installed to.
- installed_prefix ()
- {
- RESULT=$(dirname $(cd $(dirname "$1") && pwd -P))
- if which readlink >/dev/null 2>&1 ; then
- if readlink -f "$RESULT" >/dev/null 2>&1; then
- RESULT=$(readlink -f "$RESULT")
- fi
- fi
- echo $RESULT
- }
- prefix_build="/usr"
- prefix_real=$(installed_prefix "$0")
- # Use sed to fix paths from their built-to locations to their installed-to
- # locations.
- prefix=$(echo "$prefix_build" | sed "s#$prefix_build#$prefix_real#")
- exec_prefix_build="/usr"
- exec_prefix=$(echo "$exec_prefix_build" | sed "s#$exec_prefix_build#$prefix_real#")
- includedir=$(echo "/usr/include" | sed "s#$prefix_build#$prefix_real#")
- libdir=$(echo "/usr/lib" | sed "s#$prefix_build#$prefix_real#")
- 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#")
- VERSION="3.5"
- LIBM="-lm"
- LIBC=""
- SYSLIBS="$LIBM $LIBC"
- ABIFLAGS="m"
- LIBS="-lpython${VERSION}${ABIFLAGS} -lpthread -ldl -lpthread -lutil $SYSLIBS"
- BASECFLAGS=" -Wno-unused-result -Wsign-compare"
- LDLIBRARY="libpython${LDVERSION}.so"
- LINKFORSHARED="-Xlinker -export-dynamic"
- OPT="-DNDEBUG -g -O3 -Wall -Wstrict-prototypes"
- PY_ENABLE_SHARED="1"
- LDVERSION="${VERSION}${ABIFLAGS}"
- LIBDEST=${prefix}/lib/python${VERSION}
- LIBPL=$(echo "${LIBDIR}/python3.5/config-${VERSION}${ABIFLAGS}" | sed "s#$prefix_build#$prefix_real#")
- SO=".cpython-35m-arm-linux-gnueabihf.so"
- PYTHONFRAMEWORK=""
- INCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
- PLATINCDIR="-I$includedir/python${VERSION}${ABIFLAGS}"
- # Scan for --help or unknown argument.
- for ARG in $*
- do
- case $ARG in
- --help)
- exit_with_usage 0
- ;;
- --prefix|--exec-prefix|--includes|--libs|--cflags|--ldflags|--extension-suffix|--abiflags|--configdir)
- ;;
- *)
- exit_with_usage 1
- ;;
- esac
- done
- for ARG in "$@"
- do
- case "$ARG" in
- --prefix)
- echo "$prefix"
- ;;
- --exec-prefix)
- echo "$exec_prefix"
- ;;
- --includes)
- echo "$INCDIR $PLATINCDIR"
- ;;
- --cflags)
- echo "$INCDIR $PLATINCDIR $BASECFLAGS $CFLAGS $OPT"
- ;;
- --libs)
- echo "$LIBS"
- ;;
- --ldflags)
- LINKFORSHAREDUSED=
- if [ -z "$PYTHONFRAMEWORK" ] ; then
- LINKFORSHAREDUSED=$LINKFORSHARED
- fi
- LIBPLUSED=
- if [ "$PY_ENABLE_SHARED" = "0" ] ; then
- LIBPLUSED="-L$LIBPL"
- fi
- echo "$LIBPLUSED -L$libdir $LIBS $LINKFORSHAREDUSED"
- ;;
- --extension-suffix)
- echo "$SO"
- ;;
- --abiflags)
- echo "$ABIFLAGS"
- ;;
- --configdir)
- echo "$LIBPL"
- ;;
- esac
- done
|