summaryrefslogtreecommitdiff
path: root/math/ntl/patches/patch-aa
blob: 97d3e8beb230403e2792f657d2ed623371651073 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
$NetBSD: patch-aa,v 1.2 2001/01/28 01:51:40 jtb Exp $

--- makefile.orig	Sun Nov 19 14:11:21 2000
+++ makefile
@@ -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
@@ -31,7 +31,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
@@ -40,16 +40,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)
@@ -61,13 +61,13 @@
 LDLIBS_CXX=$(LDLIBS)
 # libraries for linking C++ programs
 
-CPPFLAGS=
+#CPPFLAGS=
 # arguments for the C preprocessor
 
-PREFIX=/usr/local
+#PREFIX=/usr/local
 LIBDIR=$(PREFIX)/lib
 INCLUDEDIR=$(PREFIX)/include
-DOCDIR=$(PREFIX)/doc
+DOCDIR=$(PREFIX)/share/doc
 # where to install NTL
 
 ###############################################################
@@ -87,15 +87,15 @@
 ###############################################################
 
 
-GMP_INCDIR=
+GMP_INCDIR= -I${GMP_PREFIX}/include
 # Set to -I<directory containing gmp.h> if using GMP and GMP
 # is not installed in a standard system directory, empty otherwise
 
-GMP_LIBDIR=
+GMP_LIBDIR= -Wl,-R${GMP_PREFIX}/lib -L${GMP_PREFIX}/lib
 # Set to -L<directory containing libgmp.a> if using GMP and GMP
 # is not installed in a standard system directory, empty otherwise
 
-GMP_LIB=
+GMP_LIB= -lgmp
 # Set to -lgmp if using GMP, empty otherwise
 
 ###############################################################
@@ -291,7 +291,7 @@
 	make setup2
 	make setup3
 	make setup4
-	make ntl.a
+	make libntl.a
 
 
 # setup1 generates the file ../incluse/NTL/mach_desc.h
@@ -325,9 +325,9 @@
 	sh Wizard $(WIZARD)
 
 
-ntl.a:	$(OBJ) 
-	$(AR) $(ARFLAGS) ntl.a $(OBJ)
-	- $(RANLIB) ntl.a
+libntl.a:	$(OBJ) 
+	$(AR) $(ARFLAGS) $@ $(OBJ)
+	- $(RANLIB) $@
 
 lip.o:	lip.c g_lip.c c_lip.c lip_gmp_aux.c
 	$(COMPILE) $(GMP_INCDIR) lip.c
@@ -344,7 +344,7 @@
 	$(COMPILE_CXX) $<
 
 .c: 
-	$(LINK_CXX) -o $@ $< ntl.a  $(GMP_LIBDIR) $(GMP_LIB) $(LDLIBS_CXX) 
+	$(LINK_CXX) -o $@ $< libntl.a  $(GMP_LIBDIR) $(GMP_LIB) $(LDLIBS_CXX) 
 
 #################################################################
 #
@@ -372,17 +372,24 @@
 
 
 install:
-	mkdir -p $(LIBDIR)
-	cp ntl.a $(LIBDIR)/libntl.a
-	mkdir -p $(INCLUDEDIR)
-	- rm -r $(INCLUDEDIR)/NTL
-	mkdir $(INCLUDEDIR)/NTL
-	cp ../include/NTL/*.h $(INCLUDEDIR)/NTL
-	mkdir -p $(DOCDIR)
-	- rm -r $(DOCDIR)/NTL
-	mkdir $(DOCDIR)/NTL
-	cp ../doc/*.txt $(DOCDIR)/NTL
-	cp ../doc/*.html $(DOCDIR)/NTL
+	$(INSTALL_DATA_DIR) $(LIBDIR)
+	$(INSTALL_DATA) libntl.a $(LIBDIR)
+	$(INSTALL_DATA_DIR) $(INCLUDEDIR)
+	$(INSTALL_DATA_DIR) $(INCLUDEDIR)/NTL
+	@for d in ../include/NTL/*.h; do \
+		c="$(INSTALL_DATA) $$d $(INCLUDEDIR)/NTL/"; \
+		echo $$c; $$c; \
+	done
+	$(INSTALL_DATA_DIR) $(DOCDIR)
+	$(INSTALL_DATA_DIR) $(DOCDIR)/NTL
+	@for d in ../doc/*.txt; do \
+		c="$(INSTALL_DATA) $$d $(DOCDIR)/NTL/"; \
+		echo $$c; $$c; \
+	done
+	@for d in ../doc/*.html; do \
+		c="$(INSTALL_DATA) $$d $(DOCDIR)/NTL/"; \
+		echo $$c; $$c; \
+	done
 
 
 uninstall:
@@ -402,16 +409,16 @@
 #################################################################
 
 clobber:	
-	- rm ntl.a mach_desc.h ../include/NTL/mach_desc.h  GetTime.c 
-	- rm lip_gmp_aux.c ../include/NTL/gmp_aux.h
+	- rm -f libntl.a mach_desc.h ../include/NTL/mach_desc.h  GetTime.c 
+	- rm -f lip_gmp_aux.c ../include/NTL/gmp_aux.h
 	- sh RemoveProg $(PROGS) MakeDesc TestGetTime gen_lip_gmp_aux gen_gmp_aux
-	- rm *.o
-	- rm -r small
+	- rm -f *.o
+	- rm -fr small
 
 clean:
-	- rm *.o 
+	- rm -f *.o 
 	- sh RemoveProg MakeDesc TestGetTime gen_lip_gmp_aux gen_gmp_aux
-	- rm -r small
+	- rm -fr small
 
 #################################################################
 #