build_static.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. set -ex
  3. _buildd_static=build-static
  4. _buildd_shared=build-shared
  5. if [[ ${DEBUG_PY} == yes ]]; then
  6. DBG=d
  7. else
  8. DBG=
  9. fi
  10. VER=${PKG_VERSION%.*}
  11. VERABI=${VER}${DBG}
  12. case "$target_platform" in
  13. linux-64)
  14. OLD_HOST=$(echo ${HOST} | sed -e 's/-conda_cos6//g')
  15. OLD_HOST=$(echo ${OLD_HOST} | sed -e 's/-conda_cos7//g')
  16. OLD_HOST=$(echo ${OLD_HOST} | sed -e 's/-conda//g')
  17. ;;
  18. linux-*)
  19. OLD_HOST=$(echo ${HOST} | sed -e 's/-conda_cos7//g')
  20. OLD_HOST=$(echo ${OLD_HOST} | sed -e 's/-conda//g')
  21. ;;
  22. *)
  23. OLD_HOST=$HOST
  24. ;;
  25. esac
  26. cp -pf ${_buildd_static}/libpython${VERABI}.a ${PREFIX}/lib/libpython${VERABI}.a
  27. if [[ ${HOST} =~ .*linux.* ]]; then
  28. pushd ${PREFIX}/lib/python${VERABI}/config-${VERABI}-${OLD_HOST}
  29. elif [[ ${HOST} =~ .*darwin.* ]]; then
  30. pushd ${PREFIX}/lib/python${VERABI}/config-${VERABI}-darwin
  31. fi
  32. ln -s ../../libpython${VERABI}.a libpython${VERABI}.a
  33. popd
  34. # If the LTO info in the normal lib is problematic (using different compilers for example
  35. # we also provide a 'nolto' version).
  36. cp -pf ${_buildd_shared}/libpython${VERABI}-pic.a ${PREFIX}/lib/libpython${VERABI}.nolto.a