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