autotools-multilib.eclass 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Copyright 1999-2014 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. # @ECLASS: autotools-multilib.eclass
  4. # @MAINTAINER:
  5. # gx86-multilib team <multilib@gentoo.org>
  6. # @AUTHOR:
  7. # Author: Michał Górny <mgorny@gentoo.org>
  8. # @BLURB: autotools-utils wrapper for multilib builds
  9. # @DESCRIPTION:
  10. # The autotools-multilib.eclass provides a glue between
  11. # autotools-utils.eclass(5) and multilib-minimal.eclass(5), aiming
  12. # to provide a convenient way to build packages using autotools
  13. # for multiple ABIs.
  14. #
  15. # Inheriting this eclass sets IUSE and exports default multilib_src_*()
  16. # sub-phases that call autotools-utils phase functions for each ABI
  17. # enabled. The multilib_src_*() functions can be defined in ebuild just
  18. # like in multilib-minimal.
  19. # EAPI=4 is required for meaningful MULTILIB_USEDEP.
  20. case ${EAPI:-0} in
  21. 6) die "${ECLASS}.eclass is banned in EAPI ${EAPI}";;
  22. 4|5) ;;
  23. *) die "EAPI=${EAPI} is not supported" ;;
  24. esac
  25. inherit autotools-utils eutils multilib-build multilib-minimal
  26. EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install
  27. # Note: _at_args[@] passing is a backwards compatibility measure.
  28. # Don't use it in new packages.
  29. autotools-multilib_src_prepare() {
  30. autotools-utils_src_prepare "${@}"
  31. [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && multilib_copy_sources
  32. }
  33. multilib_src_configure() {
  34. [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]] && local ECONF_SOURCE=${BUILD_DIR}
  35. autotools-utils_src_configure "${_at_args[@]}"
  36. }
  37. autotools-multilib_src_configure() {
  38. local _at_args=( "${@}" )
  39. multilib-minimal_src_configure
  40. }
  41. multilib_src_compile() {
  42. emake "${_at_args[@]}"
  43. }
  44. autotools-multilib_src_compile() {
  45. local _at_args=( "${@}" )
  46. multilib-minimal_src_compile
  47. }
  48. multilib_src_test() {
  49. autotools-utils_src_test "${_at_args[@]}"
  50. }
  51. autotools-multilib_src_test() {
  52. local _at_args=( "${@}" )
  53. multilib-minimal_src_test
  54. }
  55. multilib_src_install() {
  56. emake DESTDIR="${D}" "${_at_args[@]}" install
  57. }
  58. multilib_src_install_all() {
  59. einstalldocs
  60. # Remove libtool files and unnecessary static libs
  61. local prune_ltfiles=${AUTOTOOLS_PRUNE_LIBTOOL_FILES}
  62. if [[ ${prune_ltfiles} != none ]]; then
  63. prune_libtool_files ${prune_ltfiles:+--${prune_ltfiles}}
  64. fi
  65. }
  66. autotools-multilib_src_install() {
  67. local _at_args=( "${@}" )
  68. multilib-minimal_src_install
  69. }