3 AC_CONFIG_SRCDIR([main.c])
8 if test "x$oldcflags" != "x$CFLAGS"
11 CFLAGS="-march=native"
12 AC_MSG_CHECKING([whether CC supports -march=native])
13 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
14 [AC_MSG_RESULT([yes])]
15 [oldcflags="$oldcflags -march=native"],
18 CFLAGS="-fomit-frame-pointer"
19 AC_MSG_CHECKING([whether CC supports -fomit-frame-pointer])
20 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
21 [AC_MSG_RESULT([yes])]
22 [oldcflags="$oldcflags -fomit-frame-pointer"],
32 AC_MSG_CHECKING([whether CC supports -nopie])
33 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
34 [AC_MSG_RESULT([yes])]
40 if test "x$nopie" = "x"
44 AC_MSG_CHECKING([whether CC supports -no-pie])
45 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
46 [AC_MSG_RESULT([yes])]
56 AC_ARG_ENABLE([ref10],
57 [AS_HELP_STRING([--enable-ref10],
58 [use SUPERCOP ref10 ed25519 implementation @<:@default=yes@:>@])],
60 AS_IF([test "x$ed25519impl" != "x" -a "$ed25519impl" != "ref10"],
61 [AC_ERROR([only one ed25519 implementation can be defined])])
67 AC_ARG_ENABLE([amd64-51-30k],
68 [AS_HELP_STRING([--enable-amd64-51-30k],
69 [use SUPERCOP amd64-51-30k ed25519 implementation @<:@default=no@:>@])],
71 AS_IF([test "x$ed25519impl" != "x" -a "$ed25519impl" != "amd64_51_30k"],
72 [AC_ERROR([only one ed25519 implementation can be defined])])
73 ed25519impl="amd64_51_30k"
78 AC_ARG_ENABLE([amd64-64-24k],
79 [AS_HELP_STRING([--enable-amd64-64-24k],
80 [use SUPERCOP amd64-64-24k ed25519 implementation @<:@default=no@:>@])],
82 AS_IF([test "x$ed25519impl" != "x" -a "$ed25519impl" != "amd64_64_24k"],
83 [AC_ERROR([only one ed25519 implementation can be defined])])
84 ed25519impl="amd64_64_24k"
89 AC_ARG_ENABLE([donna],
90 [AS_HELP_STRING([--enable-donna],
91 [use ed25519-donna implementation @<:@default=no@:>@])],
93 AS_IF([test "x$ed25519impl" != "x" -a "$ed25519impl" != "donna"],
94 [AC_ERROR([only one ed25519 implementation can be defined])])
100 AC_ARG_ENABLE([donna-sse2],
101 [AS_HELP_STRING([--enable-donna-sse2],
102 [use ed25519-donna SSE2 implementation @<:@default=no@:>@])],
104 AS_IF([test "x$ed25519impl" != "x" -a "$ed25519impl" != "donna-sse2"],
105 [AC_ERROR([only one ed25519 implementation can be defined])])
106 ed25519impl="donna-sse2"
111 AS_IF([test "x$ed25519impl" == "x"],[ed25519impl=ref10])
113 if test "$ed25519impl" = "donna-sse2"
116 MYDEFS="$MYDEFS -DED25519_SSE2"
117 CFLAGS="$CFLAGS -msse2"
120 AC_ARG_ENABLE([intfilter],
121 [AS_HELP_STRING([--enable-intfilter@<:@=(32|64|128|native)@:>@],
122 [use integers of specific size @<:@default=64@:>@ for filtering. faster but limits filter length to: 6 for 32-bit, 12 for 64-bit, 24 for 128-bit @<:@default=no@:>@])],
123 [], [enable_intfilter=no]
125 AC_ARG_ENABLE([intfilter32],
126 [AS_HELP_STRING([--enable-intfilter32], [deprecated. use --enable-intfilter=32 instead])],
127 [enable_intfilter=32]
128 [AC_MSG_WARN([--enable-intfilter32 option is deprecated. use --enable-intfilter=32 instead])],
131 case "$enable_intfilter" in
139 intfiltertype="unsigned __int128"
142 intfiltertype="size_t"
148 AC_MSG_WARN([unrecognised intfilter type: $enable_intfilter])
153 if test -n "$intfiltertype"
155 MYDEFS="$MYDEFS -DINTFILTER -DIFT='$intfiltertype'"
162 AC_MSG_CHECKING([whether CC supports -std=c99])
163 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
164 [AC_MSG_RESULT([yes])]
167 [AC_MSG_RESULT([no])]
170 AC_MSG_CHECKING([whether CC supports -Wall])
171 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
172 [AC_MSG_RESULT([yes])]
173 [cstd="$cstd -Wall"],
174 [AC_MSG_RESULT([no])]
176 if test "x$c99" = "xyes" -a "x$ed25519impl" != "xdonna" -a "x$enable_intfilter" != "x128"
178 CFLAGS="$cstd -Wpedantic"
179 AC_MSG_CHECKING([whether CC supports -Wpedantic])
180 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
181 [AC_MSG_RESULT([yes])]
182 [cstd="$cstd -Wpedantic"],
183 [AC_MSG_RESULT([no])]
186 if test "x$ed25519impl" = "xdonna"
188 CFLAGS="$cstd -Wno-unused-function"
189 AC_MSG_CHECKING([whether CC supports -Wno-unused-function])
190 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
191 [AC_MSG_RESULT([yes])]
192 [cstd="$cstd -Wno-unused-function"],
193 [AC_MSG_RESULT([no])]
198 AC_ARG_ENABLE([binfilterlen],
199 [AS_HELP_STRING([--enable-binfilterlen=VAL],
200 [set binary string filter length (if you don't use intfilter) @<:@default=32@:>@])],
201 [], [enable_binfilterlen=no]
203 if test "x$enable_binfilterlen" != "xyes" -a "x$enable_binfilterlen" != "xno"
205 MYDEFS="$MYDEFS -DBINFILTERLEN=$enable_binfilterlen"
208 AC_ARG_ENABLE([binsearch],
209 [AS_HELP_STRING([--enable-binsearch],
210 [enable binary search algoritm; MUCH faster if there are a lot of filters @<:@default=no@:>@])],
211 [], [enable_binsearch=no]
213 if test "x$enable_binsearch" = "xyes"
215 MYDEFS="$MYDEFS -DBINSEARCH"
218 AC_ARG_ENABLE([besort],
219 [AS_HELP_STRING([--enable-besort],
220 [force intfilter binsearch case to use big endian sorting and not omit masks from filters; useful if your filters aren't of same length @<:@default=no@:>@])],
221 [], [enable_besort=no]
223 if test "x$enable_besort" = "xyes"
225 MYDEFS="$MYDEFS -DBESORT"
228 AC_ARG_ENABLE([statistics],
229 [AS_HELP_STRING([--enable-statistics],
230 [collect statistics @<:@default=yes@:>@])],
231 [], [enable_statistics=yes]
233 if test "x$enable_statistics" = "xyes"
235 MYDEFS="$MYDEFS -DSTATISTICS"
238 AC_SUBST(CSTD,["$cstd"])
239 AC_SUBST(ED25519IMPL,["$ed25519impl"])
240 AC_SUBST(MYDEFS,["$MYDEFS"])
241 AC_SUBST(NOPIE,["$nopie"])