pkgsrc/math/ntl/patches/patch-aa
agc 18df049659 Update math/ntl to version 6.0.0
Differences from previous version (5.5.2):

	2013.02.15: Changes between NTL 5.5.2 and 6.0

	Replaced the old template-like macros for vectors, matrices, and pairs
	with true template classes:  Vec<T>, Mat<T>, and Pair<S,T>.  For
	backwards compatibilty, all the names that were used in previous
	versions (e.g., vec_ZZ_p, mat_ZZ_p) have been replaced with
	appropriate typedefs.

	For many years, I resisted the temptation of using templates, because
	compiler support was very inconsistent.  But that no longer seems to
	be the case.

	This change, while rather sweeping, should create very few, if any,
	incompatibilities with existing software.  The biggest issue would be
	for software that uses the old template-like macros:  such macro
	invocations can simply be replaced with appropriate typedefs.

	Made the conversion interface more complete and uniform.  Also, using
	template notation, one can and should now write conv<ZZ>(a) instead of
	to_ZZ(a) (for backward compatibility, all the old names to_XXX are
	still there, but many new conversions are not available under these
	old names).  There are many new conversions provided.  Moreover,
	whenever there is a conversion from a ring R to a ring S, there is a
	corresponding, coefficiet-wise conversion from the polynomial ring
	R[X] to the polynomial ring R[X].

	In addition, using the template mechanism, there are generic
	conversions for vectors and matrices.  For example, if there is a
	conversion from S to T, then there is automatically a corresponding
	component-wise conversion from Vec<S> to Vec<T>.

	Introduced a more general mechanism for accessing GF2's in packed
	structures via indexing (see the class ref_GF2 in the GF2 module).
	Employed ideas from David Harvey to make the single-precision FFT
	faster (about twice as fast in many cases).  This speeds up many
	higher-level operations.

	Fixed all known bugs.
2013-05-18 18:32:19 +00:00

306 lines
9.5 KiB
Text

$NetBSD: patch-aa,v 1.8 2013/05/18 18:32:19 agc Exp $
- configure for pkgsrc
- libtoolize
--- makefile.orig 2013-02-15 06:44:27.000000000 -0800
+++ makefile 2013-05-07 10:56:46.000000000 -0700
@@ -7,7 +7,7 @@
###############################################################
-CC=gcc
+#CC=gcc
# A C or C++ compiler, e. g., gcc, cc, xlc.
# There are a few components written in C which may be compiled
# under C++, but C compilers tend to generate slightly better code.
@@ -15,11 +15,11 @@
# compatible code.
-CXX=g++
+#CXX=g++
# A C++ compiler, e.g., g++, CC, xlC
-CFLAGS=-O2
+#CFLAGS=-O2
# Flags for the C compiler
# Some useful flags:
# -O2 -- recommended level of optimization
@@ -32,7 +32,7 @@
-CXXFLAGS=$(CFLAGS)
+#CXXFLAGS=$(CFLAGS)
# Flags for the C++ compiler (usually the same as CFLAGS)
# Some useful flags:
# -+ -- needed with xlC to make it treat .c files as C++ files
@@ -41,16 +41,16 @@
# The defaults should almost always be OK.
-AR=ar
+#AR=ar
# command to make a library
-ARFLAGS=ruv
+#ARFLAGS=ruv
# arguments for AR
-RANLIB=ranlib
+#RANLIB=ranlib
# set to echo if you want to disable it completely
-LDFLAGS=
+#LDFLAGS=
# arguments for linker for C programs
LDFLAGS_CXX=$(LDFLAGS)
@@ -62,15 +62,15 @@
LDLIBS_CXX=$(LDLIBS)
# libraries for linking C++ programs
-CPPFLAGS=
+#CPPFLAGS=
# arguments for the C preprocessor
-LIBTOOL=libtool
+#LIBTOOL=libtool
# libtool command
-DEF_PREFIX=/usr/local
+DEF_PREFIX=/nonexistent
-PREFIX=$(DEF_PREFIX)
+#PREFIX=$(DEF_PREFIX)
LIBDIR=$(PREFIX)/lib
INCLUDEDIR=$(PREFIX)/include
DOCDIR=$(PREFIX)/share/doc
@@ -92,17 +92,17 @@
###############################################################
-GMP_PREFIX=$(DEF_PREFIX)
+GMP_PREFIX=${BUILDLINK_PREFIX.gmp}
-GMP_INCDIR=$(GMP_PREFIX)/include
+GMP_INCDIR= ${GMP_PREFIX}/include
# directory containing gmp.h if using GMP
-GMP_LIBDIR=$(GMP_PREFIX)/lib
+GMP_LIBDIR= ${GMP_PREFIX}/lib
# directory containing libgmp.a if using GMP
-GMP_OPT_INCDIR=# -I$(GMP_INCDIR) # GMPI
-GMP_OPT_LIBDIR=# -L$(GMP_LIBDIR) # GMPL
-GMP_OPT_LIB=# -lgmp # GMP
+GMP_OPT_INCDIR= -I$(GMP_INCDIR) # GMP
+GMP_OPT_LIBDIR= -Wl,-R$(GMP_LIBDIR) -L$(GMP_LIBDIR) # GMP
+GMP_OPT_LIB= -lgmp # GMP
# uncomment these if using GMP
@@ -116,7 +116,7 @@
#
###############################################################
-GF2X_PREFIX=$(DEF_PREFIX)
+GF2X_PREFIX=/nonexistent
GF2X_INCDIR=$(GF2X_PREFIX)/include
# directory containing gf2x.h if using gf2x
@@ -125,7 +125,7 @@
# directory containing libgf2x.a
GF2X_OPT_INCDIR=# -I$(GF2X_INCDIR) # GF2X
-GF2X_OPT_LIBDIR=# -L$(GF2X_LIBDIR) # GF2X
+GF2X_OPT_LIBDIR=# -Wl,-R$(GF2X_LIBDIR) -L$(GF2X_LIBDIR) # GF2X
GF2X_OPT_LIB=# -lgf2x # GF2X
# uncomment these if using gf2x
@@ -179,7 +179,7 @@
S01=FFT.c FacVec.c GF2.c GF2E.c GF2EX.c GF2EXFactoring.c GF2X.c GF2X1.c
S02=$(S01) GF2XFactoring.c GF2XVec.c HNF.c ctools.c LLL.c LLL_FP.c LLL_QP.c
S03=$(S02) LLL_RR.c LLL_XD.c RR.c WordVector.c ZZ.c ZZVec.c ZZX.c ZZX1.c
-S04=$(S03) ZZXCharPoly.c ZZXFactoring.c ZZ_p.c ZZ_pE.c ZZ_pEX.c
+S04=$(S03) ZZXCharPoly.c ZZXFactoring.c ZZ_p.c ZZ_pE.c ZZ_pEX.c
S05=$(S04) ZZ_pEXFactoring.c ZZ_pX.c ZZ_pX1.c ZZ_pXCharPoly.c
S06=$(S05) ZZ_pXFactoring.c fileio.c lip.c lzz_p.c lzz_pE.c lzz_pEX.c
S07=$(S06) lzz_pEXFactoring.c lzz_pX.c lzz_pX1.c
@@ -233,9 +233,9 @@
# test data
-TD1=BerlekampTestIn BerlekampTestOut CanZassTestIn CanZassTestOut
-TD2=$(TD1) ZZXFacTestIn ZZXFacTestOut MoreFacTestIn LLLTestIn LLLTestOut RRTestIn RRTestOut
-TD3=$(TD2) MatrixTestIn MatrixTestOut CharPolyTestIn
+TD1=BerlekampTestIn BerlekampTestOut CanZassTestIn CanZassTestOut
+TD2=$(TD1) ZZXFacTestIn ZZXFacTestOut MoreFacTestIn LLLTestIn LLLTestOut RRTestIn RRTestOut
+TD3=$(TD2) MatrixTestIn MatrixTestOut CharPolyTestIn
TD4=$(TD3) CharPolyTestOut QuadTestIn QuadTestOut
TD = $(TD4)
@@ -313,11 +313,11 @@
NTL_INCLUDE = -I../include -I.
# NTL needs this to find its include files
-COMPILE = $(CC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) -c
-COMPILE_CXX = $(CXX) $(NTL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) -c
+COMPILE = $(LIBTOOL) --mode=compile $(CC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) -c
+COMPILE_CXX = $(LIBTOOL) --mode=compile $(CXX) $(NTL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) -c
-LINK = $(CC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
-LINK_CXX = $(CXX) $(NTL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS_CXX)
+LINK = $(LIBTOOL) --mode=link $(CC) $(NTL_INCLUDE) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)
+LINK_CXX = $(LIBTOOL) --mode=link $(CXX) $(NTL_INCLUDE) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS_CXX)
@@ -331,7 +331,7 @@
make setup2
make setup3
make setup4
- make ntl.a
+ make libntl.a
touch all
@@ -339,7 +339,7 @@
setup1:
$(COMPILE) MakeDescAux.c
- $(LINK) -o MakeDesc MakeDesc.c MakeDescAux.o $(LDLIBS)
+ $(LINK) -o MakeDesc MakeDesc.c MakeDescAux.lo $(LDLIBS)
./MakeDesc
mv mach_desc.h ../include/NTL/mach_desc.h
@@ -366,10 +366,16 @@
sh Wizard $(WIZARD)
-ntl.a: $(OBJ)
- $(AR) $(ARFLAGS) ntl.a $(OBJ) #LSTAT
- - $(RANLIB) ntl.a #LSTAT
-# $(LIBTOOL) --mode=link $(LINK_CXX) -o libntl.la $(OBJ:.o=.lo) $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(GF2X_OPT_LIBDIR) $(GF2X_OPT_LIB) $(LDLIBS_CXX) -rpath $(LIBDIR) -version-info `cat VERSION_INFO` #LSHAR
+libntl.a: $(OBJ)
+ $(LIBTOOL) --mode=link $(CXX) -o libntl.la $(OBJ:.o=.lo) \
+ $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) \
+ $(GF2X_OPT_LIBDIR) $(GF2X_OPT_LIB) \
+ $(LDLIBS_CXX) \
+ -rpath $(LIBDIR) \
+ -version-info `cat VERSION_INFO`
+# $(AR) $(ARFLAGS) ntl.a $(OBJ) #LSTAT
+# - $(RANLIB) ntl.a #LSTAT
+## $(LIBTOOL) --mode=link $(LINK_CXX) -o libntl.la $(OBJ:.o=.lo) $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(GF2X_OPT_LIBDIR) $(GF2X_OPT_LIB) $(LDLIBS_CXX) -rpath $(LIBDIR) -version-info `cat VERSION_INFO` #LSHAR
LCOMP= #LSTAT
# LCOMP=$(LIBTOOL) --mode=compile #LSHAR
@@ -390,7 +396,7 @@
$(LCOMP) $(COMPILE_CXX) $(GF2X_OPT_INCDIR) $<
.c:
- $(LINK_CXX) -o $@ $< ntl.a $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(GF2X_OPT_LIBDIR) $(GF2X_OPT_LIB) $(LDLIBS_CXX) #LSTAT
+ $(LINK_CXX) -o $@ $< libntl.la $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(GF2X_OPT_LIBDIR) $(GF2X_OPT_LIB) $(LDLIBS_CXX) #LSTAT
# $(LIBTOOL) --mode=link $(LINK_CXX) -o $@ $< libntl.la #LSHAR
#################################################################
@@ -424,23 +430,29 @@
install:
- mkdir -p -m 755 $(INCLUDEDIR)
- rm -rf $(INCLUDEDIR)/NTL
- mkdir -m 755 $(INCLUDEDIR)/NTL
- cp -p ../include/NTL/*.h $(INCLUDEDIR)/NTL
- - chmod -R a+r $(INCLUDEDIR)/NTL
- mkdir -p -m 755 $(DOCDIR)
- rm -rf $(DOCDIR)/NTL
- mkdir -m 755 $(DOCDIR)/NTL
- cp -p ../doc/*.txt $(DOCDIR)/NTL
- cp -p ../doc/*.html $(DOCDIR)/NTL
- cp -p ../doc/*.gif $(DOCDIR)/NTL
- - chmod -R a+r $(DOCDIR)/NTL
- mkdir -p -m 755 $(LIBDIR)
- cp -p ntl.a $(LIBDIR)/libntl.a #LSTAT
- - chmod a+r $(LIBDIR)/libntl.a #LSTAT
-# $(LIBTOOL) --mode=install cp -p libntl.la $(LIBDIR) #LSHAR
-
+# mkdir -p -m 755 $(INCLUDEDIR)
+# rm -rf $(INCLUDEDIR)/NTL
+# mkdir -m 755 $(INCLUDEDIR)/NTL
+# cp -p ../include/NTL/*.h $(INCLUDEDIR)/NTL
+# - chmod -R a+r $(INCLUDEDIR)/NTL
+# mkdir -p -m 755 $(DOCDIR)
+# rm -rf $(DOCDIR)/NTL
+# mkdir -m 755 $(DOCDIR)/NTL
+# cp -p ../doc/*.txt $(DOCDIR)/NTL
+# cp -p ../doc/*.html $(DOCDIR)/NTL
+# cp -p ../doc/*.gif $(DOCDIR)/NTL
+# - chmod -R a+r $(DOCDIR)/NTL
+# mkdir -p -m 755 $(LIBDIR)
+# cp -p ntl.a $(LIBDIR)/libntl.a #LSTAT
+# - chmod a+r $(LIBDIR)/libntl.a #LSTAT
+## $(LIBTOOL) --mode=install cp -p libntl.la $(LIBDIR) #LSHAR
+ $(BSD_INSTALL_DATA_DIR) ${DESTDIR}$(INCLUDEDIR)/NTL
+ $(BSD_INSTALL_DATA) ../include/NTL/*.h ${DESTDIR}$(INCLUDEDIR)/NTL
+ $(BSD_INSTALL_DATA_DIR) ${DESTDIR}$(DOCDIR)/NTL
+ $(BSD_INSTALL_DATA) ../doc/*.txt ${DESTDIR}$(DOCDIR)/NTL
+ $(BSD_INSTALL_DATA) ../doc/*.html ${DESTDIR}$(DOCDIR)/NTL
+ $(BSD_INSTALL_DATA) ../doc/*.gif ${DESTDIR}$(DOCDIR)/NTL
+ $(LIBTOOL) --mode=install $(BSD_INSTALL_LIB) libntl.la ${DESTDIR}$(LIBDIR)
uninstall:
rm -f $(LIBDIR)/libntl.a #LSTAT
@@ -460,7 +472,7 @@
#################################################################
clobber:
- rm -f ntl.a mach_desc.h ../include/NTL/mach_desc.h GetTime.c
+ rm -f mach_desc.h ../include/NTL/mach_desc.h GetTime.c
rm -f lip_gmp_aux_impl.h ../include/NTL/gmp_aux.h
sh RemoveProg $(PROGS) MakeDesc TestGetTime gen_lip_gmp_aux gen_gmp_aux
rm -f *.o
@@ -471,7 +483,7 @@
clean:
sh RemoveProg MakeDesc TestGetTime gen_lip_gmp_aux gen_gmp_aux
- rm -f *.o
+ rm -f *.o *.lo
rm -rf small
# - $(LIBTOOL) --mode=clean rm -f libntl.la *.lo #LSHAR
@@ -521,22 +533,25 @@
WOBJ = $(WO3)
# wntl.a: LCOMP= #LSHAR
-wntl.a: $(WOBJ)
- $(AR) $(ARFLAGS) wntl.a $(WOBJ)
- - $(RANLIB) wntl.a
+libwntl.la: $(WOBJ)
+# $(AR) $(ARFLAGS) wntl.a $(WOBJ)
+# - $(RANLIB) wntl.a
+ $(LIBTOOL) --mode=link $(CC) -o libwntl.la $(WOBJ:.o=.lo) \
+ -rpath $(LIBDIR) \
+ -version-info 0:0
MulTimeTest:
- $(LINK_CXX) -o MulTimeTest MulTimeTest.c wntl.a $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS_CXX)
+ $(LINK_CXX) -o MulTimeTest MulTimeTest.c libwntl.la $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS_CXX)
PolyTimeTest:
- $(LINK_CXX) -o PolyTimeTest PolyTimeTest.c wntl.a $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS_CXX)
+ $(LINK_CXX) -o PolyTimeTest PolyTimeTest.c libwntl.la $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS_CXX)
Poly1TimeTest:
- $(LINK_CXX) -o Poly1TimeTest Poly1TimeTest.c wntl.a $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS_CXX)
+ $(LINK_CXX) -o Poly1TimeTest Poly1TimeTest.c libwntl.la $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS_CXX)
GF2XTimeTest:
- $(LINK_CXX) -o GF2XTimeTest GF2XTimeTest.c wntl.a $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS_CXX)
+ $(LINK_CXX) -o GF2XTimeTest GF2XTimeTest.c libwntl.la $(GMP_OPT_LIBDIR) $(GMP_OPT_LIB) $(LDLIBS_CXX)
InitSettings:
$(LINK_CXX) -o InitSettings InitSettings.c $(LDLIBS_CXX)