mgorny      14/05/23 07:47:40

  Modified:             ChangeLog multilib-build.eclass
  Log:
  Use MULTILIB_ABI_FLAG for header wrapping. Also, use explicit error when ABI 
is omitted in wrapper template.

Revision  Changes    Path
1.1269               eclass/ChangeLog

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1269&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.1269&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.1268&r2=1.1269

Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.1268
retrieving revision 1.1269
diff -u -r1.1268 -r1.1269
--- ChangeLog   23 May 2014 07:39:26 -0000      1.1268
+++ ChangeLog   23 May 2014 07:47:39 -0000      1.1269
@@ -1,6 +1,10 @@
 # ChangeLog for eclass directory
 # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1268 2014/05/23 
07:39:26 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1269 2014/05/23 
07:47:39 mgorny Exp $
+
+  23 May 2014; Michał Górny <[email protected]> multilib-build.eclass:
+  Use MULTILIB_ABI_FLAG for header wrapping. Also, use explicit error when ABI
+  is omitted in wrapper template.
 
   23 May 2014; Michał Górny <[email protected]> multilib-build.eclass:
   Deprecate multilib_for_best_abi() to decrease confusion.



1.52                 eclass/multilib-build.eclass

file : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/multilib-build.eclass?rev=1.52&view=markup
plain: 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/multilib-build.eclass?rev=1.52&content-type=text/plain
diff : 
http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/multilib-build.eclass?r1=1.51&r2=1.52

Index: multilib-build.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- multilib-build.eclass       23 May 2014 07:39:26 -0000      1.51
+++ multilib-build.eclass       23 May 2014 07:47:39 -0000      1.52
@@ -1,6 +1,6 @@
 # Copyright 1999-2014 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.51 
2014/05/23 07:39:26 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.52 
2014/05/23 07:47:39 mgorny Exp $
 
 # @ECLASS: multilib-build.eclass
 # @MAINTAINER:
@@ -411,35 +411,12 @@
        done
 
        if [[ ${MULTILIB_WRAPPED_HEADERS[@]} ]]; then
-               # XXX: get abi_* directly
-               local abi_flag
-               case "${ABI}" in
-                       amd64|amd64_fbsd)
-                               abi_flag=abi_x86_64;;
-                       x86|x86_fbsd)
-                               abi_flag=abi_x86_32;;
-                       x32)
-                               abi_flag=abi_x86_x32;;
-                       n32)
-                               abi_flag=abi_mips_n32;;
-                       n64)
-                               abi_flag=abi_mips_n64;;
-                       o32)
-                               abi_flag=abi_mips_o32;;
-               esac
-
-               # If abi_flag is unset, then header wrapping is unsupported
-               # on this ABI. This could mean either that:
-               #
-               # 1) the arch doesn't support multilib at all -- in this case,
-               # the headers are not wrapped and everything works as expected,
-               #
-               # 2) someone added new ABI and forgot to update the function --
-               # in this case, the header consistency check will notice one of
-               # those ABIs has an extra header (compared to the header moved
-               # for wrapping) and will fail.
+               # If abi_flag is unset, then header wrapping is unsupported on
+               # this ABI. This means the arch doesn't support multilib at all
+               # -- in this case, the headers are not wrapped and everything
+               # works as expected.
 
-               if [[ ${abi_flag} ]]; then
+               if [[ ${MULTILIB_ABI_FLAG} ]]; then
                        for f in "${MULTILIB_WRAPPED_HEADERS[@]}"; do
                                # drop leading slash if it's there
                                f=${f#/}
@@ -454,10 +431,12 @@
 
                                # Some ABIs may have install less files than 
others.
                                if [[ -f ${root}/usr/include${f} ]]; then
+                                       local 
wrapper=${ED}/tmp/multilib-include${f}
+
                                        if [[ ! -f 
${ED}/tmp/multilib-include${f} ]]; then
                                                dodir 
"/tmp/multilib-include${dir}"
                                                # a generic template
-                                               cat > 
"${ED}/tmp/multilib-include${f}" <<_EOF_
+                                               cat > "${wrapper}" <<_EOF_
 /* This file is auto-generated by multilib-build.eclass
  * as a multilib-friendly wrapper. For the original content,
  * please see the files that are #included below.
@@ -485,20 +464,25 @@
 _EOF_
                                        fi
 
+                                       if ! grep -q "${MULTILIB_ABI_FLAG} " 
"${wrapper}"
+                                       then
+                                               die "Flag ${MULTILIB_ABI_FLAG} 
not listed in wrapper template. Please report a bug to https://bugs.gentoo.org.";
+                                       fi
+
                                        # $CHOST shall be set by 
multilib_toolchain_setup
                                        dodir 
"/tmp/multilib-include/${CHOST}${dir}"
                                        mv "${root}/usr/include${f}" 
"${ED}/tmp/multilib-include/${CHOST}${dir}/" || die
 
                                        # Note: match a space afterwards to 
avoid collision potential.
-                                       sed -e "/${abi_flag} /s&error.*&include 
<${CHOST}${f}>&" \
-                                               -i 
"${ED}/tmp/multilib-include${f}" || die
+                                       sed -e "/${MULTILIB_ABI_FLAG} 
/s&error.*&include <${CHOST}${f}>&" \
+                                               -i "${wrapper}" || die
 
                                        # Hack for emul-linux-x86 compatibility.
                                        # It assumes amd64 will come after x86, 
and will use amd64
                                        # headers if no specific x86 headers 
were installed.
                                        if [[ ${ABI} == amd64 ]]; then
                                                sed -e "/abi_x86_32 
/s&error.*&include <${CHOST}${f}>&" \
-                                                       -i 
"${ED}/tmp/multilib-include${f}" || die
+                                                       -i "${wrapper}" || die
                                        fi
                                fi
                        done




Reply via email to