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"
124 AC_MSG_CHECKING([whether CC supports -std=c99])
125 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
126 [AC_MSG_RESULT([yes])]
129 [AC_MSG_RESULT([no])]
132 AC_MSG_CHECKING([whether CC supports -Wall])
133 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
134 [AC_MSG_RESULT([yes])]
135 [cstd="$cstd -Wall"],
136 [AC_MSG_RESULT([no])]
138 if test "x$c99" = "xyes" -a "x$ed25519impl" != "xdonna"
140 CFLAGS="$cstd -Wpedantic"
141 AC_MSG_CHECKING([whether CC supports -Wpedantic])
142 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
143 [AC_MSG_RESULT([yes])]
144 [cstd="$cstd -Wpedantic"],
145 [AC_MSG_RESULT([no])]
148 if test "x$ed25519impl" = "xdonna"
150 CFLAGS="$cstd -Wno-unused-function"
151 AC_MSG_CHECKING([whether CC supports -Wno-unused-function])
152 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
153 [AC_MSG_RESULT([yes])]
154 [cstd="$cstd -Wno-unused-function"],
155 [AC_MSG_RESULT([no])]
161 AC_ARG_ENABLE([intfilter],
162 [AS_HELP_STRING([--enable-intfilter],
163 [use 64-bit integers for filtering. faster but limits filter length to 12 @<:@default=no@:>@])],
164 [], [enable_intfilter=no]
166 AC_ARG_ENABLE([intfilter32],
167 [AS_HELP_STRING([--enable-intfilter32],
168 [use 32-bit integers for filtering. even faster on 32-bit machines but limits filter length to 6 @<:@default=no@:>@])],
169 [], [enable_intfilter32=no]
171 if test "x$enable_intfilter32" = "xyes"
173 if test "x$enable_intfilter" = "xyes"
175 AC_MSG_WARN([both intfilter and intfilter32 specified; using intfilter32])
177 MYDEFS="$MYDEFS -DINTFILTER -DIFT=u32"
179 if test "x$enable_intfilter" = "xyes"
181 MYDEFS="$MYDEFS -DINTFILTER"
185 AC_ARG_ENABLE([binfilterlen],
186 [AS_HELP_STRING([--enable-binfilterlen=VAL],
187 [set binary string filter length (if you don't use intfilter) @<:@default=32@:>@])],
188 [], [enable_binfilterlen=no]
190 if test "x$enable_binfilterlen" != "xyes" -a "x$enable_binfilterlen" != "xno"
192 MYDEFS="$MYDEFS -DBINFILTERLEN=$enable_binfilterlen"
195 AC_ARG_ENABLE([binsearch],
196 [AS_HELP_STRING([--enable-binsearch],
197 [enable binary search algoritm; MUCH faster if there are a lot of filters @<:@default=no@:>@])],
198 [], [enable_binsearch=no]
200 if test "x$enable_binsearch" = "xyes"
202 MYDEFS="$MYDEFS -DBINSEARCH"
205 AC_ARG_ENABLE([statistics],
206 [AS_HELP_STRING([--enable-statistics],
207 [collect statistics @<:@default=yes@:>@])],
208 [], [enable_statistics=yes]
210 if test "x$enable_statistics" = "xyes"
212 MYDEFS="$MYDEFS -DSTATISTICS"
215 AC_SUBST(CSTD,["$cstd"])
216 AC_SUBST(ED25519IMPL,["$ed25519impl"])
217 AC_SUBST(MYDEFS,["$MYDEFS"])
218 AC_SUBST(NOPIE,["$nopie"])