Mac OS X >= 10.7 support
[runtime.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(runtimedefs.h)
23
24 AC_PROG_INSTALL
25 AC_PROG_MAKE_SET
26
27 AC_PROG_LN_S
28 AC_PROG_EGREP
29 AC_SUBST(LN_S)
30 AC_PATH_PROG(sedpath, sed)
31
32 AC_PROG_CC
33 AM_PROG_AS
34 AC_C_INLINE
35 AC_C_CONST
36
37 AC_PROG_RANLIB
38 #ifdef SILC_DIST_INPLACE
39 AC_DISABLE_SHARED
40 #endif SILC_DIST_INPLACE
41 AC_PROG_LIBTOOL
42
43 SILC_TOP_SRCDIR=`pwd`
44
45 ##
46 ## Library versioning.
47 ##
48
49 # Do the releases and library versioning according to following rules:
50 #
51 #  - If any code has changed in library, increment RUNTIME_REVISION
52 #  - If API were added, removed or changed, set RUNTIME_REVISION to 0
53 #  - If API were added, removed or changed, increment RUNTIME_CURRENT
54 #  - If APi were added, increment RUNTIME_AGE
55 #  - If API were removed, set RUNTIME_AGE to 0
56 #
57
58 # Base version for library.
59 RUNTIME_BASE_VERSION=1.2
60
61 # libsilc versions
62 RUNTIME_CURRENT=1               # prev = 0
63 RUNTIME_REVISION=0              # prev = 0
64 RUNTIME_AGE=0                   # prev = 0
65
66 # Substitute the version numbers
67 AC_SUBST(RUNTIME_BASE_VERSION)
68 AC_SUBST(RUNTIME_CURRENT)
69 AC_SUBST(RUNTIME_REVISION)
70 AC_SUBST(RUNTIME_AGE)
71
72
73 ##
74 ##  Installation
75 ##
76
77 # Default installation destination
78 AC_PREFIX_DEFAULT(/usr/local)
79 if test "x$prefix" != xNONE; then
80   silc_prefix="$prefix"
81 else
82   silc_prefix="$ac_default_prefix"
83   prefix="$silc_prefix"
84 fi
85
86
87 ##
88 ## Detect CPU
89 ##
90
91 # Disable all CPU feature optimizations
92 AC_MSG_CHECKING(whether to enable CPU feature optimizations)
93 AC_ARG_ENABLE(cpu-optimizations,
94   [  --disable-cpu-optimizations  do not use any CPU feature optimizations],
95   [
96     AC_MSG_RESULT(no)
97     AC_DEFINE([SILC_NO_CPU_OPTIMIZATIONS], [], [SILC_NO_CPU_OPTIMIZATIONS])
98     want_cpu_optimizations=false
99   ],
100   [
101     AC_MSG_RESULT(yes)
102     want_cpu_optimizations=true
103   ])
104 AM_CONDITIONAL(SILC_NO_CPU_OPTIMIZATIONS,
105                test x$want_cpu_optimizations = xfalse)
106
107 SILC_SYSTEM_IS_SMP(AC_DEFINE([SILC_SMP], [], [SILC_SMP]), [],
108                    AC_DEFINE([SILC_SMP], [], [SILC_SMP]))
109 cpu_i386=false
110 cpu_i486=false
111 cpu_i586=false
112 cpu_i686=false
113 cpu_i786=false
114 cpu_x86_64=false
115 cpu_ppc=false
116 cpu_ia64=false
117 case "$host_cpu" in
118   # All following Intels are considered 32-bit CPUs.
119   i?86)
120     # All CPUs of today are considered i386 and i486 compatible */
121     AC_DEFINE([SILC_I386], [], [SILC_I386])
122     AC_DEFINE([SILC_I486], [], [SILC_I486])
123     cpu_i386=true
124     cpu_i486=true
125
126     if test "x$host_cpu" = "xi586"; then
127       AC_DEFINE([SILC_I586], [], [SILC_I586])
128       cpu_i586=true
129     fi
130
131     if test "x$host_cpu" = "xi686"; then
132       AC_DEFINE([SILC_I586], [], [SILC_I586])
133       AC_DEFINE([SILC_I686], [], [SILC_I686])
134       cpu_i586=true
135       cpu_i686=true
136     fi
137
138     if test "x$host_cpu" = "xi786"; then
139       AC_DEFINE([SILC_I586], [], [SILC_I586])
140       AC_DEFINE([SILC_I686], [], [SILC_I686])
141       AC_DEFINE([SILC_I786], [], [SILC_I786])
142       cpu_i586=true
143       cpu_i686=true
144       cpu_i786=true
145     fi
146
147     # Check for specific CPU features
148     SILC_CPU_FLAG(mmx, true, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
149     SILC_CPU_FLAG(sse2, true, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
150     SILC_CPU_FLAG(pni, true, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
151     SILC_CPU_FLAG(ssse3, true, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
152     SILC_CPU_FLAG(sse4a, true, AC_DEFINE([SILC_CPU_SSE4A], [], [SILC_CPU_SSE4A]), [])
153     SILC_CPU_FLAG(sse4_1, true, AC_DEFINE([SILC_CPU_SSE41], [], [SILC_CPU_SSE41]), [])
154     SILC_CPU_FLAG(sse4_2, true, AC_DEFINE([SILC_CPU_SSE42], [], [SILC_CPU_SSE42]), [])
155     SILC_CPU_FLAG(sse5, true, AC_DEFINE([SILC_CPU_SSE5], [], [SILC_CPU_SSE5]), [])
156     ;;
157
158   # Intel IA-64, 64-bit CPU (not x86_64 compatible)
159   ia64)
160     AC_DEFINE([SILC_IA64], [], [SILC_IA64])
161     cpu_ia64=true
162     ;;
163
164   # AMD/Intel x86_64, 64-bit CPU
165   x86_64)
166     AC_DEFINE([SILC_X86_64], [], [SILC_X86_64])
167     cpu_x86_64=true
168
169     # Check for specific CPU features
170     SILC_CPU_FLAG(mmx, true, AC_DEFINE([SILC_CPU_MMX], [], [SILC_CPU_MMX]), [])
171     SILC_CPU_FLAG(sse2, true, AC_DEFINE([SILC_CPU_SSE2], [], [SILC_CPU_SSE2]), [])
172     SILC_CPU_FLAG(pni, true, AC_DEFINE([SILC_CPU_SSE3], [], [SILC_CPU_SSE3]), [])
173     SILC_CPU_FLAG(ssse3, true, AC_DEFINE([SILC_CPU_SSSE3], [], [SILC_CPU_SSSE3]), [])
174     SILC_CPU_FLAG(sse4a, true, AC_DEFINE([SILC_CPU_SSE4A], [], [SILC_CPU_SSE4A]), [])
175     SILC_CPU_FLAG(sse4_1, true, AC_DEFINE([SILC_CPU_SSE41], [], [SILC_CPU_SSE41]), [])
176     SILC_CPU_FLAG(sse4_2, true, AC_DEFINE([SILC_CPU_SSE42], [], [SILC_CPU_SSE42]), [])
177     SILC_CPU_FLAG(sse5, true, AC_DEFINE([SILC_CPU_SSE5], [], [SILC_CPU_SSE5]), [])
178     ;;
179
180   # PowerPC, 32-bit and 64-bit CPUs
181   powerpc*)
182     AC_DEFINE([SILC_POWERPC], [], [SILC_POWERPC])
183     cpu_ppc=true
184     ;;
185 esac
186 AM_CONDITIONAL(SILC_I386, test x$cpu_i386 = xtrue)
187 AM_CONDITIONAL(SILC_I486, test x$cpu_i486 = xtrue)
188 AM_CONDITIONAL(SILC_I586, test x$cpu_i586 = xtrue)
189 AM_CONDITIONAL(SILC_I686, test x$cpu_i686 = xtrue)
190 AM_CONDITIONAL(SILC_7686, test x$cpu_i786 = xtrue)
191 AM_CONDITIONAL(SILC_X86_64, test x$cpu_x86_64 = xtrue)
192 AM_CONDITIONAL(SILC_POWERPC, test x$cpu_ppc = xtrue)
193 AM_CONDITIONAL(SILC_IA64, test x$cpu_ia64 = xtrue)
194
195 if test x$want_cpu_optimizations = xtrue; then
196   # Set some compiler options based on CPU
197   if test "x$CC" = "xicc"; then
198     # ICC flags
199     if test x$x_have_cpu_sse4_1 = xtrue; then
200       SILC_ADD_CFLAGS(-axS)
201     fi
202     if test x$x_have_cpu_ssse3 = xtrue; then
203       SILC_ADD_CFLAGS(-axT)
204     elif test x$x_have_cpu_pni = xtrue; then
205       SILC_ADD_CFLAGS(-axP)
206     elif test x$x_have_cpu_sse2 = xtrue; then
207       SILC_ADD_CFLAGS(-axW)
208     fi
209   else
210     # Other compilers
211     if test x$x_have_cpu_sse2 = xtrue; then
212       SILC_ADD_CFLAGS(-msse2)
213       SILC_ADD_CFLAGS(-ftree-vectorize)
214     fi
215     if test x$x_have_cpu_pni = xtrue; then
216       SILC_ADD_CFLAGS(-msse3)
217       SILC_ADD_CFLAGS(-ftree-vectorize)
218     fi
219     if test x$x_have_cpu_ssse3 = xtrue; then
220       SILC_ADD_CFLAGS(-mssse3)
221       SILC_ADD_CFLAGS(-ftree-vectorize)
222     fi
223     if test x$x_have_cpu_sse4_1 = xtrue; then
224       SILC_ADD_CFLAGS(-msse4)
225       SILC_ADD_CFLAGS(-ftree-vectorize)
226     fi
227     if test x$x_have_cpu_sse4_2 = xtrue; then
228       SILC_ADD_CFLAGS(-msse4)
229       SILC_ADD_CFLAGS(-ftree-vectorize)
230     fi
231     if test x$x_have_cpu_sse5 = xtrue; then
232       SILC_ADD_CFLAGS(-msse5)
233       SILC_ADD_CFLAGS(-ftree-vectorize)
234     fi
235   fi
236 fi
237
238
239 ##
240 ## Put here any platform specific stuff
241 ##
242
243 case "$target" in
244   *-*-linux*)
245     check_threads=true
246     CFLAGS=`echo $CFLAGS -D_GNU_SOURCE`
247     ;;
248   *-*-freebsd*)
249     check_threads=true
250     ;;
251   *-*-netbsd*)
252     check_threads=true
253     ;;
254   *-*-*bsd*)
255     check_threads=false
256     ;;
257   *-*-*darwin*)
258     check_threads=true
259     ;;
260   *)
261     check_threads=true
262     ;;
263 esac
264
265
266 ##
267 ## Header checking
268 ##
269 AC_HEADER_STDC
270 AC_HEADER_TIME
271 AC_HEADER_STAT
272
273 # More header checking
274 #
275 AC_CHECK_HEADERS(unistd.h string.h errno.h fcntl.h assert.h execinfo.h)
276 AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/time.h stddef.h)
277 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h xti.h netdb.h sys/resource.h)
278 AC_CHECK_HEADERS(pwd.h grp.h termcap.h paths.h)
279 AC_CHECK_HEADERS(ncurses.h signal.h ctype.h utime.h dirent.h)
280 AC_CHECK_HEADERS(arpa/inet.h sys/mman.h limits.h termios.h locale.h langinfo.h)
281
282
283 ##
284 ## Data type checking
285 ##
286 AC_TYPE_SIGNAL
287 AC_TYPE_SIZE_T
288 AC_TYPE_MODE_T
289 AC_TYPE_UID_T
290 AC_TYPE_PID_T
291 AC_CHECK_SIZEOF(long long, 0)
292 AC_SUBST(SILC_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
293 AC_CHECK_SIZEOF(long, 0)
294 AC_SUBST(SILC_SIZEOF_LONG, $ac_cv_sizeof_long)
295 AC_CHECK_SIZEOF(int, 0)
296 AC_SUBST(SILC_SIZEOF_INT, $ac_cv_sizeof_int)
297 AC_CHECK_SIZEOF(short, 0)
298 AC_SUBST(SILC_SIZEOF_SHORT, $ac_cv_sizeof_short)
299 AC_CHECK_SIZEOF(char, 0)
300 AC_SUBST(SILC_SIZEOF_CHAR, $ac_cv_sizeof_char)
301 AC_CHECK_SIZEOF(void *, 0)
302 AC_SUBST(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
303 AC_CHECK_TYPES(long long)
304 AC_CHECK_TYPES(long double)
305
306 # Check for big-endian machines
307 AC_C_BIGENDIAN
308
309
310 ##
311 ## Compiler and compiler flag checks
312 ##
313
314 # Disable all compiler optimizations
315 AC_MSG_CHECKING(whether to enable compiler optimizations)
316 AC_ARG_ENABLE(optimizations,
317   [  --disable-optimizations do not use any compiler optimizations],
318   [
319     AC_MSG_RESULT(no)
320     AC_DEFINE([SILC_NO_CC_OPTIMIZATIONS], [], [SILC_NO_CC_OPTIMIZATIONS])
321     want_cc_optimizations=false
322   ],
323   [
324     AC_MSG_RESULT(yes)
325     want_cc_optimizations=true
326   ])
327 AM_CONDITIONAL(SILC_NO_CC_OPTIMIZATIONS, test x$want_cc_optimizations = xfalse)
328
329 if test "$GCC"; then
330   # GCC specific options
331   if test "x$summary_debug" = "xyes"; then
332     SILC_ADD_CFLAGS(-g)
333   else
334     SILC_ADD_CFLAGS(-g)
335   fi
336   SILC_ADD_CFLAGS(-Wall -finline-functions)
337   SILC_ADD_CFLAGS(-Wno-pointer-sign)
338 else
339   # Other compilers
340   case "$target" in
341     alpha*-dec-osf*)
342       SILC_ADD_CFLAGS(-g3)
343       ;;
344     mips*-sgi-irix*)
345       SILC_ADD_CFLAGS(-g3)
346       ;;
347     *)
348       SILC_ADD_CFLAGS(-g)
349       ;;
350   esac
351
352   # Intel C++ Compiler flags
353   if test "x$CC" = "xicc"; then
354     SILC_ADD_CFLAGS(-restrict)
355     SILC_ADD_CFLAGS(-finline-functions)
356
357     # Don't define __GNUC__ except for system includes
358     SILC_ADD_CFLAGS(-gcc-sys)
359   fi
360 fi
361
362 if test x$want_cc_optimizations = xtrue; then
363   if test "$GCC"; then
364     # GCC specific options
365     if test "x$summary_debug" = "xyes"; then
366       SILC_ADD_CFLAGS(-O)
367     else
368       SILC_ADD_CFLAGS(-O2)
369     fi
370   else
371     # Other compilers
372     case "$target" in
373       alpha*-dec-osf*)
374         SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
375         ;;
376       mips*-sgi-irix*)
377         SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
378         ;;
379       *)
380         SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
381         ;;
382     esac
383   fi
384 fi
385
386
387 ##
388 ## Function and libary checking
389 ##
390 AC_CHECK_FUNCS(gethostname gethostbyaddr getservbyname getservbyport)
391 AC_CHECK_FUNCS(poll select listen bind shutdown close connect setsockopt)
392 AC_CHECK_FUNCS(setrlimit time ctime utime gettimeofday getrusage)
393 AC_CHECK_FUNCS(chmod fcntl stat fstat getenv putenv strerror)
394 AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid sched_yield)
395 AC_CHECK_FUNCS(setgroups initgroups nl_langinfo nanosleep)
396 AC_CHECK_FUNCS(strchr snprintf strstr strcpy strncpy memcpy memset memmove)
397 AC_CHECK_FUNCS(setenv getenv putenv unsetenv clearenv backtrace)
398
399 # Check getopt_long
400 AC_CHECK_FUNC(getopt_long,
401   [
402     AC_DEFINE([HAVE_GETOPT_LONG], [], [HAVE_GETOPT_LONG])
403     have_getopt_long=1
404   ], have_getopt_long=0
405 )
406
407 # Check gethostbyname
408 AC_CHECK_FUNC(gethostbyname, [],
409   [
410     AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl")
411     AC_CHECK_FUNC(res_gethostbyname, [],
412        AC_CHECK_LIB(resolv, res_gethostbyname, LIBS="$LIBS -lresolv")
413     )
414   ])
415
416 # Check socket
417 AC_CHECK_FUNC(socket, [],
418   AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
419 )
420
421 # Check clock_gettime
422 AC_CHECK_FUNC(clock_gettime, [],
423   [
424     AC_CHECK_LIB(rt, clock_gettime,
425                  [ LIBS="$LIBS -lrt"
426                    AC_DEFINE([HAVE_CLOCK_GETTIME], [], [HAVE_CLOCK_GETTIME])])
427   ])
428
429 # Check for epoll_wait and verify that epoll_create works
430 AC_CHECK_FUNC(epoll_wait,
431   [
432     AC_RUN_IFELSE([AC_LANG_SOURCE(
433       [
434         #include <sys/epoll.h>
435         int main()
436         {
437           int ret = epoll_create(5);
438           if (ret < 0)
439             return 1;
440           close(ret);
441           return 0;
442         }
443       ])],
444       [
445         AC_DEFINE([HAVE_EPOLL_WAIT], [1], [HAVE_EPOLL_WAIT])
446       ],
447     )
448   ])
449
450 # Check for va_copy
451 va_copy=false
452 __SILC_VA_COPY="#define __SILC_VA_COPY(dest, src) dest = src"
453 AC_MSG_CHECKING(for va_copy)
454 AC_TRY_COMPILE(
455   [
456     #include <stdarg.h>
457     #include <stdlib.h>
458   ],
459   [
460     int t(int x, ...)
461     {
462       va_list va, cp;
463       va_start(va, x);
464       va_copy(cp, va);
465       if (va_arg(cp, int) != 0xff11)
466         return 1;
467       va_end(va);
468       va_end(cp);
469       return 0;
470     }
471     int main()
472     {
473       return t(0, 0xff11);
474     }
475   ],
476   [
477     __SILC_VA_COPY="#define __SILC_VA_COPY(dest, src) va_copy(dest, src)"
478     AC_MSG_RESULT(yes)
479     va_copy=true
480   ],
481   [
482     AC_MSG_RESULT(no)
483     va_copy=false
484   ]
485 )
486
487 if test x$va_copy = xfalse; then
488   AC_MSG_CHECKING(for __va_copy)
489   AC_TRY_COMPILE(
490   [
491     #include <stdarg.h>
492     #include <stdlib.h>
493   ],
494   [
495     int t(int x, ...)
496     {
497       va_list va, cp;
498       va_start(va, x);
499       __va_copy(cp, va);
500       if (va_arg(cp, int) != 0xff11)
501         return 1;
502       va_end(va);
503       va_end(cp);
504       return 0;
505     }
506     int main()
507     {
508       return t(0, 0xff11);
509     }
510   ],
511   [
512     __SILC_VA_COPY="#define __SILC_VA_COPY(dest, src) __va_copy(dest, src)"
513     AC_MSG_RESULT(yes)
514     va_copy=true
515   ],
516   [
517     AC_MSG_RESULT(no)
518     va_copy=false
519   ]
520   )
521 fi
522
523 if test x$va_copy = xfalse; then
524   AC_RUN_IFELSE([AC_LANG_SOURCE(
525     [
526       #include <stdarg.h>
527       #include <stdlib.h>
528       int t(int x, ...)
529       {
530         va_list va, cp;
531         va_start(va, x);
532         cp = va;
533         if (va_arg(cp, int) != 0xff11)
534           return 1;
535         va_end(va);
536         va_end(cp);
537         return 0;
538       }
539       int main()
540       {
541         return t(0, 0xff11);
542       }
543     ])],
544     [va_copy=false],
545     [
546       AC_DEFINE([SILC_VA_COPY_ARRAY], [], [SILC_VA_COPY_ARRAY])
547       __SILC_VA_COPY="#define __SILC_VA_COPY(dest, src) memmove(dest, src, sizeof(va_list))"
548     ],
549     [va=copy=false]
550   )
551 fi
552 AC_SUBST(__SILC_VA_COPY)
553
554 # Check for timezone and tm_gmtoff for timezone information
555 AC_MSG_CHECKING(whether system has timezone)
556 AC_RUN_IFELSE([AC_LANG_SOURCE(
557   [
558     #include <stdio.h>
559     #include <time.h>
560     int main()
561     {
562       timezone = 0;
563       return 0;
564     }
565   ])],
566   [ AC_MSG_RESULT(yes)
567     AC_DEFINE([HAVE_TIMEZONE], [], [HAVE_TIMEZONE]) ],
568   [ AC_MSG_RESULT(no) ],
569   [ AC_MSG_RESULT(no) ]
570 )
571 AC_MSG_CHECKING(whether system has tm_gmtoff)
572 AC_RUN_IFELSE([AC_LANG_SOURCE(
573   [
574     #include <stdio.h>
575     #include <time.h>
576     int main()
577     {
578       struct tm tm;
579       tm.tm_gmtoff = 0;
580       return 0;
581     }
582   ])],
583   [ AC_MSG_RESULT(yes)
584     AC_DEFINE([HAVE_TM_GMTOFF], [], [HAVE_TM_GMTOFF]) ],
585   [ AC_MSG_RESULT(no) ],
586   [ AC_MSG_RESULT(no) ]
587 )
588 AC_MSG_CHECKING(whether system has __tm_gmtoff)
589 AC_RUN_IFELSE([AC_LANG_SOURCE(
590   [
591     #include <stdio.h>
592     #include <time.h>
593     int main()
594     {
595       struct tm tm;
596       tm.__tm_gmtoff = 0;
597       return 0;
598     }
599   ])],
600   [ AC_MSG_RESULT(yes)
601     AC_DEFINE([HAVE___TM_GMTOFF], [], [HAVE___TM_GMTOFF]) ],
602   [ AC_MSG_RESULT(no) ],
603   [ AC_MSG_RESULT(no) ]
604 )
605 AC_MSG_CHECKING(whether system has __tm_gmtoff__)
606 AC_RUN_IFELSE([AC_LANG_SOURCE(
607   [
608     #include <stdio.h>
609     #include <time.h>
610     int main()
611     {
612       struct tm tm;
613       tm.__tm_gmtoff__ = 0;
614       return 0;
615     }
616   ])],
617   [ AC_MSG_RESULT(yes)
618     AC_DEFINE([HAVE___TM_GMTOFF__], [], [HAVE___TM_GMTOFF__]) ],
619   [ AC_MSG_RESULT(no) ],
620   [ AC_MSG_RESULT(no) ]
621 )
622
623 # Check for dlopen() and friends
624 AC_CHECK_HEADERS(dlfcn.h,
625   [
626     AC_CHECK_LIB(dl, dlopen,
627       [
628         AC_DEFINE([HAVE_DLOPEN], [], [HAVE_DLOPEN])
629         LIBS="$LIBS -ldl"
630       ],
631       [
632         AC_CHECK_LIB(c, dlopen,
633           [
634             AC_DEFINE([HAVE_DLOPEN], [], [HAVE_DLOPEN])
635           ])
636       ])
637   ])
638
639 __SILC_ENABLE_DEBUG=""
640
641 runtimever=`echo $VERSION | sed 's/\./ /g'`
642 maj=0
643 min=0
644 bld=0
645 for v in $runtimever
646 do
647   if test $maj -eq 0; then
648     maj=$v
649     continue
650   fi
651   if test $min -eq 0; then
652     min=$v
653     continue
654   fi
655   if test $bld -eq 0; then
656     bld=$v
657     continue
658   fi
659 done
660 __RUNTIME_PACKAGE_VERSION="#define __SILC_RUNTIME_VERSION SILC_VERSION($maj,$min,$bld)"
661
662
663 ##
664 ##  Enable/disable checking
665 ##
666
667 # IPv6 support
668 AC_MSG_CHECKING(whether to enable IPv6 support)
669 AC_ARG_ENABLE(ipv6,
670   [  --enable-ipv6           enable IPv6 support],
671   [
672     case "${enableval}" in
673       yes)
674         want_ipv6=true
675         check_ipv6=false
676         summary_ipv6="yes"
677         AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
678         AC_MSG_RESULT(yes)
679         ;;
680       *)
681         want_ipv6=false
682         check_ipv6=false
683         summary_ipv6="no"
684         AC_MSG_RESULT(no)
685         ;;
686     esac
687   ],
688     check_ipv6=true
689   )
690
691 if test x$check_ipv6 = xtrue; then
692   summary_ipv6="no"
693   AC_TRY_COMPILE(
694     [
695       #ifdef HAVE_SYS_TYPES_H
696       #include <sys/types.h>
697       #endif
698       #ifdef HAVE_NETINET_TCP_H
699       #include <netinet/tcp.h>
700       #endif
701       #ifdef HAVE_NETDB_H
702       #include <netdb.h>
703       #endif
704       #include <sys/socket.h>
705       #ifdef HAVE_NETINET_IN_H
706       #include <netinet/in.h>
707       #endif
708     ],
709     [
710       struct sockaddr_in6 sin6;
711       int family = AF_INET6;
712     ],
713     [
714       AC_DEFINE([HAVE_IPV6], [], [HAVE_IPV6])
715       AC_MSG_RESULT(yes)
716       summary_ipv6="yes"
717     ],
718       AC_MSG_RESULT(no)
719     )
720 fi
721
722 # Memory alignment.  User can specify what alignment memory allocation and
723 # SilcStack allocation use.  Default is system default alignemnt.
724 AC_ARG_WITH(alignment,
725   [  --with-alignment=NUMBER Memory alignment in bytes],
726   [
727     AC_DEFINE_UNQUOTED([SILC_ALIGNMENT], [$withval], [SILC_ALIGNMENT])
728     AC_MSG_RESULT(Memory allocation alignment is $withval bytes)
729   ],
730   [
731     AC_DEFINE([SILC_ALIGNMENT], SILC_SIZEOF_VOID_P, [SILC_ALIGNMENT])
732   ])
733
734 # Memory trace checking
735 __SILC_ENABLE_MEMTRACE=""
736 AC_MSG_CHECKING(whether to enable memory tracing)
737 AC_ARG_ENABLE(mem-trace,
738   [  --enable-mem-trace      enable memory tracing],
739   [
740     case "${enableval}" in
741     yes)
742       AC_MSG_RESULT(yes)
743       AC_DEFINE([SILC_MEMTRACE], [], [SILC_MEMTRACE])
744       __SILC_ENABLE_MEMTRACE="#define __SILC_ENABLE_MEMTRACE 1"
745       CFLAGS="$CFLAGS -rdynamic"
746       PC_CFLAGS="$PC_CFLAGS -rdynamic"
747       ;;
748     *)
749       AC_MSG_RESULT(no)
750       ;;
751     esac
752   ],
753     AC_MSG_RESULT(no)
754   )
755
756 #ifdef SILC_DIST_INPLACE
757 #
758 # Profiling options (never delivered to distributions)
759 #
760 AC_MSG_CHECKING(whether to enable gprof)
761 AC_ARG_ENABLE(gprof,
762   [  --enable-gprof          enable gprof profiling],
763   [
764     case "${enableval}" in
765       yes)
766         AC_MSG_RESULT(yes)
767         SILC_ADD_CFLAGS(-pg)
768         LIBS="$LIBS -pg"
769         ;;
770       *)
771         AC_MSG_RESULT(no)
772         ;;
773     esac
774   ],
775   [
776     AC_MSG_RESULT(no)
777   ])
778
779 AC_MSG_CHECKING(whether to enable gcov)
780 AC_ARG_ENABLE(gcov,
781   [  --enable-gcov           enable gcov],
782   [
783     case "${enableval}" in
784       yes)
785         AC_MSG_RESULT(yes)
786         SILC_ADD_CFLAGS(-fprofile-arcs)
787         LIBS="$LIBS -lgcov"
788         ;;
789       *)
790         AC_MSG_RESULT(no)
791         ;;
792     esac
793   ],
794   [
795     AC_MSG_RESULT(no)
796   ])
797
798 AC_MSG_CHECKING(whether to have verbose compilation)
799 AC_ARG_ENABLE(verbose,
800   [  --enable-verbose        have verbose compilation],
801   [
802     case "${enableval}" in
803       yes)
804         AC_MSG_RESULT(yes)
805
806         # Add here any options to give verbose compilation output
807         SILC_ADD_CFLAGS(-ftree-vectorizer-verbose=2)
808         ;;
809       *)
810         AC_MSG_RESULT(no)
811         ;;
812     esac
813   ],
814   [
815     AC_MSG_RESULT(no)
816   ])
817 #endif SILC_DIST_INPLACE
818
819 # Debug checking
820 AC_MSG_CHECKING(whether to enable debugging)
821 summary_debug="no"
822 __SILC_ENABLE_DEBUG=""
823 AC_ARG_ENABLE(debug,
824   [  --enable-debug          enable debugging],
825   [
826     case "${enableval}" in
827       yes)
828         AC_MSG_RESULT(yes)
829         AC_DEFINE([SILC_DEBUG], [], [enable-debug])
830         PC_CFLAGS="$PC_CFLAGS -DSILC_DEBUG"
831         summary_debug="yes"
832         __SILC_ENABLE_DEBUG="#define __SILC_ENABLE_DEBUG 1"
833         ;;
834       *)
835         AC_MSG_RESULT(no)
836         ;;
837     esac
838   ],
839   [
840     AC_MSG_RESULT(no)
841   ])
842
843 # Disable all assembler optimizations
844 AC_MSG_CHECKING(whether to enable assembler optimizations)
845 AC_ARG_ENABLE(asm,
846   [  --disable-asm           do not use assembler optimizations],
847   [
848     AC_MSG_RESULT(no)
849     AC_DEFINE([SILC_NO_ASM], [], [SILC_NO_ASM])
850     want_asm=false
851   ],
852   [
853     AC_MSG_RESULT(yes)
854     want_asm=true
855   ])
856 AM_CONDITIONAL(SILC_NO_ASM, test x$want_asm = xfalse)
857
858 # Check for assembler
859 SILC_ASSEMBLER=""
860 have_assembler=false
861 if test x$want_asm = xtrue; then
862   AC_PATH_PROG([NASM], [nasm], [no])
863   if test "x$NASM" != "xno"; then
864     if test x$cpu_x86_64 = xtrue; then
865       SILC_ASSEMBLER="$NASM -O2 -felf64"
866     else
867       SILC_ASSEMBLER="$NASM -O2 -felf"
868     fi
869     have_assembler=true
870   fi
871
872   AC_PATH_PROG([YASM], [yasm], [no])
873   if test "x$YASM" != "xno"; then
874     if test x$cpu_x86_64 = xtrue; then
875       SILC_ASSEMBLER="$YASM -Xgnu -felf64"
876     else
877       SILC_ASSEMBLER="$YASM -Xgnu -felf"
878     fi
879     have_assembler=true
880   fi
881 fi
882 AC_SUBST(SILC_ASSEMBLER)
883
884
885 ##
886 ##  With/without checkings
887 ##
888
889 LIBSUBDIR=lib
890 LDFLAGS="-L\$(silc_top_srcdir)/lib $LDFLAGS"
891
892 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/contrib"
893 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcutil"
894 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silchttp"
895
896
897 # Check for iconv support
898 check_iconv=true
899 has_iconv=false
900 SAVE_LIBS="$LIBS"
901 SAVE_CFLAGS="$CFLAGS"
902 SAVE_LDFLAGS="$LDFLAGS"
903 SAVE_CPPFLAGS="$CPPFLAGS"
904 AC_MSG_CHECKING(whether to implicit search for libiconv)
905 AC_ARG_WITH(iconv,
906   [[  --with-iconv[=DIR]      use libiconv [search in DIR/include and DIR/lib]]],
907   [
908     case "${withval}" in
909       no)
910         AC_MSG_RESULT(no)
911         AC_CHECK_HEADERS(iconv.h,
912           [
913             AC_CHECK_FUNC(iconv, has_iconv=true)
914           ])
915         check_iconv=false
916         ;;
917       *)
918         AC_MSG_RESULT(yes)
919         if test -d $withval/include; then
920           CPPFLAGS="$CPPFLAGS -I$withval/include"
921           CFLAGS="$CFLAGS -I$withval/include"
922         fi
923         if test -d $withval/lib; then
924           LDFLAGS="$LDFLAGS -L$withval/lib"
925         fi
926         ;;
927     esac
928   ],
929   [
930     AC_MSG_RESULT(no)
931     AC_CHECK_HEADERS(iconv.h,
932       [
933         # Default check for iconv in C-library
934         AC_CHECK_FUNCS(iconv iconv_open iconv_close,
935           [
936             has_iconv=true
937             check_iconv=false
938           ])
939       ])
940   ])
941
942 if test x$check_iconv = xtrue; then
943   # Check for iconv in libiconv installed under /usr
944   AC_MSG_RESULT(Searching for iconv...)
945
946   # XXX
947   unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
948
949   AC_CHECK_HEADERS(iconv.h,
950     [
951       LIBS="$LIBS -liconv"
952       LDFLAGS="$LDFLAGS -L/usr/lib"
953       CFLAGS="$CFLAGS -I/usr/include"
954       CPPLAGS="$CPPFLAGS -I/usr/include"
955
956       AC_MSG_CHECKING(for iconv in -liconv)
957       AC_TRY_LINK(
958         [
959           #include <stdlib.h>
960           #include <iconv.h>
961         ],
962         [
963           iconv_t cd = iconv_open("", "");
964           iconv(cd, NULL, NULL, NULL, NULL);
965           iconv_close(cd);
966         ],
967         [
968           echo "yes"
969           AC_DEFINE([HAVE_ICONV], [], [Define if you have the iconv() function.])
970           has_iconv=true
971           check_iconv=false
972         ],
973         [
974           echo "no"
975           LIBS="$SAVE_LIBS"
976           CFLAGS="$SAVE_CFLAGS"
977           LDFLAGS="$SAVE_LDFLAGS"
978           CPPFLAGS="$SAVE_CPPFLAGS"
979         ])
980      ])
981 fi
982
983 if test x$check_iconv = xtrue; then
984   # search for iconv library..
985   SAVE_LIBS="$LIBS"
986   SAVE_CFLAGS="$CFLAGS"
987   SAVE_LDFLAGS="$LDFLAGS"
988   SAVE_CPPFLAGS="$CPPFLAGS"
989
990   for dir in `echo "/usr/local /usr/pkg /usr/contrib /opt/local"`; do
991     if test x$has_iconv = xfalse; then
992       AC_MSG_RESULT(searching in $dir...)
993
994       if test -d $dir/include; then
995         CPPFLAGS="$CPPFLAGS -I$dir/include"
996         CFLAGS="$CFLAGS -I$dir/include"
997       fi
998       if test -d $dir/lib; then
999         LDFLAGS="$LDFLAGS -L$dir/lib"
1000       fi
1001
1002       # XXX
1003       unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
1004
1005       AC_CHECK_HEADERS(iconv.h,
1006         [
1007           LIBS="$LIBS -liconv"
1008           AC_MSG_CHECKING(for iconv in -liconv)
1009           AC_TRY_LINK(
1010             [
1011               #include <stdlib.h>
1012               #include <iconv.h>
1013             ],
1014             [
1015               iconv_t cd = iconv_open("", "");
1016               iconv(cd, NULL, NULL, NULL, NULL);
1017               iconv_close(cd);
1018             ],
1019             [
1020               echo "yes"
1021               has_iconv=true
1022               AC_DEFINE([HAVE_ICONV], [], [Define if you have the iconv() function.])
1023             ],
1024             [
1025               echo "no"
1026               has_iconv=false
1027
1028               LIBS="$SAVE_LIBS"
1029               CFLAGS="$SAVE_CFLAGS"
1030               LDFLAGS="$SAVE_LDFLAGS"
1031               CPPFLAGS="$SAVE_CPPFLAGS"
1032             ])
1033          ],
1034          [
1035            CFLAGS="$SAVE_CFLAGS"
1036            LDFLAGS="$SAVE_LDFLAGS"
1037            CPPFLAGS="$SAVE_CPPFLAGS"
1038          ])
1039       fi
1040     done
1041 fi
1042
1043 if test x$has_iconv = xtrue; then
1044   # (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
1045   # (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
1046   #     obl when args 2 and 3 are 0 (fixed in glibc-2.1.3).
1047   #
1048   AC_CACHE_CHECK([whether this iconv is good enough], ac_cv_iconv_good,
1049     AC_TRY_RUN(
1050       [
1051         #include <iconv.h>
1052         int main() {
1053           iconv_t cd;
1054         changequote(, )dnl
1055           char buf[4];
1056         changequote([, ])dnl
1057           char *ob;
1058           size_t obl;
1059           ob = buf, obl = sizeof(buf);
1060           return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
1061                  (iconv(cd, 0, 0, &ob, &obl) ||
1062                  !(ob == buf && obl == sizeof(buf)) ||
1063                  iconv_close(cd)));
1064         }
1065       ],
1066       [
1067         ac_cv_iconv_good=yes
1068       ],
1069       [
1070         ac_cv_iconv_good=no
1071       ],
1072       [
1073         ac_cv_iconv_good=yes
1074       ])
1075     )
1076
1077   if test x$ac_cv_iconv_good = xno; then
1078     AC_MSG_RESULT(Try using libiconv instead.)
1079   fi
1080 fi
1081
1082 # Check for POSIX threads support
1083 AC_MSG_CHECKING(whether to search for POSIX threads)
1084 AC_ARG_WITH(pthreads,
1085   [[  --with-pthreads[=DIR]   use POSIX threads [search in DIR/include and DIR/lib]]],
1086   [
1087     case "${withval}" in
1088       no)
1089         check_threads=false
1090         ;;
1091       *)
1092         if test -d $withval/include; then
1093           CPPFLAGS="$CPPFLAGS -I$withval/include"
1094           CFLAGS="$CFLAGS -I$withval/include"
1095         fi
1096         if test -d $withval/lib; then
1097           LDFLAGS="$LDFLAGS -L$withval/lib"
1098         fi
1099
1100         check_threads=true
1101         ;;
1102     esac
1103   ])
1104
1105 if test x$check_threads = xtrue; then
1106   has_threads=false
1107   SAVE_LIBS="$LIBS"
1108   SAVE_CFLAGS="$CFLAGS"
1109   SAVE_LDFLAGS="$LDFLAGS"
1110   SAVE_CPPFLAGS="$CPPFLAGS"
1111
1112   AC_MSG_RESULT(yes)
1113   AC_CHECK_HEADERS(pthread.h,
1114     [
1115       LIBS="$LIBS -lpthread"
1116       AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
1117         [
1118           # FreeBSD
1119           case "${target}" in
1120             *-*-freebsd*)
1121               LIBS="$SAVE_LIBS -pthread"
1122               AC_CHECK_LIB(c_r, pthread_attr_init, has_threads=true, LIBS="$SAVE_LIBS")
1123               ;;
1124             *)
1125               LIBS="$SAVE_LIBS"
1126               ;;
1127           esac
1128         ])
1129     ],
1130     [
1131       # search for pthread library..
1132       for dir in `echo "/usr/local /usr/pkg /usr/contrib /usr/pkg/pthreads /usr/local/pthreads"`; do
1133         if test x$has_threads = xfalse; then
1134           AC_MSG_RESULT(searching in $dir...)
1135
1136           if test -d $dir/include; then
1137             CPPFLAGS="$CPPFLAGS -I$dir/include"
1138             CFLAGS="$CFLAGS -I$dir/include"
1139           fi
1140           if test -d $dir/lib; then
1141             LDFLAGS="$LDFLAGS -L$dir/lib"
1142           fi
1143
1144           # XXX
1145           unset ac_cv_header__pthread_h_ ac_cv_header_pthread_h || true
1146
1147           AC_CHECK_HEADERS(pthread.h,
1148             [
1149               LIBS="$LIBS -lpthread"
1150               AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
1151                 [
1152                   has_threads=false
1153
1154                   LIBS="$SAVE_LIBS"
1155                   CFLAGS="$SAVE_CFLAGS"
1156                   LDFLAGS="$SAVE_LDFLAGS"
1157                   CPPFLAGS="$SAVE_CPPFLAGS"
1158                 ])
1159             ],
1160             [
1161               CFLAGS="$SAVE_CFLAGS"
1162               LDFLAGS="$SAVE_LDFLAGS"
1163               CPPFLAGS="$SAVE_CPPFLAGS"
1164             ])
1165         fi
1166       done
1167     ])
1168 else
1169   AC_MSG_RESULT(no)
1170   has_threads=false
1171 fi
1172
1173 __SILC_HAVE_PTHREAD=""
1174 AM_CONDITIONAL(SILC_THREADS, test x$has_threads = xtrue)
1175 if test x$has_threads = xtrue; then
1176   CFLAGS="$CFLAGS -D_REENTRANT"
1177
1178   # XXX possibly incomplete
1179   case "${target}" in
1180     *-*-aix*)
1181       CFLAGS="$CFLAGS -D_THREAD_SAFE"
1182       if test x"$GCC" = xyes; then
1183         CFLAGS="$CFLAGS -mthreads"
1184       fi
1185       ;;
1186     *-*-freebsd*)
1187       CFLAGS="$CFLAGS -D_THREAD_SAFE"
1188       ;;
1189     *-*-sysv5uw7*)  # UnixWare 7
1190       if test "$GCC" != "yes"; then
1191         CFLAGS="$CFLAGS -Kthread"
1192       else
1193         CFLAGS="$CFLAGS -pthread"
1194       fi
1195       ;;
1196     *-dg-dgux*)  # DG/UX
1197       CFLAGS="$CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
1198       ;;
1199    esac
1200
1201   # Check for threads
1202   AC_CHECK_FUNCS(pthread_create pthread_key_create pthread_once)
1203
1204   # Check for read/write locks
1205   AC_CHECK_FUNC(pthread_rwlock_init,
1206   [
1207     AC_RUN_IFELSE([AC_LANG_SOURCE(
1208       [
1209         #include <pthread.h>
1210         int main()
1211         {
1212           pthread_rwlock_t rwlock;
1213           pthread_rwlock_init(&rwlock, NULL);
1214           pthread_rwlock_destroy(&rwlock);
1215           return 0;
1216         }
1217       ])],
1218       [],
1219       [
1220         # Rwlock not defined
1221         CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600"
1222       ]
1223     )
1224   ],
1225   [
1226     # Rwlock not defined
1227     CFLAGS="$CFLAGS -D_XOPEN_SOURCE=600"
1228   ])
1229
1230   AC_DEFINE([SILC_HAVE_PTHREAD], [], [HAVE_PTHREAD])
1231   AC_DEFINE([SILC_THREADS], [], [HAVE_THREAD])
1232   __SILC_HAVE_PTHREAD="#define __SILC_HAVE_PTHREAD 1"
1233   PC_CFLAGS="$PC_CFLAGS -DSILC_THREADS"
1234 fi
1235
1236
1237 # Check for Expat
1238 AC_ARG_WITH(expat,
1239   [[  --with-expat[=DIR]      use Expat XML [search in DIR/include and DIR/lib]]],
1240   [
1241     case "${withval}" in
1242       no)
1243         ;;
1244       *)
1245         if test -d $withval/include; then
1246           CPPFLAGS="$CPPFLAGS -I$withval/include"
1247           CFLAGS="$CFLAGS -I$withval/include"
1248         fi
1249         if test -d $withval/lib; then
1250           LDFLAGS="$LDFLAGS -L$withval/lib"
1251         fi
1252         ;;
1253     esac
1254   ])
1255
1256 AC_CHECK_HEADERS(expat.h,
1257   [ LIBS="$LIBS -lexpat" ],
1258   [ AC_MSG_ERROR(Expat XML Library is required to compile SRT) ])
1259
1260
1261 ##
1262 ## Native WIN32 compilation under cygwin
1263 ##
1264 AC_MSG_CHECKING(whether to compile native WIN32 code)
1265 AC_ARG_WITH(win32,
1266   [  --with-win32            compile native WIN32 (MinGW) code (-mno-cygwin)],
1267   [
1268     AC_MSG_RESULT(yes)
1269     AC_DEFINE([SILC_WIN32], [], [SILC_WIN32])
1270     win32_support=true
1271     CFLAGS="-mno-cygwin $CFLAGS"
1272     LIBS="$LIBS -lwsock32"
1273   ],
1274   [
1275     AC_MSG_RESULT(no)
1276     win32_support=false
1277   ])
1278 AM_CONDITIONAL(SILC_WIN32, test x$win32_support = xtrue)
1279
1280
1281 ##
1282 ## Outputs and substitutions
1283 ##
1284
1285 AC_SUBST(LIBSUBDIR)
1286 AC_SUBST(SILC_TOP_SRCDIR)
1287 AC_SUBST(LDFLAGS)
1288 AC_SUBST(LIBS)
1289 AC_SUBST(SILC_LIB_INCLUDES)
1290 AC_SUBST(PC_CFLAGS)
1291 AC_SUBST(__SILC_ENABLE_DEBUG)
1292 AC_SUBST(__SILC_ENABLE_MEMTRACE)
1293 AC_SUBST(__SILC_HAVE_PTHREAD)
1294 AC_SUBST(__RUNTIME_PACKAGE_VERSION)
1295
1296 # Native Symbian OS support (disabled by default)
1297 AM_CONDITIONAL(SILC_SYMBIAN, test xfalse = xtrue)
1298
1299 # Make enable-shared aware
1300 AM_CONDITIONAL(SILC_ENABLE_SHARED, test "$enable_shared" = yes)
1301
1302 ETCDIR=`eval echo $sysconfdir`;ETCDIR=`eval echo $ETCDIR`
1303 AC_SUBST(ETCDIR)
1304 AC_DEFINE_UNQUOTED([SILC_ETCDIR], "$ETCDIR", [SILC_ETCDIR])
1305
1306 DOCDIR=`eval echo $docdir`;DOCDIR=`eval echo $DOCDIR`
1307 AC_SUBST(DOCDIR)
1308 AC_DEFINE_UNQUOTED([SILC_DOCDIR], "$DOCDIR", [SILC_DOCDIR])
1309
1310 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
1311 AC_SUBST(INCLUDE_DEFINES_INT)
1312
1313 DATE=`date`
1314 AC_SUBST(DATE)
1315
1316
1317 #
1318 # Makefile outputs
1319 #
1320 AC_CONFIG_FILES(
1321 Makefile
1322 doc/Makefile
1323 doc/runtime.in/index.html
1324 doc/runtime.in/manual.html
1325 Makefile.defines
1326 Makefile.defines_int
1327 includes/Makefile
1328 apps/Makefile
1329 win32/Makefile
1330 )
1331
1332 AC_CONFIG_FILES(
1333 lib/Makefile
1334 lib/contrib/Makefile
1335 lib/silcutil/silcruntime.h
1336 lib/silcutil/Makefile
1337 lib/silcutil/tests/Makefile
1338 lib/silcutil/unix/Makefile
1339 lib/silcutil/win32/Makefile
1340 lib/silcutil/symbian/Makefile
1341 lib/silchttp/Makefile
1342 lib/silchttp/tests/Makefile
1343 lib/srt.pc
1344 )
1345
1346 AC_OUTPUT
1347
1348
1349 ##
1350 ## Summary output
1351 ##
1352
1353 s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
1354 s_sbindir=`eval echo $sbindir`;s_sbindir=`eval echo $s_sbindir`
1355 s_mandir=`eval echo $mandir`;s_mandir=`eval echo $s_mandir`
1356 s_includedir=`eval echo $includedir`;s_includedir=`eval echo $s_includedir`
1357
1358 echo ""
1359 echo "SILC Runtime Toolkit configuration summary:"
1360 echo "------------------------------------------"
1361 echo " Target host ...................: $target"
1362 echo " Compiler ......................: $CC"
1363 echo " CFLAGS ........................: $CFLAGS"
1364 echo " LDFLAGS .......................: $LDFLAGS"
1365 echo " LIBS ..........................: $LIBS"
1366 echo ""
1367 echo " Installation prefix ...........: $prefix"
1368 echo " bin directory .................: $s_bindir"
1369 echo " sbin directory ................: $s_sbindir"
1370 echo " etc directory .................: $ETCDIR"
1371 echo " man directory .................: $s_mandir"
1372 echo " doc directory .................: $DOCDIR"
1373 echo " include directory .............: $s_includedir"
1374 echo ""
1375 echo " IPv6 support ..................: $summary_ipv6"
1376
1377 if test x$has_iconv = xfalse; then
1378   iconv_support="no"
1379 else
1380   iconv_support="yes"
1381 fi
1382 echo " Iconv support .................: $iconv_support"
1383
1384 if test x$want_asm = xfalse; then
1385   summary_asm="no"
1386 else
1387   summary_asm="yes"
1388 fi
1389 echo " Assembler optimizations .......: $summary_asm"
1390
1391 if test x$want_cc_optimizations = xfalse; then
1392   summary_cc_opt="no"
1393 else
1394   summary_cc_opt="yes"
1395 fi
1396 echo " Compiler optimizations ........: $summary_cc_opt"
1397
1398 if test x$want_cpu_optimizations = xfalse; then
1399   summary_cpu_opt="no"
1400 else
1401   summary_cpu_opt="yes"
1402 fi
1403 echo " CPU feature optimizations .....: $summary_cpu_opt"
1404
1405 threads="no"
1406 if test x$has_threads = xtrue; then
1407   threads="yes"
1408 fi
1409 echo " Multi-threads support .........: $threads"
1410 echo " Debugging enabled .............: $summary_debug"
1411 echo ""
1412 echo "Compile the sources with 'make' or 'gmake' command."