diff options
author | 2011-08-05 10:55:25 +0000 | |
---|---|---|
committer | 2011-08-05 10:55:25 +0000 | |
commit | 1df52125dcab8ee40764dee278d314c1a6d022d0 (patch) | |
tree | a2e7ff3dd273732267ba43ce778fa0f73ebb412a /app-text | |
parent | Fix build failure for USE=-doc case. Discovered and fixed by Yvan Royon, bug ... (diff) | |
download | gentoo-2-1df52125dcab8ee40764dee278d314c1a6d022d0.tar.gz gentoo-2-1df52125dcab8ee40764dee278d314c1a6d022d0.tar.bz2 gentoo-2-1df52125dcab8ee40764dee278d314c1a6d022d0.zip |
Handle FreeBSD byteswap function. Fix bug #367119
(Portage version: 2.2.0_alpha43/cvs/FreeBSD i386)
Diffstat (limited to 'app-text')
-rw-r--r-- | app-text/ghostscript-gpl/ChangeLog | 6 | ||||
-rw-r--r-- | app-text/ghostscript-gpl/files/ghostscript-gpl-9.02-byteswap.patch | 107 | ||||
-rw-r--r-- | app-text/ghostscript-gpl/ghostscript-gpl-9.02.ebuild | 5 |
3 files changed, 116 insertions, 2 deletions
diff --git a/app-text/ghostscript-gpl/ChangeLog b/app-text/ghostscript-gpl/ChangeLog index 566ad43d6596..dcbeae861d34 100644 --- a/app-text/ghostscript-gpl/ChangeLog +++ b/app-text/ghostscript-gpl/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for app-text/ghostscript-gpl # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript-gpl/ChangeLog,v 1.113 2011/06/05 21:16:28 dilfridge Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript-gpl/ChangeLog,v 1.114 2011/08/05 10:55:25 naota Exp $ + + 05 Aug 2011; Naohiro Aota <naota@gentoo.org> ghostscript-gpl-9.02.ebuild, + +files/ghostscript-gpl-9.02-byteswap.patch: + Handle FreeBSD byteswap function. Fix bug #367119 05 Jun 2011; Andreas K. Huettel <dilfridge@gentoo.org> ghostscript-gpl-9.02.ebuild, +files/ghostscript-gpl-9.02-libpng15.patch: diff --git a/app-text/ghostscript-gpl/files/ghostscript-gpl-9.02-byteswap.patch b/app-text/ghostscript-gpl/files/ghostscript-gpl-9.02-byteswap.patch new file mode 100644 index 000000000000..dcd8ae1ae43a --- /dev/null +++ b/app-text/ghostscript-gpl/files/ghostscript-gpl-9.02-byteswap.patch @@ -0,0 +1,107 @@ +diff --git a/gs/base/Makefile.in b/gs/base/Makefile.in +index 8cc3b63..b014051 100644 +--- a/gs/base/Makefile.in ++++ b/gs/base/Makefile.in +@@ -121,6 +121,11 @@ GENOPT= + + # Choose capability options. + ++# -DHAVE_BSWAP32 ++# use bswap32 intrinsic ++# -DHAVE_BYTESWAP_H ++# use byteswap.h functions ++# + # -DHAVE_MKSTEMP + # uses mkstemp instead of mktemp + # This uses the more secure temporary file creation call +@@ -142,7 +147,7 @@ GENOPT= + # -DHAVE_SSE2 + # use sse2 intrinsics + +-CAPOPT= @HAVE_MKSTEMP@ @HAVE_HYPOT@ @HAVE_FILE64@ @HAVE_MKSTEMP64@ @HAVE_FONTCONFIG@ @HAVE_LIBIDN@ @HAVE_SETLOCALE@ @HAVE_SSE2@ @HAVE_DBUS@ ++CAPOPT= @HAVE_MKSTEMP@ @HAVE_HYPOT@ @HAVE_FILE64@ @HAVE_MKSTEMP64@ @HAVE_FONTCONFIG@ @HAVE_LIBIDN@ @HAVE_SETLOCALE@ @HAVE_SSE2@ @HAVE_DBUS@ @HAVE_BSWAP32@ @HAVE_BYTESWAP_H@ + + # Define the name of the executable file. + +diff --git a/gs/base/configure.ac b/gs/base/configure.ac +index 2385b18..346a7ae 100644 +--- a/gs/base/configure.ac ++++ b/gs/base/configure.ac +@@ -1554,6 +1554,49 @@ AC_ARG_ENABLE([sse2], AC_HELP_STRING([--disable-sse2], + AC_SUBST(HAVE_SSE2) + + dnl -------------------------------------------------- ++dnl check for byte swap intrinsics ++dnl -------------------------------------------------- ++ ++HAVE_BSWAP32="" ++AC_COMPILE_IFELSE([ ++int main (int argc, char *argv[]) ++{ ++ int a = __builtin_bswap32(argc); ++ return(0); ++} ++],HAVE_BSWAP32="-DHAVE_BSWAP32", HAVE_BSWAP32="") ++ ++AC_ARG_ENABLE([bswap32], AC_HELP_STRING([--disable-bswap32], ++ [Do not use bswap32 instrinsic]), [ ++ if test "x$enable_bswap32" = xno; then ++ HAVE_BSWAP32="" ++ fi]) ++ ++AC_SUBST(HAVE_BSWAP32) ++ ++dnl -------------------------------------------------- ++dnl check for byte swap header ++dnl -------------------------------------------------- ++ ++HAVE_BYTESWAP_H="" ++AC_COMPILE_IFELSE([ ++#include "byteswap.h" ++int main (int argc, char *argv[]) ++{ ++ int a = bswap_32(argc); ++ return(0); ++} ++],HAVE_BYTESWAP_H="-DHAVE_BYTESWAP_H", HAVE_BYTESWAP_H="") ++ ++AC_ARG_ENABLE([byteswap-h], AC_HELP_STRING([--disable-byteswap-h], ++ [Do not use byteswap.h functions]), [ ++ if test "x$enable_byteswap-h" = xno; then ++ HAVE_BYTESWAP_H="" ++ fi]) ++ ++AC_SUBST(HAVE_BYTESWAP_H) ++ ++dnl -------------------------------------------------- + dnl Do substitutions + dnl -------------------------------------------------- + +diff --git a/gs/base/gsropt.h b/gs/base/gsropt.h +index 220ba84..3bbd81a 100644 +--- a/gs/base/gsropt.h ++++ b/gs/base/gsropt.h +@@ -377,18 +377,15 @@ void rop_release_run_op(rop_run_op *op); + # define ENDIAN_SWAP_INT _byteswap_ulong + #endif + +-#elif defined(__GNUC__) /* Are we using GCC? */ + +-#ifdef __i386__ /* Are we on an x86? */ +-#define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +-#if GCC_VERSION >= 40300 /* Modern enough to have byteswap intrinsics? */ ++#elif defined(HAVE_BSWAP32) + +-#include <byteswap.h> ++#define ENDIAN_SWAP_INT __builtin_bswap32 + +-#define ENDIAN_SWAP_INT bswap_32 ++#elif defined(HAVE_BYTESWAP_H) + +-#endif /* GCC >= 4.3 */ +-#endif /* x86 or later */ ++#include <byteswap.h> ++#define ENDIAN_SWAP_INT bswap_32 + + #endif + diff --git a/app-text/ghostscript-gpl/ghostscript-gpl-9.02.ebuild b/app-text/ghostscript-gpl/ghostscript-gpl-9.02.ebuild index 8c135a6238fd..4c19c2a3c780 100644 --- a/app-text/ghostscript-gpl/ghostscript-gpl-9.02.ebuild +++ b/app-text/ghostscript-gpl/ghostscript-gpl-9.02.ebuild @@ -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/app-text/ghostscript-gpl/ghostscript-gpl-9.02.ebuild,v 1.2 2011/06/05 21:16:28 dilfridge Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-text/ghostscript-gpl/ghostscript-gpl-9.02.ebuild,v 1.3 2011/08/05 10:55:25 naota Exp $ EAPI=3 inherit autotools eutils versionator flag-o-matic @@ -80,6 +80,9 @@ src_prepare() { # apply libpng-1.5 patch epatch "${FILESDIR}/${PN}-9.02-libpng15.patch" + # byteswap detection bug 367119 + epatch "${FILESDIR}"/${P}-byteswap.patch + # apply various patches, many borrowed from Fedora # http://pkgs.fedoraproject.org/gitweb/?p=ghostscript.git EPATCH_SUFFIX="patch" EPATCH_FORCE="yes" |