summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <eradicator@gentoo.org>2005-01-18 04:56:03 +0000
committerJeremy Huddleston <eradicator@gentoo.org>2005-01-18 04:56:03 +0000
commit76a1df8db35b5120e023549d2498b638ef72246f (patch)
tree1510cfe4a47da5931a7cb6562bd434cf5e711fd1
parentAdded ~sparc keyword. (diff)
downloadhistorical-76a1df8db35b5120e023549d2498b638ef72246f.tar.gz
historical-76a1df8db35b5120e023549d2498b638ef72246f.tar.bz2
historical-76a1df8db35b5120e023549d2498b638ef72246f.zip
Added has_multilib_profile and documentation near the top.
-rw-r--r--eclass/multilib.eclass83
1 files changed, 80 insertions, 3 deletions
diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
index 329f9b60e545..364edd83c035 100644
--- a/eclass/multilib.eclass
+++ b/eclass/multilib.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.13 2005/01/17 04:20:55 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.14 2005/01/18 04:56:03 eradicator Exp $
#
# Author: Jeremy Huddleston <eradicator@gentoo.org>
#
@@ -12,6 +12,83 @@ INHERITED="$INHERITED $ECLASS"
DESCRIPTION="Based on the ${ECLASS} eclass"
+# has_multilib_profile:
+# Return true if the current profile is a multilib profile. You might
+# want to use this like 'use multilib || has_multilib_profile' until
+# all profiles utilizing the 'multilib' use flag are removed from portage
+
+# is_final_abi:
+# Return true if ${ABI} is the final abi to be installed (and thus we are
+# on our last run through a src_* function.
+
+# number_abis:
+# echo the number of ABIs we will be installing for
+
+# get_abi_order:
+# Return a list of the ABIs we want to install for with
+# the last one in the list being the default.
+
+# get_all_libdir:
+# Returns a list of all the libdirs used by this profile. This includes
+# those that might not be touched by the current ebuild and always includes
+# "lib".
+
+# get_libdir:
+# Returns the libdir for the selected ABI. This is backwards compatible
+# and simply calls get_abi_LIBDIR() on newer profiles. You should use this
+# to determine where to install shared objects (ex: /usr/$(get_libdir))
+
+# get_abi_var <VAR> [<ABI>]:
+# returns the value of ${<VAR>_<ABI>} which should be set in make.defaults
+#
+# get_abi_CFLAGS:
+# get_abi_CDEFINE:
+# get_abi_LIBDIR:
+# Aliases for 'get_abi_var CFLAGS', etc.
+
+# get_ml_incdir [<include dir> [<ABI>]]
+# include dir defaults to /usr/include
+# ABI defaults to ${ABI} or ${DEFAULT_ABI}
+#
+# If a multilib include dir is associated with the passed include dir, then
+# we return it, otherwise, we just echo back the include dir. This is
+# neccessary when a built script greps header files rather than testing them
+# via #include (like perl) to figure out features.
+
+# prep_ml_includes:
+# Some includes (include/asm, glibc, etc) are ABI dependent. In this case,
+# We can install them in different locations for each ABI and create a common
+# header which includes the right one based on CDEFINE_${ABI}. If your
+# package installs ABI-specific headers, just add 'prep_ml_includes' to the
+# end of your src_install(). It takes a list of directories that include
+# files are installed in (default is /usr/include if none are passed).
+#
+# Example:
+# src_install() {
+# ...
+# prep_ml_includes /usr/qt/3/include
+# }
+
+# create_ml_includes <include dir> <symbol 1>:<dir 1> [<symbol 2>:<dir 2> ...]
+# If you need more control than prep_ml_includes can offer (like linux-headers
+# for the asm-* dirs, then use create_ml_includes. The firs argument is the
+# common dir. The remaining args are of the form <symbol>:<dir> where
+# <symbol> is what is put in the #ifdef for choosing that dir.
+#
+# Ideas for this code came from debian's sparc-linux headers package.
+#
+# Example:
+# create_ml_includes /usr/include/asm __sparc__:/usr/include/asm-sparc __sparc64__:/usr/include/asm-sparc64
+# create_ml_includes /usr/include/asm __i386__:/usr/include/asm-i386 __x86_64__:/usr/include/asm-x86_64
+
+### END DOCUMENTATION ###
+
+# has_multilib_profile()
+# Return true if
+has_multilib_profile() {
+ [ -n "${MULTILIB_ABIS}" ]
+}
+
# This function simply returns the desired lib directory. With portage
# 2.0.51, we now have support for installing libraries to lib32/lib64
# to accomidate the needs of multilib systems. It's no longer a good idea
@@ -152,7 +229,7 @@ get_all_libdirs() {
local abi
local dir
- if [ -n "${MULTILIB_ABIS}" ]; then
+ if has_multilib_profile; then
for abi in ${MULTILIB_ABIS}; do
[ "$(get_abi_LIBDIR ${abi})" != "lib" ] && libdirs="${libdirs} $(get_abi_LIBDIR ${abi})"
done
@@ -169,7 +246,7 @@ get_all_libdirs() {
# using the new multilib configuration. This can be used to determine
# if we're in the last (or only) run through src_{unpack,compile,install}
is_final_abi() {
- [ -z "${ABI}" ] && return 0
+ ! has_multilib_profile && return 0
local ALL_ABIS=$(get_abi_order)
local LAST_ABI=${ALL_ABIS/* /}
[ "${LAST_ABI}" = "${ABI}" ]