1 | |
---|
2 | CC=gcc |
---|
3 | CXX=g++ |
---|
4 | CFLAGS=-O2 |
---|
5 | CXXFLAGS=$$(CFLAGS) |
---|
6 | AR=ar |
---|
7 | ARFLAGS=ruv |
---|
8 | RANLIB=ranlib |
---|
9 | LDFLAGS= |
---|
10 | LDFLAGS_CXX=$$(LDFLAGS) |
---|
11 | LDLIBS=-lm |
---|
12 | LDLIBS_CXX=$$(LDLIBS) |
---|
13 | CPPFLAGS= |
---|
14 | PREFIX=/usr/local |
---|
15 | LIBDIR=$$(PREFIX)/lib |
---|
16 | INCLUDEDIR=$$(PREFIX)/include |
---|
17 | DOCDIR=$$(PREFIX)/doc |
---|
18 | |
---|
19 | NTL_GMP_LIP=off |
---|
20 | NTL_GMP_HACK=off |
---|
21 | |
---|
22 | GMP_PREFIX=none |
---|
23 | GMP_INCDIR= |
---|
24 | GMP_LIBDIR= |
---|
25 | |
---|
26 | WIZARD=on |
---|
27 | |
---|
28 | |
---|
29 | all: |
---|
30 | sh Check1 '$(WIZARD)' 'WIZARD' |
---|
31 | sh Check1 '$(NTL_GMP_LIP)' 'NTL_GMP_LIP' |
---|
32 | sh Check1 '$(NTL_GMP_HACK)' 'NTL_GMP_HACK' |
---|
33 | echo '###############################################################' |
---|
34 | echo '#' |
---|
35 | echo '# First, choose a C and C++ compilers, and set compiler flags.' |
---|
36 | echo '# This is done by setting the variables CXX, CC, CFLAGS, and' |
---|
37 | echo '# CXXFLAGS.' |
---|
38 | echo '#' |
---|
39 | echo '###############################################################' |
---|
40 | echo '' |
---|
41 | echo '' |
---|
42 | echo 'CC=$(CC)' |
---|
43 | echo '# A C or C++ compiler, e. g., gcc, cc, xlc.' |
---|
44 | echo '# There are a few components written in C which may be compiled' |
---|
45 | echo '# under C++, but C compilers tend to generate slightly better code.' |
---|
46 | echo '# The C++ and C compilers (if different) must generate' |
---|
47 | echo '# compatible code.' |
---|
48 | echo '' |
---|
49 | echo '' |
---|
50 | echo 'CXX=$(CXX)' |
---|
51 | echo '# A C++ compiler, e.g., g++, CC, xlC' |
---|
52 | echo '' |
---|
53 | echo '' |
---|
54 | echo 'CFLAGS=$(CFLAGS)' |
---|
55 | echo '# Flags for the C compiler' |
---|
56 | echo '# Some useful flags:' |
---|
57 | echo '# -O2 -- recommended level of optimization' |
---|
58 | echo '# -g -- debugging' |
---|
59 | echo '# -mv8 -- needed with gcc/g++ to get the full instruction set' |
---|
60 | echo '# of a SparcStation' |
---|
61 | echo '# -qarch=ppc -- needed with xlc/C to get the full instruction set' |
---|
62 | echo '# of a PowerPC' |
---|
63 | echo '' |
---|
64 | echo '' |
---|
65 | echo '' |
---|
66 | echo 'CXXFLAGS=$(CXXFLAGS)' |
---|
67 | echo '# Flags for the C++ compiler (usually the same as CFLAGS)' |
---|
68 | echo '# Some useful flags:' |
---|
69 | echo '# -+ -- needed with xlC to make it treat .c files as C++ files' |
---|
70 | echo '' |
---|
71 | echo '# Here are a few more variables for standard utilities.' |
---|
72 | echo '# The defaults should almost always be OK.' |
---|
73 | echo '' |
---|
74 | echo '' |
---|
75 | echo 'AR=$(AR)' |
---|
76 | echo '# command to make a library' |
---|
77 | echo '' |
---|
78 | echo 'ARFLAGS=$(ARFLAGS)' |
---|
79 | echo '# arguments for AR' |
---|
80 | echo '' |
---|
81 | echo 'RANLIB=$(RANLIB)' |
---|
82 | echo '# set to echo if you want to disable it completely' |
---|
83 | echo '' |
---|
84 | echo 'LDFLAGS=$(LDFLAGS)' |
---|
85 | echo '# arguments for linker for C++ programs' |
---|
86 | echo '' |
---|
87 | echo 'LDFLAGS_CXX=$(LDFLAGS_CXX)' |
---|
88 | echo '# libraries for linking C programs' |
---|
89 | echo '' |
---|
90 | echo 'LDLIBS=$(LDLIBS)' |
---|
91 | echo '# libraries for linking C++ programs' |
---|
92 | echo '' |
---|
93 | echo 'LDLIBS_CXX=$(LDLIBS_CXX)' |
---|
94 | echo '# libraries for linking C++ programs' |
---|
95 | echo '' |
---|
96 | echo 'CPPFLAGS=$(CPPFLAGS)' |
---|
97 | echo '# arguments for the C preprocessor' |
---|
98 | echo '' |
---|
99 | echo 'PREFIX=$(PREFIX)' |
---|
100 | echo 'LIBDIR=$(LIBDIR)' |
---|
101 | echo 'INCLUDEDIR=$(INCLUDEDIR)' |
---|
102 | echo 'DOCDIR=$(DOCDIR)' |
---|
103 | echo '# where to install NTL' |
---|
104 | echo '' |
---|
105 | echo '###############################################################' |
---|
106 | echo '#' |
---|
107 | echo '# Second, if you want to use GMP (the GNU Multi-Precision library),' |
---|
108 | echo '# define the variables GMP_INCDIR, GMP_LIBDIR, GMP_LIB below.' |
---|
109 | echo '# Otherwise, leave these defined as empty.' |
---|
110 | echo '# You also will have to set either NTL_GMP_LIP or NTL_GMP_HACK' |
---|
111 | echo '# in the config.h file.' |
---|
112 | echo '#' |
---|
113 | echo '# Using GMP can lead to significant performance gains on some' |
---|
114 | echo '# platforms. You can obtain GMP from http://www.swox.com/gmp.' |
---|
115 | echo '# Once you unpack it into a directory, just execute' |
---|
116 | echo '# ./configure; make' |
---|
117 | echo '# in that directory.' |
---|
118 | echo '#' |
---|
119 | echo '###############################################################' |
---|
120 | echo '' |
---|
121 | echo '' |
---|
122 | sh Select1 '$(GMP_PREFIX)' 'none' 'GMP_INCDIR=$(GMP_INCDIR)' 'GMP_INCDIR=-I$(GMP_PREFIX)/include' |
---|
123 | echo '# Set to -I<directory containing gmp.h> if using GMP and GMP' |
---|
124 | echo '# is not installed in a standard system directory, empty otherwise' |
---|
125 | echo '' |
---|
126 | sh Select1 '$(GMP_PREFIX)' 'none' 'GMP_LIBDIR=$(GMP_LIBDIR)' 'GMP_LIBDIR=-L$(GMP_PREFIX)/lib' |
---|
127 | echo '# Set to -L<directory containing libgmp.a> if using GMP and GMP' |
---|
128 | echo '# is not installed in a standard system directory, empty otherwise' |
---|
129 | echo '' |
---|
130 | sh Select2 '$(NTL_GMP_LIP)' '$(NTL_GMP_HACK)' 'GMP_LIB=-lgmp' 'GMP_LIB=' |
---|
131 | echo '# Set to -lgmp if using GMP, empty otherwise' |
---|
132 | echo '' |
---|
133 | echo '###############################################################' |
---|
134 | echo '#' |
---|
135 | echo '# Third, if you do not want to run the wizard that automagically' |
---|
136 | echo '# sets some performace related flags in config.h, set the flag below.' |
---|
137 | echo '#' |
---|
138 | echo '###############################################################' |
---|
139 | echo '' |
---|
140 | echo '' |
---|
141 | echo 'WIZARD=$(WIZARD)' |
---|
142 | echo '# Set to off if you want to bypass the wizard; otherwise, set to on.' |
---|