/[gentoo-x86]/eclass/multilib.eclass
Gentoo

Diff of /eclass/multilib.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.18 Revision 1.19
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.18 2005/02/03 05:52:51 eradicator Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multilib.eclass,v 1.19 2005/02/09 03:22:25 eradicator Exp $
4# 4#
5# Author: Jeremy Huddleston <eradicator@gentoo.org> 5# Author: Jeremy Huddleston <eradicator@gentoo.org>
6# 6#
7# This eclass is for all functions pertaining to handling multilib. 7# This eclass is for all functions pertaining to handling multilib.
8# configurations. 8# configurations.
86# create_ml_includes /usr/include/asm __sparc__:/usr/include/asm-sparc __sparc64__:/usr/include/asm-sparc64 86# create_ml_includes /usr/include/asm __sparc__:/usr/include/asm-sparc __sparc64__:/usr/include/asm-sparc64
87# create_ml_includes /usr/include/asm __i386__:/usr/include/asm-i386 __x86_64__:/usr/include/asm-x86_64 87# create_ml_includes /usr/include/asm __i386__:/usr/include/asm-i386 __x86_64__:/usr/include/asm-x86_64
88 88
89### END DOCUMENTATION ### 89### END DOCUMENTATION ###
90 90
91# Defaults:
92CFLAGS_default=""
93LIBDIR_default="${CONF_LIBDIR:-lib}"
94CDEFINE_default="__unix__"
95
91# has_multilib_profile() 96# has_multilib_profile()
92has_multilib_profile() { 97has_multilib_profile() {
93 [ -n "${MULTILIB_ABIS}" -a "${MULTILIB_ABIS}" != "${MULTILIB_ABIS/ /}" ] 98 [ -n "${MULTILIB_ABIS}" -a "${MULTILIB_ABIS}" != "${MULTILIB_ABIS/ /}" ]
94} 99}
95 100
105# Added support for ${ABI} and ${DEFAULT_ABI}. If they're both not set, 110# Added support for ${ABI} and ${DEFAULT_ABI}. If they're both not set,
106# fall back on old behavior. Any profile that has these set should also 111# fall back on old behavior. Any profile that has these set should also
107# depend on a newer version of portage (not yet released) which uses these 112# depend on a newer version of portage (not yet released) which uses these
108# over CONF_LIBDIR in econf, dolib, etc... 113# over CONF_LIBDIR in econf, dolib, etc...
109get_libdir() { 114get_libdir() {
110 LIBDIR_TEST=$(type econf) 115 local CONF_LIBDIR
111 if [ ! -z "${CONF_LIBDIR_OVERRIDE}" ] ; then 116 if [ -n "${CONF_LIBDIR_OVERRIDE}" ] ; then
112 # if there is an override, we want to use that... always. 117 # if there is an override, we want to use that... always.
113 CONF_LIBDIR="${CONF_LIBDIR_OVERRIDE}" 118 echo ${CONF_LIBDIR_OVERRIDE}
114 elif [ -n "$(get_abi_LIBDIR)" ]; then 119 else
115 CONF_LIBDIR="$(get_abi_LIBDIR)" 120 get_abi_LIBDIR
116 elif [ "${LIBDIR_TEST/CONF_LIBDIR}" == "${LIBDIR_TEST}" ]; then # we don't have CONF_LIBDIR support
117 # will be <portage-2.0.51_pre20
118 CONF_LIBDIR="lib"
119 fi 121 fi
120 # and of course, default to lib if CONF_LIBDIR isnt set
121 echo ${CONF_LIBDIR:=lib}
122 unset LIBDIR_TEST
123} 122}
124 123
125get_multilibdir() { 124get_multilibdir() {
126 if [ -n "$(get_abi_LIBDIR)" ]; then 125 if has_multilib_profile; then
127 eerror "get_multilibdir called, but it shouldn't be needed with the new multilib approach. Please file a bug at http://bugs.gentoo.org and assign it to eradicator@gentoo.org" 126 eerror "get_multilibdir called, but it shouldn't be needed with the new multilib approach. Please file a bug at http://bugs.gentoo.org and assign it to eradicator@gentoo.org"
128 exit 1 127 exit 1
129 fi 128 fi
130 echo ${CONF_MULTILIBDIR:=lib32} 129 echo ${CONF_MULTILIBDIR:=lib32}
131} 130}
140# 139#
141# get_libdir_override lib64 140# get_libdir_override lib64
142# 141#
143# Travis Tilley <lv@gentoo.org> (31 Aug 2004) 142# Travis Tilley <lv@gentoo.org> (31 Aug 2004)
144get_libdir_override() { 143get_libdir_override() {
145 if [ -n "$(get_abi_LIBDIR)" ]; then 144 if has_multilib_profile; then
146 eerror "get_libdir_override called, but it shouldn't be needed with the new multilib approach. Please file a bug at http://bugs.gentoo.org and assign it to eradicator@gentoo.org" 145 eerror "get_libdir_override called, but it shouldn't be needed with the new multilib approach. Please file a bug at http://bugs.gentoo.org and assign it to eradicator@gentoo.org"
147 exit 1 146 exit 1
148 fi 147 fi
149 CONF_LIBDIR="$1" 148 CONF_LIBDIR="$1"
150 CONF_LIBDIR_OVERRIDE="$1" 149 CONF_LIBDIR_OVERRIDE="$1"
150 LIBDIR_default="$1"
151} 151}
152 152
153# get_abi_var <VAR> [<ABI>] 153# get_abi_var <VAR> [<ABI>]
154# returns the value of ${<VAR>_<ABI>} which should be set in make.defaults 154# returns the value of ${<VAR>_<ABI>} which should be set in make.defaults
155# 155#
172 elif [ -n "${ABI}" ]; then 172 elif [ -n "${ABI}" ]; then
173 abi=${ABI} 173 abi=${ABI}
174 elif [ -n "${DEFAULT_ABI}" ]; then 174 elif [ -n "${DEFAULT_ABI}" ]; then
175 abi=${DEFAULT_ABI} 175 abi=${DEFAULT_ABI}
176 else 176 else
177 return 1 177 abi="default"
178 fi 178 fi
179 179
180 local var="${flag}_${abi}" 180 local var="${flag}_${abi}"
181 echo ${!var} 181 echo ${!var}
182} 182}
189# the last one in the list being the default. 189# the last one in the list being the default.
190get_install_abis() { 190get_install_abis() {
191 local order="" 191 local order=""
192 192
193 if [ -z "${MULTILIB_ABIS}" ]; then 193 if [ -z "${MULTILIB_ABIS}" ]; then
194 echo "NOMULTILIB" 194 echo "default"
195 return 1 195 return 0
196 fi 196 fi
197 197
198 if hasq multilib-pkg-force ${RESTRICT} || 198 if hasq multilib-pkg-force ${RESTRICT} ||
199 { hasq multilib-pkg ${FEATURES} && hasq multilib-pkg ${RESTRICT}; }; then 199 { hasq multilib-pkg ${FEATURES} && hasq multilib-pkg ${RESTRICT}; }; then
200 for x in ${MULTILIB_ABIS}; do 200 for x in ${MULTILIB_ABIS}; do
229# the last one in the list being the default. 229# the last one in the list being the default.
230get_all_abis() { 230get_all_abis() {
231 local order="" 231 local order=""
232 232
233 if [ -z "${MULTILIB_ABIS}" ]; then 233 if [ -z "${MULTILIB_ABIS}" ]; then
234 echo "NOMULTILIB" 234 echo "default"
235 return 1 235 return 0
236 fi 236 fi
237 237
238 for x in ${MULTILIB_ABIS}; do 238 for x in ${MULTILIB_ABIS}; do
239 if [ "${x}" != "${DEFAULT_ABI}" ]; then 239 if [ "${x}" != "${DEFAULT_ABI}" ]; then
240 order="${order:+${order }}${x}" 240 order="${order:+${order }}${x}"
257 if has_multilib_profile; then 257 if has_multilib_profile; then
258 for abi in ${MULTILIB_ABIS}; do 258 for abi in ${MULTILIB_ABIS}; do
259 [ "$(get_abi_LIBDIR ${abi})" != "lib" ] && libdirs="${libdirs} $(get_abi_LIBDIR ${abi})" 259 [ "$(get_abi_LIBDIR ${abi})" != "lib" ] && libdirs="${libdirs} $(get_abi_LIBDIR ${abi})"
260 done 260 done
261 elif [ -n "${CONF_LIBDIR}" ]; then 261 elif [ -n "${CONF_LIBDIR}" ]; then
262 for dir in ${CONF_LIBDIR} ${CONF_MULTILIBDIR:=lib32}; do 262 for dir in ${CONF_LIBDIR} ${CONF_MULTILIBDIR:-lib32}; do
263 [ "${dir}" != "lib" ] && libdirs="${libdirs} ${dir}" 263 [ "${dir}" != "lib" ] && libdirs="${libdirs} ${dir}"
264 done 264 done
265 fi 265 fi
266 266
267 echo "${libdirs}" 267 echo "${libdirs}"

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.20