summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-03-18 22:03:25 +0000
committerMike Frysinger <vapier@gentoo.org>2011-03-18 22:03:25 +0000
commit9c562480eee3ef0a921af6a66282520af44e98a8 (patch)
treeda4aae107f66b79d6466c62e6b5494bfb0300831 /eclass/multilib.eclass
parentDrop gupnp-av and gupnp-vala mask since gstreamer-0.10.32 has been added to t... (diff)
downloadgentoo-2-9c562480eee3ef0a921af6a66282520af44e98a8.tar.gz
gentoo-2-9c562480eee3ef0a921af6a66282520af44e98a8.tar.bz2
gentoo-2-9c562480eee3ef0a921af6a66282520af44e98a8.zip
punt now unused get_ml_incdir/prep_ml_includes funcs and associated CDEFINE logic
Diffstat (limited to 'eclass/multilib.eclass')
-rw-r--r--eclass/multilib.eclass271
1 files changed, 1 insertions, 270 deletions
diff --git a/eclass/multilib.eclass b/eclass/multilib.eclass
index e92a81b0dd5b..3a5ab6fc8b57 100644
--- a/eclass/multilib.eclass
+++ b/eclass/multilib.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.89 2011/03/18 21:58:15 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.90 2011/03/18 22:03:25 vapier Exp $
# @ECLASS: multilib.eclass
# @MAINTAINER:
@@ -21,7 +21,6 @@ export LDFLAGS_default
export CHOST_default=${CHOST_default:-${CHOST}}
export CTARGET_default=${CTARGET_default:-${CTARGET:-${CHOST_default}}}
export LIBDIR_default=${CONF_LIBDIR:-"lib"}
-export CDEFINE_default="__unix__"
export KERNEL_ABI=${KERNEL_ABI:-${DEFAULT_ABI}}
# @FUNCTION: has_multilib_profile
@@ -155,12 +154,6 @@ get_abi_CTARGET() { get_abi_var CTARGET "$@"; }
# Alias for 'get_abi_var FAKE_TARGETS'
get_abi_FAKE_TARGETS() { get_abi_var FAKE_TARGETS "$@"; }
-# @FUNCTION: get_abi_CDEFINE
-# @USAGE: [ABI]
-# @DESCRIPTION:
-# Alias for 'get_abi_var CDEFINE'
-get_abi_CDEFINE() { get_abi_var CDEFINE "$@"; }
-
# @FUNCTION: get_abi_LIBDIR
# @USAGE: [ABI]
# @DESCRIPTION:
@@ -269,256 +262,6 @@ number_abis() {
echo $#
}
-# @FUNCTION: get_ml_incdir
-# @USAGE: [include_dir] [ABI]
-# @DESCRIPTION:
-# 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.
-get_ml_incdir() {
- local dir=/usr/include
-
- if [[ $# -gt 0 ]]; then
- incdir=$1
- shift
- fi
-
- if [[ -z "${MULTILIB_ABIS}" ]]; then
- echo ${incdir}
- return 0
- fi
-
- local abi=${ABI-${DEFAULT_ABI}}
- if [[ $# -gt 0 ]]; then
- abi=$1
- shift
- fi
-
- if [[ -d "${dir}/gentoo-multilib/${abi}" ]]; then
- echo ${dir}/gentoo-multilib/${abi}
- else
- echo ${dir}
- fi
-}
-
-# @FUNCTION: prep_ml_includes
-# @DESCRIPTION:
-# 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
-# }
-prep_ml_includes() {
- if [[ $(number_abis) -gt 1 ]] ; then
- local dir
- local dirs
- local base
-
- if [[ $# -eq 0 ]] ; then
- dirs=/usr/include
- else
- dirs="$@"
- fi
-
- for dir in ${dirs} ; do
- base=${T}/gentoo-multilib/${dir}/gentoo-multilib
- mkdir -p "${base}"
- [[ -d ${base}/${ABI} ]] && rm -rf "${base}/${ABI}"
- mv "${D}/${dir}" "${base}/${ABI}"
- done
-
- if is_final_abi; then
- base=${T}/gentoo-multilib
- pushd "${base}"
- find . | tar -c -T - -f - | tar -x --no-same-owner -f - -C "${D}"
- popd
-
- # This 'set' stuff is required by mips profiles to properly pass
- # CDEFINE's (which have spaces) to sub-functions
- set --
- for dir in ${dirs} ; do
- set -- "$@" "${dir}"
- local abi
- for abi in $(get_install_abis); do
- set -- "$@" "$(get_abi_CDEFINE ${abi}):${dir}/gentoo-multilib/${abi}"
- done
- create_ml_includes "$@"
- done
- fi
- fi
-}
-
-# @FUNCTION: create_ml_includes
-# @USAGE: <include_dir> <symbol_1>:<dir_1> [<symbol_2>:<dir_2>...]
-# @DESCRIPTION:
-# 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
-#
-# Warning: Be careful with the ordering here. The default ABI has to be the
-# last, because it is always defined (by GCC)
-create_ml_includes() {
- local dest=$1
- shift
- local basedirs=$(create_ml_includes-listdirs "$@")
-
- create_ml_includes-makedestdirs ${dest} ${basedirs}
-
- local file
- for file in $(create_ml_includes-allfiles ${basedirs}) ; do
- #local name=$(echo ${file} | tr '[:lower:]' '[:upper:]' | sed 's:[^[:upper:]]:_:g')
- (
- echo "/* Autogenerated by create_ml_includes() in multilib.eclass */"
-
- local dir
- for dir in ${basedirs}; do
- if [[ -f ${D}/${dir}/${file} ]] ; then
- echo ""
- local sym=$(create_ml_includes-sym_for_dir ${dir} "$@")
- if [[ ${sym/=} != "${sym}" ]] ; then
- echo "#if ${sym}"
- elif [[ ${sym::1} == "!" ]] ; then
- echo "#ifndef ${sym:1}"
- else
- echo "#ifdef ${sym}"
- fi
- echo "# include <$(create_ml_includes-absolute ${dir}/${file})>"
- echo "#endif /* ${sym} */"
- fi
- done
-
- #echo "#endif /* __CREATE_ML_INCLUDES_STUB_${name}__ */"
- ) > "${D}/${dest}/${file}"
- done
-}
-
-# Helper function for create_ml_includes
-create_ml_includes-absolute() {
- local dst="$(create_ml_includes-tidy_path $1)"
-
- dst=(${dst//\// })
-
- local i
- for ((i=0; i<${#dst[*]}; i++)); do
- [ "${dst[i]}" == "include" ] && break
- done
-
- local strip_upto=$i
-
- for ((i=strip_upto+1; i<${#dst[*]}-1; i++)); do
- echo -n ${dst[i]}/
- done
-
- echo -n ${dst[i]}
-}
-
-# Helper function for create_ml_includes
-create_ml_includes-tidy_path() {
- local removed=$1
-
- if [ -n "${removed}" ]; then
- # Remove multiple slashes
- while [ "${removed}" != "${removed/\/\//\/}" ]; do
- removed=${removed/\/\//\/}
- done
-
- # Remove . directories
- while [ "${removed}" != "${removed//\/.\//\/}" ]; do
- removed=${removed//\/.\//\/}
- done
- [ "${removed##*/}" = "." ] && removed=${removed%/*}
-
- # Removed .. directories
- while [ "${removed}" != "${removed//\/..\/}" ]; do
- local p1="${removed%%\/..\/*}"
- local p2="${removed#*\/..\/}"
-
- removed="${p1%\/*}/${p2}"
- done
-
- # Remove trailing ..
- [ "${removed##*/}" = ".." ] && removed=${removed%/*/*}
-
- # Remove trailing /
- [ "${removed##*/}" = "" ] && removed=${removed%/*}
-
- echo ${removed}
- fi
-}
-
-# Helper function for create_ml_includes
-create_ml_includes-listdirs() {
- local dirs
- local data
- for data in "$@"; do
- dirs="${dirs} ${data/*:/}"
- done
- echo ${dirs:1}
-}
-
-# Helper function for create_ml_includes
-create_ml_includes-makedestdirs() {
- local dest=$1
- shift
- local basedirs=$@
- [[ -z ${ED} ]] && local ED=${D}
-
- dodir ${dest}
-
- local basedir
- for basedir in ${basedirs}; do
- local dir
- for dir in $(find "${ED}"/${basedir} -type d); do
- dodir ${dest}/${dir/${ED}\/${basedir}/}
- done
- done
-}
-
-# Helper function for create_ml_includes
-create_ml_includes-allfiles() {
- [[ -z ${ED} ]] && local ED=${D}
- local basedir file
- for basedir in "$@" ; do
- for file in $(find "${ED}"/${basedir} -type f); do
- echo ${file/${ED}\/${basedir}\//}
- done
- done | sort | uniq
-}
-
-# Helper function for create_ml_includes
-create_ml_includes-sym_for_dir() {
- local dir=$1
- shift
- local data
- for data in "$@"; do
- if [[ ${data} == *:${dir} ]] ; then
- echo ${data/:*/}
- return 0
- fi
- done
- echo "Shouldn't be here -- create_ml_includes-sym_for_dir $1 $@"
- # exit because we'll likely be called from a subshell
- exit 1
-}
-
# @FUNCTION: get_libname
# @USAGE: [version]
# @DESCRIPTION:
@@ -582,7 +325,6 @@ multilib_env() {
export CFLAGS_x86=${CFLAGS_x86--m32}
export CHOST_x86=${CTARGET/x86_64/i686}
export CTARGET_x86=${CHOST_x86}
- export CDEFINE_x86="__i386__"
if [[ ${SYMLINK_LIB} == "yes" ]] ; then
export LIBDIR_x86="lib32"
else
@@ -592,13 +334,11 @@ multilib_env() {
export CFLAGS_amd64=${CFLAGS_amd64--m64}
export CHOST_amd64=${CTARGET}
export CTARGET_amd64=${CHOST_amd64}
- export CDEFINE_amd64="__x86_64__"
export LIBDIR_amd64="lib64"
export CFLAGS_x32=${CFLAGS_x32--mx32}
export CHOST_x32=${CTARGET}
export CTARGET_x32=${CHOST_x32}
- export CDEFINE_x32="__i386__"
export LIBDIR_x32="libx32"
: ${MULTILIB_ABIS=amd64 x86}
@@ -608,19 +348,16 @@ multilib_env() {
export CFLAGS_o32=${CFLAGS_o32--mabi=32}
export CHOST_o32=${CTARGET/mips64/mips}
export CTARGET_o32=${CHOST_o32}
- export CDEFINE_o32="_MIPS_SIM == _ABIO32"
export LIBDIR_o32="lib"
export CFLAGS_n32=${CFLAGS_n32--mabi=n32}
export CHOST_n32=${CTARGET}
export CTARGET_n32=${CHOST_n32}
- export CDEFINE_n32="_MIPS_SIM == _ABIN32"
export LIBDIR_n32="lib32"
export CFLAGS_n64=${CFLAGS_n64--mabi=64}
export CHOST_n64=${CTARGET}
export CTARGET_n64=${CHOST_n64}
- export CDEFINE_n64="_MIPS_SIM == _ABI64"
export LIBDIR_n64="lib64"
: ${MULTILIB_ABIS=n64 n32 o32}
@@ -630,13 +367,11 @@ multilib_env() {
export CFLAGS_ppc=${CFLAGS_ppc--m32}
export CHOST_ppc=${CTARGET/powerpc64/powerpc}
export CTARGET_ppc=${CHOST_ppc}
- export CDEFINE_ppc="!__powerpc64__"
export LIBDIR_ppc="lib"
export CFLAGS_ppc64=${CFLAGS_ppc64--m64}
export CHOST_ppc64=${CTARGET}
export CTARGET_ppc64=${CHOST_ppc64}
- export CDEFINE_ppc64="__powerpc64__"
export LIBDIR_ppc64="lib64"
: ${MULTILIB_ABIS=ppc64 ppc}
@@ -646,13 +381,11 @@ multilib_env() {
export CFLAGS_s390=${CFLAGS_s390--m31} # the 31 is not a typo
export CHOST_s390=${CTARGET/s390x/s390}
export CTARGET_s390=${CHOST_s390}
- export CDEFINE_s390="!__s390x__"
export LIBDIR_s390="lib"
export CFLAGS_s390x=${CFLAGS_s390x--m64}
export CHOST_s390x=${CTARGET}
export CTARGET_s390x=${CHOST_s390x}
- export CDEFINE_s390x="__s390x__"
export LIBDIR_s390x="lib64"
: ${MULTILIB_ABIS=s390x s390}
@@ -662,13 +395,11 @@ multilib_env() {
export CFLAGS_sparc32=${CFLAGS_sparc32}
export CHOST_sparc32=${CTARGET/sparc64/sparc}
export CTARGET_sparc32=${CHOST_sparc32}
- export CDEFINE_sparc32="!__arch64__"
export LIBDIR_sparc32="lib"
export CFLAGS_sparc64=${CFLAGS_sparc64--m64}
export CHOST_sparc64=${CTARGET}
export CTARGET_sparc64=${CHOST_sparc64}
- export CDEFINE_sparc64="__arch64__"
export LIBDIR_sparc64="lib64"
: ${MULTILIB_ABIS=sparc64 sparc32}