forked from Singular/LELA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
199 lines (166 loc) · 4.72 KB
/
configure.in
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# Copyright 2010 members of the LinBox group
#
# This file is part of LELA, licensed under the GNU General Public
# License version 3. See COPYING for more information.
AC_PREREQ(2.50)
AC_INIT(lela,0.1.0,[email protected])
AM_INIT_AUTOMAKE([1.8 gnu no-dependencies])
AM_CONFIG_HEADER([lela/lela-config.h])
AX_PREFIX_CONFIG_H(lela/lela-config.h, __LELA)
AC_PATH_PROG(RM, rm, $FALSE)
RM="$RM -f"
AC_CONFIG_MACRO_DIR([macros])
AM_MAINTAINER_MODE
AM_DEP_TRACK
AM_OUTPUT_DEPENDENCY_COMMANDS
# Give a sane default for CFLAGS and CXXFLAGS
# The sane thing is to define the flags differenly in tests, examples, interfaces, etc. -bds
#DEFAULT_CFLAGS="-O2 -Wall"
CFLAGS=${CFLAGS:-$DEFAULT_CFLAGS}
CXXFLAGS=${CXXFLAGS:-$DEFAULT_CFLAGS}
AM_ACLOCAL_INCLUDE(macros)
# work around to fix the backward compatibility issue of automake 1.10 with 1.9 (pb with MKDIR_P)
AC_SUBST([MKDIR_P])
AC_PROG_CC
AC_PROG_CXX
AC_STDC_HEADERS
LT_INIT([disable-shared])
# Machine characteristics
AC_CHECK_SIZEOF(char, 8)
AC_CHECK_SIZEOF(short, 16)
AC_CHECK_SIZEOF(int, 32)
AC_CHECK_SIZEOF(long, 32)
AC_CHECK_SIZEOF(long long, 64)
AC_CHECK_SIZEOF(__int64, 64)
AC_CHECK_SIZEOF(__uint128_t, 128)
AC_CHECK_SIZEOF(__uint256_t, 256)
# check endianness of the architecture
AC_C_BIGENDIAN(
[AC_DEFINE(HAVE_BIG_ENDIAN, 1, [Define that architecture uses big endian storage])],
[AC_DEFINE(HAVE_LITTLE_ENDIAN, 1, [Define that architecture uses little endian storage])],[])
# Create some useful data types of fixed, known lengths
# We hereby assume that a character is always one byte
LELA_INT8="char";
case $ac_cv_sizeof_char in
1)
TWO_BYTES=2;
FOUR_BYTES=4;
EIGHT_BYTES=8;
SIXTEEN_BYTES=16;
THIRTY_TWO_BYTES=32;
;;
8)
TWO_BYTES=16;
FOUR_BYTES=32;
EIGHT_BYTES=64;
SIXTEEN_BYTES=128;
THIRTY_TWO_BYTES=256;
esac
case $TWO_BYTES in
$ac_cv_sizeof_short)
LELA_INT16="short";
;;
$ac_cv_sizeof_int)
LELA_INT16="int";
;;
esac
case $FOUR_BYTES in
$ac_cv_sizeof_short)
LELA_INT32="short";
;;
$ac_cv_sizeof_int)
LELA_INT32="int";
;;
$ac_cv_sizeof_long)
LELA_INT32="long";
;;
esac
case $EIGHT_BYTES in
$ac_cv_sizeof_short)
LELA_INT64="short";
;;
$ac_cv_sizeof_int)
LELA_INT64="int";
;;
$ac_cv_sizeof_long)
LELA_INT64="long";
;;
$ac_cv_sizeof_long_long)
LELA_INT64="long long";
;;
$ac_cv_sizeof___int64)
LELA_INT64="__int64";
;;
esac
case $SIXTEEN_BYTES in
$ac_cv_sizeof___uint128_t)
LELA_UINT128="__uint128_t";
;;
esac
case $THIRTY_TWO_BYTES in
$ac_cv_sizeof___uint256_t)
LELA_UINT256="__uint256_t";
;;
esac
AC_DEFINE_UNQUOTED(INT8, $LELA_INT8, Canonical 8-bit data type)
AC_DEFINE_UNQUOTED(INT16, $LELA_INT16, Canonical 16-bit data type)
AC_DEFINE_UNQUOTED(INT32, $LELA_INT32, Canonical 32-bit data type)
AC_DEFINE_UNQUOTED(INT64, $LELA_INT64, Canonical 64-bit data type)
if test "x$LELA_UINT128" != "x"; then
AC_DEFINE_UNQUOTED(UINT128, $LELA_UINT128, Canonical 128-bit data type)
fi
if test "x$LELA_UINT256" != "x"; then
AC_DEFINE_UNQUOTED(UINT256, $LELA_UINT256, Canonical 256-bit data type)
fi
# Feature checks
# LB_MISC
# LB_DRIVER
LB_CHECK_GMP(3.1.1,,AC_MSG_ERROR([Unable to find GMP on your machine: please use --with-gmp=PATH_TO_DIR_CONTAINING_LIB_AND_INCLUDE (see also ./configure --help if you do not understand what we are talking about)]))
#LB_CHECK_GMP(,,[
#echo '*******************************************************************************'
#echo ' ERROR: GMP not found!'
#echo
#echo ' GMP version 3.1.1 or greater with --enable-cxx is required for this library to compile. Please'
#echo ' make sure GMP is installed and specify its location with the option'
#echo ' --with-gmp=<prefix> when running configure.'
#echo '*******************************************************************************'
#exit 1
#])
AC_LANG_CPLUSPLUS
LB_CHECK_BLAS
LB_CHECK_M4RI
LB_CHECK_PNG
LB_CHECK_LIBPOLYS
AC_PATH_PROG(XMLTO,xmlto,"no")
if test "x$XMLTO" = "xno" ; then
echo "Note: xmlto not found. Cannot rebuild documentation."
XMLTO=
fi
AC_PATH_PROG(DOXYGEN,doxygen,"no")
if test "x$DOXYGEN" = "xno" ; then
echo "Note: doxygen not found. Cannot rebuild reference-documentation."
DOXYGEN=
fi
AM_CONDITIONAL(BUILD_DOCS,[test x$XMLTO != x -a x$DOXYGEN != x])
# this is bogus so far as I can tell. -bds
#CXXFLAGS="${GMP_CFLAGS} ${NTL_CFLAGS} ${GIVARO_CFLAGS} ${SACLIB_CFLAGS} ${CXXFLAGS}"
#AC_SUBST(CXXFLAGS)
AC_OUTPUT([
Makefile
lela-config
lela/Makefile
lela/algorithms/Makefile
lela/solutions/Makefile
lela/blas/Makefile
lela/element/Makefile
lela/ring/Makefile
lela/matrix/Makefile
lela/randiter/Makefile
lela/util/Makefile
lela/vector/Makefile
util/Makefile
tests/Makefile
tests/data/Makefile
macros/Makefile
doc/Makefile
])