Cross-platform detection of multiarch

2011-06-16 Thread Jan Medlock
What is the recommended way to detect the presence of multiarch in a
cross-platform build?

I'm trying to fix up the Sage <http://www.sagemath.org/> build, which
seems to need to set a search path on multiarch systems:
<http://trac.sagemath.org/sage_trac/ticket/11243>

Currently, there's an explicit check for Ubuntu 11.04, which doesn't
work for Debian and its other derivatives, will break with the next
version of Ubuntu, etc.

So, what's the best way to check whether the OS has multiarch?

I though about using dpkg-architecture.  Another way would be
preferred since dpkg-dev, the package containing dpkg-architecture,
might not be installed.

Thanks,
Jan Medlock


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110616232841.ga5...@ralph.turboshower.net



Re: Cross-platform detection of multiarch

2011-06-16 Thread Jan Medlock
On 17 June 2011 10:002, Brian May 
wrote:
> On 17 June 2011 09:28, Jan Medlock 
> wrote:
>> I though about using dpkg-architecture.  Another way would be
>> preferred since dpkg-dev, the package containing dpkg-architecture,
>> might not be installed.
> 
> Is that likely?
> 
> dpkg-dev is required by build-essential and contains a number of
> important programs required for building Debian packages.

I don't know.  Is dpkg-dev installed by default on Debian, Ubuntu,
Mint, etc.?   (I'd guess the answer is no to all of them.)

Sage is designed to be built easily (just 'make') on a wide variety of
platforms.  I'd like a solution that as robust as possible to optional
packages the user might not have installed, since that's what Sage
tries to provide with its build system.

And in case there's confusion, I'm not talking about building a Debian
package: smarter people than me haven't yet solved that problem
because of all of its included dependencies, some of which are
required to be very specific versions.  The way to install Sage is to
build it from source, which now fails on multiarch Debian and
derivatives (except for Ubuntu 11.04).


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110617015148.ga2...@turboshower.net



Re: Cross-platform detection of multiarch

2011-06-16 Thread Jan Medlock
Jonathan Nieder wrote:
> Jonathan Nieder wrote:
>> After
>> reading the bug log you linked to, it's still unclear to me where
>> multiarch fits in (as not ld's change in defaults to
>> --no-copy-dt-needed, say).
> 
> Ah, stupid me: here's a link so others can start where I left off.
> 
>  http://groups.google.com/group/sage-devel/msg/e60dc9297efebeaa
> 
> Perhaps Python should be making use of "gcc -print-search-dirs"
> output.

I just dug through this and understand better now.

Debian uses a different solution for building Python 2.6 than that
used by Sage (and it looks like Ubuntu). There's a patch in Debian's
packages of Python 2.6 that essential adds
{/lib,/usr/lib}/$(DEB_HOST_MULTIARCH) to the library search path.
This solution is included in upstream Python 2.7.

Python's distutils (or whatever is setting the default library paths)
seems to be not using the compiler's ideas about the library path
(i.e.  gcc -print-search-dirs).  That seems broken to me...  Parsing
the library directory paths across multiple compilers must be hard.

Thanks for sending me down the right path.  It looks like I should
just patch my local versions until Sage upgrades to Python 2.7.  (And
even then, it'll require dpkg-dev to compile.)  And multiarch was not
really involved...

JM


-- 
To UNSUBSCRIBE, email to debian-devel-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/20110617041720.ga26...@ralph.turboshower.net