241
NETTLE_CHECK_ARM_NEON
244
if test "x$enable_arm_neon" = xyes ; then
245
asm_path="arm/neon $asm_path"
222
249
enable_assembler=no
226
# echo "enable_assembler: $enable_assembler, asm_path: $asm_path"
254
# Files which replace a C source file (or otherwise don't correspond
255
# to a new object file).
256
asm_replace_list="aes-encrypt-internal.asm aes-decrypt-internal.asm \
257
arcfour-crypt.asm camellia-crypt-internal.asm \
258
md5-compress.asm memxor.asm \
259
salsa20-crypt.asm salsa20-core-internal.asm \
260
serpent-encrypt.asm serpent-decrypt.asm \
261
sha1-compress.asm sha256-compress.asm sha512-compress.asm \
262
sha3-permute.asm umac-nh.asm umac-nh-n.asm machine.m4"
264
# Assembler files which generate additional object files if they are used.
267
if test "x$enable_public_key" = "xyes" ; then
268
asm_optional_list="ecc-192-modp.asm ecc-224-modp.asm ecc-256-redc.asm \
269
ecc-384-modp.asm ecc-521-modp.asm"
228
276
if test "x$enable_assembler" = xyes ; then
229
277
if test -n "$asm_path"; then
230
AC_MSG_NOTICE([Looking for assembler files in $asm_path/.])
232
for tmp_f in aes-encrypt-internal.asm aes-decrypt-internal.asm \
233
arcfour-crypt.asm camellia-crypt-internal.asm \
234
md5-compress.asm memxor.asm \
235
serpent-encrypt.asm serpent-decrypt.asm \
236
sha1-compress.asm machine.m4; do
237
# echo "Looking for $srcdir/$asm_path/$tmp_f"
238
if test -f "$srcdir/$asm_path/$tmp_f"; then
241
AC_CONFIG_LINKS($tmp_f:$asm_path/$tmp_f)
278
AC_MSG_NOTICE([Looking for assembler files in $asm_path.])
279
for tmp_f in $asm_replace_list ; do
280
for asm_dir in $asm_path ; do
281
if test -f "$srcdir/$asm_dir/$tmp_f"; then
282
asm_file_list="$asm_file_list $tmp_f"
283
AC_CONFIG_LINKS($tmp_f:$asm_dir/$tmp_f)
244
if test "$found" = no; then
288
dnl Workaround for AC_CONFIG_LINKS, which complains if we use the
289
dnl same destination argument $tmp_f multiple times.
290
for tmp_o in $asm_optional_list ; do
291
for asm_dir in $asm_path ; do
292
if test -f "$srcdir/$asm_dir/$tmp_o"; then
293
asm_file_list="$asm_file_list $tmp_o"
294
AC_CONFIG_LINKS($tmp_o:$asm_dir/$tmp_o)
295
while read tmp_func ; do
296
AC_DEFINE_UNQUOTED(HAVE_NATIVE_$tmp_func)
297
eval HAVE_NATIVE_$tmp_func=yes
299
[`sed -n 's/[^ ]*PROLOGUE(_*\(nettle_\)*\([^)]*\)).*$/\2/p' < "$srcdir/$asm_dir/$tmp_o"`]
301
OPT_ASM_SOURCES="$OPT_ASM_SOURCES $tmp_o"
306
if test -z "$asm_file_list"; then
245
307
enable_assembler=no
246
308
AC_MSG_WARN([No assembler files found.])
313
AC_SUBST([OPT_ASM_SOURCES])
315
AH_VERBATIM([HAVE_NATIVE],
316
[/* Define to 1 each of the following for which a native (ie. CPU specific)
317
implementation of the corresponding routine exists. */
318
#undef HAVE_NATIVE_ecc_192_modp
319
#undef HAVE_NATIVE_ecc_192_redc
320
#undef HAVE_NATIVE_ecc_224_modp
321
#undef HAVE_NATIVE_ecc_224_redc
322
#undef HAVE_NATIVE_ecc_256_modp
323
#undef HAVE_NATIVE_ecc_256_redc
324
#undef HAVE_NATIVE_ecc_384_modp
325
#undef HAVE_NATIVE_ecc_384_redc
326
#undef HAVE_NATIVE_ecc_521_modp
327
#undef HAVE_NATIVE_ecc_521_redc])
329
# Besides getting correct dependencies, the explicit rules also tell
330
# make that the .s files "ought to exist", so they are preferred over
332
AC_CONFIG_COMMANDS([asm.d],
333
[ for f in $asm_file_list
337
echo "`basename $f .asm`.s : $f "'$(srcdir)/asm.m4 machine.m4 config.m4'
342
[ asm_file_list="$asm_file_list" ]
253
347
SHLIBCFLAGS="$CCPIC"
350
LIBNETTLE_FILE_SRC='$(LIBNETTLE_FORLINK)'
351
LIBHOGWEED_FILE_SRC='$(LIBHOGWEED_FORLINK)'
255
355
case "$host_os" in
257
LIBNETTLE_FORLINK='libnettle-$(LIBNETTLE_MAJOR)-$(LIBNETTLE_MINOR).dll'
357
# The actual DLLs, e.g. libnettle-$major-$minor.dll, are normally
358
# installed into the bin dir (or more exactly $libdir/../bin, for
359
# automake), while libnettle.dll.a, which is a stub file for
360
# linking to the DLL, is installed into the lib dir.
363
LIBNETTLE_FORLINK='libnettle-$(LIBNETTLE_MAJOR)-$(LIBNETTLE_MINOR).dll'
364
LIBHOGWEED_FORLINK='libhogweed-$(LIBHOGWEED_MAJOR)-$(LIBHOGWEED_MINOR).dll'
367
LIBNETTLE_FORLINK='cygnettle-$(LIBNETTLE_MAJOR)-$(LIBNETTLE_MINOR).dll'
368
LIBHOGWEED_FORLINK='cyghogweed-$(LIBHOGWEED_MAJOR)-$(LIBHOGWEED_MINOR).dll'
371
if test "x$cross_compiling" = xyes ; then
381
if test "x$ABI" = x64 ; then
258
384
LIBNETTLE_SONAME=''
259
385
LIBNETTLE_FILE='libnettle.dll.a'
260
LIBNETTLE_LINK='$(CC) $(LDFLAGS) -shared -Wl,--out-implib=$(LIBNETTLE_FILE) -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive'
386
LIBNETTLE_FILE_SRC='$(LIBNETTLE_FILE)'
387
LIBNETTLE_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,--out-implib=$(LIBNETTLE_FILE) -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive'
261
388
LIBNETTLE_LIBS='-Wl,--no-whole-archive $(LIBS)'
263
LIBHOGWEED_FORLINK='libhogweed-$(LIBHOGWEED_MAJOR)-$(LIBHOGWEED_MINOR).dll'
264
390
LIBHOGWEED_SONAME=''
265
391
LIBHOGWEED_FILE='libhogweed.dll.a'
266
LIBHOGWEED_LINK='$(CC) $(LDFLAGS) -shared -Wl,--out-implib=$(LIBHOGWEED_FILE) -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive'
392
LIBHOGWEED_FILE_SRC='$(LIBHOGWEED_FILE)'
393
LIBHOGWEED_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,--out-implib=$(LIBHOGWEED_FILE) -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive'
267
394
LIBHOGWEED_LIBS='-Wl,--no-whole-archive $(LIBS) libnettle.dll.a'
270
LIBNETTLE_FORLINK='cygnettle-$(LIBNETTLE_MAJOR)-$(LIBNETTLE_MINOR).dll'
272
LIBNETTLE_FILE='libnettle.dll.a'
273
LIBNETTLE_LINK='$(CC) $(LDFLAGS) -shared -Wl,--out-implib=$(LIBNETTLE_FILE) -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive'
274
LIBNETTLE_LIBS='-Wl,--no-whole-archive $(LIBS)'
276
LIBHOGWEED_FORLINK='cyghogweed-$(LIBHOGWEED_MAJOR)-$(LIBHOGWEED_MINOR).dll'
278
LIBHOGWEED_FILE='libhogweed.dll.a'
279
LIBHOGWEED_LINK='$(CC) $(LDFLAGS) -shared -Wl,--out-implib=$(LIBHOGWEED_FILE) -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive'
280
LIBHOGWEED_LIBS='-Wl,--no-whole-archive $(LIBS)'
283
398
LIBNETTLE_FORLINK=libnettle.dylib
284
LIBNETTLE_SONAME='$(LIBNETTLE_FORLINK).$(LIBNETTLE_MAJOR)'
285
LIBNETTLE_FILE='$(LIBNETTLE_SONAME).$(LIBNETTLE_MINOR)'
286
LIBNETTLE_LINK='$(CC) -dynamiclib $(LDFLAGS)'
399
LIBNETTLE_SONAME='libnettle.$(LIBNETTLE_MAJOR).dylib'
400
LIBNETTLE_FILE='libnettle.$(LIBNETTLE_MAJOR).$(LIBNETTLE_MINOR).dylib'
401
LIBNETTLE_LINK='$(CC) $(CFLAGS) -dynamiclib $(LDFLAGS) -install_name ${libdir}/$(LIBNETTLE_SONAME) -compatibility_version $(LIBNETTLE_MAJOR) -current_version $(LIBNETTLE_MAJOR).$(LIBNETTLE_MINOR)'
287
402
LIBNETTLE_LIBS=''
289
404
LIBHOGWEED_FORLINK=libhogweed.dylib
290
LIBHOGWEED_SONAME='$(LIBHOGWEED_FORLINK).$(LIBHOGWEED_MAJOR)'
291
LIBHOGWEED_FILE='$(LIBHOGWEED_SONAME).$(LIBHOGWEED_MINOR)'
292
LIBHOGWEED_LINK='$(CC) -dynamiclib $(LDFLAGS)'
405
LIBHOGWEED_SONAME='libhogweed.$(LIBHOGWEED_MAJOR).dylib'
406
LIBHOGWEED_FILE='libhogweed.$(LIBHOGWEED_MAJOR).$(LIBHOGWEED_MINOR).dylib'
407
LIBHOGWEED_LINK='$(CC) $(CFLAGS) -dynamiclib -L. $(LDFLAGS) -install_name ${libdir}/$(LIBHOGWEED_SONAME) -compatibility_version $(LIBHOGWEED_MAJOR) -current_version $(LIBHOGWEED_MAJOR).$(LIBHOGWEED_MINOR)'
408
LIBHOGWEED_LIBS='-lnettle -lgmp'
296
411
# Sun's ld uses -h to set the soname, and this option is passed
299
414
LIBNETTLE_FORLINK=libnettle.so
300
415
LIBNETTLE_SONAME='$(LIBNETTLE_FORLINK).$(LIBNETTLE_MAJOR)'
301
416
LIBNETTLE_FILE='$(LIBNETTLE_SONAME).$(LIBNETTLE_MINOR)'
302
LIBNETTLE_LINK='$(CC) $(LDFLAGS) -G -h $(LIBNETTLE_SONAME)'
417
LIBNETTLE_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -G -h $(LIBNETTLE_SONAME)'
303
418
LIBNETTLE_LIBS=''
305
420
LIBHOGWEED_FORLINK=libhogweed.so
306
421
LIBHOGWEED_SONAME='$(LIBHOGWEED_FORLINK).$(LIBHOGWEED_MAJOR)'
307
422
LIBHOGWEED_FILE='$(LIBHOGWEED_SONAME).$(LIBHOGWEED_MINOR)'
308
LIBHOGWEED_LINK='$(CC) $(LDFLAGS) -L. -G -h $(LIBHOGWEED_SONAME)'
423
LIBHOGWEED_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -L. -G -h $(LIBHOGWEED_SONAME)'
309
424
LIBHOGWEED_LIBS='-lnettle -lgmp'
312
427
LIBNETTLE_FORLINK=libnettle.so
313
428
LIBNETTLE_SONAME='$(LIBNETTLE_FORLINK).$(LIBNETTLE_MAJOR)'
314
429
LIBNETTLE_FILE='$(LIBNETTLE_SONAME).$(LIBNETTLE_MINOR)'
315
LIBNETTLE_LINK='$(CC) $(LDFLAGS) -shared -Wl,-soname=$(LIBNETTLE_SONAME)'
430
LIBNETTLE_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname=$(LIBNETTLE_SONAME)'
316
431
LIBNETTLE_LIBS=''
318
433
LIBHOGWEED_FORLINK=libhogweed.so
319
434
LIBHOGWEED_SONAME='$(LIBHOGWEED_FORLINK).$(LIBHOGWEED_MAJOR)'
320
435
LIBHOGWEED_FILE='$(LIBHOGWEED_SONAME).$(LIBHOGWEED_MINOR)'
321
LIBHOGWEED_LINK='$(CC) $(LDFLAGS) -L. -shared -Wl,-soname=$(LIBHOGWEED_SONAME)'
436
LIBHOGWEED_LINK='$(CC) $(CFLAGS) $(LDFLAGS) -L. -shared -Wl,-soname=$(LIBHOGWEED_SONAME)'
322
437
# Requested by debian, to make linking with only -lhogweed work
323
438
# (does not work in general, e.g., with static linking all of
324
439
# -lhogweed -lgmp -lnettle are still required). Also makes dlopen