File ntl-automake.diff of Package ntl

From: Jan Engelhardt <jengelh@medozas.de>
Date: 2011-09-15 16:30:59.937789147 +0200 (initial production)
Upstream: sent 2012-12-06 04:02:00 +0100 (initial send)
Date: 2015-05-09 00:22 +0200 (update for 9.2)

---
 Makefile.am         |   15 ++++++
 autogen.sh          |    5 ++
 configure.ac        |   94 +++++++++++++++++++++++++++++++++++++++++
 include/Makefile.am |  101 ++++++++++++++++++++++++++++++++++++++++++++
 include/NTL/g_lip.h |    1 
 src/Makefile.am     |  118 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 333 insertions(+), 1 deletion(-)

Index: ntl-9.2.0/Makefile.am
===================================================================
--- /dev/null
+++ ntl-9.2.0/Makefile.am
@@ -0,0 +1,15 @@
+# -*- Makefile -*-
+
+ACLOCAL_AMFLAGS = -I m4
+
+SUBDIRS = . include src
+
+BUILT_SOURCES = include/NTL/config.h
+CLEANFILES = include/NTL/config.h
+
+pkgincludedir = ${includedir}/NTL
+pkginclude_HEADERS = include/NTL/config.h
+
+include/NTL/config.h: config.h
+	mkdir -p include/NTL
+	grep 'define NTL_' <$< >$@
Index: ntl-9.2.0/autogen.sh
===================================================================
--- /dev/null
+++ ntl-9.2.0/autogen.sh
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+mkdir -p m4;
+autoreconf -fi;
+rm -Rf autom4te.cache;
Index: ntl-9.2.0/configure.ac
===================================================================
--- /dev/null
+++ ntl-9.2.0/configure.ac
@@ -0,0 +1,94 @@
+AC_INIT([ntl], [8.1.2])
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_MACRO_DIR([m4])
+AC_PROG_INSTALL
+AM_INIT_AUTOMAKE([-Wall foreign subdir-objects])
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_PROG_CXX
+m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
+LT_INIT
+AC_DISABLE_STATIC
+
+
+AH_TEMPLATE([NTL_STD_CXX], [Use this flag if you want to use the Standard C++ version of NTL. In this version, all of NTL is wrapped inside the NTL namespace, and standard headers like cstdlib are used instead of stdlib.h.])
+AH_TEMPLATE([NTL_THREADS], [Enable using C++11 threads])
+AH_TEMPLATE([NTL_PSTD_NNS], [Set if NTL library components are to be wrapped in namespace NTL.])
+AH_TEMPLATE([NTL_PSTD_NHF], [Set if you want to use the new header files cstdlib, etc.])
+AH_TEMPLATE([NTL_PSTD_NTN], [Set if you want to use the nothrow version of new.])
+AH_TEMPLATE([NTL_GMP_LIP], [Use this flag if you want to use GMP as the long integer package.])
+AH_TEMPLATE([NTL_GMP_HACK], [Use this flag if you want to use GMP, but keep compatibility with older NTL codes.])
+AH_TEMPLATE([NTL_GF2X_LIB], [Use this flag if you want to use the gf2x library for faster GF2X arithmetic.])
+AH_TEMPLATE([NTL_LONG_LONG_TYPE], [This will be used to declare double-word signed integer types. If left unset, will default to autodetect.])
+AH_TEMPLATE([NTL_UNSIGNED_LONG_LONG_TYPE], [This will be used to declare double-word unsigned integer types. If left unset, will default to autodetect.])
+AH_TEMPLATE([NTL_CXX_ONLY], [Compile using C++ only])
+AH_TEMPLATE([NTL_CLEAN_INT], [This will disallow the use of some non-standard integer arithmetic that may improve performance somewhat.])
+AH_TEMPLATE([NTL_CLEAN_PTR], [This will disallow the use of some non-standard pointer arithmetic that may improve performance somewhat.])
+AH_TEMPLATE([NTL_RANGE_CHECK], [This will generate vector subscript range-check code.])
+AH_TEMPLATE([NTL_NO_INIT_TRANS], [Without this flag, NTL uses a special code sequence to avoid copying large objects in return statements.])
+AH_TEMPLATE([NTL_X86_FIX], [Forces the x86 FP fix])
+AH_TEMPLATE([NTL_NO_X86_FIX], [Forces no x86 FP fix])
+
+AC_DEFINE([NTL_STD_CXX], [1])
+AC_DEFINE([NTL_PSTD_NHF], [1])
+
+shorthost=""
+case "$host" in
+	*-mingw*)
+		shorthost="mingw";;
+esac
+AM_CONDITIONAL([MINGW], [test "$shorthost" = mingw])
+
+AC_MSG_CHECKING([for C++11 support])
+>conftest.c
+has_cxx11=no
+my_CXXFLAGS=""
+AS_IF([$CC -std=c++11 -c conftest.c >/dev/null 2>/dev/null], [
+	AC_MSG_RESULT([yes])
+	has_cxx11=yes
+	my_CXXFLAGS="$my_CXXFLAGS -std=c++11"
+], [
+	AC_MSG_RESULT([no])
+	has_cxx11=no
+])
+
+# threads
+AC_ARG_ENABLE([threads],
+	AS_HELP_STRING([--disable-threads], [[Do not use C++11 threads [automatic]]]),
+	[with_threads="$enableval"],
+	[with_threads=yes])
+dnl mingw's thread implementation is not complete it seems.
+AS_IF([test "$shorthost" = mingw], [with_threads=no])
+AS_IF([test "$has_cxx11" != yes], [with_threads=no])
+AC_MSG_CHECKING([whether to build with C++11 threads])
+AC_MSG_RESULT([$with_threads])
+AS_IF([test "$with_threads" != no], [AC_DEFINE([NTL_THREADS], [1])])
+
+# gmp
+AC_ARG_WITH([gmp], AS_HELP_STRING([--with-gmp], [Build against GMP]),
+	[with_gmp="$withval"],
+	[
+		AC_LANG_PUSH([C++])
+		AC_CHECK_HEADERS([gmpxx.h], [with_gmp=yes], [with_gmp=no])
+		AC_LANG_POP([C++])
+	])
+AC_MSG_CHECKING([whether to build with GMP])
+AC_MSG_RESULT([$with_gmp])
+AM_CONDITIONAL([WITH_GMP], [test "$with_gmp" != no])
+AS_IF([test "$with_gmp" != no], [AC_DEFINE([NTL_GMP_LIP], [1])])
+
+# gf2x
+AC_ARG_WITH([gf2x], AS_HELP_STRING([--with-gf2x], [Build against GF2X]),
+	[with_gf2x="$withval"],
+	[
+		AC_CHECK_HEADERS([gf2x.h], [with_gf2x=yes], [with_gf2x=no])
+	])
+AC_MSG_CHECKING([whether to build with gf2x])
+AC_MSG_RESULT([$with_gf2x])
+AM_CONDITIONAL([WITH_GF2X], [test "$with_gf2x" != no])
+AS_IF([test "$with_gf2x" != no], [AC_DEFINE([NTL_GF2X_LIB], [1])])
+
+AC_SUBST([my_CXXFLAGS])
+AC_CONFIG_FILES([Makefile src/Makefile include/Makefile])
+AC_OUTPUT
Index: ntl-9.2.0/include/Makefile.am
===================================================================
--- /dev/null
+++ ntl-9.2.0/include/Makefile.am
@@ -0,0 +1,101 @@
+# -*- Makefile -*-
+
+nobase_include_HEADERS = \
+	NTL/FFT.h \
+	NTL/FacVec.h \
+	NTL/GF2.h \
+	NTL/GF2E.h \
+	NTL/GF2EX.h \
+	NTL/GF2EXFactoring.h \
+	NTL/GF2X.h \
+	NTL/GF2XFactoring.h \
+	NTL/GF2XVec.h \
+	NTL/HNF.h \
+	NTL/Lazy.h \
+	NTL/LazyTable.h \
+	NTL/LLL.h \
+	NTL/RR.h \
+	NTL/SmartPtr.h \
+	NTL/SPMM_ASM.h \
+	NTL/WordVector.h \
+	NTL/ZZ.h \
+	NTL/ZZVec.h \
+	NTL/ZZX.h \
+	NTL/ZZXFactoring.h \
+	NTL/ZZ_p.h \
+	NTL/ZZ_pE.h \
+	NTL/ZZ_pEX.h \
+	NTL/ZZ_pEXFactoring.h \
+	NTL/ZZ_pX.h \
+	NTL/ZZ_pXFactoring.h \
+	NTL/c_lip.h \
+	NTL/ctools.h \
+	NTL/def_config.h \
+	NTL/fileio.h \
+	NTL/g_lip.h \
+	NTL/have_LL.h \
+	NTL/have_LL_no.h \
+	NTL/have_LL_yes.h \
+	NTL/have_builtin_clzl.h \
+	NTL/have_builtin_clzl_no.h \
+	NTL/have_builtin_clzl_yes.h \
+	NTL/lip.h \
+	NTL/lzz_p.h \
+	NTL/lzz_pE.h \
+	NTL/lzz_pEX.h \
+	NTL/lzz_pEXFactoring.h \
+	NTL/lzz_pX.h \
+	NTL/lzz_pXFactoring.h \
+	NTL/mat_GF2.h \
+	NTL/mat_GF2E.h \
+	NTL/mat_RR.h \
+	NTL/mat_ZZ.h \
+	NTL/mat_ZZ_p.h \
+	NTL/mat_ZZ_pE.h \
+	NTL/mat_lzz_p.h \
+	NTL/mat_lzz_pE.h \
+	NTL/mat_poly_ZZ.h \
+	NTL/mat_poly_ZZ_p.h \
+	NTL/mat_poly_lzz_p.h \
+	NTL/matrix.h \
+	NTL/new.h \
+	NTL/pair.h \
+	NTL/pair_GF2EX_long.h \
+	NTL/pair_GF2X_long.h \
+	NTL/pair_ZZX_long.h \
+	NTL/pair_ZZ_pEX_long.h \
+	NTL/pair_ZZ_pX_long.h \
+	NTL/pair_lzz_pEX_long.h \
+	NTL/pair_lzz_pX_long.h \
+	NTL/quad_float.h \
+	NTL/sp_arith.h \
+	NTL/thread.h \
+	NTL/tools.h \
+	NTL/vec_GF2.h \
+	NTL/vec_GF2E.h \
+	NTL/vec_GF2XVec.h \
+	NTL/vec_RR.h \
+	NTL/vec_ZZ.h \
+	NTL/vec_ZZVec.h \
+	NTL/vec_ZZ_p.h \
+	NTL/vec_ZZ_pE.h \
+	NTL/vec_double.h \
+	NTL/vec_long.h \
+	NTL/vec_lzz_p.h \
+	NTL/vec_lzz_pE.h \
+	NTL/vec_quad_float.h \
+	NTL/vec_ulong.h \
+	NTL/vec_vec_GF2.h \
+	NTL/vec_vec_GF2E.h \
+	NTL/vec_vec_RR.h \
+	NTL/vec_vec_ZZ.h \
+	NTL/vec_vec_ZZ_p.h \
+	NTL/vec_vec_ZZ_pE.h \
+	NTL/vec_vec_long.h \
+	NTL/vec_vec_lzz_p.h \
+	NTL/vec_vec_lzz_pE.h \
+	NTL/vec_vec_ulong.h \
+	NTL/vec_xdouble.h \
+	NTL/vector.h \
+	NTL/version.h \
+	NTL/xdouble.h
Index: ntl-9.2.0/include/NTL/g_lip.h
===================================================================
--- ntl-9.2.0.orig/include/NTL/g_lip.h
+++ ntl-9.2.0/include/NTL/g_lip.h
@@ -588,5 +588,4 @@ long _ntl_gblock_storage(long d);
 
 
 
-#define NTL_GMP_LIP
 
Index: ntl-9.2.0/src/Makefile.am
===================================================================
--- /dev/null
+++ ntl-9.2.0/src/Makefile.am
@@ -0,0 +1,118 @@
+# -*- Makefile -*-
+
+AM_CPPFLAGS = -I${top_builddir}/include -I${top_srcdir}/include
+AM_CXXFLAGS = ${my_CXXFLAGS}
+
+lib_LTLIBRARIES = libntl.la
+
+# cf. "VERSION_INFO" file
+libntl_la_LDFLAGS = -version-info 15:0:0 -no-undefined
+libntl_la_LIBADD  = -lm
+if WITH_GMP
+libntl_la_LIBADD += -lgmp
+endif
+if WITH_GF2X
+libntl_la_LIBADD += -lgf2x
+endif
+libntl_la_SOURCES = \
+	FFT.cpp FacVec.cpp GF2.cpp GF2E.cpp GF2EX.cpp GF2EXFactoring.cpp \
+	GF2X.cpp GF2X1.cpp GF2XFactoring.cpp GF2XVec.cpp HNF.cpp \
+	ctools.cpp LLL.cpp LLL_FP.cpp LLL_QP.cpp LLL_RR.cpp LLL_XD.cpp RR.cpp \
+	WordVector.cpp ZZ.cpp ZZVec.cpp ZZX.cpp ZZX1.cpp ZZXCharPoly.cpp \
+	ZZXFactoring.cpp ZZ_p.cpp ZZ_pE.cpp ZZ_pEX.cpp ZZ_pEXFactoring.cpp \
+	ZZ_pX.cpp ZZ_pX1.cpp ZZ_pXCharPoly.cpp ZZ_pXFactoring.cpp fileio.cpp \
+	lip.cpp lzz_p.cpp lzz_pE.cpp lzz_pEX.cpp lzz_pEXFactoring.cpp \
+	lzz_pX.cpp lzz_pX1.cpp lzz_pXCharPoly.cpp lzz_pXFactoring.cpp \
+	mat_GF2.cpp mat_GF2E.cpp mat_RR.cpp mat_ZZ.cpp mat_ZZ_p.cpp \
+	mat_ZZ_pE.cpp mat_lzz_p.cpp mat_lzz_pE.cpp mat_poly_ZZ.cpp \
+	mat_poly_ZZ_p.cpp mat_poly_lzz_p.cpp quad_float.cpp tools.cpp \
+	vec_GF2.cpp vec_GF2E.cpp vec_RR.cpp vec_ZZ.cpp vec_ZZ_p.cpp \
+	vec_ZZ_pE.cpp xdouble.cpp G_LLL_FP.cpp G_LLL_QP.cpp G_LLL_XD.cpp \
+	G_LLL_RR.cpp vec_lzz_p.cpp vec_lzz_pE.cpp GetPID1.cpp thread.cpp
+if MINGW
+libntl_la_SOURCES += GetTime4.cpp
+else
+libntl_la_SOURCES += GetTime1.cpp
+endif
+
+BUILT_SOURCES = mach_desc.h gmp_aux.h
+
+pkgincludedir = ${includedir}/NTL
+pkginclude_HEADERS = gmp_aux.h mach_desc.h
+
+gen_gmp_aux.${OBJEXT}: mach_desc.h
+
+gmp_aux.h: gen_gmp_aux${EXEEXT}
+	./gen_gmp_aux${EXEEXT} >gmp_aux.h;
+	mkdir -p ../include/NTL;
+	cp gmp_aux.h ../include/NTL/;
+
+mach_desc.h: MakeDesc${EXEEXT}
+	./MakeDesc${EXEEXT};
+	mkdir -p ../include/NTL;
+	cp mach_desc.h ../include/NTL/;
+
+noinst_PROGRAMS = gen_gmp_aux MakeDesc DispSettings InitSettings
+
+gen_gmp_aux_SOURCES = gen_gmp_aux.cpp
+if WITH_GMP
+gen_gmp_aux_LDADD = -lgmp
+endif
+
+check_PROGRAMS = \
+	BerlekampTest BitMatTest CanZassTest CharPolyTest ExceptionTest \
+	GF2EXTest GF2XTest GF2XTimeTest LLLTest MatrixTest \
+	MoreFacTest MulTimeTest Poly1TimeTest PolyTimeTest QuadTest QuickTest \
+	RRTest TestGetPid TestGetTime ThreadTest ZZXFacTest ZZ_pEXTest \
+	lzz_pEXTest
+
+MakeDesc_SOURCES      = MakeDesc.cpp MakeDescAux.cpp
+DispSettings_SOURCES  = DispSettings.cpp
+InitSettings_SOURCES  = InitSettings.cpp
+
+BerlekampTest_SOURCES = BerlekampTest.cpp
+BerlekampTest_LDADD   = libntl.la
+BitMatTest_SOURCES    = BitMatTest.cpp
+BitMatTest_LDADD      = libntl.la
+CanZassTest_SOURCES   = CanZassTest.cpp
+CanZassTest_LDADD     = libntl.la
+CharPolyTest_SOURCES  = CharPolyTest.cpp
+CharPolyTest_LDADD    = libntl.la
+ExceptionTest_SOURCES = ExceptionTest.cpp
+ExceptionTest_LDADD   = libntl.la
+GF2EXTest_SOURCES     = GF2EXTest.cpp
+GF2EXTest_LDADD       = libntl.la
+GF2XTest_SOURCES      = GF2XTest.cpp
+GF2XTest_LDADD        = libntl.la
+GF2XTimeTest_SOURCES  = GF2XTimeTest.cpp
+GF2XTimeTest_LDADD    = libntl.la
+LLLTest_SOURCES       = LLLTest.cpp
+LLLTest_LDADD         = libntl.la
+MatrixTest_SOURCES    = MatrixTest.cpp
+MatrixTest_LDADD      = libntl.la
+MoreFacTest_SOURCES   = MoreFacTest.cpp
+MoreFacTest_LDADD     = libntl.la
+MulTimeTest_SOURCES   = MulTimeTest.cpp
+MulTimeTest_LDADD     = libntl.la
+Poly1TimeTest_SOURCES = Poly1TimeTest.cpp
+Poly1TimeTest_LDADD   = libntl.la
+PolyTimeTest_SOURCES  = PolyTimeTest.cpp
+PolyTimeTest_LDADD    = libntl.la
+QuadTest_SOURCES      = QuadTest.cpp
+QuadTest_LDADD        = libntl.la
+QuickTest_SOURCES     = QuickTest.cpp
+QuickTest_LDADD       = libntl.la
+RRTest_SOURCES        = RRTest.cpp
+RRTest_LDADD          = libntl.la
+TestGetPid_SOURCES    = TestGetPid.cpp
+TestGetPid_LDADD      = libntl.la
+TestGetTime_SOURCES   = TestGetTime.cpp
+TestGetTime_LDADD     = libntl.la
+ThreadTest_SOURCES    = ThreadTest.cpp
+ThreadTest_LDADD      = libntl.la
+ZZXFacTest_SOURCES    = ZZXFacTest.cpp
+ZZXFacTest_LDADD      = libntl.la
+ZZ_pEXTest_SOURCES    = ZZ_pEXTest.cpp
+ZZ_pEXTest_LDADD      = libntl.la
+lzz_pEXTest_SOURCES   = lzz_pEXTest.cpp
+lzz_pEXTest_LDADD     = libntl.la