Avoid multiarch conflicts when installed for multiple architectures.

This commit is contained in:
Roberto Bagnara 2008-01-09 10:47:16 +00:00
parent 8b5e1279d5
commit 59623aa509
4 changed files with 163 additions and 5 deletions

43
ppl.hh Normal file
View File

@ -0,0 +1,43 @@
/* This is the header file switcher of the Parma Polyhedra Library.
Copyright (C) 2001-2008 Roberto Bagnara <bagnara@cs.unipr.it>
This file is part of the Parma Polyhedra Library (PPL).
The PPL is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
The PPL is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
For the most up-to-date information see the Parma Polyhedra Library
site: http://www.cs.unipr.it/ppl/ . */
#if defined(__x86_64__)
#include "ppl-x86_64.hh"
#elif defined(__i386__)
#include "ppl-i386.hh"
#elif defined(__powerpc64__)
#include "ppl-ppc64.hh"
#elif defined(__powerpc__)
#include "ppl-ppc.hh"
#elif defined(__ia64__)
#include "ppl-ia64.hh"
#elif defined(__alpha__)
#include "ppl-alpha.hh"
#elif defined(__arm__)
#include "ppl-arm.hh"
#elif defined(__s390x__)
#include "ppl-s390x.hh"
#elif defined(__s390__)
#include "ppl-s390.hh"
#else
#error "This architecture is not supported by the currently installed ppl-devel packages."
#endif

View File

@ -1,12 +1,15 @@
Name: ppl
Version: 0.9
Release: 17%{?dist}
Release: 18%{?dist}
Summary: The Parma Polyhedra Library: a library of numerical abstractions
Group: Development/Libraries
License: GPLv2+
URL: http://www.cs.unipr.it/ppl/
Source: ftp://ftp.cs.unipr.it/pub/ppl/releases/%{version}/%{name}-%{version}.tar.gz
Source0: ftp://ftp.cs.unipr.it/pub/ppl/releases/%{version}/%{name}-%{version}.tar.gz
Source1: ppl.hh
Source2: ppl_c.h
Source3: pwl.hh
Patch0: ppl-0.9-docfiles.patch
Patch1: ppl-0.9-configure.patch
Patch2: ppl-0.9-makefiles.patch
@ -174,6 +177,29 @@ rm -rf %{buildroot}
make DESTDIR=%{buildroot} INSTALL="%{__install} -p" install
rm -f %{buildroot}%{_libdir}/*.la %{buildroot}%{_libdir}/%{name}/*.la
# In order to avoid multiarch conflicts when installed for multiple
# architectures (i.e., i386 and x86_64), we rename the header files
# of the ppl-devel and ppl-pwl-devel packages. They are substituted with
# ad-hoc switchers that select the appropriate header file depending on
# the architecture for which the compiler is compiling.
# Since our header files only depend on the sizeof things, we smash
# ix86 onto i386 and arm* onto arm.
normalized_arch=%{_arch}
%ifarch %{ix86}
normalized_arch=i386
%endif
%ifarch %{arm}
normalized_arch=arm
%endif
mv %{buildroot}/%{_includedir}/ppl.hh %{buildroot}/%{_includedir}/ppl-${normalized_arch}.hh
install -m644 %{SOURCE1} %{buildroot}/%{_includedir}/ppl.hh
mv %{buildroot}/%{_includedir}/ppl_c.h %{buildroot}/%{_includedir}/ppl_c-${normalized_arch}.h
install -m644 %{SOURCE2} %{buildroot}/%{_includedir}/ppl_c.h
mv %{buildroot}/%{_includedir}/pwl.hh %{buildroot}/%{_includedir}/pwl-${normalized_arch}.hh
install -m644 %{SOURCE3} %{buildroot}/%{_includedir}/pwl.hh
%files
%defattr(-,root,root,-)
%doc %{_datadir}/doc/%{name}/BUGS
@ -193,8 +219,8 @@ rm -f %{buildroot}%{_libdir}/*.la %{buildroot}%{_libdir}/%{name}/*.la
%files devel
%defattr(-,root,root,-)
%doc %{_datadir}/doc/%{name}/README.configure
%{_includedir}/ppl.hh
%{_includedir}/ppl_c.h
%{_includedir}/ppl*.hh
%{_includedir}/ppl_c*.h
%{_libdir}/libppl.so
%{_libdir}/libppl_c.so
%{_bindir}/ppl-config
@ -269,7 +295,7 @@ rm -f %{buildroot}%{_libdir}/*.la %{buildroot}%{_libdir}/%{name}/*.la
%files pwl-devel
%defattr(-,root,root,-)
%doc Watchdog/README.doc
%{_includedir}/pwl.hh
%{_includedir}/pwl*.hh
%{_libdir}/libpwl.so
%files pwl-static
@ -285,6 +311,9 @@ rm -f %{buildroot}%{_libdir}/*.la %{buildroot}%{_libdir}/%{name}/*.la
rm -rf %{buildroot}
%changelog
* Wed Jan 09 2008 Roberto Bagnara <bagnara@cs.unipr.it> 0.9-18
- Avoid multiarch conflicts when installed for multiple architectures.
* Sun Dec 23 2007 Roberto Bagnara <bagnara@cs.unipr.it> 0.9-17
- The SWI-Prolog `pl' package is temporarily not available on the ppc64
architecture: temporarily disabled `ppl-swiprolog' and

43
ppl_c.h Normal file
View File

@ -0,0 +1,43 @@
/* Header file switcher for the C interface. -*- C -*-
Copyright (C) 2001-2008 Roberto Bagnara <bagnara@cs.unipr.it>
This file is part of the Parma Polyhedra Library (PPL).
The PPL is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
The PPL is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
For the most up-to-date information see the Parma Polyhedra Library
site: http://www.cs.unipr.it/ppl/ . */
#if defined(__x86_64__)
#include "ppl_c-x86_64.h"
#elif defined(__i386__)
#include "ppl_c-i386.h"
#elif defined(__powerpc64__)
#include "ppl_c-ppc64.h"
#elif defined(__powerpc__)
#include "ppl_c-ppc.h"
#elif defined(__ia64__)
#include "ppl_c-ia64.h"
#elif defined(__alpha__)
#include "ppl_c-alpha.h"
#elif defined(__arm__)
#include "ppl_c-arm.h"
#elif defined(__s390x__)
#include "ppl_c-s390x.h"
#elif defined(__s390__)
#include "ppl_c-s390.h"
#else
#error "This architecture is not supported by the currently installed ppl-devel packages."
#endif

43
pwl.hh Normal file
View File

@ -0,0 +1,43 @@
/* This is the header file switcher of the Parma Watchdog Library.
Copyright (C) 2001-2008 Roberto Bagnara <bagnara@cs.unipr.it>
This file is part of the Parma Watchdog Library (PWL).
The PWL is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
The PWL is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA.
For the most up-to-date information see the CS@Parma software
site: http://www.cs.unipr.it/Software/ . */
#if defined(__x86_64__)
#include "pwl-x86_64.hh"
#elif defined(__i386__)
#include "pwl-i386.hh"
#elif defined(__powerpc64__)
#include "pwl-ppc64.hh"
#elif defined(__powerpc__)
#include "pwl-ppc.hh"
#elif defined(__ia64__)
#include "pwl-ia64.hh"
#elif defined(__alpha__)
#include "pwl-alpha.hh"
#elif defined(__arm__)
#include "pwl-arm.hh"
#elif defined(__s390x__)
#include "pwl-s390x.hh"
#elif defined(__s390__)
#include "pwl-s390.hh"
#else
#error "This architecture is not supported by the currently installed ppl-pwl-devel packages."
#endif