ae0645bdabc1f1844c4eb042488b06c3bef939c4
[silc.git] / configure.in.pre
1 #
2 #  configure.in.pre
3 #
4 #  Author: Pekka Riikonen <priikone@silcnet.org>
5 #
6 #  Copyright (C) 2000 - 2005 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 AC_INIT(includes/silcversion.h)
19
20 # Put here any platform specific stuff
21 #
22 AC_CANONICAL_SYSTEM
23 case "$target" in
24   *-*-freebsd*)
25     check_threads=true
26     ;;
27   *-*-*bsd*)
28     check_threads=false
29     ;;
30   *)
31     check_threads=true
32     ;;
33 esac
34
35 # ./prepare script will automatically put the correct version. Do not edit!
36 #
37 AM_INIT_AUTOMAKE(SILC_PACKAGE, SILC_VERSION)
38 AC_PREREQ(2.52)
39 AC_CONFIG_HEADERS(includes/silcdefs.h)
40
41 CFLAGS=
42 AC_PROG_CC
43 AC_C_INLINE
44 AC_C_CONST
45
46 AC_PROG_LN_S
47 AC_SUBST(LN_S)
48
49 ##
50 ## Distribution definition. ./prepare will automatically add here a correct
51 ## value. Do not edit!
52 ##
53 silc_dist=SILC_PACKAGE
54 SILC_DIST_SUBDIRS="SILC_DISTRIBUTION_SUBDIRS"
55 AC_DEFINE(SILC_DIST_DEFINE)
56
57 __SILC_HAVE_PTHREAD=""
58 __SILC_HAVE_SIM=""
59 __SILC_HAVE_LIBIDN=""
60 __SILC_ENABLE_DEBUG=""
61
62 #
63 # Program checking
64 #
65 AC_PROG_INSTALL
66 AC_PROG_RANLIB
67 AC_PROG_MAKE_SET
68 AC_DISABLE_SHARED
69 AC_PROG_LIBTOOL
70 AC_PATH_PROG(sedpath, sed)
71
72 # Header checking
73 #
74 AC_HEADER_STDC
75 AC_HEADER_TIME
76 AC_HEADER_STAT
77
78 # More header checking
79 #
80 AC_CHECK_HEADERS(unistd.h string.h getopt.h errno.h fcntl.h assert.h)
81 AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/time.h stddef.h)
82 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h xti.h netdb.h sys/resource.h)
83 AC_CHECK_HEADERS(pwd.h grp.h termcap.h paths.h)
84 AC_CHECK_HEADERS(ncurses.h signal.h ctype.h utime.h)
85 AC_CHECK_HEADERS(arpa/inet.h sys/mman.h limits.h termios.h locale.h langinfo.h)
86
87 # Data type checking
88 #
89 AC_TYPE_SIGNAL
90 AC_TYPE_SIZE_T
91 AC_TYPE_MODE_T
92 AC_TYPE_UID_T
93 AC_TYPE_PID_T
94
95 AC_CHECK_SIZEOF(long long, 0)
96 AC_SUBST(SILC_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
97 AC_CHECK_SIZEOF(long, 0)
98 AC_SUBST(SILC_SIZEOF_LONG, $ac_cv_sizeof_long)
99 AC_CHECK_SIZEOF(int, 0)
100 AC_SUBST(SILC_SIZEOF_INT, $ac_cv_sizeof_int)
101 AC_CHECK_SIZEOF(short, 0)
102 AC_SUBST(SILC_SIZEOF_SHORT, $ac_cv_sizeof_short)
103 AC_CHECK_SIZEOF(char, 0)
104 AC_SUBST(SILC_SIZEOF_CHAR, $ac_cv_sizeof_char)
105 AC_CHECK_SIZEOF(void *, 0)
106 AC_SUBST(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
107
108 # Function and library checking
109 #
110 AC_CHECK_FUNC(gethostbyname, [],
111   [
112     AC_CHECK_LIB(nsl, gethostbyname, LIBS="$LIBS -lnsl")
113     AC_CHECK_FUNC(res_gethostbyname, [],
114        AC_CHECK_LIB(resolv, res_gethostbyname, LIBS="$LIBS -lresolv")
115     )
116   ])
117 AC_CHECK_FUNC(socket, [],
118   AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket")
119 )
120 AC_CHECK_FUNCS(gethostname gethostbyaddr getservbyname getservbyport)
121 AC_CHECK_FUNCS(select listen bind shutdown close connect setsockopt)
122 AC_CHECK_FUNCS(time ctime utime gettimeofday getrusage)
123 AC_CHECK_FUNCS(chmod fcntl stat fstat getenv putenv strerror)
124 AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid)
125 AC_CHECK_FUNCS(setgroups initgroups nl_langinfo)
126 AC_CHECK_FUNCS(strchr strstr strcpy strncpy memcpy memset memmove)
127
128 # SIM support checking
129 # XXX These needs to be changed as more supported platforms appear.
130 # XXX This probably needs to be made platform dependant check.
131 #
132 sim_support=false
133 AC_MSG_CHECKING(for SIM support)
134 AC_MSG_RESULT()
135 AC_CHECK_HEADERS(dlfcn.h,
136   [
137     AC_CHECK_LIB(dl, dlopen,
138       [
139         AC_DEFINE(SILC_SIM)
140         sim_support=true
141         LIBS="$LIBS -ldl"
142       ],
143       [
144         AC_CHECK_LIB(c, dlopen,
145           [
146             AC_DEFINE(SILC_SIM)
147             sim_support=true
148           ])
149       ])
150    ])
151
152 AM_CONDITIONAL(SILC_SIM, test x$sim_support = xtrue)
153 if test x$sim_support = xtrue; then
154   AC_MSG_RESULT(Enabled SIM support.)
155   __SILC_HAVE_SIM="#define __SILC_HAVE_SIM 1"
156 else
157   AC_MSG_RESULT(No SIM support found.)
158 fi
159
160 # lib/contrib conditionals
161 #
162 AC_CHECK_HEADER(regex.h,
163   [
164     AC_DEFINE(HAVE_REGEX)
165     have_regex=1
166   ], have_regex=0
167 )
168 AM_CONDITIONAL(HAVE_REGEX, test x$have_regex = x1)
169
170 AC_CHECK_FUNC(getopt_long,
171   [
172     AC_DEFINE(HAVE_GETOPT_LONG)
173     have_getopt_long=1
174   ], have_getopt_long=0
175 )
176 AM_CONDITIONAL(HAVE_GETOPT_LONG, test x$have_getopt_long = x1)
177
178 ##
179 ##  Enable/disable checking
180 ##
181
182 # IPv6 support
183 #
184 AC_MSG_CHECKING(whether to enable IPv6 support)
185 AC_ARG_ENABLE(ipv6,
186   [  --enable-ipv6           enable IPv6 support],
187   [
188     case "${enableval}" in
189       yes)
190         want_ipv6=true
191         check_ipv6=false
192         summary_ipv6="yes"
193         AC_DEFINE(HAVE_IPV6)
194         AC_MSG_RESULT(yes)
195         ;;
196       *)
197         want_ipv6=false
198         check_ipv6=false
199         summary_ipv6="no"
200         AC_MSG_RESULT(no)
201         ;;
202     esac
203   ],
204     check_ipv6=true
205   )
206
207 if test x$check_ipv6 = xtrue; then
208   summary_ipv6="no"
209   AC_TRY_COMPILE(
210     [
211       #ifdef HAVE_SYS_TYPES_H
212       #include <sys/types.h>
213       #endif
214       #ifdef HAVE_NETINET_TCP_H
215       #include <netinet/tcp.h>
216       #endif
217       #ifdef HAVE_NETDB_H
218       #include <netdb.h>
219       #endif
220       #include <sys/socket.h>
221       #ifdef HAVE_NETINET_IN_H
222       #include <netinet/in.h>
223       #endif
224     ],
225     [
226       struct sockaddr_in6 sin6;
227       int family = AF_INET6;
228     ],
229     [
230       AC_DEFINE(HAVE_IPV6)
231       AC_MSG_RESULT(yes)
232       summary_ipv6="yes"
233     ],
234       AC_MSG_RESULT(no)
235     )
236 fi
237
238 # Debug checking
239 #
240 AC_MSG_CHECKING(whether to enable debugging)
241 summary_debug="no"
242 __SILC_ENABLE_DEBUG=""
243 AC_ARG_ENABLE(debug,
244   [  --enable-debug          enable debugging],
245   [
246     case "${enableval}" in
247       yes)
248         AC_MSG_RESULT(yes)
249         AC_DEFINE(SILC_DEBUG)
250         summary_debug="yes"
251         __SILC_ENABLE_DEBUG="#define __SILC_ENABLE_DEBUG 1"
252         ;;
253       *)
254         AC_MSG_RESULT(no)
255         ;;
256     esac
257   ],
258   [
259     AC_MSG_RESULT(no)
260   ])
261
262 # Disable all assembler optimizations
263 #
264 AC_MSG_CHECKING(whether to enable assembler optimizations)
265 want_asm=true
266 AC_ARG_ENABLE(asm,
267   [  --disable-asm           do not use assembler optimizations],
268   [
269     AC_MSG_RESULT(no)
270     want_asm=false
271   ],
272   [
273     AC_MSG_RESULT(yes)
274     want_asm=true
275   ])
276
277
278 ##
279 ## Compiler and compiler flag checks
280 ##
281
282 # Function to check if compiler flag works
283 # Usage: SILC_ADD_CFLAGS(FLAGS, [ACTION-IF-FAILED])
284 AC_DEFUN([SILC_ADD_CFLAGS],
285 [ tmp_CFLAGS="$CFLAGS"
286   CFLAGS="$CFLAGS $1"
287   AC_MSG_CHECKING(whether $CC accepts $1 flag)
288   AC_TRY_LINK([], [], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)
289                                        CFLAGS="$tmp_CFLAGS"
290                                        $2])
291   unset tmp_CFLAGS
292 ])
293
294 if test "$GCC"; then
295   # GCC specific options
296   if test "x$summary_debug" = "xyes"; then
297     SILC_ADD_CFLAGS(-g -O)
298   else
299     SILC_ADD_CFLAGS(-g -O2)
300   fi
301   SILC_ADD_CFLAGS(-Wall -finline-functions)
302 else
303   # Other compilers
304   case "$target" in
305     alpha*-dec-osf*)
306       SILC_ADD_CFLAGS(-g3 -O2, SILC_ADD_CFLAGS(-g3 -O, SILC_ADD_CFLAGS(-O)))
307       ;;
308     *)
309       SILC_ADD_CFLAGS(-g)
310       SILC_ADD_CFLAGS(-O2, SILC_ADD_CFLAGS(-O))
311       ;;
312   esac
313
314   # Intel C++ Compiler needs -restrict
315   if test "x$CC" = "xicc"; then
316     SILC_ADD_CFLAGS(-restrict)
317   fi
318 fi
319
320 #
321 # Workaround a bug in GCC 2.x which causes memory exhaustion
322 # when compiling sha1 with optimizations on UltraSPARC.
323 #
324 FIX_SHA1='#'
325 if test "$GCC" -a "$host_cpu" = "sparc64"; then
326   AC_MSG_CHECKING(whether to enable GCC 2.x workaround for SHA1)
327   AC_TRY_COMPILE(
328     [
329       #if defined(__sparc64__) && (__GNUC__ == 2)
330       #else
331       choke me
332       #endif
333     ],
334     [],
335     [
336       FIX_SHA1=''
337       AC_MSG_RESULT(yes)
338     ],
339       AC_MSG_RESULT(no)
340     )
341 fi
342 AC_SUBST(FIX_SHA1)
343
344 ##
345 ##  Installation
346 ##
347
348 # Default installation destination
349 #
350 AC_PREFIX_DEFAULT(/usr/local/silc)
351 if test "x$prefix" != xNONE; then
352   silc_prefix="$prefix"
353 else
354   silc_prefix="$ac_default_prefix"
355 fi
356
357 # etc directory
358 #
359 if test "x$sysconfdir" != 'x${prefix}/etc'; then
360   ETCDIR="$sysconfdir"
361 else
362   ETCDIR="$silc_prefix/etc"
363 fi
364
365 AC_ARG_WITH(etcdir,
366   [[  --with-etcdir=DIR       directory for system files [/etc/silc]]],
367   [
368     case "$withval" in
369       no|yes)
370         ;;
371       *)
372         ETCDIR="$withval"
373         ;;
374     esac
375   ])
376 AC_SUBST(ETCDIR)
377 AC_DEFINE_UNQUOTED(SILC_ETCDIR, "$ETCDIR")
378
379 # help directory
380 #
381 HELPDIR="$silc_prefix/help"
382 AC_ARG_WITH(helpdir,
383   [[  --with-helpdir=DIR      directory for SILC help files [PREFIX/help]]],
384   [
385     case "$withval" in
386       no|yes)
387         ;;
388       *)
389        HELPDIR="$withval"
390        ;;
391     esac
392   ])
393 AC_SUBST(HELPDIR)
394 AC_DEFINE_UNQUOTED(SILC_HELPDIR, "$HELPDIR")
395
396 # doc directory
397 #
398 DOCDIR="$silc_prefix/doc"
399 AC_ARG_WITH(docdir,
400   [[  --with-docdir=DIR       directory for SILC documentation [PREFIX/doc]]],
401   [
402     case "$withval" in
403       no|yes)
404         ;;
405       *)
406         DOCDIR="$withval"
407         ;;
408     esac
409   ])
410 AC_SUBST(DOCDIR)
411 AC_DEFINE_UNQUOTED(SILC_DOCDIR, "$DOCDIR")
412
413 # SIM modules directory
414 #
415 MODULESDIR="$silc_prefix/modules"
416 AC_ARG_WITH(simdir,
417   [[  --with-simdir=DIR       directory for SIM modules [PREFIX/modules]]],
418   [
419     case "$withval" in
420       no|yes)
421         ;;
422       *)
423         MODULESDIR="$withval"
424         ;;
425     esac
426   ])
427 AC_SUBST(MODULESDIR)
428 AC_DEFINE_UNQUOTED(SILC_MODULESDIR, "$MODULESDIR")
429
430 # Logs directory
431 #
432 LOGSDIR="$silc_prefix/logs"
433 AC_ARG_WITH(logsdir,
434   [[  --with-logsdir=DIR      directory for SILC Server logs [PREFIX/logs]]],
435   [
436     case "$withval" in
437       no|yes)
438         ;;
439       *)
440         LOGSDIR="$withval"
441         ;;
442     esac
443   ])
444 AC_SUBST(LOGSDIR)
445 AC_DEFINE_UNQUOTED(SILC_LOGSDIR, "$LOGSDIR")
446
447 # silcd config file checking
448 #
449 summary_silcd_configfile="/etc/silc/silcd.conf"
450 AC_ARG_WITH(silcd-config-file,
451   [[  --with-silcd-config-file=FILE  use FILE as default configuration file
452                                  for SILC Server [/etc/silc/silcd.conf]]],
453     AC_DEFINE_UNQUOTED(SILC_SERVER_CONFIG_FILE, "$withval")
454     summary_silcd_configfile="$withval"
455   )
456
457 # silcd pid file checking
458 #
459 if test "x$localstatedir" != 'x${prefix}/var'; then
460   PIDFILE="$localstatedir/silcd.pid"
461 else
462   PIDFILE="$silc_prefix/var/silcd.pid"
463 fi
464
465 AC_ARG_WITH(silcd-pid-file,
466   [[  --with-silcd-pid-file=FILE     use FILE as default pid file for SILC
467                                  Server [/var/run/silcd.pid]]],
468   [
469     case "$withval" in
470       no|yes)
471         ;;
472       *)
473         PIDFILE="$withval"
474         ;;
475     esac
476   ])
477 AC_SUBST(PIDFILE)
478
479
480 ##
481 ##  With/without checkings
482 ##
483
484 #
485 # SILC library checking
486 compile_libs=true
487
488 if test "x$silc_dist" != "xsilc-toolkit"; then
489
490 AC_ARG_WITH(silc-includes, 
491   [  --with-silc-includes=DIR SILC Toolkit includes [search in DIR]],
492   [ac_silc_includes="$withval"], [ac_silc_includes="no"])
493 AC_ARG_WITH(silc-libs,
494   [  --with-silc-libs=DIR     SILC Toolkit libraries [search in DIR]],
495   [ac_silc_libs="$withval"], [ac_silc_libs="no"])
496
497 #
498 # XXX missing checking the __SILC_WITH_XXX defines from the provided libs
499 # in order to determine correct libs to link.
500
501 #
502 # XXX missing pkg-config check.
503
504 if test "$ac_silc_includes" != "no"; then
505   compile_libs=false
506   SILC_LIB_INCLUDES="-I$ac_silc_includes"
507 fi
508 if test "$ac_silc_libs" != "no"; then
509   compile_libs=false
510   LIBS="$LIBS -L$ac_silc_libs"
511 fi
512
513 fi # silc_dist != silc-toolkit
514
515
516 # SOCKS4 support checking
517 #
518 SAVE_LIBS="$LIBS"
519 SAVE_CFLAGS="$CFLAGS"
520 SAVE_LDFLAGS="$LDFLAGS"
521 AC_MSG_CHECKING(whether to support SOCKS4)
522 AC_ARG_WITH(socks4,
523   [[  --with-socks4[=DIR]     with SOCKS4 support [search in DIR/lib and DIR/include]]],
524   [
525     case "$withval" in
526       no)
527         AC_MSG_RESULT(no)
528         ;;
529       *)
530         AC_MSG_RESULT(yes)
531         socks=4
532
533         if test -d "$withval/include"; then
534           CFLAGS="$CFLAGS -I$withval/include"
535         fi
536         if test -d "$withval/lib"; then
537           LDFLAGS="$LDFLAGS -L$withval/lib"
538         fi
539
540         LIBS="-lsocks $LIBS"
541         ;;
542     esac
543
544     AC_TRY_LINK([],
545       [
546         Rconnect();
547       ], [],
548       [
549         AC_MSG_ERROR(Could not find SOCKS4 library.)
550         LIBS="$SAVE_LIBS"
551         CFLAGS="$SAVE_CFLAGS"
552         LDFLAGS="$SAVE_LDFLAGS"
553       ])
554   ],
555     AC_MSG_RESULT(no)
556   )
557
558 # SOCKS5 support checking
559 #
560 SAVE_LIBS="$LIBS"
561 SAVE_CFLAGS="$CFLAGS"
562 SAVE_LDFLAGS="$LDFLAGS"
563 AC_MSG_CHECKING(whether to support SOCKS5)
564 AC_ARG_WITH(socks5,
565   [[  --with-socks5[=DIR]     with SOCKS5 support [search in DIR/lib and DIR/include]]],
566   [
567     case "$withval" in
568       no)
569         AC_MSG_RESULT(no)
570         ;;
571       *)
572         AC_MSG_RESULT(yes)
573         socks=5
574
575         if test -d "$withval/include"; then
576           CFLAGS="$CFLAGS -I$withval/include"
577         fi
578         if test -d "$withval/lib"; then
579           LDFLAGS="$LDFLAGS -L$withval/lib"
580         fi
581
582         LIBS="-lsocks5 $LIBS"
583         ;;
584     esac
585
586     AC_TRY_LINK([],
587       [
588         SOCKSconnect();
589       ], [],
590       [
591         AC_MSG_ERROR(Could not find SOCKS5 library.)
592         LIBS="$SAVE_LIBS"
593         CFLAGS="$SAVE_CFLAGS"
594         LDFLAGS="$SAVE_LDFLAGS"
595       ])
596   ],
597     AC_MSG_RESULT(no)
598   )
599
600 if test "x$socks" = "x4"; then
601   AC_DEFINE(SOCKS)
602   CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
603 fi
604
605 if test "x$socks" = "x5"; then
606   AC_DEFINE(SOCKS)
607   AC_DEFINE(SOCKS5)
608   AC_DEFINE(Rconnect, SOCKSconnect)
609   AC_DEFINE(Rgetsockname, SOCKSgetsockname)
610   AC_DEFINE(Rgetpeername, SOCKSgetpeername)
611   AC_DEFINE(Rbind, SOCKSbind)
612   AC_DEFINE(Raccept, SOCKSaccept)
613   AC_DEFINE(Rlisten, SOCKSlisten)
614   AC_DEFINE(Rselect, SOCKSselect)
615   AC_DEFINE(Rrecvfrom, SOCKSrecvfrom)
616   AC_DEFINE(Rsendto, SOCKSsendto)
617   AC_DEFINE(Rrecv, SOCKSrecv)
618   AC_DEFINE(Rsend, SOCKSsend)
619   AC_DEFINE(Rread, SOCKSread)
620   AC_DEFINE(Rwrite, SOCKSwrite)
621   AC_DEFINE(Rrresvport, SOCKSrresvport)
622   AC_DEFINE(Rshutdown, SOCKSshutdown)
623   AC_DEFINE(Rlisten, SOCKSlisten)
624   AC_DEFINE(Rclose, SOCKSclose)
625   AC_DEFINE(Rdup, SOCKSdup)
626   AC_DEFINE(Rdup2, SOCKSdup2)
627   AC_DEFINE(Rfclose, SOCKSfclose)
628   AC_DEFINE(Rgethostbyname, SOCKSgethostbyname)
629 fi
630
631 # MP library checking. First check whether user wants to use GMP and use
632 # it if found. If not or not defined then compile the MPI library in the
633 # source tree.
634 #
635 mp_gmp=false
636 SAVE_LIBS="$LIBS"
637 SAVE_CFLAGS="$CFLAGS"
638 SAVE_LDFLAGS="$LDFLAGS"
639 AC_MSG_CHECKING(whether to search for GMP)
640 AC_ARG_WITH(gmp,
641   [[  --with-gmp[=DIR]        use GMP instead of MPI [search in DIR/lib and DIR/include]]],
642   [
643     case "$withval" in
644       no)
645         AC_MSG_RESULT(no)
646         ;;
647       *)
648         AC_MSG_RESULT(yes)
649
650         if test -d "$withval/include"; then
651           CFLAGS="$CFLAGS -I$withval/include"
652         fi
653         if test -d "$withval/lib"; then
654           LDFLAGS="$LDFLAGS -L$withval/lib"
655         fi
656
657         LIBS="-lgmp $LIBS"
658         ;;
659     esac
660
661     AC_CHECK_LIB(gmp, __gmpz_init,
662       [
663         mp_gmp=true
664         AC_DEFINE(SILC_MP_GMP)
665         AC_MSG_RESULT(Using GMP as a MP library.)
666       ],
667       [
668         LIBS="$SAVE_LIBS"
669         CFLAGS="$SAVE_CFLAGS"
670         LDFLAGS="$SAVE_LDFLAGS"
671       ])
672   ],
673     AC_MSG_RESULT(no)
674   )
675
676 AM_CONDITIONAL(SILC_MP_GMP, test x$mp_gmp = xtrue)
677 AM_CONDITIONAL(SILC_MP_NSS_MPI, test x$mp_gmp = xfalse)
678 if test x$mp_gmp = xfalse; then
679   AC_DEFINE(SILC_MP_NSS_MPI)
680   AC_MSG_RESULT(Using NSS MPI as a MP library.)
681 fi
682
683
684 # GNU Libidn (for stringprep) support
685 #
686 check_libidn=true
687 has_libidn=false
688 SAVE_LIBS="$LIBS"
689 SAVE_CFLAGS="$CFLAGS"
690 SAVE_LDFLAGS="$LDFLAGS"
691 SAVE_CPPFLAGS="$CPPFLAGS"
692 AC_MSG_CHECKING(whether to implicit search for libidn)
693 AC_ARG_WITH(libidn,
694   [[  --with-libidn[=DIR]     use libidn [search in DIR/include and DIR/lib]]],
695   [
696     case "${withval}" in
697       no)
698         AC_MSG_RESULT(no)
699         AC_CHECK_HEADERS(stringprep.h,
700           [
701             AC_CHECK_FUNC(stringprep, has_libidn=true)
702           ])
703         check_libidn=false
704         ;;
705       *)
706         AC_MSG_RESULT(yes)
707         if test -d $withval/include; then
708           CPPFLAGS="$CPPFLAGS -I$withval/include"
709           CFLAGS="$CFLAGS -I$withval/include"
710         fi
711         if test -d $withval/lib; then
712           LDFLAGS="$LDFLAGS -L$withval/lib"
713         fi
714         ;;
715     esac
716   ],
717   [
718     AC_MSG_RESULT(no)
719     AC_CHECK_HEADERS(stringprep.h,
720       [
721         AC_CHECK_FUNCS(stringprep,
722           [
723             has_libidn=true
724             check_libidn=false
725           ])
726       ])
727   ])
728
729 if test x$check_libidn = xtrue; then
730   AC_MSG_RESULT(Searching for libidn...)
731
732   AC_CHECK_HEADERS(stringprep.h,
733     [
734       LIBS="$LIBS -lidn"
735       AC_MSG_CHECKING(for stringprep in -lidn)
736       AC_TRY_LINK(
737         [
738           #include <stdlib.h>
739           #include <stringprep.h>
740         ],
741         [
742           (void)stringprep_locale_charset();
743         ],
744         [
745           echo "yes"
746           AC_DEFINE(HAVE_LIBIDN, 1, [Define if you have the stringprep() function.])
747           has_libidn=true
748           check_libidn=false
749         ],
750         [
751           echo "no"
752           LIBS="$SAVE_LIBS"
753           CFLAGS="$SAVE_CFLAGS"
754           LDFLAGS="$SAVE_LDFLAGS"
755           CPPFLAGS="$SAVE_CPPFLAGS"
756         ])
757      ])
758 fi
759
760 if test x$check_libidn = xtrue; then
761   # search for idn library..
762   SAVE_LIBS="$LIBS"
763   SAVE_CFLAGS="$CFLAGS"
764   SAVE_LDFLAGS="$LDFLAGS"
765   SAVE_CPPFLAGS="$CPPFLAGS"
766
767   for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
768     if test x$has_libidn = xfalse; then
769       AC_MSG_RESULT(searching in $dir...)
770
771       if test -d $dir/include; then
772         CPPFLAGS="$CPPFLAGS -I$dir/include"
773         CFLAGS="$CFLAGS -I$dir/include"
774       fi
775       if test -d $dir/lib; then
776         LDFLAGS="$LDFLAGS -L$dir/lib"
777       fi
778
779       # XXX
780       unset ac_cv_header__stringprep_h_ ac_cv_header_stringprep_h || true
781
782       AC_CHECK_HEADERS(stringprep.h,
783         [
784           LIBS="$LIBS -lidn"
785           AC_MSG_CHECKING(for stringprep in -lidn)
786           AC_TRY_LINK(
787             [
788               #include <stdlib.h>
789               #include <stringprep.h>
790             ],
791             [
792               (void)stringprep_locale_charset();
793             ],
794             [
795               echo "yes"
796               has_libidn=true
797               AC_DEFINE(HAVE_LIBIDN, 1, [Define if you have the stringprep() function.])
798             ],
799             [
800               echo "no"
801               has_libidn=false
802
803               LIBS="$SAVE_LIBS"
804               CFLAGS="$SAVE_CFLAGS"
805               LDFLAGS="$SAVE_LDFLAGS"
806               CPPFLAGS="$SAVE_CPPFLAGS"
807             ])
808          ],
809          [
810            CFLAGS="$SAVE_CFLAGS"
811            LDFLAGS="$SAVE_LDFLAGS"
812            CPPFLAGS="$SAVE_CPPFLAGS"
813          ])
814       fi
815     done
816 fi
817
818 if test x$has_libidn = xtrue; then
819   __SILC_HAVE_LIBIDN="#define __SILC_HAVE_LIBIDN 1"
820 else
821   AC_MSG_ERROR(Could not locate libidn.  GNU Libidn is required to compile SILC)
822 fi
823
824 # iconv support
825 #
826 check_iconv=true
827 has_iconv=false
828 SAVE_LIBS="$LIBS"
829 SAVE_CFLAGS="$CFLAGS"
830 SAVE_LDFLAGS="$LDFLAGS"
831 SAVE_CPPFLAGS="$CPPFLAGS"
832 AC_MSG_CHECKING(whether to implicit search for libiconv)
833 AC_ARG_WITH(iconv,
834   [[  --with-iconv[=DIR]      use libiconv [search in DIR/include and DIR/lib]]],
835   [
836     case "${withval}" in
837       no)
838         AC_MSG_RESULT(no)
839         AC_CHECK_HEADERS(iconv.h,
840           [
841             AC_CHECK_FUNC(iconv, has_iconv=true)
842           ])
843         check_iconv=false
844         ;;
845       *)
846         AC_MSG_RESULT(yes)
847         if test -d $withval/include; then
848           CPPFLAGS="$CPPFLAGS -I$withval/include"
849           CFLAGS="$CFLAGS -I$withval/include"
850         fi
851         if test -d $withval/lib; then
852           LDFLAGS="$LDFLAGS -L$withval/lib"
853         fi
854         ;;
855     esac
856   ],
857   [
858     AC_MSG_RESULT(no)
859     AC_CHECK_HEADERS(iconv.h,
860       [
861         AC_CHECK_FUNCS(iconv,
862           [
863             has_iconv=true
864             check_iconv=false
865           ])
866       ])
867   ])
868
869 if test x$check_iconv = xtrue; then
870   AC_MSG_RESULT(Searching for iconv...)
871
872   # XXX
873   unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
874
875   AC_CHECK_HEADERS(iconv.h,
876     [
877       LIBS="$LIBS -liconv"
878       AC_MSG_CHECKING(for iconv in -liconv)
879       AC_TRY_LINK(
880         [
881           #include <stdlib.h>
882           #include <iconv.h>
883         ],
884         [
885           iconv_t cd = iconv_open("", "");
886           iconv(cd, NULL, NULL, NULL, NULL);
887           iconv_close(cd);
888         ],
889         [
890           echo "yes"
891           AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
892           has_iconv=true
893           check_iconv=false
894         ],
895         [
896           echo "no"
897           LIBS="$SAVE_LIBS"
898           CFLAGS="$SAVE_CFLAGS"
899           LDFLAGS="$SAVE_LDFLAGS"
900           CPPFLAGS="$SAVE_CPPFLAGS"
901         ])
902      ])
903 fi
904
905 if test x$check_iconv = xtrue; then
906   # search for iconv library..
907   SAVE_LIBS="$LIBS"
908   SAVE_CFLAGS="$CFLAGS"
909   SAVE_LDFLAGS="$LDFLAGS"
910   SAVE_CPPFLAGS="$CPPFLAGS"
911
912   for dir in `echo "/usr/local /usr/pkg /usr/contrib"`; do
913     if test x$has_iconv = xfalse; then
914       AC_MSG_RESULT(searching in $dir...)
915
916       if test -d $dir/include; then
917         CPPFLAGS="$CPPFLAGS -I$dir/include"
918         CFLAGS="$CFLAGS -I$dir/include"
919       fi
920       if test -d $dir/lib; then
921         LDFLAGS="$LDFLAGS -L$dir/lib"
922       fi
923
924       # XXX
925       unset ac_cv_header__iconv_h_ ac_cv_header_iconv_h || true
926
927       AC_CHECK_HEADERS(iconv.h,
928         [
929           LIBS="$LIBS -liconv"
930           AC_MSG_CHECKING(for iconv in -liconv)
931           AC_TRY_LINK(
932             [
933               #include <stdlib.h>
934               #include <iconv.h>
935             ],
936             [
937               iconv_t cd = iconv_open("", "");
938               iconv(cd, NULL, NULL, NULL, NULL);
939               iconv_close(cd);
940             ],
941             [
942               echo "yes"
943               has_iconv=true
944               AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
945             ],
946             [
947               echo "no"
948               has_iconv=false
949
950               LIBS="$SAVE_LIBS"
951               CFLAGS="$SAVE_CFLAGS"
952               LDFLAGS="$SAVE_LDFLAGS"
953               CPPFLAGS="$SAVE_CPPFLAGS"
954             ])
955          ],
956          [
957            CFLAGS="$SAVE_CFLAGS"
958            LDFLAGS="$SAVE_LDFLAGS"
959            CPPFLAGS="$SAVE_CPPFLAGS"
960          ])
961       fi
962     done
963 fi
964
965 if test x$has_iconv = xtrue; then
966   # (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
967   # (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
968   #     obl when args 2 and 3 are 0 (fixed in glibc-2.1.3).
969   #
970   AC_CACHE_CHECK([whether this iconv is good enough], ac_iconv_good,
971     AC_TRY_RUN(
972       [
973         #include <iconv.h>
974         int main() {
975           iconv_t cd;
976         changequote(, )dnl
977           char buf[4];
978         changequote([, ])dnl
979           char *ob;
980           size_t obl;
981           ob = buf, obl = sizeof(buf);
982           return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
983                  (iconv(cd, 0, 0, &ob, &obl) ||
984                  !(ob == buf && obl == sizeof(buf)) ||
985                  iconv_close(cd)));
986         }
987       ],
988       [
989         ac_iconv_good=yes
990       ],
991       [
992         ac_iconv_good=no
993       ],
994       [
995         ac_iconv_good=yes
996       ])
997     )
998
999   if test x$ac_iconv_good = xno; then
1000     AC_MSG_RESULT(Try using libiconv instead.)
1001   fi
1002 fi
1003
1004
1005 # POSIX threads support
1006 #
1007 has_threads=false
1008 AC_MSG_CHECKING(whether to search for POSIX threads)
1009 AC_ARG_WITH(pthreads,
1010   [[  --with-pthreads[=DIR]   use POSIX threads [search in DIR/include and DIR/lib]]],
1011   [
1012     case "${withval}" in
1013       no)
1014         check_threads=false
1015         ;;
1016       *)
1017         if test -d $withval/include; then
1018           CPPFLAGS="$CPPFLAGS -I$withval/include"
1019           CFLAGS="$CFLAGS -I$withval/include"
1020         fi
1021         if test -d $withval/lib; then
1022           LDFLAGS="$LDFLAGS -L$withval/lib"
1023         fi
1024
1025         check_threads=true
1026         ;;
1027     esac
1028   ])
1029
1030 if test x$check_threads = xtrue; then
1031   SAVE_LIBS="$LIBS"
1032   SAVE_CFLAGS="$CFLAGS"
1033   SAVE_LDFLAGS="$LDFLAGS"
1034   SAVE_CPPFLAGS="$CPPFLAGS"
1035
1036   AC_MSG_RESULT(yes)
1037   AC_CHECK_HEADERS(pthread.h,
1038     [
1039       LIBS="$LIBS -lpthread"
1040       AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
1041         [
1042           # FreeBSD
1043           case "${target}" in
1044             *-*-freebsd*)
1045               LIBS="$SAVE_LIBS -pthread"
1046               AC_CHECK_LIB(c_r, pthread_attr_init, has_threads=true, LIBS="$SAVE_LIBS")
1047               ;;
1048             *)
1049               LIBS="$SAVE_LIBS"
1050               ;;
1051           esac
1052         ])
1053     ],
1054     [
1055       # search for pthread library..
1056       for dir in `echo "/usr/local /usr/pkg /usr/contrib /usr/pkg/pthreads /usr/local/pthreads"`; do
1057         if test x$has_threads = xfalse; then
1058           AC_MSG_RESULT(searching in $dir...)
1059
1060           if test -d $dir/include; then
1061             CPPFLAGS="$CPPFLAGS -I$dir/include"
1062             CFLAGS="$CFLAGS -I$dir/include"
1063           fi
1064           if test -d $dir/lib; then
1065             LDFLAGS="$LDFLAGS -L$dir/lib"
1066           fi
1067
1068           # XXX
1069           unset ac_cv_header__pthread_h_ ac_cv_header_pthread_h || true
1070
1071           AC_CHECK_HEADERS(pthread.h,
1072             [
1073               LIBS="$LIBS -lpthread"
1074               AC_CHECK_LIB(pthread, pthread_attr_init, has_threads=true,
1075                 [
1076                   has_threads=false
1077
1078                   LIBS="$SAVE_LIBS"
1079                   CFLAGS="$SAVE_CFLAGS"
1080                   LDFLAGS="$SAVE_LDFLAGS"
1081                   CPPFLAGS="$SAVE_CPPFLAGS"
1082                 ])
1083             ],
1084             [
1085               CFLAGS="$SAVE_CFLAGS"
1086               LDFLAGS="$SAVE_LDFLAGS"
1087               CPPFLAGS="$SAVE_CPPFLAGS"
1088             ])
1089         fi
1090       done
1091     ])
1092 else
1093   AC_MSG_RESULT(no)
1094   has_threads=false
1095 fi
1096
1097 __SILC_HAVE_PTHREAD=""
1098 AM_CONDITIONAL(SILC_THREADS, test x$has_threads = xtrue)
1099 if test x$has_threads = xtrue; then
1100   CFLAGS="$CFLAGS -D_REENTRANT"
1101
1102   # XXX possibly incomplete
1103   case "${target}" in
1104     *-*-aix*)
1105       CFLAGS="$CFLAGS -D_THREAD_SAFE"
1106       if test x"$GCC" = xyes; then
1107         CFLAGS="$CFLAGS -mthreads"
1108       fi
1109       ;;
1110     *-*-freebsd*)
1111       CFLAGS="$CFLAGS -D_THREAD_SAFE"
1112       ;;
1113     *-*-sysv5uw7*)  # UnixWare 7
1114       if test "$GCC" != "yes"; then
1115         CFLAGS="$CFLAGS -Kthread"
1116       else
1117         CFLAGS="$CFLAGS -pthread"
1118       fi
1119       ;;
1120     *-dg-dgux*)  # DG/UX
1121       CFLAGS="$CFLAGS -D_POSIX4A_DRAFT10_SOURCE"
1122       ;;
1123    esac
1124
1125   AC_CHECK_FUNC(pthread_create)
1126   AC_DEFINE(SILC_HAVE_PTHREAD)
1127   AC_DEFINE(SILC_THREADS)
1128   __SILC_HAVE_PTHREAD="#define __SILC_HAVE_PTHEAD 1"
1129 fi
1130
1131 # Native WIN32 compilation under cygwin
1132 #
1133 AC_MSG_CHECKING(whether to compile native WIN32 code)
1134 AC_ARG_WITH(win32,
1135   [  --with-win32            compile native WIN32 (MinGW) code (-mno-cygwin)],
1136   [
1137     AC_MSG_RESULT(yes)
1138     AC_DEFINE(SILC_WIN32)
1139     win32_support=true
1140     CFLAGS="-mno-cygwin $CFLAGS"
1141     LIBS="$LIBS -lwsock32"
1142   ],
1143   [
1144     AC_MSG_RESULT(no)
1145   ])
1146 AM_CONDITIONAL(SILC_WIN32, test x$win32_support = xtrue)
1147
1148 # Native EPOC support (disabled by default)
1149 #
1150 AM_CONDITIONAL(SILC_EPOC, test xfalse = xtrue)
1151
1152 # Native BeOS support (disabled by default)
1153 #
1154 AM_CONDITIONAL(SILC_BEOS, test xfalse = xtrue)
1155
1156 # Native OS2 support (disabled by default)
1157 #
1158 AM_CONDITIONAL(SILC_OS2, test xfalse = xtrue)
1159
1160 # --without-irssi
1161 #
1162 without_irssi=false
1163 AC_MSG_CHECKING(whether to compile Irssi SILC Client)
1164 AC_ARG_WITH(irssi,
1165   [  --without-irssi         compile without Irssi SILC Client],
1166   [
1167     AC_MSG_RESULT(no)
1168     without_irssi=true
1169     SILC_DIST_SUBDIRS=`echo $SILC_DIST_SUBDIRS | $sedpath -e 's/irssi//'`
1170   ],
1171   [
1172     AC_MSG_RESULT(yes)
1173   ])
1174
1175 # --without-silcd
1176 #
1177 without_silcd=false
1178 AC_MSG_CHECKING(whether to compile SILC Server)
1179 AC_ARG_WITH(silcd,
1180   [  --without-silcd         compile without SILC Server],
1181   [
1182     AC_MSG_RESULT(no)
1183     without_silcd=true
1184     SILC_DIST_SUBDIRS=`echo $SILC_DIST_SUBDIRS | $sedpath -e 's/silcd//'`
1185   ],
1186   [
1187     AC_MSG_RESULT(yes)
1188   ])
1189
1190 # Irssi perl support
1191 #
1192 AC_ARG_WITH(perl,
1193   [[  --with-perl[=yes|no|module]  Build with Perl support - also specifies
1194                                if it should be built into main silc binary
1195                                (static, default) or as a module]])
1196
1197 libtoolfix=true
1198 AC_MSG_CHECKING(whether to do libtoolfix)
1199 AC_ARG_WITH(libtoolfix,
1200   [  --without-libtoolfix    Do not fix libtool, for package builders],
1201   [
1202     AC_MSG_RESULT(no)
1203     libtoolfix=false
1204   ],
1205   [
1206     AC_MSG_RESULT(yes)
1207   ])
1208
1209 AC_SUBST(ETCDIR)
1210 AC_DEFINE_UNQUOTED(SILC_ETCDIR, "$ETCDIR")
1211
1212
1213
1214 ##
1215 ##  Misc
1216 ##
1217
1218 # Other configure scripts
1219 #
1220 if test x$without_irssi = xfalse; then
1221   if test "x$silc_dist" = "xsilc-client" ||
1222      test "x$silc_dist" = "xsilc-toolkit"; then
1223     AC_CONFIG_SUBDIRS(irssi)
1224   fi
1225 fi
1226
1227 SILC_TOP_SRCDIR=`pwd`
1228
1229 # Included configure scripts
1230 AD_INCLUDE_CONFIGURE
1231
1232 #
1233 # Substitutions
1234 #
1235 AC_SUBST(SILC_TOP_SRCDIR)
1236 AC_SUBST(LIBS)
1237 INCLUDE_DEFINES_INT="include \$(top_srcdir)/Makefile.defines_int"
1238 AC_SUBST(INCLUDE_DEFINES_INT)
1239 AC_SUBST(SILC_DIST_SUBDIRS)
1240 AC_SUBST(SILC_LIB_INCLUDES)
1241
1242 #
1243 # Fix the libtool to support run-time configuration.  This allows us
1244 # to in run-time specify when to compile shared/static libraries without
1245 # need to reconfigure the entire libtool.
1246 #
1247 if test x$libtoolfix = xtrue; then
1248   ./libtoolfix $SILC_TOP_SRCDIR/ltmain.sh
1249 fi
1250 AM_CONDITIONAL(SILC_LIBTOOLFIX, test x$libtoolfix = xtrue)
1251
1252 AC_SUBST(__SILC_HAVE_PTHREAD)
1253 AC_SUBST(__SILC_HAVE_SIM)
1254 AC_SUBST(__SILC_HAVE_LIBIDN)
1255 AC_SUBST(__SILC_ENABLE_DEBUG)
1256
1257 #
1258 # Makefile outputs
1259 #
1260 AC_CONFIG_FILES(
1261 Makefile
1262 Makefile.defines
1263 Makefile.defines_int
1264 doc/Makefile
1265 includes/Makefile
1266 doc/example_silcd.conf
1267 includes/silcincludes.h
1268 )
1269
1270 if test x$without_irssi = xfalse ; then
1271   if test "x$silc_dist" = "xsilc-client" ||
1272      test "x$silc_dist" = "xsilc-toolkit"; then
1273     AC_CONFIG_FILES(
1274 irssi/Makefile.defines
1275 irssi/Makefile.defines_int
1276 )
1277   fi
1278 fi
1279
1280 if test x$without_silcd = xfalse ; then
1281   if test "x$silc_dist" = "xsilc-server" ||
1282      test "x$silc_dist" = "xsilc-toolkit"; then
1283     AC_CONFIG_FILES(
1284 silcd/Makefile
1285 )
1286   fi
1287 fi
1288
1289 if test "x$silc_dist" = "xsilc-toolkit"; then
1290   AC_CONFIG_FILES(
1291 silc/Makefile
1292 win32/Makefile
1293 win32/libsilc/Makefile
1294 win32/libsilcclient/Makefile
1295 tutorial/Makefile
1296 tutorial/Makefile.defines
1297 tutorial/Makefile.defines_int
1298 )
1299 fi
1300
1301 AC_OUTPUT
1302
1303 s_bindir=`eval echo $bindir`;s_bindir=`eval echo $s_bindir`
1304 s_sbindir=`eval echo $sbindir`;s_sbindir=`eval echo $s_sbindir`
1305 s_mandir=`eval echo $mandir`;s_mandir=`eval echo $s_mandir`
1306 s_includedir=`eval echo $includedir`;s_includedir=`eval echo $s_includedir`
1307
1308 echo ""
1309 echo "SILC Configuration Summary:"
1310 echo "---------------------------"
1311 echo " Target host ...................: $target"
1312 echo " Compiler ......................: $CC"
1313 echo " CFLAGS ........................: $CFLAGS"
1314 echo " CPPFLAGS ......................: $CPPFLAGS"
1315 echo " LDFLAGS .......................: $LDFLAGS"
1316 echo " LIBS ..........................: $LIBS"
1317 echo ""
1318 echo " Installation prefix ...........: $prefix"
1319 echo " bin directory .................: $s_bindir"
1320 echo " sbin directory ................: $s_sbindir"
1321 echo " etc directory .................: $ETCDIR"
1322 echo " man directory .................: $s_mandir"
1323 echo " help directory ................: $HELPDIR"
1324 echo " doc directory .................: $DOCDIR"
1325 echo " logs directory ................: $LOGSDIR"
1326 echo " SIM directory .................: $MODULESDIR"
1327 echo " include directory .............: $s_includedir"
1328 echo ""
1329
1330 if test "x$silc_dist" = "xsilc-client" ||
1331    test "x$silc_dist" = "xsilc-toolkit"; then
1332   irssi="yes"
1333   if test x$without_irssi = xtrue; then
1334     irssi="no"
1335   fi
1336 echo " Compile SILC Client ...........: $irssi"
1337 fi
1338
1339 if test "x$silc_dist" = "xsilc-server" ||
1340    test "x$silc_dist" = "xsilc-toolkit"; then
1341   silcd="yes"
1342   if test x$without_silcd = xtrue; then
1343     silcd="no"
1344   fi
1345 echo " Compile SILC Server ...........: $silcd"
1346 echo " Server configuration file .....: $summary_silcd_configfile"
1347 echo " Server PID file ...............: $PIDFILE"
1348 fi
1349
1350 if test x$sim_support = xfalse; then
1351   sim_support="no"
1352 else
1353   sim_support="yes"
1354 fi
1355 if test x$has_iconv = xfalse; then
1356   iconv_support="no"
1357 else
1358   iconv_support="yes"
1359 fi
1360 if test x$has_libidn = xfalse; then
1361   libidn_support="no"
1362 else
1363   libidn_support="yes"
1364 fi
1365 echo " SIM support ...................: $sim_support"
1366 echo " IPv6 support ..................: $summary_ipv6"
1367 echo " Iconv support .................: $iconv_support"
1368 echo " Idn support ...................: $libidn_support"
1369 if test x$want_asm = xfalse; then
1370   summary_asm="no"
1371 else
1372   summary_asm="yes"
1373 fi
1374 echo " Assembler optimizations .......: $summary_asm"
1375
1376 mp="MPI"
1377 if test x$mp_gmp = xtrue; then
1378   mp="GMP"
1379 fi
1380 echo " Arithmetic library ............: $mp"
1381
1382 threads="no"
1383 if test x$has_threads = xtrue; then
1384   threads="yes"
1385 fi
1386 echo " Multi-threads support .........: $threads"
1387 echo " Debugging enabled .............: $summary_debug"
1388 echo ""
1389 if test "x$silc_dist" = "xsilc-client"; then
1390   echo "Compile the sources with 'make' or 'gmake' command (GNU make is required)."
1391 else
1392   echo "Compile the sources with 'make' or 'gmake' command."
1393 fi