4 # Author: Pekka Riikonen <priikone@poseidon.pspt.fi>
6 # Copyright (C) 2000 - 2001 Pekka Riikonen
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; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
19 AC_INIT(includes/version.h)
22 CFLAGS="-Wall $CFLAGS"
25 # Put here any platform specific stuff
29 *-*-linux*|*-*-mklinux*)
30 CFLAGS="-D_GNU_SOURCE $CFLAGS"
36 # ./prepare script will automatically put the correct date. Do not edit!
37 AM_INIT_AUTOMAKE(silc, YYYYMMDD)
39 AM_CONFIG_HEADER(includes/silcdefs.h)
52 CFLAGS="-finline-functions $CFLAGS"
54 # Currently GCC is only supported compiler
55 AC_MSG_ERROR(GCC is only supported compiler currently)
68 # More header checking
69 AC_CHECK_HEADERS(unistd.h string.h getopt.h errno.h fcntl.h assert.h)
70 AC_CHECK_HEADERS(sys/types.h sys/stat.h sys/time.h)
71 AC_CHECK_HEADERS(netinet/in.h netinet/tcp.h netdb.h)
72 AC_CHECK_HEADERS(pwd.h grp.h termcap.h paths.h)
73 AC_CHECK_HEADERS(ncurses.h signal.h ctype.h regex.h)
74 AC_CHECK_HEADERS(arpa/inet.h sys/mman.h)
83 AC_CHECK_SIZEOF(long long, 0)
84 AC_DEFINE_UNQUOTED(SILC_SIZEOF_LONG_LONG, $ac_cv_sizeof_long_long)
85 AC_CHECK_SIZEOF(long, 0)
86 AC_DEFINE_UNQUOTED(SILC_SIZEOF_LONG, $ac_cv_sizeof_long)
87 AC_CHECK_SIZEOF(int, 0)
88 AC_DEFINE_UNQUOTED(SILC_SIZEOF_INT, $ac_cv_sizeof_int)
89 AC_CHECK_SIZEOF(short, 0)
90 AC_DEFINE_UNQUOTED(SILC_SIZEOF_SHORT, $ac_cv_sizeof_short)
91 AC_CHECK_SIZEOF(char, 0)
92 AC_DEFINE_UNQUOTED(SILC_SIZEOF_CHAR, $ac_cv_sizeof_char)
93 AC_CHECK_SIZEOF(void *, 0)
94 AC_DEFINE_UNQUOTED(SILC_SIZEOF_VOID_P, $ac_cv_sizeof_void_p)
97 AC_CHECK_FUNCS(chmod stat fstat getenv putenv strerror ctime gettimeofday)
98 AC_CHECK_FUNCS(getpid getgid getsid getpgid getpgrp getuid)
99 AC_CHECK_FUNCS(strchr strstr strcpy strncpy memcpy memset memmove)
100 AC_CHECK_FUNCS(gethostname gethostbyname gethostbyaddr)
101 AC_CHECK_FUNCS(select socket listen bind shutdown close connect)
102 AC_CHECK_FUNCS(fcntl setsockopt)
103 AC_CHECK_FUNCS(getservbyname getservbyport)
104 AC_CHECK_FUNCS(getopt_long time)
105 AC_CHECK_FUNCS(mlock munlock)
107 # SIM support checking
108 # XXX These needs to be changed as more supported platforms appear.
109 # XXX This probably needs to be made platform dependant check.
110 AC_CHECKING(for SIM support)
111 AC_CHECK_HEADERS(dlfcn.h,
112 AC_CHECK_LIB(dl, dlopen,
114 AC_MSG_RESULT(enabled SIM support)
116 AC_MSG_RESULT(no SIM support found)),
117 AC_MSG_RESULT(no SIM support found))
120 AC_MSG_CHECKING(for enabled debugging)
122 [ --enable-debug Enable debugging (warning: it is heavy!)],
123 [ case "${enableval}" in
126 AC_DEFINE(SILC_DEBUG)
127 CFLAGS="-O -g $CFLAGS"
131 CFLAGS="-O2 -g $CFLAGS"
133 esac ], CFLAGS="-O2 -g $CFLAGS"
136 # SOCKS4 support checking
137 AC_MSG_CHECKING(whether to support SOCKS4)
139 [ --with-socks4[=PATH] Compile with SOCKS4 support.],
148 if test -d "$withval/include"; then
149 CFLAGS="$CFLAGS -I$withval/include"
151 CFLAGS="$CFLAGS -I$withval"
153 if test -d "$withval/lib"; then
154 withval="-L$withval/lib -lsocks"
156 withval="-L$withval -lsocks"
159 LIBS="$withval $LIBS"
164 [ AC_MSG_ERROR(Could not find SOCKS4 library.)])
170 # SOCKS5 support checking
171 AC_MSG_CHECKING(whether to support SOCKS5)
173 [ --with-socks5[=PATH] Compile with SOCKS5 support.],
182 if test -d "$withval/include"; then
183 CFLAGS="$CFLAGS -I$withval/include"
185 CFLAGS="$CFLAGS -I$withval"
187 if test -d "$withval/lib"; then
188 withval="-L$withval/lib -lsocks5"
190 withval="-L$withval -lsocks5"
193 LIBS="$withval $LIBS"
198 [ AC_MSG_ERROR(Could not find SOCKS5 library.)])
204 if test "x$socks" = "x4"; then
206 CFLAGS="$CFLAGS -Dconnect=Rconnect -Dgetsockname=Rgetsockname -Dbind=Rbind -Daccept=Raccept -Dlisten=Rlisten -Dselect=Rselect"
209 if test "x$socks" = "x5"; then
212 AC_DEFINE(Rconnect, SOCKSconnect)
213 AC_DEFINE(Rgetsockname, SOCKSgetsockname)
214 AC_DEFINE(Rgetpeername, SOCKSgetpeername)
215 AC_DEFINE(Rbind, SOCKSbind)
216 AC_DEFINE(Raccept, SOCKSaccept)
217 AC_DEFINE(Rlisten, SOCKSlisten)
218 AC_DEFINE(Rselect, SOCKSselect)
219 AC_DEFINE(Rrecvfrom, SOCKSrecvfrom)
220 AC_DEFINE(Rsendto, SOCKSsendto)
221 AC_DEFINE(Rrecv, SOCKSrecv)
222 AC_DEFINE(Rsend, SOCKSsend)
223 AC_DEFINE(Rread, SOCKSread)
224 AC_DEFINE(Rwrite, SOCKSwrite)
225 AC_DEFINE(Rrresvport, SOCKSrresvport)
226 AC_DEFINE(Rshutdown, SOCKSshutdown)
227 AC_DEFINE(Rlisten, SOCKSlisten)
228 AC_DEFINE(Rclose, SOCKSclose)
229 AC_DEFINE(Rdup, SOCKSdup)
230 AC_DEFINE(Rdup2, SOCKSdup2)
231 AC_DEFINE(Rfclose, SOCKSfclose)
232 AC_DEFINE(Rgethostbyname, SOCKSgethostbyname)
235 # GMP Library checking
236 AC_MSG_CHECKING(whether to compile GMP)
238 [ --with-gmp Build the GMP in the SILC source tree],
239 [ case "${withval}" in
241 AM_CONDITIONAL(SILC_BUILD_GMP, test x$withval = xyes)
245 AC_CHECK_HEADER(gmp.h,
246 AC_CHECK_LIB(gmp, __gmpz_init,
247 AM_CONDITIONAL(SILC_BUILD_GMP, test x$withval = yes)
248 AC_MSG_RESULT(GMP will not be compiled),
249 AM_CONDITIONAL(SILC_BUILD_GMP, test x$withval != yes)
250 AC_MSG_RESULT(GMP will be compiled)
252 AM_CONDITIONAL(SILC_BUILD_GMP, test x$withval != yes)
253 AC_MSG_RESULT(GMP will be compiled)
257 AC_CHECK_HEADER(gmp.h,
258 AC_CHECK_LIB(gmp, __gmpz_init,
260 AM_CONDITIONAL(SILC_BUILD_GMP, test x$build_gmp = xtrue)
261 AC_MSG_RESULT(GMP will not be compiled),
263 AM_CONDITIONAL(SILC_BUILD_GMP, test x$build_gmp = xtrue)
264 AC_MSG_RESULT(GMP will be compiled)
267 AM_CONDITIONAL(SILC_BUILD_GMP, test x$build_gmp = xtrue)
268 AC_MSG_RESULT(GMP will be compiled)
272 AC_ARG_WITH(silcd-config-file,
273 [ --with-silcd-config-file[=PATH]
274 Use PATH as default configuration file in SILC
276 [ AC_DEFINE_UNQUOTED(SILC_SERVER_CONFIG_FILE, "$withval") ])
279 #LIBS="$LIBS -lefence"
281 # Other configure scripts
282 #AC_CONFIG_SUBDIRS(lib/zlib)
283 AC_CONFIG_SUBDIRS(lib/dotconf)
284 AC_CONFIG_SUBDIRS(lib/silcmath/gmp)
285 AC_CONFIG_SUBDIRS(lib/trq)
293 lib/silcclient/Makefile
294 lib/silccore/Makefile
295 lib/silccrypt/Makefile
296 lib/silcmath/Makefile
298 lib/silcsim/modules/Makefile
300 lib/silcutil/Makefile