diff -Nru gmp-6.2.0+dfsg/debian/changelog gmp-6.2.0+dfsg/debian/changelog --- gmp-6.2.0+dfsg/debian/changelog 2020-02-24 03:06:28.000000000 +0000 +++ gmp-6.2.0+dfsg/debian/changelog 2020-05-14 05:49:24.000000000 +0000 @@ -1,3 +1,11 @@ +gmp (2:6.2.0+dfsg-5) unstable; urgency=medium + + * Team Upload. + * add lib64 for i386 x32 mipsel etc, + to support gcc host64 and target32 (Closes: 950645) + + -- YunQiang Su Thu, 14 May 2020 13:49:24 +0800 + gmp (2:6.2.0+dfsg-4) unstable; urgency=medium [ Steve Robbins ] diff -Nru gmp-6.2.0+dfsg/debian/control gmp-6.2.0+dfsg/debian/control --- gmp-6.2.0+dfsg/debian/control 2020-02-24 03:05:32.000000000 +0000 +++ gmp-6.2.0+dfsg/debian/control 2020-05-14 05:48:55.000000000 +0000 @@ -3,8 +3,7 @@ Uploaders: Steve M. Robbins Section: libs Priority: optional -Build-Depends: m4, - debhelper (>= 9) +Build-Depends: m4, debhelper (>= 9), g++-multilib [i386 x32 powerpc mips mipsel mipsn32 mipsn32el mipsr6 mipsr6el mipsn32r6 mipsn32r6el] Standards-Version: 4.1.3 Vcs-Browser: https://salsa.debian.org/science-team/gmp Vcs-Git: https://salsa.debian.org/science-team/gmp.git @@ -27,6 +26,22 @@ It has a rich set of functions, and the functions have a regular interface. +Package: lib64gmp10 +Architecture: i386 x32 powerpc mips mipsel mipsn32 mipsn32el mipsr6 mipsr6el mipsn32r6 mipsn32r6el +Multi-Arch: no +Section: libs +Priority: optional +Depends: ${shlibs:Depends}, + ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Description: Multiprecision arithmetic library (64bit) + GNU MP is a programmer's library for arbitrary precision + arithmetic (ie, a bignum package). It can operate on signed + integer, rational, and floating point numeric types. + . + It has a rich set of functions, and the functions have a regular + interface. + Package: libgmpxx4ldbl Architecture: any Multi-Arch: same @@ -43,6 +58,19 @@ arithmetic (ie, a bignum package). It can operate on signed integer, rational, and floating point numeric types. +Package: lib64gmpxx4ldbl +Architecture: i386 x32 powerpc mips mipsel mipsn32 mipsn32el mipsr6 mipsr6el mipsn32r6 mipsn32r6el +Multi-Arch: no +Section: libs +Priority: optional +Depends: ${shlibs:Depends}, + ${misc:Depends} +Pre-Depends: ${misc:Pre-Depends} +Description: Multiprecision arithmetic library (C++ bindings, 64bit) + GNU MP is a programmer's library for arbitrary precision + arithmetic (ie, a bignum package). It can operate on signed + integer, rational, and floating point numeric types. + Package: libgmp-dev Architecture: any Multi-Arch: same @@ -64,7 +92,27 @@ provided in the libgmp10 package. . Both C and C++ bindings are present in this package. Package - libstdc++-dev is required to use the C++ bindings. + libstdc++-dev is required to use the C++ bindings. + . + The MPFR library (multiple-precision floating-point) used to be + included, but has since been moved to package libmpfr-dev. + +Package: lib64gmp-dev +Architecture: i386 x32 powerpc mips mipsel mipsn32 mipsn32el mipsr6 mipsr6el mipsn32r6 mipsn32r6el +Multi-Arch: no +Section: libdevel +Priority: optional +Depends: lib64gmp10 (= ${binary:Version}), + lib64gmpxx4ldbl (= ${binary:Version}), + libgmp-dev (= ${binary:Version}), + ${misc:Depends} +Description: Multiprecision arithmetic library developers tools (64bit) + This development package provides the header files and the symbolic + links to allow compilation and linking of programs that use the libraries + provided in the libgmp10 package. + . + Both C and C++ bindings are present in this package. Package + libstdc++-dev is required to use the C++ bindings. . The MPFR library (multiple-precision floating-point) used to be included, but has since been moved to package libmpfr-dev. diff -Nru gmp-6.2.0+dfsg/debian/rules gmp-6.2.0+dfsg/debian/rules --- gmp-6.2.0+dfsg/debian/rules 2020-02-24 02:48:35.000000000 +0000 +++ gmp-6.2.0+dfsg/debian/rules 2020-05-14 05:48:55.000000000 +0000 @@ -46,6 +46,33 @@ confflags += --enable-fat endif +lib64_archs = i386 x32 powerpc mips mipsn32 mipsel mipsn32el mipsr6 mipsr6n32 mipsr6el mipsn32r6el +ifneq (,$(filter $(DEB_HOST_ARCH), i386 x32)) + host64_gnu_type = x86_64-linux-gnu + CFLAGS_64 = -m64 + confflags64 = $(confflags) ABI=64 +else ifneq (,$(filter $(DEB_HOST_ARCH), powerpc)) + host64_gnu_type = powerpc64-linux-gnu + CFLAGS_64 = -m64 + confflags64 = $(confflags) ABI=mode64 +else ifneq (,$(filter $(DEB_HOST_ARCH), mips mipsn32)) + host64_gnu_type = mips64-linux-gnuabi64 + CFLAGS_64 = -mabi=64 + confflags64 = $(confflags) ABI=64 +else ifneq (,$(filter $(DEB_HOST_ARCH), mipsel mipsn32el)) + host64_gnu_type = mips64el-linux-gnuabi64 + CFLAGS_64 = -mabi=64 + confflags64 = $(confflags) ABI=64 +else ifneq (,$(filter $(DEB_HOST_ARCH), mipsr6 mipsn32r6)) + host64_gnu_type = mipsisa64r6-linux-gnuabi64 + CFLAGS_64 = -mabi=64 + confflags64 = $(confflags) ABI=64 +else ifneq (,$(filter $(DEB_HOST_ARCH), mipsr6el mipsn32r6el)) + host64_gnu_type = mipsisa64r6el-linux-gnuabi64 + CFLAGS_64 = -mabi=64 + confflags64 = $(confflags) ABI=64 +endif + ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) AR = ar confflags_build += --build $(DEB_BUILD_GNU_TYPE) @@ -63,6 +90,7 @@ endif confflags_ma = $(confflags) $(confflags_build) --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) +confflags64 += --build $(DEB_BUILD_GNU_TYPE) --host $(host64_gnu_type) --target $(host64_gnu_type) --libdir=/usr/lib64 CC = $(DEB_HOST_GNU_TYPE)-gcc CXX = $(DEB_HOST_GNU_TYPE)-g++ @@ -85,24 +113,41 @@ wget https://gmplib.org/download/gmp/$@ configure: configure-stamp +ifneq (,$(filter $(DEB_HOST_ARCH), $(lib64_archs))) +configure: configure64-stamp +endif configure-stamp: mkdir -p build cd build && ../configure $(confflags_ma) \ AR=$(AR) CC="$(CC)" CFLAGS="$(CFLAGS)" \ CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS)" touch $@ +configure64-stamp: + mkdir -p build64 + cd build64 && ../configure $(confflags64) \ + AR=$(AR) CC="$(CC)" CFLAGS="$(CFLAGS) $(CFLAGS_64)" \ + CXX="$(CXX)" CXXFLAGS="$(CXXFLAGS) $(CFLAGS_64)" + touch $@ build: build-stamp +ifneq (,$(filter $(DEB_HOST_ARCH), $(lib64_archs))) +build: build64-stamp +endif build-stamp: configure dh_testdir $(MAKE) $(JOBSFLAG) -C build $(MAKE_CHECK) -C build touch $@ +build64-stamp: configure + dh_testdir + $(MAKE) $(JOBSFLAG) -C build64 + $(MAKE_CHECK) -C build64 + touch $@ clean: dh_testdir dh_testroot - rm -rf build build-stamp + rm -rf build build-stamp build64 build64-stamp dh_clean install-prep: @@ -123,7 +168,19 @@ dh_install -plibgmp-dev usr/lib/*/lib*.so dh_install -plibgmp-dev usr/lib/*/lib*.a dh_install -plibgmp-dev usr/lib/*/pkgconfig - dh_install -plibgmp-dev usr/include + dh_install -plibgmp-dev usr/include/gmpxx.h + dh_install -plibgmp-dev usr/include/$(DEB_HOST_MULTIARCH) + +ifneq (,$(filter $(DEB_HOST_ARCH), $(lib64_archs))) + $(MAKE) DESTDIR=`pwd`/debian/tmp includeexecdir=/usr/include -C build64 install + dh_install -plib64gmp10 usr/lib64/libgmp.so.* + dh_install -plib64gmpxx4ldbl usr/lib64/libgmpxx.so.* + + dh_install -plib64gmp-dev usr/lib64/lib*.so + dh_install -plib64gmp-dev usr/lib64/lib*.a + dh_install -plib64gmp-dev usr/lib64/pkgconfig + dh_install -plib64gmp-dev usr/include/gmp.h +endif # Install upstream ChangeLog, AUTHORS, NEWS, and README only in -dev package dh_installchangelogs -plibgmp-dev