[gmp-ecm] 77/77: Imported Debian patch 6.4.4+ds-1

Jerome Benoit calculus-guest at moszumanska.debian.org
Sat Jun 6 12:33:57 UTC 2015


This is an automated email from the git hooks/post-receive script.

calculus-guest pushed a commit to branch master
in repository gmp-ecm.

commit d66eaf3c397b5243966ad7273ac5ce779030687b
Author: Jerome Benoit <calculus at rezozer.net>
Date:   Sat Jun 6 14:20:27 2015 +0200

    Imported Debian patch 6.4.4+ds-1
---
 debian/adhoc/examples/Makefile                     |   34 +
 debian/changelog                                   |   40 +
 debian/compat                                      |    2 +-
 debian/control                                     |  103 +-
 debian/copyright                                   |  192 ++-
 debian/gmp-ecm.install                             |    1 -
 debian/gmp-ecm.links                               |    2 +-
 debian/gmp-ecm.manpages                            |    1 +
 debian/libecm-dev.install                          |    3 -
 debian/{docs => libecm0-dev-common.docs}           |    3 +-
 debian/libecm0-dev-common.examples                 |    2 +
 debian/libecm0-dev-common.install                  |    1 +
 debian/libecm0-dev.install                         |    3 +
 debian/{README.Debian => libecm0.README.Debian}    |    0
 debian/{docs => libecm0.docs}                      |    2 +-
 debian/libecm0.install                             |    2 +-
 debian/libecm0.lintian-overrides                   |   19 +
 debian/patches/0001-Disable-assembly-on-mips.patch |   24 -
 debian/patches/debianization-examples.patch        |   23 +
 debian/patches/series                              |    5 +-
 .../upstream-autotoolization-noexecstack.patch     |   18 +
 .../patches/upstream-autotoolization-refresh.patch | 1451 ++++++++++++++++++++
 .../upstream-libtoolization-version_script.patch   |   78 ++
 debian/rules                                       |   24 +-
 debian/source/lintian-overrides                    |    3 +
 debian/tests/build-examples                        |   11 +
 debian/tests/control                               |    5 +
 debian/tests/make-longcheck                        |   37 +
 debian/watch                                       |    4 +-
 29 files changed, 2021 insertions(+), 72 deletions(-)

diff --git a/debian/adhoc/examples/Makefile b/debian/adhoc/examples/Makefile
new file mode 100644
index 0000000..81d0090
--- /dev/null
+++ b/debian/adhoc/examples/Makefile
@@ -0,0 +1,34 @@
+# /usr/share/doc/libecm0-dev-common/examples/Makefile
+#
+# Ad hoc Makefile for building and playing with the sample sources
+# distributed within the debian package libecm0-dev-common.
+#
+# Recommended usage:
+#  create a dedicated folder somewhere in your HOME directory;
+#  link all the files in usr/share/doc/libecm0-dev-common/examples
+#  in the dedicated folder; launch this Makefile in the dedicated
+#  folder:
+#  $ make ;
+#  for a basic cleanup, consider the clean target:
+#  $ make clean ;
+#  for other targets, just read the Makefile.
+#
+# written for Debian by Jerome Benoit <calculus at rezozer.net>
+# on behalf of the Debian Science Team
+# copyright: 2015 Jerome Benoit <calculus at rezozer.net>
+# distributed under the terms and conditions of GPL version 3 or later
+#
+
+default: all
+
+PROGRAMS = \
+	ecmfactor
+
+LDLIBS = -lecm -lgmp
+
+all: build
+
+build: $(PROGRAMS)
+
+clean:
+	$(RM) $(PROGRAMS)
diff --git a/debian/changelog b/debian/changelog
index c5e1503..43cd91b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,43 @@
+gmp-ecm (6.4.4+ds-1) unstable; urgency=medium
+
+  * New maintainer (Closes: #771880).
+  * Debianization:
+    - debian/copyright:
+      - in DEP-5 format, bump;
+      - Files-Excluded field, introduce;
+      - refresh;
+    - debian/control:
+      - debhelper build-dep to >= 9, bump;
+      - Standards Version 3.9.6, bump;
+      - Build-Depends field, refresh;
+      - Multi-Arch support, achieve;
+      - Vcs-* headers, refresh;
+    - debian/watch, refresh;
+    - debian/rules:
+      - full dh integration, refresh;
+      - get-orig-source uscan based target which downloads the currently
+        packaged upstream tarball and repacks it wrt Files-Excluded;
+      - default target which basically queries package status with uscan
+        -- output in DEHS format;
+    - debian/patches/:
+      - patches in DEP-3 format;
+      - autotoolization:
+        - configure.ac, refresh;
+        - master Makefile.am, mark the shared library as not requiring
+          executable stack;
+      - examples, aka ecmfactor.c, system wide #include;
+    - debian/tests/:
+      - in DEP-8 format, initiate;
+      - simple build test based on examples, introduce;
+      - heavy test based on the upstream longcheck ($ make long check),
+        introduce;
+    - debian/adhoc/examples/:
+      - illustrative Makefile, provide;
+    - gpg-signature check support, neutralize.
+  * This upstream release closes LP: #1294929.
+
+ -- Jerome Benoit <calculus at rezozer.net>  Sat, 06 Jun 2015 12:19:51 +0000
+
 gmp-ecm (6.4.4-2) unstable; urgency=low
 
   * Apply patch by Logan Rosen to fix FTBFS on ppc64el (closes: #735986).
diff --git a/debian/compat b/debian/compat
index 7f8f011..ec63514 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-7
+9
diff --git a/debian/control b/debian/control
index 6e33387..e83415d 100644
--- a/debian/control
+++ b/debian/control
@@ -1,16 +1,23 @@
 Source: gmp-ecm
 Section: math
 Priority: optional
+Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.debian.org>
+Uploaders: Jerome Benoit <calculus at rezozer.net>
+Build-Depends:
+ debhelper (>= 9),
+ autotools-dev, gnulib, m4 [amd64 kfreebsd-amd64], dh-autoreconf, libtool,
+ libgmp-dev (>= 2:6.0)
+Standards-Version: 3.9.6
 Homepage: http://ecm.gforge.inria.fr/
-Maintainer: Laurent Fousse <lfousse at debian.org>
-Build-Depends: debhelper (>= 7.0.50) , libgmp10-dev, m4 [amd64 kfreebsd-amd64], dh-autoreconf
-Standards-Version: 3.9.1
+Vcs-Git: git://anonscm.debian.org/debian-science/packages/gmp-ecm.git
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=debian-science/packages/gmp-ecm.git
 
 Package: gmp-ecm
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Breaks: ecm (<< 1.00-2)
 Replaces: ecm (<< 1.00-2)
+Multi-Arch: foreign
 Description: Factor integers using the Elliptic Curve Method
  gmp-ecm is a free implementation of the Elliptic Curve Method (ECM)
  for integer factorization.
@@ -27,12 +34,19 @@ Description: Factor integers using the Elliptic Curve Method
  .
  See http://www.loria.fr/~zimmerma/records/ecmnet.html for more
  information about ecmnet.
+ .
+ This package provides the command line utility.
 
 Package: libecm0
-Architecture: any
+Provides: libecm
 Section: libs
+Architecture: any
+Pre-Depends: ${misc:Pre-Depends}
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Factor integers using the Elliptic Curve Method (library)
+Recommends: gmp-ecm (=${binary:Version})
+Conflicts: libecm
+Multi-Arch: same
+Description: factor integers using the Elliptic Curve Method -- lib
  gmp-ecm is a free implementation of the Elliptic Curve Method (ECM)
  for integer factorization.
  .
@@ -51,11 +65,46 @@ Description: Factor integers using the Elliptic Curve Method (library)
  .
  This package provides the shared library.
 
-Package: libecm-dev
+Package: libecm0-dev
+Provides: libecm-dev
+Section: libdevel
 Architecture: any
+Replaces: libecm-dev (<= 6.4.4-2)
+Breaks: libecm-dev (<= 6.4.4-2)
+Depends:
+ libecm0 (= ${binary:Version}), libecm0-dev-common (= ${source:Version}),
+ libgmp-dev, ${misc:Depends}
+Conflicts: libecm-dev
+Multi-Arch: same
+Description: factor integers using the Elliptic Curve Method -- libdev
+ gmp-ecm is a free implementation of the Elliptic Curve Method (ECM)
+ for integer factorization.
+ .
+ The original purpose of the ECMNET project was to make Richard Brent's
+ prediction true, i.e. to find a factor of 50 digits or more by
+ ECM. This goal was attained on September 14, 1998, when Conrad Curry
+ found a 53-digit factor of 2^677-1 c150 using George Woltman's mprime
+ program. The new goal of ECMNET is now to find other large factors by
+ ecm, mainly by contributing to the Cunningham project, most likely the
+ longest, ongoing computational project in history according to Bob
+ Silverman. A new record was set by Nik Lygeros and Michel Mizony, who
+ found in December 1999 a prime factor of 54 digits using GMP-ECM.
+ .
+ See http://www.loria.fr/~zimmerma/records/ecmnet.html for more
+ information about ecmnet.
+ .
+ This package provides the static library and symbolic links needed
+ for development.
+
+Package: libecm0-dev-common
+Provides: libecm-dev-common
 Section: libdevel
-Depends: libgmp10-dev, libecm0 (= ${binary:Version}), ${misc:Depends}
-Description: Factor integers using the Elliptic Curve Method (library)
+Architecture: all
+Depends: ${misc:Depends}
+Recommends: libecm0-dev (=${binary:Version})
+Conflicts: libecm-dev-common
+Multi-Arch: foreign
+Description: factor integers using the Elliptic Curve Method -- header
  gmp-ecm is a free implementation of the Elliptic Curve Method (ECM)
  for integer factorization.
  .
@@ -72,4 +121,40 @@ Description: Factor integers using the Elliptic Curve Method (library)
  See http://www.loria.fr/~zimmerma/records/ecmnet.html for more
  information about ecmnet.
  .
- This package provides the static library.
+ This package provides the header needed by developers.
+
+Package: libecm0-dbg
+Provides: libecm-dbg
+Section: debug
+Priority: extra
+Architecture: any
+Depends: libecm0 (= ${binary:Version}), ${misc:Depends}
+Conflicts: libecm-dbg
+Multi-Arch: same
+Description: factor integers using the Elliptic Curve Method -- debug
+ gmp-ecm is a free implementation of the Elliptic Curve Method (ECM)
+ for integer factorization.
+ .
+ The original purpose of the ECMNET project was to make Richard Brent's
+ prediction true, i.e. to find a factor of 50 digits or more by
+ ECM. This goal was attained on September 14, 1998, when Conrad Curry
+ found a 53-digit factor of 2^677-1 c150 using George Woltman's mprime
+ program. The new goal of ECMNET is now to find other large factors by
+ ecm, mainly by contributing to the Cunningham project, most likely the
+ longest, ongoing computational project in history according to Bob
+ Silverman. A new record was set by Nik Lygeros and Michel Mizony, who
+ found in December 1999 a prime factor of 54 digits using GMP-ECM.
+ .
+ See http://www.loria.fr/~zimmerma/records/ecmnet.html for more
+ information about ecmnet.
+ .
+ This package provides the debugging symbols.
+
+Package: libecm-dev
+Section: oldlibs
+Priority: extra
+Architecture: all
+Depends: libecm0-dev (>= ${source:Version}), ${misc:Depends}
+Multi-Arch: foreign
+Description: transitional dummy package
+ This is a transitional dummy package. It can safely be removed.
diff --git a/debian/copyright b/debian/copyright
index 13f8cc2..d10e660 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,31 +1,171 @@
-This package was debianized by Laurent Fousse <laurent at komite.net> on
-Tue, 22 Apr 2003 10:19:24 +0200.
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0
+Upstream-Name: gmp-ecm
+Upstream-Contact:
+ Paul Zimmermann <zimmerma+gforge at loria.fr>
+Source: http://gforge.inria.fr/projects/ecm/
+Comment:
+ The upstream source tarball is repacked to drop off some substantial
+ weight and to allow clean git-buildpackage builds by mainly cleaning
+ up regenerated files (mainly autotools related material).
+Files-Excluded:
+ build.vc10/assembler/Makefile.in
+ build.vc10/bench_mulredc/Makefile.in
+ build.vc10/ecm/Makefile.in
+ build.vc10/libecm/Makefile.in
+ build.vc10/Makefile.in
+ build.vc10/tune/Makefile.in
+ athlon/Makefile.in
+ pentium4/Makefile.in
+ powerpc64/Makefile.in
+ x86_64/Makefile.in
+ m4/ltversion.m4
+ m4/ltoptions.m4
+ m4/libtool.m4
+ m4/ltsugar.m4
+ m4/lt~obsolete.m4
+ aclocal.m4
+ config.h.in
+ Makefile.in
+ compile
+ missing
+ ltmain.sh
+ install-sh
+ depcomp
+ config.sub
+ config.guess
+ configure
+ INSTALL
 
-It was downloaded from http://gforge.inria.fr/projects/ecm/
+Files: *
+Copyright:
+ Copyright (C) 2001-2015 the GMP-ECM Project Team
+	Paul Zimmermann
+	Cyril Bouvier
+	David Cleaver
+	Laurent Fousse
+	Pierrick Gaudry
+	Brian Gladman
+	Alexander Kruppa
+	Dave Newman
+	Jason Papadopoulos
+License: LGPL-3+ and GPL-3+
 
-Upstream Authors (from upstream `AUTHORS' file):
-    Jim Fougeron <jfoug at cox dot net>
-    Laurent Fousse <laurent at komite dot net>
-    Alexander Kruppa <firstname.lastname at mytum.de> (substitute appropriately)
-    Dave Newman <david dot newman at jesus dot ox dot ac dot uk>
-    Paul Zimmermann <zimmerma at loria dot fr>
+Files:
+ auxi.c
+ b1_ainc.c
+ candi.c
+ ecm-ecm.h
+ ecmfactor.c
+ eval.c
+ main.c
+ resume.c
+ tune.c
+ test.ecm
+ test.pm1
+ test.pp1
+Copyright:
+ Copyright (C) 2001-2015 the GMP-ECM Project Team
+License: GPL-3+
 
-This software is Copyright (C) 2001-2007 Paul Zimmerman and Alexander Kruppa,
-(C) 2003-2005 Jim Fougeron, Laurent Fousse and Dave Newman.
+Files:
+ auxarith.c
+ auxlib.c
+ batch.c
+ bestd.c
+ ecm2.c
+ ecm.c
+ ecm.h
+ ecm-impl.h
+ ecm_ntt.c
+ ellparam_batch.c
+ factor.c
+ Fgw.c
+ getprime.c
+ ks-multiply.c
+ listz.c
+ lucas.c
+ median.c
+ mpmod.c
+ mpmod.h
+ mpzspm.c
+ mpzspv.c
+ mul_fft.c
+ mul_lo.c
+ ntt_gfp.c
+ pm1.c
+ pm1fs2.c
+ polyeval.c
+ pp1.c
+ random.c
+ rho.c
+ schoen_strass.c
+ sets_long.c
+ sp.c
+ sp.h
+ spm.c
+ spv.c
+ stage2.c
+ toomcook.c
+ powerpc64/redc.asm
+ powerpc64/mulredc*.asm
+ powerpc64/mulredc*.m4
+ powerpc64/powerpc-defs.m4
+Copyright:
+ Copyright (C) 2001-2015 the GMP-ECM Project Team
+License: LGPL-3+
 
-You are free to distribute the files:
-    auxlib.c bestd.c ecm-gmp.h ecm.c ecm2.c factor.c getprime.c ks-multiply.c
-    listz.c lucas.c median.c memory.c mpmod.c mul_lo.c pm1.c polyeval.c pp1.c
-    random.c rho.c schoen_strass.c stage2.c toomcook.c
-under the terms of the GNU Lesser General Public License, version 2.1 or any
-later version, and the files:
-    Fgw.c auxi.c b1_ainc.c candi.c ecm-ecm.h ecm-impl.h ecm.h ecmfactor.c
-    eval.c getprime2.c main.c random2.c resume.c smartprp.c trial.c tune.c
-    tune2.c
-under the terms of the GNU General Public License, version 2 or any later
-version.
+Files:
+ ecm-gmp.h
+ longlong.h
+ memory.c
+ athlon/redc.asm
+ pentium4/redc.asm
+Copyright:
+ Copyright 1991-2015 Free Software Foundation, Inc.
+License: LGPL-3+
+Comment:
+ These files were copied from the GNU MP Library.
 
-On Debian systems, the complete texts of the GNU General Public
-License and of the GNU Lesser General Public License can be found in
-the file `/usr/share/common-licenses/GPL' and `/usr/share/common-licenses/LGPL'
-respectively.
+Files: debian/*
+Copyright:
+ 2015 Jerome Benoit <calculus at rezozer.net>
+ 2003-2014 Laurent Fousse <lfousse at debian.org>
+License: GPL-3+
+Comment:
+ This package was originally debianized by Laurent Fousse <lfousse at debian.org>
+ on Tue 2003-04-22; thanks to Laurent Fousse <lfousse at debian.org> for providing
+ the original SVN repository.
+
+License: GPL-3+
+ This package 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.
+ .
+ This package 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, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU General
+ Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
+
+License: LGPL-3+
+ This package is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 3 of the License, or (at your option) any later version.
+ .
+ This package 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
+ Lesser General Public License for more details.
+ .
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ .
+ On Debian systems, the complete text of the GNU Lesser General
+ Public License can be found in "/usr/share/common-licenses/LGPL-3".
diff --git a/debian/gmp-ecm.install b/debian/gmp-ecm.install
index 565d1b3..b59311a 100644
--- a/debian/gmp-ecm.install
+++ b/debian/gmp-ecm.install
@@ -1,2 +1 @@
 usr/bin/ecm
-usr/share/man/man1/ecm.1
diff --git a/debian/gmp-ecm.links b/debian/gmp-ecm.links
index d8e3ff5..4f83633 100644
--- a/debian/gmp-ecm.links
+++ b/debian/gmp-ecm.links
@@ -1 +1 @@
-usr/share/man/man1/ecm.1.gz usr/share/man/man1/gmp-ecm.1.gz
+usr/share/man/man1/ecm.1.gz     usr/share/man/man1/gmp-ecm.1.gz
diff --git a/debian/gmp-ecm.manpages b/debian/gmp-ecm.manpages
new file mode 100644
index 0000000..4450a71
--- /dev/null
+++ b/debian/gmp-ecm.manpages
@@ -0,0 +1 @@
+debian/tmp/usr/share/man/man1/*.1
diff --git a/debian/libecm-dev.install b/debian/libecm-dev.install
deleted file mode 100644
index cfa81b9..0000000
--- a/debian/libecm-dev.install
+++ /dev/null
@@ -1,3 +0,0 @@
-usr/lib/libecm.a
-usr/lib/libecm.so
-usr/include/ecm.h
diff --git a/debian/docs b/debian/libecm0-dev-common.docs
similarity index 64%
copy from debian/docs
copy to debian/libecm0-dev-common.docs
index 9a58ad6..f135b5a 100644
--- a/debian/docs
+++ b/debian/libecm0-dev-common.docs
@@ -1,3 +1,4 @@
+NEWS
 README
+README.lib
 AUTHORS
-NEWS
diff --git a/debian/libecm0-dev-common.examples b/debian/libecm0-dev-common.examples
new file mode 100644
index 0000000..5bbf6ab
--- /dev/null
+++ b/debian/libecm0-dev-common.examples
@@ -0,0 +1,2 @@
+ecmfactor.c
+debian/adhoc/examples/*
diff --git a/debian/libecm0-dev-common.install b/debian/libecm0-dev-common.install
new file mode 100644
index 0000000..e5c00da
--- /dev/null
+++ b/debian/libecm0-dev-common.install
@@ -0,0 +1 @@
+usr/include/*.h
diff --git a/debian/libecm0-dev.install b/debian/libecm0-dev.install
new file mode 100644
index 0000000..9b8405d
--- /dev/null
+++ b/debian/libecm0-dev.install
@@ -0,0 +1,3 @@
+usr/lib/*/libecm.so
+usr/lib/*/libecm.a
+#usr/lib/*/pkgconfig/*
diff --git a/debian/README.Debian b/debian/libecm0.README.Debian
similarity index 100%
rename from debian/README.Debian
rename to debian/libecm0.README.Debian
diff --git a/debian/docs b/debian/libecm0.docs
similarity index 100%
rename from debian/docs
rename to debian/libecm0.docs
index 9a58ad6..eb9b151 100644
--- a/debian/docs
+++ b/debian/libecm0.docs
@@ -1,3 +1,3 @@
+NEWS
 README
 AUTHORS
-NEWS
diff --git a/debian/libecm0.install b/debian/libecm0.install
index d44a21e..c4b9222 100644
--- a/debian/libecm0.install
+++ b/debian/libecm0.install
@@ -1 +1 @@
-usr/lib/libecm.so.*	usr/lib/
+usr/lib/*/libecm.so.*
diff --git a/debian/libecm0.lintian-overrides b/debian/libecm0.lintian-overrides
new file mode 100644
index 0000000..7aa6e06
--- /dev/null
+++ b/debian/libecm0.lintian-overrides
@@ -0,0 +1,19 @@
+# Mathematically impossible computations or absurde entries are managed
+# with either exit(3) or abort(3): this looks as a clumsy DEBUG policy
+# rather than a design issue, nevertheless it is unlikely to be fixed by
+# the upstream team as it is widely employed.
+# Out of memory events are also managed with exit(3): this looks as a
+# clumsy emergency exit policy rather than a design issue that may be
+# revisited only to please lintian(1).
+libecm0: shlib-calls-exit
+
+# A public interface is clearly defined in the library header ecm.h
+# (see README.lib), but unfortunately no ABI is clearly defined ABI.
+# In particular, it appeared that the command line utility ecm uses
+# symbols not declared in this headeer (and suppoed to be used).
+# The issue was discussed with the upstream maintainer.
+# -- Jerome Benoit <calculus at rezozer.net>  Fri, 29 May 2015
+libecm0: no-symbols-control-file
+
+# WIP
+# libecm0: shlib-with-executable-stack
diff --git a/debian/patches/0001-Disable-assembly-on-mips.patch b/debian/patches/0001-Disable-assembly-on-mips.patch
deleted file mode 100644
index 9eb161c..0000000
--- a/debian/patches/0001-Disable-assembly-on-mips.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Laurent Fousse <laurent at komite.net>
-Date: Mon, 26 Sep 2011 23:00:49 +0200
-Subject: Disable assembly on mips.
-
----
- sp.h |    4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
-
-diff --git a/sp.h b/sp.h
-index e587046..ab61eba 100644
---- a/sp.h
-+++ b/sp.h
-@@ -79,6 +79,10 @@ typedef mp_limb_t UDItype;
- #define ULONG_MAX __GMP_ULONG_MAX
- #endif
- 
-+#if defined (__s390__) || defined (__hppa__) || defined (__mips__)
-+#define NO_ASM
-+#endif
-+
- #define LONGLONG_STANDALONE
- #include "longlong.h"
- 
--- 
diff --git a/debian/patches/debianization-examples.patch b/debian/patches/debianization-examples.patch
new file mode 100644
index 0000000..1fe0f80
--- /dev/null
+++ b/debian/patches/debianization-examples.patch
@@ -0,0 +1,23 @@
+Description: debianization -- examples
+ System preprocessing directive #include for examples.
+Origin: debian
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2015-05-31
+
+--- a/ecmfactor.c
++++ b/ecmfactor.c
+@@ -1,4 +1,4 @@
+-/* ecmfactor.c - example of use of libecm.a.
++/* ecmfactor.c - example of use of the ECM library.
+ 
+ Copyright 2005, 2006 Paul Zimmermann, Dave Newman.
+ 
+@@ -20,7 +20,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <gmp.h> /* GMP header file */
+-#include "ecm.h" /* ecm header file */
++#include <ecm.h> /* ecm header file */
+ 
+ int
+ main (int argc, char *argv[])
diff --git a/debian/patches/series b/debian/patches/series
index 484c8d8..91930ed 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,4 @@
-0001-Disable-assembly-on-mips.patch
+upstream-autotoolization-refresh.patch
+#upstream-libtoolization-version_script.patch
+upstream-autotoolization-noexecstack.patch
+debianization-examples.patch
diff --git a/debian/patches/upstream-autotoolization-noexecstack.patch b/debian/patches/upstream-autotoolization-noexecstack.patch
new file mode 100644
index 0000000..a6a0eba
--- /dev/null
+++ b/debian/patches/upstream-autotoolization-noexecstack.patch
@@ -0,0 +1,18 @@
+Description: upstream -- autotoolization -- noexecstack
+ Mark the ECM shared library as not requiring executable stack;
+ meant to be submitted to the upstream maintainer team.
+Origin: debian
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2015-06-01
+
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -39,7 +39,7 @@
+ # Link the asm redc code (if we use it) into libecm.la
+ libecm_la_CPPFLAGS = $(MULREDCINCPATH)
+ libecm_la_CFLAGS = $(OPENMP_CFLAGS)
+-libecm_la_LDFLAGS = -version-info 0:0:0
++libecm_la_LDFLAGS = -version-info 0:0:0 -Wl,-znoexecstack
+ libecm_la_LIBADD = $(MULREDCLIBRARY) $(GMPLIB)
+ 
+ bin_PROGRAMS = ecm
diff --git a/debian/patches/upstream-autotoolization-refresh.patch b/debian/patches/upstream-autotoolization-refresh.patch
new file mode 100644
index 0000000..d8d3f3f
--- /dev/null
+++ b/debian/patches/upstream-autotoolization-refresh.patch
@@ -0,0 +1,1451 @@
+Description: upstream -- autotoolization -- refreshment
+ Slightly refresh the autotools machinery, in particular the original autoconf
+ configuration file was rename configure.ac to please lintian(1);
+ meant to be submitted to the upstream maintainer team.
+Origin: debian
+Author: Jerome Benoit <calculus at rezozer.net>
+Last-Update: 2015-05-31
+
+--- /dev/null
++++ b/configure.ac
+@@ -0,0 +1,714 @@
++m4_define([ECM_VERSION], [6.4.4])
++
++AC_PREREQ([2.57])
++AC_INIT([ecm], ECM_VERSION, [ecm-discuss at lists.gforge.inria.fr])
++AC_CONFIG_MACRO_DIR([m4])
++AC_CONFIG_AUX_DIR([build-aux])
++AC_CONFIG_HEADER([config.h])
++AC_USE_SYSTEM_EXTENSIONS
++GMP_INIT([config.m4])
++AM_INIT_AUTOMAKE([1.10])
++AM_INIT_AUTOMAKE([ecm], ECM_VERSION)
++AM_SILENT_RULES([no])
++AM_MAINTAINER_MODE([])
++AC_CANONICAL_HOST
++
++dnl Copied from MPFR 2.4.2:
++unset GMP_CFLAGS GMP_CC user_redefine_cc
++dnl Check if user request his CC and CFLAGS
++if test -n "$CFLAGS" || test -n "$CC" ; then
++  user_redefine_cc=yes
++fi
++
++dnl the following is required to compile auxi.c according to autoconf 2.61
++AC_PROG_EGREP
++AC_PROG_SED
++
++AC_ARG_WITH([gmp],         [  --with-gmp=DIR          GMP install directory ],  [with_gmp_include=$withval/include with_gmp_lib=$withval/lib])
++AC_ARG_WITH([gmp_include], [  --with-gmp-include=DIR  GMP include directory ],  [with_gmp_include=$withval])
++AC_ARG_WITH([gmp_lib],     [  --with-gmp-lib=DIR      GMP lib directory ],      [with_gmp_lib=$withval])
++AC_ARG_WITH([gwnum],       [  --with-gwnum=DIR        GWNUM source directory ], [with_gwnum=$withval])
++
++if test x"$with_gmp_include" != "x"
++then
++  if ! test -d "$with_gmp_include"
++  then
++    AC_MSG_ERROR([Specified GMP include directory "$with_gmp_include" does not exist])
++  fi
++  CPPFLAGS="-I$with_gmp_include"
++fi
++
++if test x"$with_gmp_lib" != "x"
++then
++  if ! test -d "$with_gmp_lib"
++  then
++    AC_MSG_ERROR([Specified GMP library directory "$with_gmp_lib" does not exist])
++  fi
++fi
++
++############################
++# Parse --enable-* options #
++############################
++
++dnl Assertions are enabled by default for beta/rc releases. The last parameter
++dnl of AC_ARG_ENABLE() sets the default value (change also default=...).
++AC_ARG_ENABLE([assert],
++[AS_HELP_STRING([--enable-assert], [enable ASSERT checking [[default=no]]])],[],[enable_assert=no])
++if test "x$enable_assert" = xyes; then
++  AC_DEFINE([WANT_ASSERT],1,[Define to 1 if you want assertions enabled])
++  GMP_DEFINE([WANT_ASSERT], 1)
++fi
++
++AC_ARG_ENABLE([shellcmd],
++[AS_HELP_STRING([--enable-shellcmd], [enable shell command execution [[default=no]]])])
++if test "x$enable_shellcmd" = xyes; then
++  AC_DEFINE([WANT_SHELLCMD],1,[Define to 1 if you want shell command execution])
++fi
++
++AC_ARG_ENABLE([gmp-cflags],
++[AS_HELP_STRING([--enable-gmp-cflags], [enable importing CFLAGS from gmp.h [[default=yes]]])],[],[enable_gmp_cflags=yes])
++
++AC_ARG_ENABLE([openmp],
++[AS_HELP_STRING([--enable-openmp], [enable OpenMP multi-threading [[default=no]]])])
++
++AC_ARG_ENABLE([sse2],
++[AS_HELP_STRING([--enable-sse2], [use SSE2 instructions in NTT code (default=yes for 32-bit x86 systems, if supported)])])
++
++AC_ARG_ENABLE([asm-redc],
++[AS_HELP_STRING([--enable-asm-redc], [use an asm redc (default=yes on x86_64 and powerpc64, no on others)])])
++
++AC_ARG_ENABLE([memory-debug],
++[AS_HELP_STRING([--enable-memory-debug], [enable memory debugging [[default=no]]])])
++if test "x$enable_memory_debug" = xyes; then
++  AC_DEFINE([MEMORY_DEBUG], 1, [Define to 1 if you want memory debugging])
++fi
++AM_CONDITIONAL([MEMORY_DEBUG], [test "x$enable_memory_debug" = xyes])
++
++AC_ARG_ENABLE([mulredc-svoboda],
++[AS_HELP_STRING([--enable-mulredc-svoboda], [enable Svoboda mulredc [[default=no]]])])
++if test "x$enable_mulredc_svoboda" = xyes; then
++  AC_DEFINE([MULREDC_SVOBODA],1,[Define to 1 if you want Svoboda mulredc])
++  GMP_DEFINE([MULREDC_SVOBODA], 1)
++fi
++
++
++
++dnl Use C language for test programs
++AC_LANG([C])
++
++dnl Copied from MPFR 2.4.1 and modified
++dnl We need to guess the C preprocessor instead of using AC_PROG_CPP,
++dnl since AC_PROG_CPP implies AC_PROG_CC, which chooses a compiler
++dnl (before we have the chance to get it from gmp.h) and does some
++dnl checking related to this compiler (such as dependency tracking
++dnl options); if the compiler changes due to __GMP_CC in gmp.h, one
++dnl would have incorrect settings.
++dnl FIXME: Move this in aclocal ?
++
++if test "x$user_redefine_cc" = x && test "x$enable_gmp_cflags" = xyes && test "x$cross_compiling" != xyes; then
++if test "x$GMP_CC$GMP_CFLAGS" = x; then
++   AC_MSG_CHECKING([for CC and CFLAGS in gmp.h])
++   GMP_CC=__GMP_CC
++   GMP_CFLAGS=__GMP_CFLAGS
++   for cpp in /lib/cpp gcc cc c99
++   do
++     test $cpp = /lib/cpp || cpp="$cpp -E"
++     echo "Trying to run $cpp" >&AS_MESSAGE_LOG_FD
++     AC_LANG_CONFTEST([AC_LANG_SOURCE([foo])])
++     if $cpp $CPPFLAGS conftest.$ac_ext > /dev/null 2> /dev/null ; then
++       # Get CC and CFLAGS
++       AC_LANG_CONFTEST([AC_LANG_SOURCE([#include "gmp.h"
++MPFR_OPTION_CC __GMP_CC
++MPFR_OPTION_CFLAGS __GMP_CFLAGS])])
++       echo "Trying to parse gmp.h with: $cpp $CPPFLAGS conftest.$ac_ext" >&AS_MESSAGE_LOG_FD
++       if $cpp $CPPFLAGS conftest.$ac_ext 2> /dev/null > conftest.out; then
++         GMP_CC="`$EGREP MPFR_OPTION_CC conftest.out | $SED -e 's/MPFR_OPTION_CC //g' | $SED -e 's/"//g'`"
++         GMP_CFLAGS="`$EGREP MPFR_OPTION_CFLAGS conftest.out | $SED -e 's/MPFR_OPTION_CFLAGS //g'| $SED -e 's/"//g'`"
++         echo "Success, GMP_CC=$GMP_CC, GMP_CFLAGS=$GMP_CFLAGS" >&AS_MESSAGE_LOG_FD
++         break
++       else
++         echo "Could not parse gmp.h with $cpp" >&AS_MESSAGE_LOG_FD
++       fi
++     else
++       echo "Could not run $cpp" >&AS_MESSAGE_LOG_FD
++     fi
++   done
++   rm -f conftest*
++   if test "x$GMP_CC" = "x__GMP_CC" || test "x$GMP_CFLAGS" = "x__GMP_CFLAGS" ; then
++      AC_MSG_RESULT([no])
++      GMP_CFLAGS=
++      GMP_CC=
++   else
++      AC_MSG_RESULT([yes CC=$GMP_CC CFLAGS=$GMP_CFLAGS])
++   fi
++fi
++
++dnl But these variables may be invalid, so we must check them first.
++dnl Note: we do not use AC_RUN_IFELSE, as it implies AC_PROG_CC.
++if test "x$GMP_CC$GMP_CFLAGS" != x; then
++   AC_MSG_CHECKING([whether CC=$GMP_CC and CFLAGS=$GMP_CFLAGS works])
++   AC_LANG_CONFTEST([AC_LANG_SOURCE([int main (void) { return 0; }])])
++   if $GMP_CC $GMP_CFLAGS -o conftest conftest.$ac_ext 2> /dev/null ; then
++     AC_MSG_RESULT([yes])
++     CFLAGS=$GMP_CFLAGS
++     CC=$GMP_CC
++   else
++     AC_MSG_RESULT([no, reverting to default])
++   fi
++   rm -f conftest*
++fi
++
++fi
++
++
++dnl Checks for programs.
++AC_PROG_CC
++AM_PROG_AS
++AM_PROG_CC_C_O
++
++
++# Now that we have decided on CC and CFLAGS, init libtool
++# Don't make a shared library by default. Enable building a shared library
++# by specifying "--enable-shared" on the ./configure command line
++LT_PREREQ([2.2.6])
++LT_INIT([disable-shared])
++
++
++dnl Checks for typedefs, structures, and compiler characteristics.
++AC_TYPE_INT64_T
++AC_TYPE_UINT64_T
++AC_TYPE_LONG_LONG_INT
++
++dnl Check if compiler supports "const," if not define it to empty string
++AC_C_CONST
++
++dnl Check if compiler supports "inline," if not define it to
++dnl __inline__ or __inline or the empty string
++AC_C_INLINE
++
++dnl Check if both time.h and sys/time.h can be included
++AC_HEADER_TIME
++
++dnl Define size_t to something useable if standard headers don't
++AC_TYPE_SIZE_T
++
++
++dnl If OpenMP is enabled, check which command line parameter (if any)
++dnl if required to make the compiler enable OpenMP
++if test "x$enable_openmp" = xyes; then
++  AC_OPENMP
++fi
++
++########################
++# Enable asm redc code #
++########################
++# If --(en|dis)able-asm-redc not specified, choose default value
++# Test if asm redc code is available for this cpu.
++# Point ASMPATH to the correct subdirectory.
++
++# asm_redc enabled by default for x86_64 and 64 bit PowerPC
++if test "x$enable_asm_redc" = x; then
++  case $host in
++    x86_64*-*-* | powerpc-apple-darwin* | powerpc64-*-linux*) enable_asm_redc=yes;;
++    *) enable_asm_redc=no;;
++  esac
++fi
++
++if test "x$enable_asm_redc" = xyes; then
++  case $host in
++    pentium4-*-* | pentium3-*-* | viac7-*-* | i786-*-*) ASMPATH=pentium4;;
++    x86_64*-*-*)
++# In case GMP has been compiled with a 32-bit ABI...
++# Use AC_COMPILE_IFELSE instead of AC_PREPROC_IFELSE, otherwise
++# GMP's CFLAGS doesn't seem to be taken into account.
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
++#if defined(__i386__)
++#error
++#endif])], [], [AC_MSG_NOTICE([32-bit ABI (i386), disabling asm-redc])
++                enable_asm_redc=no])
++                          ASMPATH=x86_64;;
++# warning: with powerpc-apple-darwin* we can have ABI=32
++# see bug #10646 on the bug tracker, where config.guess says
++# powerpc-apple-darwin8.11.0 (this a 64-bit machine, but most applications
++# are compiled in 32 bits). It works with --disable-asm-redc.
++    powerpc-apple-darwin*)
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
++#if defined(__ppc__)
++#error
++#endif])], [], [AC_MSG_NOTICE([32-bit PowerPC, disabling asm-redc])
++                enable_asm_redc=no])
++                          ASMPATH=powerpc64;;
++    powerpc64-*-linux*)
++			  ECM_INCLUDE([<"$srcdir"/powerpc64/powerpc-defs.m4>])
++			  ASMPATH=powerpc64;;
++    i[[56]]86-*-* | k[[78]]*-*-* | athlon*-*-* | pentiumpro-*-* | \
++    pentium2-*-* | viac3*-*-* | i686-apple-darwin*)
++    		   	  ASMPATH=athlon;;
++    *) AC_MSG_ERROR([[asm redc not available on this machine $host]]);;
++  esac
++fi
++
++if test "x$enable_asm_redc" = xyes; then
++# do the necessary definitions and includes
++  AC_DEFINE([USE_ASM_REDC],1,[Define to 1 to use asm redc])
++  test "x$CCAS" != x || CCAS="$CC -c"
++  AC_SUBST([CCAS])
++  GMP_PROG_M4
++  GMP_ASM_UNDERSCORE
++  GMP_ASM_TEXT
++  GMP_ASM_GLOBL
++  GMP_ASM_TYPE
++
++  case $host in
++    *-*-mingw32) GMP_DEFINE([WINDOWS64_ABI], 1)
++                 AC_DEFINE([WINDOWS64_ABI], 1,[Define to 1 if x86_64 mulredc*() functions should be called with Windows ABI]);;
++    *) ;;
++  esac
++
++  case $host in
++    pentium3-*-*)
++      echo "WARNING: Your processor is recognized as Pentium3."
++      echo "         The asm code uses SSE2, and therefore it might"
++      echo "         fail if your proc is indeed a P3, and not a"
++      echo "         Pentium M. If you have compilation problems,"
++      echo "         consider using --disable-asm-redc." ;;
++    *)
++  esac
++fi
++AM_CONDITIONAL([ENABLE_ASM_REDC], [test "x$enable_asm_redc" = xyes])
++
++
++############################
++# Enable SSE2 instructions #
++############################
++# Test if we should use SSE2 instructions and if the cpu supports them
++if test "x$enable_sse2" = "x"; then
++dnl Default: if we build for Pentium 4, enable SSE2 code for the NTT
++dnl Some SSE2 enabled cpus are identified as i686, we enables SSE2
++dnl for them by default and let the tests below check if it works
++  case $host in
++    pentium4-*-* | viac7-*-* | i686-*-* | i786-*-*)
++      enable_sse2=yes
++    ;;
++  esac
++fi
++# If the necessary predefines (__GNUC__ or __ICL, and __i386__)
++# are not set, SSE2 will never be compiled in, and we switch off
++# the SSE2 flag
++if test "x$enable_sse2" = xyes; then
++  AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
++#if !defined(__GNUC__) && !defined(__ICL) || !defined(__i386__)
++#error
++#IRIXdoesnotexitaterrordirective
++#endif])], [], dnl Necessary predefines are present. Nothing to do
++  [ dnl Necessary predefines are not present. Switch off SSE2
++    AC_MSG_NOTICE([Not using GCC or ICC, or not a 32-bit x86. SSE2 disabled])
++    enable_sse2=no])
++fi
++if test "x$enable_sse2" = xyes; then
++  # See if we need -msse2 to enable SSE2 instructions
++  AC_MSG_CHECKING([for SSE2 support])
++  m4_define([SSE2_TEST_PROG], [AC_LANG_PROGRAM([], dnl
++[#if (defined(__GNUC__) || defined(__ICL)) && defined(__i386__)
++/* On some machines, a program without constraints may pass without -msse2 but
++   those with constraints in spv.c fail, thus we test with constraints here. */
++asm volatile ("pmuludq %%xmm2, %%xmm0" : : :"%xmm0");
++#else
++#error
++#IRIXdoesnotexitaterrordirective
++#endif])])
++  AC_COMPILE_IFELSE([SSE2_TEST_PROG], dnl
++   [ dnl SSE2 works, nothing to be done
++     AC_MSG_RESULT([yes])], dnl
++   [ dnl SSE2 does not work, try again with -msse2
++    OLDCFLAGS="$CFLAGS"
++    CFLAGS="$CFLAGS -msse2"
++    AC_COMPILE_IFELSE([SSE2_TEST_PROG], dnl
++      [ dnl works now, keep CFLAGS like this
++        AC_MSG_RESULT([yes, with -msse2])], dnl
++      [ dnl still didn't work, switch off SSE2
++       CFLAGS="$OLDCFLAGS"
++       enable_sse2=no
++       AC_MSG_RESULT([not supported, SSE2 disabled])
++      ])])
++fi
++if test "x$enable_sse2" = xyes; then
++  AC_DEFINE([HAVE_SSE2],1,[Define to 1 to enable SSE2 instructions in NTT code])
++fi
++
++########################
++# Add GWNUM if desired #
++########################
++dnl If user wants GWNUM, check if the file exists (either as .a or .lib)
++if test "x$with_gwnum" != "x"; then
++  if test "x$enable_openmp" = xyes; then
++      AC_MSG_ERROR([Woltman's GWNUM currently cannot be used together with OpenMP])
++  fi
++  AC_CHECK_FILE([$with_gwnum/gwnum.a], [
++    AC_DEFINE([HAVE_GWNUM], 1, [Define to 1 if gwnum.a or gwnum.lib exist])
++    GWLIB="$with_gwnum/gwnum.a -lpthread"
++    CPPFLAGS="$CPPFLAGS -I$with_gwnum"
++  ],[
++    AC_CHECK_FILE([$with_gwnum/gwnum.lib], [
++      AC_DEFINE([HAVE_GWNUM], 1, [Define to 1 if gwnum.a or gwnum.lib exist])
++      GWLIB="$with_gwnum/gwnum.lib -lpthread"
++      CPPFLAGS="$CPPFLAGS -I$with_gwnum"
++    ],[
++      with_gwnum=
++      AC_MSG_ERROR([Woltman's GWNUM library not found])
++    ])
++  ])
++fi
++AM_CONDITIONAL([WITH_GWNUM], [test "x$with_gwnum" != "x"])
++
++
++dnl Checks for header files.
++AC_FUNC_ALLOCA
++AC_HEADER_STDC
++AC_CHECK_HEADERS([math.h limits.h malloc.h strings.h sys/time.h unistd.h io.h signal.h fcntl.h])
++AC_CHECK_HEADERS([windows.h])
++AC_CHECK_HEADERS([ctype.h sys/types.h sys/resource.h])
++
++dnl Checks for library functions that are not in GMP
++AC_FUNC_STRTOD
++
++dnl Check functions in the math library
++AC_CHECK_LIB(m,pow,,AC_MSG_ERROR(required function missing))
++AC_CHECK_LIB(m,floor,,AC_MSG_ERROR(required function missing))
++AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR(required function missing))
++AC_CHECK_LIB(m,fmod,,AC_MSG_ERROR(required function missing))
++AC_CHECK_LIB(m,cos)
++
++dnl Check for GSL but don't add it to LIBS, since only rho uses it and
++dnl we don't want all other binaries to depend on it.
++dnl If found, pass link flags to Makefile via GSL_LD_FLAGS
++GSL_LD_FLAGS=
++dnl Check if "-lgslcblas" works. If yes, check if "-lgsl -lgslcblas" works.
++dnl If both work, put "-lgsl -lgslcblas" in GSL_LD_FLAGS
++AC_CHECK_LIB([gslcblas],[cblas_dgemm], dnl
++ [AC_CHECK_LIB([gsl],[gsl_blas_dgemm], dnl
++  [AC_DEFINE([HAVE_LIBGSL],1,[Define to 1 if you have the `gsl' library (-lgsl).])
++   AC_DEFINE([HAVE_LIBGSLCBLAS],1,[Define to 1 if you have the `gslcblas' library (-lgslcblas).])
++   GSL_LD_FLAGS="-lgsl -lgslcblas"], [], dnl
++   dnl Here comes the "OTHER-LIBRARIES" field for AC_CHECK_LIB [gsl]:
++   [-lgslcblas])])
++
++AC_CHECK_FUNCS([isascii memset strchr strlen strncasecmp strstr], [], [AC_MSG_ERROR([required function missing])])
++AC_CHECK_FUNCS([access unlink], [], [AC_MSG_ERROR([required function missing])])
++AC_CHECK_FUNCS([isspace isdigit isxdigit], [], [AC_MSG_ERROR([required function missing])])
++AC_CHECK_FUNCS([time ctime], [], [AC_MSG_ERROR([required function missing])])
++AC_CHECK_FUNCS([setpriority nice gethostname gettimeofday getrusage memmove signal fcntl fileno])
++
++dnl FIXME: which win32 library contains these functions?
++dnl AC_CHECK_FUNCS([GetCurrentProcess GetProcessTimes])
++AC_CHECK_FUNCS([malloc_usable_size])
++
++
++dnl If we use GCC and user has not specified his own CFLAGS,
++dnl add some warning flags, avoiding duplication
++if test "x$GCC" = xyes && test "x$user_redefine_cc" != xyes; then
++  case $CFLAGS in
++    "-pedantic "* | *" -pedantic "* | *" -pedantic") ;;
++    *) CFLAGS="-pedantic $CFLAGS"
++  esac
++  case $CFLAGS in
++    "-Wundef "* | *" -Wundef "* | *" -Wundef") ;;
++    *) CFLAGS="-Wundef $CFLAGS"
++  esac
++  case $CFLAGS in
++    "-Wall "* | *" -Wall "* | *" -Wall") ;;
++    *) CFLAGS="-Wall $CFLAGS"
++  esac
++  case $CFLAGS in
++    "-W "* | *" -W "* | *" -W") ;;
++    *) CFLAGS="-W $CFLAGS"
++  esac
++#  CFLAGS="-Wall -W -Wundef -pedantic $CFLAGS"
++fi
++
++
++dnl Find GMP and do some sanity checks
++dnl Tests concerning the include directories.
++if test -d "$with_gmp_include"; then
++  dnl AC_CHECK_HEADERS and AC_PREPROC_IFELSE uses CPPFLAGS but not CFLAGS
++  CPPFLAGS="-I$with_gmp_include $CPPFLAGS"
++else
++  with_gmp_include=
++fi
++AC_CHECK_HEADERS([gmp.h], [], AC_MSG_ERROR([required header file missing]))
++
++dnl This needs to find only the header file so we can do it here, before
++dnl we start looking for libgmp.a
++AC_MSG_CHECKING([for recent GMP])
++AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
++#include <gmp.h>
++#if (__GNU_MP_VERSION <= 4)
++#error
++#IRIXdoesnotexitaterrordirective
++#endif
++]])],
++  [AC_MSG_RESULT(yes)],
++  [AC_MSG_RESULT(no)
++   AC_MSG_ERROR([GMP 5.0.0 or newer is required])]
++)
++
++dnl Figure out if GMP is MPIR
++AC_MSG_CHECKING([if GMP is MPIR])
++AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
++#include <gmp.h>
++#ifndef __MPIR_VERSION
++#error
++#IRIXdoesnotexitaterrordirective
++#endif
++]])],
++  [AC_MSG_RESULT(yes)
++   AC_DEFINE([HAVE_MPIR],1,[Define to 1 if GMP is MPIR])],
++  [AC_MSG_RESULT(no)])
++
++dnl Now choose how to link the GMP library. If we can, we'd prefer to
++dnl link it statically since that makes for faster function calls. To
++dnl link it statically, we mustn't build a dynamic GMP-ECM library and
++dnl we need to find the libgmp.a file. At the moment, we only look for
++dnl it at the path specified by the user (i.e. --with-gmp) but make no
++dnl attempt to find it in the default system lib directories.
++
++dnl If GMP is linked statically, we pass its path/filename to the Makefile
++dnl via GMPLIB, otherwise -lgmp is passed via GMPLIB.
++dnl The search path to the dynamic GMP library is added to LDFLAGS,
++dnl if GMP is not specified by full pathname.
++
++GMPLDFLAGS=""
++if test -d "$with_gmp_lib"; then
++  GMPLDFLAGS="-L$with_gmp_lib"
++fi
++GMPLIB="-lgmp"
++if test "x$enable_shared" != xyes; then
++  if test -r "$with_gmp_lib/libgmp.a"; then
++    GMPLIB="$with_gmp_lib/libgmp.a"
++    dnl Don't need -L flag since we give full path to libgmp.a
++    GMPLDFLAGS=""
++  fi
++fi
++AC_SUBST([GMPLIB])
++LDFLAGS="$LDFLAGS $GMPLDFLAGS"
++
++
++dnl Test linking against GMP. This tests, for example, that the compiler
++dnl and GMP agree on the ABI (32 or 64 bit). AC_CHECK_LIB() does not work,
++dnl as it requires linking the library with -lgmp, whereas we may want
++dnl to specify it by full pathname as we do in the Makefile
++
++AC_MSG_CHECKING([whether we can link against GMP])
++LIBS_BACKUP="$LIBS"
++LIBS="$LIBS $GMPLIB"
++AC_LINK_IFELSE([AC_LANG_PROGRAM([[
++#ifdef HAVE_GMP_H
++#include <gmp.h>
++#endif]],[[
++  mpz_t t;
++  mpz_init(t);
++  mpz_clear(t);
++  return 0;
++]])], [AC_MSG_RESULT(yes)],
++   [AC_MSG_RESULT(no)
++    AC_MSG_ERROR([Could not link against GMP library.])]
++)
++
++dnl Check for corresponding 'gmp.h' and libgmp.a
++dnl This requires running a program linked against GMP,
++dnl so is done after the link-only test.
++AC_MSG_CHECKING([if gmp.h version and libgmp version are the same])
++AC_RUN_IFELSE([AC_LANG_PROGRAM([[
++#include <stdio.h>
++#include <string.h>
++#include <gmp.h>
++]],[[
++char buffer[100];
++if (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR <= 2 &&
++    __GNU_MP_VERSION_PATCHLEVEL == 0)
++  sprintf (buffer, "%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR);
++else
++  sprintf (buffer, "%d.%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR,
++   __GNU_MP_VERSION_PATCHLEVEL);
++printf ("(%s/%s) ", buffer, gmp_version);
++return strcmp (buffer, gmp_version);
++]])], [AC_MSG_RESULT([yes])],
++   [AC_MSG_RESULT([no])
++    AC_MSG_ERROR(['gmp.h' and 'libgmp' have different versions, you have to reinstall GMP properly.])],
++   [AC_MSG_RESULT([cross-compiling: cannot test])]
++)
++
++AC_CHECK_FUNCS([__gmpn_add_nc __gmpn_mod_34lsub1 __gmpn_redc_1 __gmpn_redc_2])
++AC_CHECK_FUNCS([__gmpn_mullo_n __gmpn_redc_n __gmpn_preinv_mod_1])
++
++LIBS="$LIBS_BACKUP"
++
++dnl Check if the compiler understands some __attribute__ directives
++AC_MSG_CHECKING([whether compiler knows __attribute__((hot))])
++dnl The AC_LANG_WERROR directive causes configure to consider a test
++dnl compilation unsuccessful if it produced any output on stderr.
++dnl We use it since unknown __attribute__ only cause a warning, not an
++dnl error. Unfortunately there seems to be no way to switch it off again,
++dnl so this test is at the end of the configure script
++AC_LANG_WERROR
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([void foo() __attribute__ ((hot));
++void foo() {return;}], [foo()])],
++[AC_DEFINE([ATTRIBUTE_HOT],[__attribute__ ((hot))], [How to specify hot-spot attribute, if available])
++ AC_MSG_RESULT([yes])
++],
++[AC_DEFINE([ATTRIBUTE_HOT],[ ], [How to specify hot-spot attribute, if available])
++ AC_MSG_RESULT([no])
++])
++
++dnl Check for xsltproc
++AC_CHECK_PROG([XSLTPROC],[xsltproc],[xsltproc])
++if test "x$XSLTPROC" != x; then
++  AC_MSG_CHECKING([for docbook.xsl])
++  if test "x$XSLDIR" = x; then
++    if test -d "/usr/local/share/sgml/docbook/xsl-stylesheets"; then
++      XSLDIR="/usr/local/share/sgml/docbook/xsl-stylesheets"
++    elif test -d "/usr/share/sgml/docbook/xsl-stylesheets"; then
++      XSLDIR="/usr/share/sgml/docbook/xsl-stylesheets"
++    elif test -d "/usr/local/share/docbook/"; then
++      XSLDIR="/usr/local/share/docbook/"
++    elif test -d "/usr/share/docbook/"; then
++      XSLDIR="/usr/share/docbook/"
++    fi
++  fi
++  if test -r "$XSLDIR/manpages/docbook.xsl"; then
++    AC_MSG_RESULT([yes])
++    make_manpage="yes"
++  else
++    AC_MSG_RESULT([no])
++  fi
++fi
++AM_CONDITIONAL([MAKE_MANPAGE], [test "x$make_manpage" = xyes])
++
++dnl Check for valgrind. GMP-ECM uses exit code 1 to signal error,
++dnl so we make valgrind use that code to signal error, too
++AC_CHECK_PROG([VALGRIND], [valgrind], [valgrind -q --error-exitcode=1])
++
++case $host in
++  athlon*-*-*) config_arch="athlon" ;;
++  x86_64*-*-*) config_arch="athlon64" ;;
++  pentium3-*-*) config_arch="pentium3" ;;
++  pentium4-*-*) config_arch="pentium4" ;;
++  pentium-m-*-*) config_arch="pentium-m" ;;
++  alphaev6*-*-*) config_arch="alpha-ev6" ;;
++  alphaev56*-*-*) config_arch="alpha-ev56" ;;
++  alphaev5*-*-*) config_arch="alpha-ev5" ;;
++  powerpc7450-*-*) config_arch="powerpc7450" ;;
++  powerpc-apple-darwin* | powerpc64-*-*) config_arch="powerpc970" ;;
++  mips64el-*-*) config_arch="mips64el" ;;
++  armv5tel-*-*) config_arch="armv5tel" ;;
++  sparc64-*-*) config_arch="sparc64" ;;
++  ia64-*-*) config_arch="ia64" ;;
++  hppa2.0-*-*) config_arch="hppa2.0" ;;
++  *) config_arch="default" ;;
++esac
++
++# See if this is a Core 2, if we have /proc/cpuinfo
++core2warn=no
++if test x"$config_arch" = xathlon64; then
++  if test -f /proc/cpuinfo; then
++    if $EGREP -q "Core\(TM\)2" /proc/cpuinfo; then
++      config_arch=core2
++    elif $EGREP -q "Core\(TM\) i5" /proc/cpuinfo; then
++      config_arch=corei5
++    fi;
++  else
++    # No /proc/cpuinfo, tell user about ecm-params.h.core2
++    core2warn=yes
++  fi;
++fi
++
++# See if this is a Pentium 4, if we have /proc/cpuinfo
++pentium4warn=no
++if test x"$config_arch" = xdefault; then
++  if test -f /proc/cpuinfo; then
++    if $EGREP -q "Pentium\(R\) 4" /proc/cpuinfo; then
++      config_arch=pentium4
++    fi;
++  else
++    # No /proc/cpuinfo, tell user about ecm-params.h.pentium4
++    pentium4warn=yes
++  fi;
++fi
++
++LIBS="$LIBS $GWLIB"
++
++GMP_FINISH
++AC_CONFIG_FILES([Makefile athlon/Makefile pentium4/Makefile x86_64/Makefile powerpc64/Makefile build.vc10/Makefile build.vc10/assembler/Makefile build.vc10/ecm/Makefile build.vc10/libecm/Makefile build.vc10/tune/Makefile build.vc10/bench_mulredc/Makefile])
++AC_CONFIG_LINKS([ecm-params.h:ecm-params.h.$config_arch])
++MUL_FFT_PARAMS="mul_fft-params.h.$config_arch"
++if ! test -f "$MUL_FFT_PARAMS"
++then
++  MUL_FFT_PARAMS="mul_fft-params.h.default"
++fi
++AC_CONFIG_LINKS([mul_fft-params.h:"$MUL_FFT_PARAMS"])
++
++AC_SUBST([XSLDIR])
++AC_SUBST([ASMPATH])
++AC_SUBST([GSL_LD_FLAGS])
++
++AC_OUTPUT
++
++AC_MSG_NOTICE([Configuration:])
++AC_MSG_NOTICE([Build for host type $host])
++
++AC_MSG_NOTICE([CC=$CC, CFLAGS=$CFLAGS])
++AC_MSG_NOTICE([Linking GMP with $GMPLIB])
++
++if test "x$enable_asm_redc" = xyes; then
++  AC_MSG_NOTICE([Using asm redc code from directory $ASMPATH])
++else
++  AC_MSG_NOTICE([Not using asm redc code])
++fi
++
++if test "x$enable_sse2" = xyes; then
++  AC_MSG_NOTICE([Using SSE2 instructions in NTT code])
++else
++  AC_MSG_NOTICE([Not using SSE2 instructions in NTT code])
++fi
++
++if test "x$with_gwnum" != "x"; then
++  AC_MSG_NOTICE([Linking with George Woltman's GWNUM])
++fi
++
++if test "x$enable_assert" = xyes; then
++  AC_MSG_NOTICE([Assertions enabled])
++else
++  AC_MSG_NOTICE([Assertions disabled])
++fi
++
++if test "x$enable_shellcmd" = xyes; then
++  AC_MSG_NOTICE([Shell command execution enabled])
++else
++  AC_MSG_NOTICE([Shell command execution disabled])
++fi
++
++if test "x$enable_openmp" = xyes; then
++  AC_MSG_NOTICE([OpenMP enabled])
++else
++  AC_MSG_NOTICE([OpenMP disabled])
++fi
++
++if test "x$enable_memory_debug" = xyes; then
++  AC_MSG_NOTICE([Memory debugging enabled])
++else
++  AC_MSG_NOTICE([Memory debugging disabled])
++fi
++
++if test x"$core2warn" = xyes; then
++  AC_MSG_NOTICE([Your cpu was detected as x86_64; if it is a Core 2, please either use the ecm-params.h.core2 file by executing the commands:])
++  AC_MSG_NOTICE([rm ecm-params.h])
++  AC_MSG_NOTICE([ln -s ecm-params.h.core2 ecm-params.h])
++  AC_MSG_NOTICE([or generate a custom ecm-params.h file for your system as described in INSTALL.])
++fi
++
++if test x"$pentium4warn" = xyes; then
++  AC_MSG_NOTICE([Your cpu was detected as default; if it is a Pentium 4, please either use the ecm-params.h.pentium4 file by executing the commands:])
++  AC_MSG_NOTICE([rm ecm-params.h])
++  AC_MSG_NOTICE([ln -s ecm-params.h.pentium4 ecm-params.h])
++  AC_MSG_NOTICE([or generate a custom ecm-params.h file for your system as described in INSTALL.])
++fi
+--- a/configure.in
++++ /dev/null
+@@ -1,710 +0,0 @@
+-m4_define([ECM_VERSION], [6.4.4])
+-
+-AC_PREREQ([2.57])
+-AC_INIT([ecm], ECM_VERSION, [ecm-discuss at lists.gforge.inria.fr])
+-AC_CONFIG_HEADER([config.h])
+-AC_CONFIG_MACRO_DIR([m4])
+-GMP_INIT([config.m4])
+-AM_INIT_AUTOMAKE([1.10])
+-AM_INIT_AUTOMAKE([ecm], ECM_VERSION)
+-AC_CANONICAL_HOST
+-
+-dnl Copied from MPFR 2.4.2:
+-unset GMP_CFLAGS GMP_CC user_redefine_cc
+-dnl Check if user request his CC and CFLAGS
+-if test -n "$CFLAGS" || test -n "$CC" ; then
+-  user_redefine_cc=yes
+-fi
+-
+-dnl the following is required to compile auxi.c according to autoconf 2.61
+-AC_PROG_EGREP
+-AC_PROG_SED
+-
+-AC_ARG_WITH([gmp],         [  --with-gmp=DIR          GMP install directory ],  [with_gmp_include=$withval/include with_gmp_lib=$withval/lib])
+-AC_ARG_WITH([gmp_include], [  --with-gmp-include=DIR  GMP include directory ],  [with_gmp_include=$withval])
+-AC_ARG_WITH([gmp_lib],     [  --with-gmp-lib=DIR      GMP lib directory ],      [with_gmp_lib=$withval])
+-AC_ARG_WITH([gwnum],       [  --with-gwnum=DIR        GWNUM source directory ], [with_gwnum=$withval])
+-
+-if test x"$with_gmp_include" != "x" 
+-then
+-  if ! test -d "$with_gmp_include"
+-  then
+-    AC_MSG_ERROR([Specified GMP include directory "$with_gmp_include" does not exist])
+-  fi
+-  CPPFLAGS="-I$with_gmp_include"
+-fi
+-
+-if test x"$with_gmp_lib" != "x" 
+-then
+-  if ! test -d "$with_gmp_lib"
+-  then
+-    AC_MSG_ERROR([Specified GMP library directory "$with_gmp_lib" does not exist])
+-  fi
+-fi
+-
+-############################
+-# Parse --enable-* options #
+-############################
+-
+-dnl Assertions are enabled by default for beta/rc releases. The last parameter
+-dnl of AC_ARG_ENABLE() sets the default value (change also default=...).
+-AC_ARG_ENABLE([assert],
+-[AS_HELP_STRING([--enable-assert], [enable ASSERT checking [[default=no]]])],[],[enable_assert=no])
+-if test "x$enable_assert" = xyes; then
+-  AC_DEFINE([WANT_ASSERT],1,[Define to 1 if you want assertions enabled])
+-  GMP_DEFINE([WANT_ASSERT], 1)
+-fi
+-
+-AC_ARG_ENABLE([shellcmd],
+-[AS_HELP_STRING([--enable-shellcmd], [enable shell command execution [[default=no]]])])
+-if test "x$enable_shellcmd" = xyes; then
+-  AC_DEFINE([WANT_SHELLCMD],1,[Define to 1 if you want shell command execution])
+-fi
+-
+-AC_ARG_ENABLE([gmp-cflags],
+-[AS_HELP_STRING([--enable-gmp-cflags], [enable importing CFLAGS from gmp.h [[default=yes]]])],[],[enable_gmp_cflags=yes])
+-
+-AC_ARG_ENABLE([openmp],
+-[AS_HELP_STRING([--enable-openmp], [enable OpenMP multi-threading [[default=no]]])])
+-
+-AC_ARG_ENABLE([sse2],
+-[AS_HELP_STRING([--enable-sse2], [use SSE2 instructions in NTT code (default=yes for 32-bit x86 systems, if supported)])])
+-
+-AC_ARG_ENABLE([asm-redc],
+-[AS_HELP_STRING([--enable-asm-redc], [use an asm redc (default=yes on x86_64 and powerpc64, no on others)])])
+-
+-AC_ARG_ENABLE([memory-debug],
+-[AS_HELP_STRING([--enable-memory-debug], [enable memory debugging [[default=no]]])])
+-if test "x$enable_memory_debug" = xyes; then
+-  AC_DEFINE([MEMORY_DEBUG], 1, [Define to 1 if you want memory debugging])
+-fi
+-AM_CONDITIONAL([MEMORY_DEBUG], [test "x$enable_memory_debug" = xyes])
+-
+-AC_ARG_ENABLE([mulredc-svoboda],
+-[AS_HELP_STRING([--enable-mulredc-svoboda], [enable Svoboda mulredc [[default=no]]])])
+-if test "x$enable_mulredc_svoboda" = xyes; then
+-  AC_DEFINE([MULREDC_SVOBODA],1,[Define to 1 if you want Svoboda mulredc])
+-  GMP_DEFINE([MULREDC_SVOBODA], 1)
+-fi
+-
+-
+-
+-dnl Use C language for test programs
+-AC_LANG([C])
+-
+-dnl Copied from MPFR 2.4.1 and modified
+-dnl We need to guess the C preprocessor instead of using AC_PROG_CPP,
+-dnl since AC_PROG_CPP implies AC_PROG_CC, which chooses a compiler
+-dnl (before we have the chance to get it from gmp.h) and does some
+-dnl checking related to this compiler (such as dependency tracking
+-dnl options); if the compiler changes due to __GMP_CC in gmp.h, one
+-dnl would have incorrect settings.
+-dnl FIXME: Move this in aclocal ?
+-
+-if test "x$user_redefine_cc" = x && test "x$enable_gmp_cflags" = xyes && test "x$cross_compiling" != xyes; then
+-if test "x$GMP_CC$GMP_CFLAGS" = x; then
+-   AC_MSG_CHECKING([for CC and CFLAGS in gmp.h])
+-   GMP_CC=__GMP_CC
+-   GMP_CFLAGS=__GMP_CFLAGS
+-   for cpp in /lib/cpp gcc cc c99
+-   do
+-     test $cpp = /lib/cpp || cpp="$cpp -E"
+-     echo "Trying to run $cpp" >&AS_MESSAGE_LOG_FD
+-     AC_LANG_CONFTEST([AC_LANG_SOURCE([foo])])
+-     if $cpp $CPPFLAGS conftest.$ac_ext > /dev/null 2> /dev/null ; then
+-       # Get CC and CFLAGS
+-       AC_LANG_CONFTEST([AC_LANG_SOURCE([#include "gmp.h"
+-MPFR_OPTION_CC __GMP_CC
+-MPFR_OPTION_CFLAGS __GMP_CFLAGS])])
+-       echo "Trying to parse gmp.h with: $cpp $CPPFLAGS conftest.$ac_ext" >&AS_MESSAGE_LOG_FD
+-       if $cpp $CPPFLAGS conftest.$ac_ext 2> /dev/null > conftest.out; then
+-         GMP_CC="`$EGREP MPFR_OPTION_CC conftest.out | $SED -e 's/MPFR_OPTION_CC //g' | $SED -e 's/"//g'`"
+-         GMP_CFLAGS="`$EGREP MPFR_OPTION_CFLAGS conftest.out | $SED -e 's/MPFR_OPTION_CFLAGS //g'| $SED -e 's/"//g'`"
+-         echo "Success, GMP_CC=$GMP_CC, GMP_CFLAGS=$GMP_CFLAGS" >&AS_MESSAGE_LOG_FD
+-         break
+-       else
+-         echo "Could not parse gmp.h with $cpp" >&AS_MESSAGE_LOG_FD
+-       fi
+-     else
+-       echo "Could not run $cpp" >&AS_MESSAGE_LOG_FD
+-     fi
+-   done
+-   rm -f conftest*
+-   if test "x$GMP_CC" = "x__GMP_CC" || test "x$GMP_CFLAGS" = "x__GMP_CFLAGS" ; then
+-      AC_MSG_RESULT([no])
+-      GMP_CFLAGS=
+-      GMP_CC=
+-   else
+-      AC_MSG_RESULT([yes CC=$GMP_CC CFLAGS=$GMP_CFLAGS])
+-   fi
+-fi
+-
+-dnl But these variables may be invalid, so we must check them first.
+-dnl Note: we do not use AC_RUN_IFELSE, as it implies AC_PROG_CC.
+-if test "x$GMP_CC$GMP_CFLAGS" != x; then
+-   AC_MSG_CHECKING([whether CC=$GMP_CC and CFLAGS=$GMP_CFLAGS works])
+-   AC_LANG_CONFTEST([AC_LANG_SOURCE([int main (void) { return 0; }])])
+-   if $GMP_CC $GMP_CFLAGS -o conftest conftest.$ac_ext 2> /dev/null ; then
+-     AC_MSG_RESULT([yes])
+-     CFLAGS=$GMP_CFLAGS
+-     CC=$GMP_CC
+-   else
+-     AC_MSG_RESULT([no, reverting to default])
+-   fi
+-   rm -f conftest*
+-fi
+-
+-fi
+-
+-
+-dnl Checks for programs.
+-AC_PROG_CC
+-AM_PROG_AS
+-AM_PROG_CC_C_O
+-
+-
+-# Now that we have decided on CC and CFLAGS, init libtool
+-# Don't make a shared library by default. Enable building a shared library
+-# by specifying "--enable-shared" on the ./configure command line
+-LT_PREREQ([2.2.6])
+-LT_INIT([disable-shared])
+-
+-
+-dnl Checks for typedefs, structures, and compiler characteristics.
+-AC_TYPE_INT64_T
+-AC_TYPE_UINT64_T
+-AC_TYPE_LONG_LONG_INT
+-
+-dnl Check if compiler supports "const," if not define it to empty string
+-AC_C_CONST
+-
+-dnl Check if compiler supports "inline," if not define it to 
+-dnl __inline__ or __inline or the empty string
+-AC_C_INLINE
+-
+-dnl Check if both time.h and sys/time.h can be included
+-AC_HEADER_TIME
+-
+-dnl Define size_t to something useable if standard headers don't
+-AC_TYPE_SIZE_T
+-
+-
+-dnl If OpenMP is enabled, check which command line parameter (if any)
+-dnl if required to make the compiler enable OpenMP
+-if test "x$enable_openmp" = xyes; then
+-  AC_OPENMP
+-fi
+-
+-########################
+-# Enable asm redc code #
+-########################
+-# If --(en|dis)able-asm-redc not specified, choose default value
+-# Test if asm redc code is available for this cpu.
+-# Point ASMPATH to the correct subdirectory.
+-
+-# asm_redc enabled by default for x86_64 and 64 bit PowerPC
+-if test "x$enable_asm_redc" = x; then
+-  case $host in
+-    x86_64*-*-* | powerpc-apple-darwin* | powerpc64-*-linux*) enable_asm_redc=yes;;
+-    *) enable_asm_redc=no;;
+-  esac
+-fi
+-
+-if test "x$enable_asm_redc" = xyes; then
+-  case $host in
+-    pentium4-*-* | pentium3-*-* | viac7-*-* | i786-*-*) ASMPATH=pentium4;;
+-    x86_64*-*-*)
+-# In case GMP has been compiled with a 32-bit ABI...
+-# Use AC_COMPILE_IFELSE instead of AC_PREPROC_IFELSE, otherwise
+-# GMP's CFLAGS doesn't seem to be taken into account.
+-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+-#if defined(__i386__)
+-#error
+-#endif])], [], [AC_MSG_NOTICE([32-bit ABI (i386), disabling asm-redc])
+-                enable_asm_redc=no])
+-                          ASMPATH=x86_64;;
+-# warning: with powerpc-apple-darwin* we can have ABI=32
+-# see bug #10646 on the bug tracker, where config.guess says
+-# powerpc-apple-darwin8.11.0 (this a 64-bit machine, but most applications
+-# are compiled in 32 bits). It works with --disable-asm-redc.
+-    powerpc-apple-darwin*)
+-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+-#if defined(__ppc__)
+-#error
+-#endif])], [], [AC_MSG_NOTICE([32-bit PowerPC, disabling asm-redc])
+-                enable_asm_redc=no])
+-                          ASMPATH=powerpc64;;
+-    powerpc64-*-linux*)
+-			  ECM_INCLUDE([<"$srcdir"/powerpc64/powerpc-defs.m4>])
+-			  ASMPATH=powerpc64;;
+-    i[[56]]86-*-* | k[[78]]*-*-* | athlon*-*-* | pentiumpro-*-* | \
+-    pentium2-*-* | viac3*-*-* | i686-apple-darwin*)
+-    		   	  ASMPATH=athlon;;
+-    *) AC_MSG_ERROR([[asm redc not available on this machine $host]]);;
+-  esac
+-fi
+-
+-if test "x$enable_asm_redc" = xyes; then
+-# do the necessary definitions and includes
+-  AC_DEFINE([USE_ASM_REDC],1,[Define to 1 to use asm redc])
+-  test "x$CCAS" != x || CCAS="$CC -c"
+-  AC_SUBST([CCAS])
+-  GMP_PROG_M4
+-  GMP_ASM_UNDERSCORE
+-  GMP_ASM_TEXT
+-  GMP_ASM_GLOBL
+-  GMP_ASM_TYPE 
+-
+-  case $host in
+-    *-*-mingw32) GMP_DEFINE([WINDOWS64_ABI], 1)
+-                 AC_DEFINE([WINDOWS64_ABI], 1,[Define to 1 if x86_64 mulredc*() functions should be called with Windows ABI]);;
+-    *) ;;
+-  esac
+-
+-  case $host in
+-    pentium3-*-*)
+-      echo "WARNING: Your processor is recognized as Pentium3."
+-      echo "         The asm code uses SSE2, and therefore it might"
+-      echo "         fail if your proc is indeed a P3, and not a"
+-      echo "         Pentium M. If you have compilation problems,"
+-      echo "         consider using --disable-asm-redc." ;;
+-    *)
+-  esac
+-fi
+-AM_CONDITIONAL([ENABLE_ASM_REDC], [test "x$enable_asm_redc" = xyes])
+-
+-
+-############################
+-# Enable SSE2 instructions #
+-############################
+-# Test if we should use SSE2 instructions and if the cpu supports them
+-if test "x$enable_sse2" = "x"; then
+-dnl Default: if we build for Pentium 4, enable SSE2 code for the NTT
+-dnl Some SSE2 enabled cpus are identified as i686, we enables SSE2 
+-dnl for them by default and let the tests below check if it works
+-  case $host in
+-    pentium4-*-* | viac7-*-* | i686-*-* | i786-*-*) 
+-      enable_sse2=yes
+-    ;;
+-  esac
+-fi
+-# If the necessary predefines (__GNUC__ or __ICL, and __i386__)
+-# are not set, SSE2 will never be compiled in, and we switch off
+-# the SSE2 flag
+-if test "x$enable_sse2" = xyes; then
+-  AC_PREPROC_IFELSE([AC_LANG_PROGRAM([
+-#if !defined(__GNUC__) && !defined(__ICL) || !defined(__i386__)
+-#error
+-#IRIXdoesnotexitaterrordirective
+-#endif])], [], dnl Necessary predefines are present. Nothing to do
+-  [ dnl Necessary predefines are not present. Switch off SSE2
+-    AC_MSG_NOTICE([Not using GCC or ICC, or not a 32-bit x86. SSE2 disabled])
+-    enable_sse2=no])
+-fi
+-if test "x$enable_sse2" = xyes; then
+-  # See if we need -msse2 to enable SSE2 instructions
+-  AC_MSG_CHECKING([for SSE2 support])
+-  m4_define([SSE2_TEST_PROG], [AC_LANG_PROGRAM([], dnl
+-[#if (defined(__GNUC__) || defined(__ICL)) && defined(__i386__)
+-/* On some machines, a program without constraints may pass without -msse2 but
+-   those with constraints in spv.c fail, thus we test with constraints here. */
+-asm volatile ("pmuludq %%xmm2, %%xmm0" : : :"%xmm0");
+-#else
+-#error
+-#IRIXdoesnotexitaterrordirective
+-#endif])])
+-  AC_COMPILE_IFELSE([SSE2_TEST_PROG], dnl
+-   [ dnl SSE2 works, nothing to be done
+-     AC_MSG_RESULT([yes])], dnl
+-   [ dnl SSE2 does not work, try again with -msse2
+-    OLDCFLAGS="$CFLAGS"
+-    CFLAGS="$CFLAGS -msse2"
+-    AC_COMPILE_IFELSE([SSE2_TEST_PROG], dnl
+-      [ dnl works now, keep CFLAGS like this
+-        AC_MSG_RESULT([yes, with -msse2])], dnl
+-      [ dnl still didn't work, switch off SSE2
+-       CFLAGS="$OLDCFLAGS"
+-       enable_sse2=no
+-       AC_MSG_RESULT([not supported, SSE2 disabled])
+-      ])])
+-fi
+-if test "x$enable_sse2" = xyes; then
+-  AC_DEFINE([HAVE_SSE2],1,[Define to 1 to enable SSE2 instructions in NTT code])
+-fi
+-
+-########################
+-# Add GWNUM if desired #
+-########################
+-dnl If user wants GWNUM, check if the file exists (either as .a or .lib)
+-if test "x$with_gwnum" != "x"; then
+-  if test "x$enable_openmp" = xyes; then
+-      AC_MSG_ERROR([Woltman's GWNUM currently cannot be used together with OpenMP])
+-  fi
+-  AC_CHECK_FILE([$with_gwnum/gwnum.a], [
+-    AC_DEFINE([HAVE_GWNUM], 1, [Define to 1 if gwnum.a or gwnum.lib exist])
+-    GWLIB="$with_gwnum/gwnum.a -lpthread"
+-    CPPFLAGS="$CPPFLAGS -I$with_gwnum"
+-  ],[
+-    AC_CHECK_FILE([$with_gwnum/gwnum.lib], [
+-      AC_DEFINE([HAVE_GWNUM], 1, [Define to 1 if gwnum.a or gwnum.lib exist])
+-      GWLIB="$with_gwnum/gwnum.lib -lpthread"
+-      CPPFLAGS="$CPPFLAGS -I$with_gwnum"
+-    ],[
+-      with_gwnum=
+-      AC_MSG_ERROR([Woltman's GWNUM library not found])
+-    ])
+-  ])
+-fi
+-AM_CONDITIONAL([WITH_GWNUM], [test "x$with_gwnum" != "x"])
+-
+-
+-dnl Checks for header files.
+-AC_FUNC_ALLOCA
+-AC_HEADER_STDC
+-AC_CHECK_HEADERS([math.h limits.h malloc.h strings.h sys/time.h unistd.h io.h signal.h fcntl.h])
+-AC_CHECK_HEADERS([windows.h])
+-AC_CHECK_HEADERS([ctype.h sys/types.h sys/resource.h])
+-
+-dnl Checks for library functions that are not in GMP
+-AC_FUNC_STRTOD
+-
+-dnl Check functions in the math library
+-AC_CHECK_LIB(m,pow,,AC_MSG_ERROR(required function missing))
+-AC_CHECK_LIB(m,floor,,AC_MSG_ERROR(required function missing))
+-AC_CHECK_LIB(m,sqrt,,AC_MSG_ERROR(required function missing))
+-AC_CHECK_LIB(m,fmod,,AC_MSG_ERROR(required function missing))
+-AC_CHECK_LIB(m,cos)
+-
+-dnl Check for GSL but don't add it to LIBS, since only rho uses it and
+-dnl we don't want all other binaries to depend on it. 
+-dnl If found, pass link flags to Makefile via GSL_LD_FLAGS
+-GSL_LD_FLAGS=
+-dnl Check if "-lgslcblas" works. If yes, check if "-lgsl -lgslcblas" works.
+-dnl If both work, put "-lgsl -lgslcblas" in GSL_LD_FLAGS
+-AC_CHECK_LIB([gslcblas],[cblas_dgemm], dnl
+- [AC_CHECK_LIB([gsl],[gsl_blas_dgemm], dnl
+-  [AC_DEFINE([HAVE_LIBGSL],1,[Define to 1 if you have the `gsl' library (-lgsl).])
+-   AC_DEFINE([HAVE_LIBGSLCBLAS],1,[Define to 1 if you have the `gslcblas' library (-lgslcblas).])
+-   GSL_LD_FLAGS="-lgsl -lgslcblas"], [], dnl
+-   dnl Here comes the "OTHER-LIBRARIES" field for AC_CHECK_LIB [gsl]:
+-   [-lgslcblas])])
+-
+-AC_CHECK_FUNCS([isascii memset strchr strlen strncasecmp strstr], [], [AC_MSG_ERROR([required function missing])])
+-AC_CHECK_FUNCS([access unlink], [], [AC_MSG_ERROR([required function missing])])
+-AC_CHECK_FUNCS([isspace isdigit isxdigit], [], [AC_MSG_ERROR([required function missing])])
+-AC_CHECK_FUNCS([time ctime], [], [AC_MSG_ERROR([required function missing])])
+-AC_CHECK_FUNCS([setpriority nice gethostname gettimeofday getrusage memmove signal fcntl fileno])
+-
+-dnl FIXME: which win32 library contains these functions?
+-dnl AC_CHECK_FUNCS([GetCurrentProcess GetProcessTimes])
+-AC_CHECK_FUNCS([malloc_usable_size])
+-
+-
+-dnl If we use GCC and user has not specified his own CFLAGS, 
+-dnl add some warning flags, avoiding duplication
+-if test "x$GCC" = xyes && test "x$user_redefine_cc" != xyes; then
+-  case $CFLAGS in
+-    "-pedantic "* | *" -pedantic "* | *" -pedantic") ;;
+-    *) CFLAGS="-pedantic $CFLAGS"
+-  esac
+-  case $CFLAGS in
+-    "-Wundef "* | *" -Wundef "* | *" -Wundef") ;;
+-    *) CFLAGS="-Wundef $CFLAGS"
+-  esac
+-  case $CFLAGS in
+-    "-Wall "* | *" -Wall "* | *" -Wall") ;;
+-    *) CFLAGS="-Wall $CFLAGS"
+-  esac
+-  case $CFLAGS in
+-    "-W "* | *" -W "* | *" -W") ;;
+-    *) CFLAGS="-W $CFLAGS"
+-  esac
+-#  CFLAGS="-Wall -W -Wundef -pedantic $CFLAGS"
+-fi
+-
+-
+-dnl Find GMP and do some sanity checks
+-dnl Tests concerning the include directories.
+-if test -d "$with_gmp_include"; then
+-  dnl AC_CHECK_HEADERS and AC_PREPROC_IFELSE uses CPPFLAGS but not CFLAGS
+-  CPPFLAGS="-I$with_gmp_include $CPPFLAGS"
+-else
+-  with_gmp_include=
+-fi
+-AC_CHECK_HEADERS([gmp.h], [], AC_MSG_ERROR([required header file missing]))
+-
+-dnl This needs to find only the header file so we can do it here, before
+-dnl we start looking for libgmp.a
+-AC_MSG_CHECKING([for recent GMP])
+-AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
+-#include <gmp.h>
+-#if (__GNU_MP_VERSION <= 4)
+-#error
+-#IRIXdoesnotexitaterrordirective
+-#endif
+-]])],
+-  [AC_MSG_RESULT(yes)],
+-  [AC_MSG_RESULT(no)
+-   AC_MSG_ERROR([GMP 5.0.0 or newer is required])]
+-)
+-
+-dnl Figure out if GMP is MPIR
+-AC_MSG_CHECKING([if GMP is MPIR])
+-AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
+-#include <gmp.h>
+-#ifndef __MPIR_VERSION
+-#error
+-#IRIXdoesnotexitaterrordirective
+-#endif
+-]])],
+-  [AC_MSG_RESULT(yes)
+-   AC_DEFINE([HAVE_MPIR],1,[Define to 1 if GMP is MPIR])],
+-  [AC_MSG_RESULT(no)])
+-
+-dnl Now choose how to link the GMP library. If we can, we'd prefer to
+-dnl link it statically since that makes for faster function calls. To
+-dnl link it statically, we mustn't build a dynamic GMP-ECM library and
+-dnl we need to find the libgmp.a file. At the moment, we only look for
+-dnl it at the path specified by the user (i.e. --with-gmp) but make no
+-dnl attempt to find it in the default system lib directories.
+-
+-dnl If GMP is linked statically, we pass its path/filename to the Makefile
+-dnl via GMPLIB, otherwise -lgmp is passed via GMPLIB.
+-dnl The search path to the dynamic GMP library is added to LDFLAGS, 
+-dnl if GMP is not specified by full pathname.
+-
+-GMPLDFLAGS=""
+-if test -d "$with_gmp_lib"; then
+-  GMPLDFLAGS="-L$with_gmp_lib"
+-fi
+-GMPLIB="-lgmp"
+-if test "x$enable_shared" != xyes; then
+-  if test -r "$with_gmp_lib/libgmp.a"; then
+-    GMPLIB="$with_gmp_lib/libgmp.a"
+-    dnl Don't need -L flag since we give full path to libgmp.a
+-    GMPLDFLAGS=""
+-  fi
+-fi
+-AC_SUBST([GMPLIB])
+-LDFLAGS="$LDFLAGS $GMPLDFLAGS"
+-
+-
+-dnl Test linking against GMP. This tests, for example, that the compiler
+-dnl and GMP agree on the ABI (32 or 64 bit). AC_CHECK_LIB() does not work,
+-dnl as it requires linking the library with -lgmp, whereas we may want
+-dnl to specify it by full pathname as we do in the Makefile
+-
+-AC_MSG_CHECKING([whether we can link against GMP])
+-LIBS_BACKUP="$LIBS"
+-LIBS="$LIBS $GMPLIB"
+-AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+-#ifdef HAVE_GMP_H
+-#include <gmp.h>
+-#endif]],[[
+-  mpz_t t;
+-  mpz_init(t);
+-  mpz_clear(t);
+-  return 0;
+-]])], [AC_MSG_RESULT(yes)],
+-   [AC_MSG_RESULT(no)
+-    AC_MSG_ERROR([Could not link against GMP library.])]
+-)
+-
+-dnl Check for corresponding 'gmp.h' and libgmp.a
+-dnl This requires running a program linked against GMP, 
+-dnl so is done after the link-only test.
+-AC_MSG_CHECKING([if gmp.h version and libgmp version are the same])
+-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+-#include <stdio.h>
+-#include <string.h>
+-#include <gmp.h>
+-]],[[
+-char buffer[100];
+-if (__GNU_MP_VERSION == 4 && __GNU_MP_VERSION_MINOR <= 2 && 
+-    __GNU_MP_VERSION_PATCHLEVEL == 0)
+-  sprintf (buffer, "%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR);
+-else
+-  sprintf (buffer, "%d.%d.%d", __GNU_MP_VERSION, __GNU_MP_VERSION_MINOR,
+-   __GNU_MP_VERSION_PATCHLEVEL);
+-printf ("(%s/%s) ", buffer, gmp_version);
+-return strcmp (buffer, gmp_version);
+-]])], [AC_MSG_RESULT([yes])],
+-   [AC_MSG_RESULT([no])
+-    AC_MSG_ERROR(['gmp.h' and 'libgmp' have different versions, you have to reinstall GMP properly.])],
+-   [AC_MSG_RESULT([cross-compiling: cannot test])]
+-)
+-
+-AC_CHECK_FUNCS([__gmpn_add_nc __gmpn_mod_34lsub1 __gmpn_redc_1 __gmpn_redc_2])
+-AC_CHECK_FUNCS([__gmpn_mullo_n __gmpn_redc_n __gmpn_preinv_mod_1])
+-
+-LIBS="$LIBS_BACKUP"
+-
+-dnl Check if the compiler understands some __attribute__ directives
+-AC_MSG_CHECKING([whether compiler knows __attribute__((hot))])
+-dnl The AC_LANG_WERROR directive causes configure to consider a test 
+-dnl compilation unsuccessful if it produced any output on stderr.
+-dnl We use it since unknown __attribute__ only cause a warning, not an 
+-dnl error. Unfortunately there seems to be no way to switch it off again, 
+-dnl so this test is at the end of the configure script
+-AC_LANG_WERROR
+-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([void foo() __attribute__ ((hot));
+-void foo() {return;}], [foo()])],
+-[AC_DEFINE([ATTRIBUTE_HOT],[__attribute__ ((hot))], [How to specify hot-spot attribute, if available])
+- AC_MSG_RESULT([yes])
+-],
+-[AC_DEFINE([ATTRIBUTE_HOT],[ ], [How to specify hot-spot attribute, if available])
+- AC_MSG_RESULT([no])
+-])
+-
+-dnl Check for xsltproc
+-AC_CHECK_PROG([XSLTPROC],[xsltproc],[xsltproc])
+-if test "x$XSLTPROC" != x; then
+-  AC_MSG_CHECKING([for docbook.xsl])
+-  if test "x$XSLDIR" = x; then
+-    if test -d "/usr/local/share/sgml/docbook/xsl-stylesheets"; then
+-      XSLDIR="/usr/local/share/sgml/docbook/xsl-stylesheets"
+-    elif test -d "/usr/share/sgml/docbook/xsl-stylesheets"; then
+-      XSLDIR="/usr/share/sgml/docbook/xsl-stylesheets"
+-    elif test -d "/usr/local/share/docbook/"; then
+-      XSLDIR="/usr/local/share/docbook/"
+-    elif test -d "/usr/share/docbook/"; then
+-      XSLDIR="/usr/share/docbook/"
+-    fi
+-  fi
+-  if test -r "$XSLDIR/manpages/docbook.xsl"; then
+-    AC_MSG_RESULT([yes])
+-    make_manpage="yes"
+-  else
+-    AC_MSG_RESULT([no])
+-  fi
+-fi  
+-AM_CONDITIONAL([MAKE_MANPAGE], [test "x$make_manpage" = xyes])
+-
+-dnl Check for valgrind. GMP-ECM uses exit code 1 to signal error,
+-dnl so we make valgrind use that code to signal error, too
+-AC_CHECK_PROG([VALGRIND], [valgrind], [valgrind -q --error-exitcode=1])
+-
+-case $host in
+-  athlon*-*-*) config_arch="athlon" ;;
+-  x86_64*-*-*) config_arch="athlon64" ;;
+-  pentium3-*-*) config_arch="pentium3" ;;
+-  pentium4-*-*) config_arch="pentium4" ;;
+-  pentium-m-*-*) config_arch="pentium-m" ;;
+-  alphaev6*-*-*) config_arch="alpha-ev6" ;;
+-  alphaev56*-*-*) config_arch="alpha-ev56" ;;
+-  alphaev5*-*-*) config_arch="alpha-ev5" ;;
+-  powerpc7450-*-*) config_arch="powerpc7450" ;;
+-  powerpc-apple-darwin* | powerpc64-*-*) config_arch="powerpc970" ;;
+-  mips64el-*-*) config_arch="mips64el" ;;
+-  armv5tel-*-*) config_arch="armv5tel" ;;
+-  sparc64-*-*) config_arch="sparc64" ;;
+-  ia64-*-*) config_arch="ia64" ;;
+-  hppa2.0-*-*) config_arch="hppa2.0" ;;
+-  *) config_arch="default" ;;
+-esac
+-
+-# See if this is a Core 2, if we have /proc/cpuinfo 
+-core2warn=no
+-if test x"$config_arch" = xathlon64; then
+-  if test -f /proc/cpuinfo; then
+-    if $EGREP -q "Core\(TM\)2" /proc/cpuinfo; then
+-      config_arch=core2
+-    elif $EGREP -q "Core\(TM\) i5" /proc/cpuinfo; then
+-      config_arch=corei5
+-    fi;
+-  else
+-    # No /proc/cpuinfo, tell user about ecm-params.h.core2
+-    core2warn=yes
+-  fi;
+-fi
+-
+-# See if this is a Pentium 4, if we have /proc/cpuinfo 
+-pentium4warn=no
+-if test x"$config_arch" = xdefault; then
+-  if test -f /proc/cpuinfo; then
+-    if $EGREP -q "Pentium\(R\) 4" /proc/cpuinfo; then
+-      config_arch=pentium4
+-    fi;
+-  else
+-    # No /proc/cpuinfo, tell user about ecm-params.h.pentium4
+-    pentium4warn=yes
+-  fi;
+-fi
+-
+-LIBS="$LIBS $GWLIB"
+-
+-GMP_FINISH
+-AC_CONFIG_FILES([Makefile athlon/Makefile pentium4/Makefile x86_64/Makefile powerpc64/Makefile build.vc10/Makefile build.vc10/assembler/Makefile build.vc10/ecm/Makefile build.vc10/libecm/Makefile build.vc10/tune/Makefile build.vc10/bench_mulredc/Makefile])
+-AC_CONFIG_LINKS([ecm-params.h:ecm-params.h.$config_arch])
+-MUL_FFT_PARAMS="mul_fft-params.h.$config_arch"
+-if ! test -f "$MUL_FFT_PARAMS"
+-then
+-  MUL_FFT_PARAMS="mul_fft-params.h.default"
+-fi
+-AC_CONFIG_LINKS([mul_fft-params.h:"$MUL_FFT_PARAMS"])
+-
+-AC_SUBST([XSLDIR])
+-AC_SUBST([ASMPATH])
+-AC_SUBST([GSL_LD_FLAGS])
+-
+-AC_OUTPUT
+-
+-AC_MSG_NOTICE([Configuration:])
+-AC_MSG_NOTICE([Build for host type $host])
+-
+-AC_MSG_NOTICE([CC=$CC, CFLAGS=$CFLAGS])
+-AC_MSG_NOTICE([Linking GMP with $GMPLIB])
+-
+-if test "x$enable_asm_redc" = xyes; then
+-  AC_MSG_NOTICE([Using asm redc code from directory $ASMPATH])
+-else
+-  AC_MSG_NOTICE([Not using asm redc code])
+-fi
+-
+-if test "x$enable_sse2" = xyes; then
+-  AC_MSG_NOTICE([Using SSE2 instructions in NTT code])
+-else
+-  AC_MSG_NOTICE([Not using SSE2 instructions in NTT code])
+-fi
+-
+-if test "x$with_gwnum" != "x"; then
+-  AC_MSG_NOTICE([Linking with George Woltman's GWNUM])
+-fi
+-
+-if test "x$enable_assert" = xyes; then
+-  AC_MSG_NOTICE([Assertions enabled])
+-else
+-  AC_MSG_NOTICE([Assertions disabled])
+-fi
+-
+-if test "x$enable_shellcmd" = xyes; then
+-  AC_MSG_NOTICE([Shell command execution enabled])
+-else
+-  AC_MSG_NOTICE([Shell command execution disabled])
+-fi
+-
+-if test "x$enable_openmp" = xyes; then
+-  AC_MSG_NOTICE([OpenMP enabled])
+-else
+-  AC_MSG_NOTICE([OpenMP disabled])
+-fi
+-
+-if test "x$enable_memory_debug" = xyes; then
+-  AC_MSG_NOTICE([Memory debugging enabled])
+-else
+-  AC_MSG_NOTICE([Memory debugging disabled])
+-fi
+-
+-if test x"$core2warn" = xyes; then
+-  AC_MSG_NOTICE([Your cpu was detected as x86_64; if it is a Core 2, please either use the ecm-params.h.core2 file by executing the commands:])
+-  AC_MSG_NOTICE([rm ecm-params.h])
+-  AC_MSG_NOTICE([ln -s ecm-params.h.core2 ecm-params.h])
+-  AC_MSG_NOTICE([or generate a custom ecm-params.h file for your system as described in INSTALL.])
+-fi
+-
+-if test x"$pentium4warn" = xyes; then
+-  AC_MSG_NOTICE([Your cpu was detected as default; if it is a Pentium 4, please either use the ecm-params.h.pentium4 file by executing the commands:])
+-  AC_MSG_NOTICE([rm ecm-params.h])
+-  AC_MSG_NOTICE([ln -s ecm-params.h.pentium4 ecm-params.h])
+-  AC_MSG_NOTICE([or generate a custom ecm-params.h file for your system as described in INSTALL.])
+-fi
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -39,8 +39,8 @@
+ # Link the asm redc code (if we use it) into libecm.la
+ libecm_la_CPPFLAGS = $(MULREDCINCPATH)
+ libecm_la_CFLAGS = $(OPENMP_CFLAGS)
+-libecm_la_LDFLAGS = '-version-info 0:0:0'
+-libecm_la_LIBADD = $(MULREDCLIBRARY)
++libecm_la_LDFLAGS = -version-info 0:0:0
++libecm_la_LIBADD = $(MULREDCLIBRARY) $(GMPLIB)
+ 
+ bin_PROGRAMS = ecm
+ noinst_PROGRAMS = tune ecmfactor bench_mulredc
diff --git a/debian/patches/upstream-libtoolization-version_script.patch b/debian/patches/upstream-libtoolization-version_script.patch
new file mode 100644
index 0000000..119326d
--- /dev/null
+++ b/debian/patches/upstream-libtoolization-version_script.patch
@@ -0,0 +1,78 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -13,6 +13,9 @@
+ AM_MAINTAINER_MODE([])
+ AC_CANONICAL_HOST
+ 
++# check linker script support
++gl_LD_VERSION_SCRIPT
++
+ dnl Copied from MPFR 2.4.2:
+ unset GMP_CFLAGS GMP_CC user_redefine_cc
+ dnl Check if user request his CC and CFLAGS
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,5 +1,9 @@
+ ## Process this file with automake to produce Makefile.in
+ 
++## Library versioning (C:R:A == current:revision:age)
++export LIBECM_LT_VERSION = 0:0:0
++
++
+ ACLOCAL_AMFLAGS = -I m4
+ 
+ # to not install libecm.la, we could write noinst_LTLIBRARIES instead of
+@@ -39,7 +43,11 @@
+ # Link the asm redc code (if we use it) into libecm.la
+ libecm_la_CPPFLAGS = $(MULREDCINCPATH)
+ libecm_la_CFLAGS = $(OPENMP_CFLAGS)
+-libecm_la_LDFLAGS = '-version-info 0:0:0'
++libecm_la_LD_VERSION_SCRIPT =
++if HAVE_LD_VERSION_SCRIPT
++libecm_la_LD_VERSION_SCRIPT += -Wl,--version-script=ecm.map
++endif
++libecm_la_LDFLAGS = -version-info $(LIBECM_LT_VERSION) $(libecm_la_LD_VERSION_SCRIPT)
+ libecm_la_LIBADD = $(MULREDCLIBRARY)
+ 
+ bin_PROGRAMS = ecm
+@@ -90,6 +98,11 @@
+ noinst_HEADERS = ecm-impl.h ecm-gmp.h ecm-ecm.h sp.h longlong.h ecm-params.h \
+                  mpmod.h
+ 
++if MAINTAINER_MODE
++BUILT_SOURCES = ecm.map
++ecm.map: $(include_HEADERS)
++endif
++
+ EXTRA_DIST = test.pm1 test.pp1 test.ecm README.lib INSTALL-ecm ecm.xml \
+              ecm-params.h.alpha-ev5 ecm-params.h.athlon64 \
+              ecm-params.h.default ecm-params.h.alpha-ev6 \
+@@ -101,11 +114,13 @@
+              ecm-params.h.hppa2.0 ecm-params.h.alpha-ev56 \
+              ecm-params.h.core2 ecm-params.h.corei5 \
+              mul_fft-params.h.athlon64 mul_fft-params.h.pentium3 \
+-             mul_fft-params.h.default mul_fft-params.h.pentium4
++             mul_fft-params.h.default mul_fft-params.h.pentium4 \
++						 $(BUILT_SOURCES)
+ 
+ DIST_SUBDIRS = athlon pentium4 x86_64 powerpc64 build.vc10
+ 
+ DISTCLEANFILES = config.m4
++MAINTAINERCLEANFILES = $(BUILT_SOURCES)
+ 
+ ecm-params:	tune$(EXEEXT)
+ 		@echo Optimising parameters for your system, please be patient.
+@@ -147,3 +162,13 @@
+ ecm.1: $(srcdir)/ecm.xml
+ 	xsltproc -o ecm.1 $(XSLDIR)/manpages/docbook.xsl $(srcdir)/ecm.xml
+ endif
++
++%.map :
++	_MAPNAME=$$(echo $(patsubst %.map,%,$@) | tr '[a-z]' '[A-Z]') ; \
++	printf "LIB%s_%d.%d.%d {\nglobal:\n" $$_MAPNAME $(subst :, ,$(LIBECM_LT_VERSION)) > $@ ;
++	$(CPROTO) -I$(top_srcdir) -X 1 -f 0 $^ | \
++			sed '/^\/\*/d;s/(\*\([_a-z0-9]*\))/\1/g;s/()//g;s/\*//g' | rev | cut -d ' ' -f1 | rev | sort -u \
++		>> $@
++	printf "\nlocal: *;\n};\n" >> $@
++
++CPROTO = /usr/bin/cproto
diff --git a/debian/rules b/debian/rules
index 270a79b..ca94b35 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,6 +1,26 @@
 #!/usr/bin/make -f
+
+default:
+	@uscan --no-conf --dehs --report || true
+
 %:
-	dh $@ --with autoreconf
+	dh $@ --with autoreconf --builddirectory=_build --parallel
 
 override_dh_auto_configure:
-	dh_auto_configure -a -- --enable-shared
+	dh_auto_configure -a -- --enable-shared --enable-maintainer-mode
+
+override_dh_installdocs:
+	dh_installdocs -pgmp-ecm --link-doc=libecm0
+	dh_installdocs -plibecm0-dev --link-doc=libecm0-dev-common
+	dh_installdocs -plibecm0-dbg --link-doc=libecm0
+	dh_installdocs -plibecm-dev --link-doc=libecm0-dev
+	dh_installdocs --remaining-packages
+
+override_dh_compress:
+	dh_compress -Xexamples
+
+override_dh_strip:
+	dh_strip --dbg-package=libecm0-dbg
+
+get-orig-source:
+	uscan --no-conf --download-current-version --compression xz --verbose
diff --git a/debian/source/lintian-overrides b/debian/source/lintian-overrides
new file mode 100644
index 0000000..8243a75
--- /dev/null
+++ b/debian/source/lintian-overrides
@@ -0,0 +1,3 @@
+# Upstream source ball is not (yet) signed: request to the upstream team
+# was sent -- Jerome Benoit <calculus at rrezozer.net> Sun, 31 May
+debian-watch-may-check-gpg-signature
diff --git a/debian/tests/build-examples b/debian/tests/build-examples
new file mode 100755
index 0000000..c441629
--- /dev/null
+++ b/debian/tests/build-examples
@@ -0,0 +1,11 @@
+#!/bin/sh
+# autopkgtest check: build program examples
+set -ue
+cd $ADTTMP
+
+cp -prd /usr/share/doc/libecm0-dev/examples .
+cd examples
+
+make
+
+exit 0
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..f90aa8d
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,5 @@
+Tests: build-examples
+Depends: libecm0-dev, build-essential
+
+Tests: make-longcheck
+Depends: gmp-ecm, make, valgrind
diff --git a/debian/tests/make-longcheck b/debian/tests/make-longcheck
new file mode 100755
index 0000000..6ef6218
--- /dev/null
+++ b/debian/tests/make-longcheck
@@ -0,0 +1,37 @@
+#!/bin/sh
+# autopkgtest check based on upstream longcheck check ($ make longcheck)
+# written for Debian by Jerome Benoit <calculus at rezozer.net> on behalf of the Debian Science Team
+# copyright: 2015 Jerome Benoit <calculus at rezozer.net>
+# distributed under the terms and conditions of GPL version 3 or later
+
+set -ue
+
+cat << EOF > $ADTTMP/Makefile
+
+abs_top_pkgdir = $PWD
+
+GMPECM = /usr/bin/ecm
+VALGRIND = /usr/bin/valgrind --quiet --error-exitcode=1
+
+LISTOFMETHODS = pp1 pm1 ecm
+LISTOFVARIANTS = + -no-ntt -modmuln -redc -mpzmod
+
+
+default:
+
+longcheck: \$(foreach _m,\$(LISTOFMETHODS),\$(foreach _v,\$(LISTOFVARIANTS),longcheck+\$(_m)+\$(_v)))
+	@
+
+longcheck+%:
+	\$(abs_top_pkgdir)/test.\$(word 2,\$(subst +, ,\$@)) "\$(VALGRIND) \$(GMPECM) \$(word 3,\$(subst +, ,\$@))"
+
+EOF
+
+NJOBS=$(getconf _NPROCESSORS_ONLN)
+
+LLAVG=$(( $NJOBS * 175 ))
+LLAVG=$(( $LLAVG / 100 ))
+
+make -C $ADTTMP -k -j $NJOBS -l $LLAVG longcheck
+
+exit 0
diff --git a/debian/watch b/debian/watch
index 030e46b..ec7ae49 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,2 +1,4 @@
 version=3
-https://gforge.inria.fr/frs/?group_id=135   https://gforge.inria.fr/frs/download.php/.*/ecm-(.+).tar.gz
+opts=dversionmangle=s/\+ds//,repacksuffix=+ds,uversionmangle=s/-(rc\d*)$/~$1/ \
+https://gforge.inria.fr/frs/?group_id=135 \
+	(?:|.*/)ecm(?:[_\-]v?|)(\d[^\s/]*)\.(?:tar\.xz|tar\.bz2|tar\.gz)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/gmp-ecm.git



More information about the debian-science-commits mailing list