Added silc_mp_format and silc_mp_unformat MP integer encoder/decoder
[crypto.git] / configure.ad
1 #
2 #  configure.ad
3 #
4 #  Author: Pekka Riikonen <priikone@silcnet.org>
5 #
6 #  Copyright (C) 2000 - 2008 Pekka Riikonen
7 #
8 #  This program is free software; you can redistribute it and/or modify
9 #  it under the terms of the GNU General Public License as published by
10 #  the Free Software Foundation; version 2 of the License.
11 #
12 #  This program is distributed in the hope that it will be useful,
13 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #  GNU General Public License for more details.
16 #
17
18 AD_INIT
19 AC_CANONICAL_SYSTEM
20 AM_INIT_AUTOMAKE
21 AC_PREREQ(2.52)
22 AC_CONFIG_HEADERS(cryptodefs.h)
23
24 AC_PROG_INSTALL
25 AC_PROG_MAKE_SET
26
27 AC_PROG_CC
28 AM_PROG_AS
29 AC_C_INLINE
30 AC_C_CONST
31
32 AC_PROG_RANLIB
33 #ifdef SILC_DIST_INPLACE
34 AC_DISABLE_SHARED
35 #endif SILC_DIST_INPLACE
36 AC_PROG_LIBTOOL
37
38 SILC_TOP_SRCDIR=`pwd`
39
40 ##
41 ## Library versioning.
42 ##
43
44 # Do the releases and library versioning according to following rules:
45 #
46 #  - If any code has changed in library, increment CRYPTO_REVISION
47 #  - If API were added, removed or changed, set CRYPTO_REVISION to 0
48 #  - If API were added, removed or changed, increment CRYPTO_CURRENT
49 #  - If APi were added, increment CRYPTO_AGE
50 #  - If API were removed, set CRYPTO_AGE to 0
51 #
52
53 # Base version for library.
54 CRYPTO_BASE_VERSION=1.2
55
56 # Library versions
57 CRYPTO_CURRENT=1                # prev = 0
58 CRYPTO_REVISION=0               # prev = 0
59 CRYPTo_AGE=0                    # prev = 0
60
61 # Substitute the version numbers
62 AC_SUBST(CRYPTO_BASE_VERSION)
63 AC_SUBST(CRYPTO_CURRENT)
64 AC_SUBST(CRYPTO_REVISION)
65 AC_SUBST(CRYPTO_AGE)
66
67
68 ##
69 ##  Installation
70 ##
71
72 # Default installation destination
73 AC_PREFIX_DEFAULT(/usr/local)
74 if test "x$prefix" != xNONE; then
75   silc_prefix="$prefix"
76 else
77   silc_prefix="$ac_default_prefix"
78   prefix="$silc_prefix"
79 fi
80
81
82 ##
83 ##  Required dependencies
84 ##
85
86 LIBSUBDIR=lib
87 LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS"
88
89 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silccrypt"
90 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcasn1"
91 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcacc"
92 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcskr"
93 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcmath"
94 #ifdef SILC_DIST_SSH
95 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcssh"
96 #endif SILC_DIST_SSH
97 #ifdef SILC_DIST_PGP
98 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcpgp"
99 #endif SILC_DIST_PGP
100 #ifdef SILC_DIST_PKIX
101 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcpkix"
102 #endif SILC_DIST_PKIX
103
104 # SILC Runtime Toolkit checking
105 AC_ARG_WITH(srt-includes,
106   [  --with-srt-includes=DIR  SILC Runtime Toolkit includes [search in DIR]],
107   [ac_srt_includes="$withval"], [ac_srt_includes="no"])
108 AC_ARG_WITH(srt-libs,
109   [  --with-srt-libs=DIR      SILC Runtime Toolkit libraries [search in DIR]],
110   [ac_srt_libs="$withval"], [ac_srt_libs="no"])
111
112 if test -n "$with_srt_includes" || test -n "$with_srt_libs"; then
113   # Manually provided libs
114   if test "$ac_srt_includes" != "no"; then
115     SILC_LIB_INCLUDES="-I$ac_srt_includes"
116   fi
117   if test "$ac_srt_libs" != "no"; then
118     LDFLAGS="-L$ac_srt_libs $LDFLAGS"
119   fi
120
121   # Check libs to link against
122   f=`$EGREP __SILC_HAVE_PTHREAD $ac_srt_includes/silc.h`
123   if test -n "$f"; then
124     LIBS="$LIBS -lpthread"
125     has_threads=true
126   fi
127 else
128   # pkg-config check
129   PKG_CHECK_MODULES(SRT, [srt >= 1.2])
130   LIBS="$SRT_LIBS $LIBS"
131   CFLAGS="$CFLAGS $SRT_CFLAGS"
132 fi
133
134
135 ##
136 ## Detect CPU
137 ##
138
139 # Disable all CPU feature optimizations
140 AC_MSG_CHECKING(whether to enable CPU feature optimizations)
141 AC_ARG_ENABLE(cpu-optimizations,
142   [  --disable-cpu-optimizations  do not use any CPU feature optimizations],
143   [
144     AC_MSG_RESULT(no)
145     AC_DEFINE([SILC_NO_CPU_OPTIMIZATIONS], [], [SILC_NO_CPU_OPTIMIZATIONS])
146     want_cpu_optimizations=false
147   ],
148   [
149     AC_MSG_RESULT(yes)
150     want_cpu_optimizations=true
151   ])
152 AM_CONDITIONAL(SILC_NO_CPU_OPTIMIZATIONS,
153                test x$want_cpu_optimizations = xfalse)
154
155 SILC_SYSTEM_IS_SMP(AC_DEFINE([SILC_SMP], [], [SILC_SMP]), [],
156                    AC_DEFINE([SILC_SMP], [], [SILC_SMP]))
157 cpu_i386=false
158 cpu_i486=false
159 cpu_i586=false
160 cpu_i686=false
161 cpu_i786=false
162 cpu_x86_64=false
163 cpu_ppc=false
164 cpu_ia64=false
165 case "$host_cpu" in
166   # All following Intels are considered 32-bit CPUs.
167   i?86)
168     # All CPUs of today are considered i386 and i486 compatible */
169     cpu_i386=true
170     cpu_i486=true
171
172     if test "x$host_cpu" = "xi586"; then
173       cpu_i586=true
174     fi
175
176     if test "x$host_cpu" = "xi686"; then
177       cpu_i586=true
178       cpu_i686=true
179     fi
180
181     if test "x$host_cpu" = "xi786"; then
182       cpu_i586=true
183       cpu_i686=true
184       cpu_i786=true
185     fi
186
187     # Check for specific CPU features
188     SILC_CPU_FLAG(mmx, true, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
189     SILC_CPU_FLAG(sse2, true, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
190     SILC_CPU_FLAG(pni, true, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
191     SILC_CPU_FLAG(ssse3, true, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
192     SILC_CPU_FLAG(sse4a, true, AC_DEFINE([SILC_CPU_SSE4A], [], [SILC_CPU_SSE4A]), [])
193     SILC_CPU_FLAG(sse4_1, true, AC_DEFINE([SILC_CPU_SSE41], [], [SILC_CPU_SSE41]), [])
194     SILC_CPU_FLAG(sse4_2, true, AC_DEFINE([SILC_CPU_SSE42], [], [SILC_CPU_SSE42]), [])
195     SILC_CPU_FLAG(sse5, true, AC_DEFINE([SILC_CPU_SSE5], [], [SILC_CPU_SSE5]), [])
196     ;;
197
198   # Intel IA-64, 64-bit CPU (not x86_64 compatible)
199   ia64)
200     AC_DEFINE([SILC_IA64], [], [SILC_IA64])
201     cpu_ia64=true
202     ;;
203
204   # AMD/Intel x86_64, 64-bit CPU
205   x86_64)
206     cpu_x86_64=true
207
208     # Check for specific CPU features
209     SILC_CPU_FLAG(mmx, true, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
210     SILC_CPU_FLAG(sse2, true, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
211     SILC_CPU_FLAG(pni, true, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
212     SILC_CPU_FLAG(ssse3, true, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
213     SILC_CPU_FLAG(sse4a, true, AC_DEFINE([SILC_CPU_SSE4A], [], [SILC_CPU_SSE4A]), [])
214     SILC_CPU_FLAG(sse4_1, true, AC_DEFINE([SILC_CPU_SSE41], [], [SILC_CPU_SSE41]), [])
215     SILC_CPU_FLAG(sse4_2, true, AC_DEFINE([SILC_CPU_SSE42], [], [SILC_CPU_SSE42]), [])
216     SILC_CPU_FLAG(sse5, true, AC_DEFINE([SILC_CPU_SSE5], [], [SILC_CPU_SSE5]), [])
217     ;;
218
219   # PowerPC, 32-bit and 64-bit CPUs
220   powerpc*)
221     cpu_ppc=true
222     ;;
223 esac
224 AM_CONDITIONAL(SILC_I386, test x$cpu_i386 = xtrue)
225 AM_CONDITIONAL(SILC_I486, test x$cpu_i486 = xtrue)
226 AM_CONDITIONAL(SILC_I586, test x$cpu_i586 = xtrue)
227 AM_CONDITIONAL(SILC_I686, test x$cpu_i686 = xtrue)
228 AM_CONDITIONAL(SILC_7686, test x$cpu_i786 = xtrue)
229 AM_CONDITIONAL(SILC_X86_64, test x$cpu_x86_64 = xtrue)
230 AM_CONDITIONAL(SILC_POWERPC, test x$cpu_ppc = xtrue)
231 AM_CONDITIONAL(SILC_IA64, test x$cpu_ia64 = xtrue)
232
233 if test x$want_cpu_optimizations = xtrue; then
234   # Set some compiler options based on CPU
235   if test "x$CC" = "xicc"; then
236     # ICC flags
237     if test x$x_have_cpu_sse4_1 = xtrue; then
238       SILC_ADD_CFLAGS(-axS)
239     fi
240     if test x$x_have_cpu_sse4_2 = xtrue; then
241       SILC_ADD_CFLAGS(-axS)
242     fi
243     if test x$x_have_cpu_ssse3 = xtrue; then
244       SILC_ADD_CFLAGS(-axT)
245     elif test x$x_have_cpu_pni = xtrue; then
246       SILC_ADD_CFLAGS(-axP)
247     elif test x$x_have_cpu_sse2 = xtrue; then
248       SILC_ADD_CFLAGS(-axW)
249     fi
250   else
251     # Other compilers
252     if test x$x_have_cpu_sse2 = xtrue; then
253       SILC_ADD_CFLAGS(-msse2)
254     fi
255     if test x$x_have_cpu_pni = xtrue; then
256       SILC_ADD_CFLAGS(-msse3)
257     fi
258     if test x$x_have_cpu_ssse3 = xtrue; then
259       SILC_ADD_CFLAGS(-mssse3)
260     fi
261     if test x$x_have_cpu_sse4_1 = xtrue; then
262       SILC_ADD_CFLAGS(-msse4)
263     fi
264     if test x$x_have_cpu_sse4_2 = xtrue; then
265       SILC_ADD_CFLAGS(-msse4)
266     fi
267   fi
268 fi
269
270
271 ##
272 ## Put here any platform specific stuff
273 ##
274
275 case "$target" in
276   *-*-linux*)
277     CFLAGS=`echo $CFLAGS -D_GNU_SOURCE`
278     ;;
279   *-*-freebsd*)
280     ;;
281   *-*-netbsd*)
282     ;;
283   *-*-*bsd*)
284     ;;
285   *)
286     ;;
287 esac
288
289
290 ##
291 ## Header checking
292 ##
293 AC_HEADER_STDC
294
295 # More header checking
296 #
297 AC_CHECK_HEADERS(unistd.h assert.h time.h fcntl.h)
298 AC_CHECK_HEADERS(sys/types.h sys/times.h sys/time.h sys/resource.h)
299
300 # Check for big-endian machines
301 AC_C_BIGENDIAN
302
303
304 ##
305 ## Compiler and compiler flag checks
306 ##
307
308 # Disable all compiler optimizations
309 AC_MSG_CHECKING(whether to enable compiler optimizations)
310 AC_ARG_ENABLE(optimizations,
311   [  --disable-optimizations do not use any compiler optimizations],
312   [
313     AC_MSG_RESULT(no)
314     AC_DEFINE([SILC_NO_CC_OPTIMIZATIONS], [], [SILC_NO_CC_OPTIMIZATIONS])
315     want_cc_optimizations=false
316   ],
317   [
318     AC_MSG_RESULT(yes)
319     want_cc_optimizations=true
320   ])
321 AM_CONDITIONAL(SILC_NO_CC_OPTIMIZATIONS, test x$want_cc_optimizations = xfalse)
322
323 if test "$GCC"; then
324   # GCC specific options
325   if test "x$summary_debug" = "xyes"; then
326     SILC_ADD_CFLAGS(-g)
327   else
328     SILC_ADD_CFLAGS(-g)
329   fi
330   SILC_ADD_CFLAGS(-Wall -finline-functions)
331   SILC_ADD_CFLAGS(-Wno-pointer-sign)
332 else
333   # Other compilers
334   case "$target" in
335     alpha*-dec-osf*)
336       SILC_ADD_CFLAGS(-g3)
337       ;;
338     mips*-sgi-irix*)
339       SILC_ADD_CFLAGS(-g3)
340       ;;
341     *)
342       SILC_ADD_CFLAGS(-g)
343       ;;
344   esac
345
346   # Intel C++ Compiler flags
347   if test "x$CC" = "xicc"; then
348     SILC_ADD_CFLAGS(-restrict)
349     SILC_ADD_CFLAGS(-finline-functions)
350
351     # Don't define __GNUC__ except for system includes
352     SILC_ADD_CFLAGS(-gcc-sys)
353   fi
354 fi
355
356 if test x$want_cc_optimizations = xtrue; then
357   if test "$GCC"; then
358     # GCC specific options
359     if test "x$summary_debug" = "xyes"; then
360       SILC_ADD_CFLAGS(-O)
361     else
362       SILC_ADD_CFLAGS(-O2)
363     fi
364   else
365     # Other compilers
366     case "$target" in
367       alpha*-dec-osf*)
368         SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
369         ;;
370       mips*-sgi-irix*)
371         SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
372         ;;
373       *)
374         SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
375         ;;
376     esac
377   fi
378 fi
379
380 # Workaround a bug in GCC 2.x which causes memory exhaustion
381 # when compiling sha1 with optimizations on UltraSPARC.
382 FIX_SHA1='#'
383 if test "$GCC" -a "$host_cpu" = "sparc64"; then
384   AC_MSG_CHECKING(whether to enable GCC 2.x workaround for SHA1)
385   AC_TRY_COMPILE(
386     [
387       #if defined(__sparc64__) && (__GNUC__ == 2)
388       #else
389       choke me
390       #endif
391     ],
392     [],
393     [
394       FIX_SHA1=''
395       AC_MSG_RESULT(yes)
396     ],
397       AC_MSG_RESULT(no)
398     )
399 fi
400 AC_SUBST(FIX_SHA1)
401
402 ##
403 ## Function and libary checking
404 ##
405 AC_CHECK_FUNCS(times clock time)
406 AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid getrusage setsid)
407
408 cryptover=`echo $VERSION | sed 's/\./ /g'`
409 maj=0
410 min=0
411 bld=0
412 for v in $cryptover
413 do
414   if test $maj -eq 0; then
415     maj=$v
416     continue
417   fi
418   if test $min -eq 0; then
419     min=$v
420     continue
421   fi
422   if test $bld -eq 0; then
423     bld=$v
424     continue
425   fi
426 done
427 __CRYPTO_PACKAGE_VERSION="#define __SILC_CRYPTO_VERSION SILC_VERSION($maj,$min,$bld)"
428
429
430 ##
431 ##  Enable/disable checking
432 ##
433
434 #ifdef SILC_DIST_INPLACE
435 #
436 # Profiling options (never delivered to distributions)
437 #
438 AC_MSG_CHECKING(whether to enable gprof)
439 AC_ARG_ENABLE(gprof,
440   [  --enable-gprof          enable gprof profiling],
441   [
442     case "${enableval}" in
443       yes)
444         AC_MSG_RESULT(yes)
445         SILC_ADD_CFLAGS(-pg)
446         LIBS="$LIBS -pg"
447         ;;
448       *)
449         AC_MSG_RESULT(no)
450         ;;
451     esac
452   ],
453   [
454     AC_MSG_RESULT(no)
455   ])
456
457 AC_MSG_CHECKING(whether to enable gcov)
458 AC_ARG_ENABLE(gcov,
459   [  --enable-gcov           enable gcov],
460   [
461     case "${enableval}" in
462       yes)
463         AC_MSG_RESULT(yes)
464         SILC_ADD_CFLAGS(-fprofile-arcs)
465         LIBS="$LIBS -lgcov"
466         ;;
467       *)
468         AC_MSG_RESULT(no)
469         ;;
470     esac
471   ],
472   [
473     AC_MSG_RESULT(no)
474   ])
475 #endif SILC_DIST_INPLACE
476
477 # Debug checking
478 AC_MSG_CHECKING(whether to enable debugging)
479 summary_debug="no"
480 AC_ARG_ENABLE(debug,
481   [  --enable-debug          enable debugging],
482   [
483     case "${enableval}" in
484       yes)
485         AC_MSG_RESULT(yes)
486         summary_debug="yes"
487         ;;
488       *)
489         AC_MSG_RESULT(no)
490         ;;
491     esac
492   ],
493   [
494     AC_MSG_RESULT(no)
495   ])
496
497 # Disable all assembler optimizations
498 AC_MSG_CHECKING(whether to enable assembler optimizations)
499 AC_ARG_ENABLE(asm,
500   [  --disable-asm           do not use assembler optimizations],
501   [
502     AC_MSG_RESULT(no)
503     AC_DEFINE([SILC_NO_ASM], [], [SILC_NO_ASM])
504     want_asm=false
505   ],
506   [
507     AC_MSG_RESULT(yes)
508     want_asm=true
509   ])
510 AM_CONDITIONAL(SILC_NO_ASM, test x$want_asm = xfalse)
511
512 # Check for assembler
513 SILC_ASSEMBLER=""
514 have_assembler=false
515 if test x$want_asm = xtrue; then
516   ASM_FLAGS=
517   if test x$x_have_cpu_sse2 = xtrue; then
518     ASM_FLAGS="$ASM_FLAGS -D SILC_CPU_SSE2"
519   fi
520   if test x$x_have_cpu_pni = xtrue; then
521     ASM_FLAGS="$ASM_FLAGS -D SILC_CPU_SSE3"
522   fi
523   if test x$x_have_cpu_ssse3 = xtrue; then
524     ASM_FLAGS="$ASM_FLAGS -D SILC_CPU_SSSE3"
525   fi
526   if test x$x_have_cpu_sse4_1 = xtrue; then
527     ASM_FLAGS="$ASM_FLAGS -D SILC_CPU_SSE41"
528   fi
529   if test x$x_have_cpu_sse4_2 = xtrue; then
530     ASM_FLAGS="$ASM_FLAGS -D SILC_CPU_SSE42"
531   fi
532
533   AC_PATH_PROG([NASM], [nasm], [no])
534   if test "x$NASM" != "xno"; then
535     if test x$cpu_x86_64 = xtrue; then
536       SILC_ASSEMBLER="$NASM -O2 -felf64 $ASM_FLAGS"
537     else
538       SILC_ASSEMBLER="$NASM -O2 -felf $ASM_FLAGS"
539     fi
540     have_assembler=true
541   fi
542
543   AC_PATH_PROG([YASM], [yasm], [no])
544   if test "x$YASM" != "xno"; then
545     if test x$cpu_x86_64 = xtrue; then
546       SILC_ASSEMBLER="$YASM -Xgnu -felf64 $ASM_FLAGS"
547     else
548       SILC_ASSEMBLER="$YASM -Xgnu -felf $ASM_FLAGS"
549     fi
550     have_assembler=true
551   fi
552 fi
553 AC_SUBST(SILC_ASSEMBLER)
554
555 ##
556 ##  With/without checkings
557 ##
558
559 # MP library checking. First check whether user wants to use GMP and use
560 # it if found. If not or not defined then compile the default library in the
561 # source tree.
562 #
563 mp_gmp=false
564 SAVE_LIBS="$LIBS"
565 SAVE_CFLAGS="$CFLAGS"
566 SAVE_LDFLAGS="$LDFLAGS"
567 AC_MSG_CHECKING(whether to search for GMP)
568 AC_ARG_WITH(gmp,
569   [[  --with-gmp[=DIR]        use GMP instead of SILC Math [search in DIR/lib and DIR/include]]],
570   [
571     case "$withval" in
572       no)
573         AC_MSG_RESULT(no)
574         ;;
575       *)
576         AC_MSG_RESULT(yes)
577
578         if test -d "$withval/include"; then
579           CFLAGS="$CFLAGS -I$withval/include"
580         fi
581         if test -d "$withval/lib"; then
582           LDFLAGS="$LDFLAGS -L$withval/lib"
583         fi
584
585         LIBS="-lgmp $LIBS"
586         ;;
587     esac
588
589     AC_CHECK_LIB(gmp, __gmpz_init,
590       [
591         mp_gmp=true
592         AC_DEFINE([SILC_MP_GMP], [], [GMP])
593         AC_MSG_RESULT(Using GMP as a MP library.)
594       ],
595       [
596         LIBS="$SAVE_LIBS"
597         CFLAGS="$SAVE_CFLAGS"
598         LDFLAGS="$SAVE_LDFLAGS"
599       ])
600   ],
601     AC_MSG_RESULT(no)
602   )
603
604 AM_CONDITIONAL(SILC_MP_GMP, test x$mp_gmp = xtrue)
605 AM_CONDITIONAL(SILC_MP_SILCMATH, test x$mp_gmp = xfalse)
606 if test x$mp_gmp = xfalse; then
607   AC_DEFINE([SILC_MP_SILCMATH], [], [SILCMATH])
608   AC_MSG_RESULT(Using SILC Math as a MP library.)
609 fi
610
611
612 ##
613 ## Native WIN32 compilation under cygwin
614 ##
615 AC_MSG_CHECKING(whether to compile native WIN32 code)
616 AC_ARG_WITH(win32,
617   [  --with-win32            compile native WIN32 (MinGW) code (-mno-cygwin)],
618   [
619     AC_MSG_RESULT(yes)
620     AC_DEFINE([SILC_WIN32], [], [SILC_WIN32])
621     win32_support=true
622     CFLAGS="-mno-cygwin $CFLAGS"
623     LIBS="$LIBS -lwsock32"
624   ],
625   [
626     AC_MSG_RESULT(no)
627     win32_support=false
628   ])
629 AM_CONDITIONAL(SILC_WIN32, test x$win32_support = xtrue)
630
631
632 ##
633 ## Include configure fragments
634 ##
635 AD_INCLUDE_CONFIGURE
636
637
638 ##
639 ## Outputs and substitutions
640 ##
641
642 AC_SUBST(LIBSUBDIR)
643 AC_SUBST(SILC_TOP_SRCDIR)
644 AC_SUBST(LDFLAGS)
645 AC_SUBST(LIBS)
646 AC_SUBST(SILC_LIB_INCLUDES)
647 AC_SUBST(__CRYPTO_PACKAGE_VERSION)
648
649 # Native Symbian OS support (disabled by default)
650 AM_CONDITIONAL(SILC_SYMBIAN, test xfalse = xtrue)
651
652 # Make enable-shared aware
653 AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes)
654
655 ETCDIR=`eval echo $sysconfdir`;ETCDIR=`eval echo $ETCDIR`
656 AC_SUBST(ETCDIR)
657 AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
658
659 DOCDIR=`eval echo $docdir`;DOCDIR=`eval echo $DOCDIR`
660 AC_SUBST(DOCDIR)
661 AC_DEFINE_UNQUOTED([SILC_DOCDIR], "$DOCDIR", [SILC_DOCDIR])
662
663 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
664 AC_SUBST(INCLUDE_DEFINES_INT)
665
666 DATE=`date`
667 AC_SUBST(DATE)
668
669
670 #
671 # Makefile outputs
672 #
673 AC_CONFIG_FILES(
674 Makefile
675 doc/Makefile
676 doc/crypto.in/index.html
677 doc/crypto.in/manual.html
678 Makefile.defines
679 Makefile.defines_int
680 includes/Makefile
681 apps/Makefile
682 win32/Makefile
683 )
684
685 AC_CONFIG_FILES(
686 lib/Makefile
687 lib/silccrypt/Makefile
688 lib/silccrypt/silccrypto.h
689 lib/silccrypt/tests/Makefile
690 lib/silcasn1/Makefile
691 lib/silcasn1/tests/Makefile
692 lib/silcacc/Makefile
693 lib/silcacc/tests/Makefile
694 #ifdef SILC_DIST_SSH
695 lib/silcssh/Makefile
696 lib/silcssh/tests/Makefile
697 #endif SILC_DIST_SSH
698 #ifdef SILC_DIST_PGP
699 lib/silcpgp/Makefile
700 lib/silcpgp/tests/Makefile
701 #endif SILC_DIST_PGP
702 #ifdef SILC_DIST_PKIX
703 lib/silcpkix/Makefile
704 lib/silcpkix/tests/Makefile
705 #endif SILC_DIST_PKIX
706 lib/silcskr/Makefile
707 lib/silcskr/tests/Makefile
708 lib/silcmath/Makefile
709 lib/silcmath/tests/Makefile
710 lib/sct.pc
711 )
712
713 AC_OUTPUT
714
715 ##
716 ## Summary output
717 ##
718
719 s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
720 s_sbindir=`eval echo $sbindir`;s_sbindir=`eval echo $s_sbindir`
721 s_mandir=`eval echo $mandir`;s_mandir=`eval echo $s_mandir`
722 s_includedir=`eval echo $includedir`;s_includedir=`eval echo $s_includedir`
723
724 echo ""
725 echo "SILC Crypto Toolkit configuration summary:"
726 echo "-----------------------------------------"
727 echo " Target host ...................: $target"
728 echo " Compiler ......................: $CC"
729 echo " CFLAGS ........................: $CFLAGS"
730 echo " LDFLAGS .......................: $LDFLAGS"
731 echo " LIBS ..........................: $LIBS"
732 echo ""
733 echo " Installation prefix ...........: $prefix"
734 echo " bin directory .................: $s_bindir"
735 echo " sbin directory ................: $s_sbindir"
736 echo " etc directory .................: $ETCDIR"
737 echo " man directory .................: $s_mandir"
738 echo " doc directory .................: $DOCDIR"
739 echo " include directory .............: $s_includedir"
740 echo ""
741
742 if test x$mp_gmp = xtrue; then
743   echo " Arithmetic library ............: GMP"
744 fi
745
746 if test x$want_asm = xfalse; then
747   summary_asm="no"
748 else
749   summary_asm="yes"
750 fi
751 echo " Assembler optimizations .......: $summary_asm"
752
753 if test x$want_cc_optimizations = xfalse; then
754   summary_cc_opt="no"
755 else
756   summary_cc_opt="yes"
757 fi
758 echo " Compiler optimizations ........: $summary_cc_opt"
759
760 if test x$want_cpu_optimizations = xfalse; then
761   summary_cpu_opt="no"
762 else
763   summary_cpu_opt="yes"
764 fi
765 echo " CPU feature optimizations .....: $summary_cpu_opt"
766
767 threads="no"
768 if test x$has_threads = xtrue; then
769   threads="yes"
770 fi
771 echo " Multi-threads support .........: $threads"
772 echo " Debugging enabled .............: $summary_debug"
773 echo ""
774 echo "Compile the sources with 'make' or 'gmake' command."