Commit 6a5fe00f authored by Chaoting Liu's avatar Chaoting Liu

merge

parents 968a22ee 600514eb
# Lib32 Packages for Chakra, part of chakra-project.org
#
# maintainer: Anke Boersma <abveritas[at]chakra-project[dot]org>
# maintainer: Giuseppe Calà <jiveaxe@gmail.com>
# maintainer: Manuel Tortosa <manutortosa@chakra-project.org>
# toolchain build order:
# lib32-glibc > binutils-multilib > gcc-multilib > binutils-multilib > lib32-glibc > gcc-multilib
pkgname=binutils-multilib
pkgver=2.23
pkgrel=1
pkgdesc="A set of programs to assemble and manipulate binary and object files for multilib"
arch=('x86_64')
url="http://www.gnu.org/software/binutils/"
license=('GPL')
groups=('multilib-devel')
provides=("binutils=$pkgver-$pkgrel")
conflicts=('binutils')
depends=('glibc>=2.15' 'zlib')
makedepends=('gcc-multilib') # Make sure we compile this with gcc-multilib
checkdepends=('dejagnu' 'bc')
options=('!libtool' '!distcc' '!ccache')
install=binutils.install
source=(ftp://ftp.gnu.org/gnu/binutils/binutils-${pkgver}.tar.gz{,.sig})
md5sums=('ed58f50d8920c3f1d9cb110d5c972c27'
'5293d43d444852f71f7c96c6295ba66d')
build() {
cd ${srcdir}
mkdir binutils-build && cd binutils-build
${srcdir}/binutils-${pkgver}/configure --prefix=/usr \
--with-lib-path=/usr/lib:/usr/local/lib \
--with-bugurl=http://chakra-linux.org/bugs/ \
--enable-ld=default --enable-gold \
--enable-plugins --enable-threads --enable-shared \
--disable-werror --enable-multilib
# check the host environment and makes sure all the necessary tools are available
make configure-host
make tooldir=${pkgdir}/usr
# Rebuild libiberty.a with -fPIC
cp -a libiberty libiberty-pic
make -C libiberty-pic clean
make CFLAGS="$CFLAGS -fPIC" -C libiberty-pic
# Rebuild libbfd.a with -fPIC
# hidden visability prevent 3rd party shared libraries exporting bfd non-stable API
cp -a bfd bfd-pic
make -C bfd-pic clean
make CFLAGS="$CFLAGS -fPIC -fvisibility=hidden" -C bfd-pic
# Rebuild libopcodes.a with -fPIC
cp -a opcodes opcodes-pic
make -C opcodes-pic clean
make CFLAGS="$CFLAGS -fPIC" -C opcodes-pic
}
check() {
cd ${srcdir}/binutils-build
# unset LDFLAGS as testsuite makes assumptions about which ones are active
# do not abort on errors - manually check log files
make LDFLAGS="" -k check || true
}
package() {
cd ${srcdir}/binutils-build
make prefix=${pkgdir}/usr tooldir=${pkgdir}/usr install
# Add some useful headers
install -m644 ${srcdir}/binutils-${pkgver}/include/libiberty.h ${pkgdir}/usr/include
install -m644 ${srcdir}/binutils-${pkgver}/include/demangle.h ${pkgdir}/usr/include
# install libraries rebuilt with -fPIC
install -m644 libiberty-pic/libiberty.a ${pkgdir}/usr/lib
install -m644 bfd-pic/libbfd.a ${pkgdir}/usr/lib
install -m644 opcodes/libopcodes.a ${pkgdir}/usr/lib
# Remove Windows/Novell specific man pages
rm ${pkgdir}/usr/share/man/man1/{dlltool,nlmconv,windres,windmc}*
rm ${pkgdir}/usr/share/info/{configure,standards}.info
# Remove these symlinks, they are not ABI stable.
# Programs should compile static to the .a file.
rm ${pkgdir}/usr/lib/lib{bfd,opcodes}.so
echo "INPUT ( /usr/lib/libbfd.a -liberty -lz )" >${pkgdir}/usr/lib/libbfd.so
echo "INPUT ( /usr/lib/libopcodes.a -lbfd )" >${pkgdir}/usr/lib/libopcodes.so
}
This diff is collapsed.
diff -Naur gcc-4.7.1-orig/libada/Makefile.in gcc-4.7.1/libada/Makefile.in
--- gcc-4.7.1-orig/libada/Makefile.in 2012-06-13 01:12:37.000000000 +1000
+++ gcc-4.7.1/libada/Makefile.in 2012-06-16 15:04:32.179911023 +1000
@@ -54,7 +54,7 @@
PICFLAG = @PICFLAG@
GNATLIBFLAGS= -W -Wall -gnatpg -nostdinc
GNATLIBCFLAGS= -g -O2
-GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) \
+GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(PICFLAG) \
-fexceptions -DIN_RTS @have_getipinfo@
host_subdir = @host_subdir@
diff -Naur gcc-4.7.1-orig/libgo/runtime/print.c gcc-4.7.1/libgo/runtime/print.c
--- gcc-4.7.1-orig/libgo/runtime/print.c 2012-05-26 04:22:14.000000000 +1000
+++ gcc-4.7.1/libgo/runtime/print.c 2012-06-16 15:06:28.553138502 +1000
@@ -17,7 +17,8 @@
G* g = runtime_g();
if(g == nil || g->writebuf == nil) {
- runtime_write(2, v, n);
+ ssize_t bytesWritten = runtime_write(2, v, n);
+ (void)bytesWritten;
return;
}
--- gcc/c-family/c-opts.c (revision 200330)
+++ gcc/c-family/c-opts.c (working copy)
@@ -1338,10 +1338,14 @@ c_finish_options (void)
/* Give CPP the next file given by -include, if any. */
static void
push_command_line_include (void)
{
+ // This can happen if disabled by -imacros for example.
+ if (include_cursor > deferred_count)
+ return;
+
if (!done_preinclude)
{
done_preinclude = true;
if (flag_hosted && std_inc && !cpp_opts->preprocessed)
{
diff -Naur gcc-4.9-20140604-old/gcc/graphite-clast-to-gimple.c gcc-4.9-20140604/gcc/graphite-clast-to-gimple.c
--- gcc-4.9-20140604-old/gcc/graphite-clast-to-gimple.c 2014-03-03 21:39:22.000000000 +1000
+++ gcc-4.9-20140604/gcc/graphite-clast-to-gimple.c 2014-06-25 15:07:57.958697105 +1000
@@ -28,6 +28,8 @@
#include <isl/constraint.h>
#include <isl/ilp.h>
#include <isl/aff.h>
+#include <isl/deprecated/int.h>
+#include <isl/deprecated/ilp_int.h>
#include <cloog/cloog.h>
#include <cloog/isl/domain.h>
#endif
diff -Naur gcc-4.9-20140604-old/gcc/graphite-interchange.c gcc-4.9-20140604/gcc/graphite-interchange.c
--- gcc-4.9-20140604-old/gcc/graphite-interchange.c 2014-01-03 08:23:26.000000000 +1000
+++ gcc-4.9-20140604/gcc/graphite-interchange.c 2014-06-25 15:10:06.882899243 +1000
@@ -29,6 +29,9 @@
#include <isl/map.h>
#include <isl/union_map.h>
#include <isl/ilp.h>
+#include <isl/deprecated/int.h>
+#include <isl/deprecated/ilp_int.h>
+#include <isl/deprecated/constraint_int.h>
#include <cloog/cloog.h>
#include <cloog/isl/domain.h>
#endif
diff -Naur gcc-4.9-20140604-old/gcc/graphite-optimize-isl.c gcc-4.9-20140604/gcc/graphite-optimize-isl.c
--- gcc-4.9-20140604-old/gcc/graphite-optimize-isl.c 2014-01-03 08:23:26.000000000 +1000
+++ gcc-4.9-20140604/gcc/graphite-optimize-isl.c 2014-06-25 15:16:57.038386166 +1000
@@ -28,6 +28,8 @@
#include <isl/band.h>
#include <isl/aff.h>
#include <isl/options.h>
+#include <isl/deprecated/int.h>
+#include <isl/deprecated/aff_int.h>
#endif
#include "system.h"
@@ -373,7 +375,7 @@
{
for (i = ScheduleDimensions - 1 ; i >= 0 ; i--)
{
- if (isl_band_member_is_zero_distance (Band, i))
+ if (isl_band_member_is_coincident (Band, i))
{
isl_map *TileMap;
isl_union_map *TileUMap;
diff -Naur gcc-4.9-20140604-old/gcc/graphite-poly.c gcc-4.9-20140604/gcc/graphite-poly.c
--- gcc-4.9-20140604-old/gcc/graphite-poly.c 2014-01-03 08:23:26.000000000 +1000
+++ gcc-4.9-20140604/gcc/graphite-poly.c 2014-06-25 15:18:01.207157796 +1000
@@ -28,6 +28,8 @@
#include <isl/constraint.h>
#include <isl/ilp.h>
#include <isl/aff.h>
+#include <isl/deprecated/int.h>
+#include <isl/deprecated/ilp_int.h>
#include <cloog/cloog.h>
#include <cloog/isl/domain.h>
#endif
diff -Naur gcc-4.9-20140604-old/gcc/graphite-sese-to-poly.c gcc-4.9-20140604/gcc/graphite-sese-to-poly.c
--- gcc-4.9-20140604-old/gcc/graphite-sese-to-poly.c 2014-04-08 20:59:40.000000000 +1000
+++ gcc-4.9-20140604/gcc/graphite-sese-to-poly.c 2014-06-25 15:19:46.575140398 +1000
@@ -26,6 +26,9 @@
#include <isl/union_map.h>
#include <isl/constraint.h>
#include <isl/aff.h>
+#include <isl/deprecated/int.h>
+#include <isl/deprecated/aff_int.h>
+#include <isl/deprecated/constraint_int.h>
#include <cloog/cloog.h>
#include <cloog/cloog.h>
#include <cloog/isl/domain.h>
diff -u -r gcc-4.7.0/gcc/config/i386/linux64.h gcc-4.7.0-pure64/gcc/config/i386/linux64.h
--- gcc-4.7.0/gcc/config/i386/linux64.h 2011-07-07 17:38:34.000000000 +0200
+++ gcc-4.7.0-pure64/gcc/config/i386/linux64.h 2012-03-24 11:52:58.926204014 +0100
@@ -29,5 +29,5 @@
#define GNU_USER_LINK_EMULATIONX32 "elf32_x86_64"
#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
+#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-linux-x86-64.so.2"
#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
diff -u -r gcc-4.7.0/gcc/config/i386/t-linux64 gcc-4.7.0-pure64/gcc/config/i386/t-linux64
--- gcc-4.7.0/gcc/config/i386/t-linux64 2011-11-02 16:23:48.000000000 +0100
+++ gcc-4.7.0-pure64/gcc/config/i386/t-linux64 2012-03-24 11:52:44.119651885 +0100
@@ -34,6 +34,6 @@
comma=,
MULTILIB_OPTIONS = $(subst $(comma),/,$(TM_MULTILIB_CONFIG))
MULTILIB_DIRNAMES = $(patsubst m%, %, $(subst /, ,$(MULTILIB_OPTIONS)))
-MULTILIB_OSDIRNAMES = m64=../lib64
-MULTILIB_OSDIRNAMES+= m32=$(if $(wildcard $(shell echo $(SYSTEM_HEADER_DIR))/../../usr/lib32),../lib32,../lib)
+MULTILIB_OSDIRNAMES = m64=../lib
+MULTILIB_OSDIRNAMES+= m32=../lib32
MULTILIB_OSDIRNAMES+= mx32=../libx32
......@@ -3,18 +3,18 @@
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
_pkgbasename=acl
pkgname=lib32-acl
pkgver=2.2.49
pkgrel=1
pkgver=2.2.52
pkgrel=2
pkgdesc="Access control list libraries (32-bit)"
arch=('x86_64')
url="http://savannah.nongnu.org/projects/acl"
license=('LGPL')
depends=('lib32-attr' 'acl')
depends=('lib32-attr' $_pkgbasename=$pkgver)
makedepends=('gcc-multilib')
options=('!libtool')
source=(http://mirrors.zerg.biz/nongnu/acl/acl-${pkgver}.src.tar.gz)
sha256sums=('b9c7f4752e4ef4930a62fa5aa0d7efe1cba2b5a3a2d6ee2b45c0a70c72b7e5d5')
md5sums=('a61415312426e9c2212bd7dc7929abda')
build() {
cd "${srcdir}/acl-${pkgver}"
......
......@@ -5,18 +5,16 @@
_pkgbasename=alsa-lib
pkgname=lib32-${_pkgbasename}
pkgver=1.0.26
pkgver=1.0.28
pkgrel=1
pkgdesc="An alternative implementation of Linux sound support (32 bit)"
arch=('x86_64')
url="http://www.alsa-project.org"
depends=('lib32-glibc' $_pkgbasename=$pkgver)
makedepends=('gcc-multilib')
depends=('lib32-glibc' 'alsa-lib')
license=('GPL')
options=(!libtool)
#source=(ftp://ftp.alsa-project.org/pub/lib/${_pkgbasename}-$pkgver.tar.bz2)
source=(http://alsa.cybermirror.org/lib/alsa-lib-$pkgver.tar.bz2)
md5sums=('2dfa35d28471d721e592b616beedf965')
source=(ftp://ftp.alsa-project.org/pub/lib/${_pkgbasename}-$pkgver.tar.bz2)
md5sums=('c9e21b88a2b3e6e12ea7ba0f3b271fc3')
build() {
cd $srcdir/${_pkgbasename}-$pkgver
......
......@@ -12,7 +12,7 @@ arch=(x86_64)
license=('GPL')
url="http://www.alsa-project.org"
options=(!libtool)
depends=('lib32-glibc' 'lib32-alsa-lib' 'alsa-oss')
depends=('lib32-glibc' 'lib32-alsa-lib' $_pkgbasename=$pkgver)
#source=(ftp://ftp.alsa-project.org/pub/oss-lib/${_pkgbasename}-$pkgver.tar.bz2)
source=(http://alsa.cybermirror.org/oss-lib/${_pkgbasename}-$pkgver.tar.bz2)
md5sums=('922ea177db15c72f1b5037181c73f934')
......
#
# Lib32 Packages for Chakra, part of chakra-project.org
#
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
# contributor: (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
_pkgbasename=alsa-plugins
pkgname=lib32-$_pkgbasename
pkgver=1.0.26
pkgver=1.0.28
pkgrel=1
pkgdesc="Extra alsa plugins (32-bit)"
arch=(x86_64)
arch=('x86_64')
url="http://www.alsa-project.org"
license=(GPL)
depends=(lib32-alsa-lib $_pkgbasename=$pkgver)
......@@ -18,10 +15,8 @@ optdepends=('lib32-libpulse: PulseAudio plugin'
'lib32-jack: Jack plugin'
'lib32-libsamplerate: libsamplerate resampling plugin'
'lib32-speex: libspeexdsp resampling plugin')
options=('!libtool')
#source=("ftp://ftp.alsa-project.org/pub/plugins/$_pkgbasename-$pkgver.tar.bz2")
source=("http://alsa.cybermirror.org//plugins/$_pkgbasename-$pkgver.tar.bz2")
md5sums=('4facd408326ef5567a7d4ceb6589e6b0')
source=("ftp://ftp.alsa-project.org/pub/plugins/$_pkgbasename-$pkgver.tar.bz2")
md5sums=('6fcbbb31e96f8ebc5fb926184a717aa4')
build() {
cd "$srcdir/$_pkgbasename-$pkgver"
......
# Lib32 Packages for Chakra, part of chakra-project.org
#
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
_pkgbasename=atk
pkgname=lib32-$_pkgbasename
pkgver=2.2.0
pkgrel=2
pkgver=2.15.4
pkgrel=1
pkgdesc="A library providing a set of interfaces for accessibility (32-bit)"
arch=('x86_64')
license=('LGPL')
depends=('lib32-glib2' $_pkgbasename=$pkgver)
makedepends=('gcc-multilib')
options=('!libtool')
source=(http://ftp.gnome.org/pub/gnome/sources/${_pkgbasename}/${pkgver%.*}/${_pkgbasename}-${pkgver}.tar.bz2)
source=(http://ftp.gnome.org/pub/gnome/sources/${_pkgbasename}/${pkgver%.*}/${_pkgbasename}-${pkgver}.tar.xz)
url='http://www.gtk.org/'
sha256sums=('d201e3f5808aef0b1aec2277bfa61074f68863e405428adb57a73aab5c838450')
sha256sums=('0dddfa73a02178ca21a8de172c86d699aa887b4efeec736b4c8721eee4ac349c')
build() {
export CC="gcc -m32"
......
# Lib32 Packages for Chakra, part of chakra-project.org
#
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
# maintainer (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
# contributor (x86_64): Anke Boersma <abveritas[at]chakra-project[dot]org>
_pkgbasename=audiofile
pkgname=lib32-$_pkgbasename
pkgver=0.2.7
pkgver=0.3.6
pkgrel=1
pkgdesc="Silicon Graphics Audio File Library (32-bit)"
arch=('x86_64')
url="http://www.68k.org/~michael/audiofile/"
license=('LGPL')
depends=('lib32-glibc' $_pkgbasename=$pkgver)
depends=('lib32-glibc' "$_pkgbasename=$pkgver" 'lib32-alsa-lib' 'lib32-flac')
makedepends=(gcc-multilib)
options=('!libtool')
source=(http://ftp.gnome.org/pub/gnome/sources/${_pkgbasename}/0.2/${_pkgbasename}-${pkgver}.tar.bz2)
sha256sums=('61efd278627415b5468426fc9e52aef32ea0fdac12b56bcdd72734c2ece5945e')
source=("http://audiofile.68k.org/$_pkgbasename-$pkgver.tar.gz")
md5sums=('2731d79bec0acef3d30d2fc86b0b72fd')
build() {
export CC="gcc -m32"
......
<<<<<<< HEAD
# Lib32 Packages for Chakra, part of chakra-project.org
#
# maintainer (x86_64): Giuseppe Calà <jiveaxe@gmail.com>
......@@ -87,3 +88,136 @@ package()
"${pkgdir}"/usr/share/licenses/lib32-boost-libs/LICENSE_1_0.txt
}
=======
# Maintainer : Jan Was < janek.jan@gmail.com >
# Contributor : Dan Vratil <dan@progdan.cz>
# Contributor : andy123 < ajs AT online DOT de >
pkgname=lib32-boost-libs
pkgver=1.54.0
_boostver=${pkgver//./_}
pkgrel=3
url="http://www.boost.org"
arch=('x86_64')
pkgdesc="Free peer-reviewed portable C++ source libraries - Runtime (32 bit)"
license=('custom')
groups=('lib32')
depends=('lib32-bzip2' 'lib32-zlib' 'lib32-icu' 'lib32-gcc-libs')
makedepends=('lib32-icu>=51.1' 'lib32-bzip2' 'lib32-zlib' 'gcc-multilib' 'python3' 'python2')
source=(http://downloads.sourceforge.net/sourceforge/boost/boost_${_boostver}.tar.gz
boost-1.54.0-Fix-macro-for-int128-detection.patch
fix-new-glibc.patch
# upstream patches
coroutine.patch
datetime.patch
log.patch)
sha1sums=('069501636097d3f40ddfd996d29748bb23591c53'
'bf5177694ab8a0df6bc13aa47b05727c40febebb'
'e3a5fac340c12b39add50070efb439b857108a0b'
'0dbb0e5709b2b4c3948ce5553f3abf5cab048e8f'
'cee711647ef68ca9a2580c93fcd83fbea3b26b55'
'2f8f05a79e3b88c7b9eb83c04d8c3ab21bbe991f')
prepare() {
export CC="gcc"
export CFLAGS="-m32"
export CXX="g++"
export CXXFLAGS="-m32"
export LDFLAGS="-m32"
export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
export _stagedir="${srcdir}/stagedir"
local JOBS="$(sed -e 's/.*\(-j *[0-9]\+\).*/\1/' <<< ${MAKEFLAGS})"
cd "${srcdir}/boost_${_boostver}"
patch -Np2 -i ../boost-1.54.0-Fix-macro-for-int128-detection.patch
patch -Np2 -i ../fix-new-glibc.patch
patch -Np1 < ${srcdir}/coroutine.patch
patch -Np1 < ${srcdir}/datetime.patch
patch -Np1 < ${srcdir}/log.patch
# Shut up strict aliasing warnings
echo "using gcc : : : <compileflags>-fno-strict-aliasing ;" >> ./tools/build/v2/user-config.jam
# Add an extra python version. This does not replace anything and python 2.x need to be the default.
#echo "using python : 3.3 : /usr/bin/python3 : /usr/include/python3.3m : /usr/lib ;" >> ./tools/build/v2/user-config.jam
# Support for OpenMPI
#echo "using mpi ;" >> ./tools/build/v2/user-config.jam
./bootstrap.sh --with-toolset=cc --with-icu --with-python=
# --with-python=/usr/bin/python2
sed -i 's/cc/gcc/g' project-config.jam
}
build() {
export CC="gcc"
export CFLAGS="-m32"
export CXX="g++"
export CXXFLAGS="-m32"
export LDFLAGS="-m32"
export PKG_CONFIG_PATH="/usr/lib32/pkgconfig"
export _stagedir="${srcdir}/stagedir"
local JOBS="$(sed -e 's/.*\(-j *[0-9]\+\).*/\1/' <<< ${MAKEFLAGS})"
cd "${srcdir}/boost_${_boostver}"
_bindir="bin.linuxx86"
install -d -m 755 "${_stagedir}"/bin
install "${srcdir}"/boost_${_boostver}/tools/build/v2/engine/${_bindir}/bjam "${_stagedir}"/bin/bjam
pushd tools
for _tool in bcp inspect quickbook compiler_status process_jam_log wave; do
"${_stagedir}"/bin/bjam --toolset=gcc $_tool
done
"${_stagedir}"/bin/bjam --toolset=gcc cflags="-std=gnu++11" library_status
popd
cp -a dist/bin/* "${_stagedir}"/bin
#boostbook is needed by quickbook
install -d -m 755 "${_stagedir}"/share/boostbook
cp -a tools/boostbook/{xsl,dtd} "${_stagedir}"/share/boostbook/
# default "minimal" install: "release link=shared,static
# runtime-link=shared threading=single,multi"
# --layout=tagged will add the "-mt" suffix for multithreaded libraries
# and installs includes in /usr/include/boost.
# --layout=system no longer adds the -mt suffix for multi-threaded libs.
# install to ${_stagedir} in preparation for split packaging
"${_stagedir}"/bin/bjam \
variant=release \
debug-symbols=off \
threading=multi \
runtime-link=shared \
link=shared \
toolset=gcc \
address-model=32 \
--without-python \
--without-mpi \
--layout=system \
--prefix="${_stagedir}" \
${JOBS} \
install
find ${_stagedir} -name \*.a -exec rm -f {} \;
}
package() {
_stagedir="${srcdir}/stagedir"
install -d -m 755 "${pkgdir}/usr/lib32"
cp -a "${_stagedir}"/lib/*.so{,.*} "${pkgdir}/usr/lib32/"
install -D -m 644 "${srcdir}/boost_${_boostver}/LICENSE_1_0.txt" \
"${pkgdir}"/usr/share/licenses/lib32-boost-libs/LICENSE_1_0.txt
}
>>>>>>> 600514ebcaaf80d91da28d7572f7905dbeed7b0a
diff -Naur boost_1_53_0.ori/libs/mpi/src/python/datatypes.cpp boost_1_53_0/libs/mpi/src/python/datatypes.cpp
--- boost_1_53_0.ori/libs/mpi/src/python/datatypes.cpp 2007-11-25 13:38:02.000000000 -0500
+++ boost_1_53_0/libs/mpi/src/python/datatypes.cpp 2013-03-11 20:59:57.171732691 -0400
@@ -13,6 +13,10 @@
#include <boost/mpi/python/serialize.hpp>
#include <boost/mpi.hpp>
+#if PY_MAJOR_VERSION >= 3
+#define PyInt_Type PyLong_Type
+#endif
+
namespace boost { namespace mpi { namespace python {
void export_datatypes()
diff -Naur boost_1_53_0.ori/libs/mpi/src/python/py_environment.cpp boost_1_53_0/libs/mpi/src/python/py_environment.cpp
--- boost_1_53_0.ori/libs/mpi/src/python/py_environment.cpp 2007-11-25 13:38:02.000000000 -0500
+++ boost_1_53_0/libs/mpi/src/python/py_environment.cpp 2013-03-11 21:02:12.961737401 -0400
@@ -11,6 +11,9 @@
* This file reflects the Boost.MPI "environment" class into Python
* methods at module level.
*/
+
+#include <locale>
+#include <string>
#include <boost/python.hpp>
#include <boost/mpi.hpp>
@@ -50,11 +53,65 @@
// If anything changed, convert C-style argc/argv into Python argv
if (mpi_argv != my_argv)
+ {
+#if PY_MAJOR_VERSION >= 3
+ // Code stolen from py3k/Modules/python.c.
+
+ wchar_t **argv_copy = (wchar_t **)PyMem_Malloc(sizeof(wchar_t*)*mpi_argc);
+ /* We need a second copies, as Python might modify the first one. */
+ wchar_t **argv_copy2 = (wchar_t **)PyMem_Malloc(sizeof(wchar_t*)*mpi_argc);
+
+ if (!argv_copy || !argv_copy2) {
+ fprintf(stderr, "out of memory\n");
+ return false;
+ }
+
+ std::locale mylocale;
+ mbstate_t mystate;
+
+ const std::codecvt<char, wchar_t, mbstate_t>& myfacet =
+ std::use_facet<std::codecvt<char, wchar_t, mbstate_t> >(mylocale);
+
+ for (int i = 0; i < mpi_argc; i++)
+ {
+ size_t length = strlen(mpi_argv[i]);
+
+ wchar_t *dest = (wchar_t *) PyMem_Malloc(sizeof(wchar_t) * (length + 1));
+
+ const char *from_next;
+ wchar_t *to_next;
+
+ std::codecvt<wchar_t,char,mbstate_t>::result myresult =
+ myfacet.out(mystate,
+ mpi_argv[i], mpi_argv[i] + length + 1, from_next,
+ dest, dest+length+1, to_next);
+
+ if (myresult != std::codecvt<wchar_t,char,mbstate_t>::ok )
+ {
+ fprintf(stderr, "failure translating argv\n");
+ return 1;
+ }
+
+ argv_copy2[i] = argv_copy[i] = dest;
+ if (!argv_copy[i])
+ return false;
+ }
+
+ PySys_SetArgv(mpi_argc, argv_copy);
+
+ for (int i = 0; i < mpi_argc; i++) {
+ PyMem_Free(argv_copy2[i]);
+ }
+ PyMem_Free(argv_copy);
+ PyMem_Free(argv_copy2);
+#else
PySys_SetArgv(mpi_argc, mpi_argv);
+#endif
+ }
- for (int arg = 0; arg < my_argc; ++arg)
- free(my_argv[arg]);
- delete [] my_argv;
+ for (int arg = 0; arg < mpi_argc; ++arg)
+ free(mpi_argv[arg]);
+ delete [] mpi_argv;
return true;
}
Index: /trunk/boost/lexical_cast.hpp
===================================================================
--- /trunk/boost/lexical_cast.hpp (revision 84136)
+++ /trunk/boost/lexical_cast.hpp (revision 84965)
@@ -70,8 +70,8 @@
#endif
-#if (defined(BOOST_LCAST_HAS_INT128) && !defined(__GNUC__)) || GCC_VERSION > 40700