Added preliminary Symbian support.
[silc.git] / lib / configure.ad
1 #ifdef SILC_DIST_LIB
2 #
3 #  lib/configure.ad
4 #
5 #  Author: Pekka Riikonen <priikone@silcnet.org>
6 #
7 #  Copyright (C) 2005, 2007 Pekka Riikonen
8 #
9 #  This program is free software; you can redistribute it and/or modify
10 #  it under the terms of the GNU General Public License as published by
11 #  the Free Software Foundation; version 2 of the License.
12 #
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.
17 #
18
19 if test x$compile_libs = xtrue; then
20
21 ##
22 ## Will compile included libs
23 ##
24 AC_MSG_NOTICE([Configuring SILC libraries])
25
26 # SILC Library directories
27 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/contrib"
28 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silccore"
29 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silccrypt"
30 #ifdef SILC_DIST_MATH
31 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcmath"
32 #endif SILC_DIST_MATH
33 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcutil"
34 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcapputil"
35 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcske"
36 #ifdef SILC_DIST_SFTP
37 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcsftp"
38 #endif SILC_DIST_SFTP
39 #ifdef SILC_DIST_SIM
40 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcsim"
41 #endif SILC_DIST_SIM
42 #ifdef SILC_DIST_CLIENTLIB
43 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcclient"
44 #endif SILC_DIST_CLIENTLIB
45 #ifdef SILC_DIST_ASN1
46 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcasn1"
47 #endif SILC_DIST_ASN1
48 #ifdef SILC_DIST_SKR
49 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcskr"
50 #endif SILC_DIST_SKR
51 #ifdef SILC_DIST_SERVERLIB
52 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcserver"
53 #endif SILC_DIST_SERVERLIB
54 #ifdef SILC_DIST_HTTP
55 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silchttp"
56 #endif SILC_DIST_HTTP
57 #ifdef SILC_DIST_VCARD
58 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcvcard"
59 #endif SILC_DIST_VCARD
60
61 ##
62 ## Library versioning.
63 ##
64 # Do the releases and library versioning according to following rules:
65 #
66 #  - If any code has changed in library, increment [LIB]_REVISION
67 #  - If functions were added, removed or changed, set [LIB]_REVISION to 0
68 #  - If functions were added, removed or changed, increment [LIB]_CURRENT
69 #  - If functions were added, increment [LIB]_AGE
70 #  - If functions were removed, set [LIB]_AGE to 0
71 #
72 # where [LIB] is LIBSILC, LIBSILCCLIENT or LIBSILCSERVER, and where
73 # "functions" means functions public interfaces (API).
74 #
75 # The LIB_BASE_VERSION defines the SILC software major.minor version and
76 # it is increment only when these version numbers actually change.
77 #
78
79 # Base version for libraries.  Do not change this unless SILC version
80 # changes too.
81 LIB_BASE_VERSION=1.1
82
83 # libsilc versions
84 LIBSILC_CURRENT=1               # prev = 0
85 LIBSILC_REVISION=0              # prev = 0
86 LIBSILC_AGE=0                   # prev = 0
87
88 # libsilcclient versions
89 LIBSILCCLIENT_CURRENT=1         # prev = 0
90 LIBSILCCLIENT_REVISION=0        # prev = 0
91 LIBSILCCLIENT_AGE=0             # prev = 0
92
93 # libsilcserver versions
94 LIBSILCSERVER_CURRENT=1         # prev = 0
95 LIBSILCSERVER_REVISION=0        # prev = 0
96 LIBSILCSERVER_AGE=0             # prev = 0
97
98 # Substitute the version numbers
99 AC_SUBST(LIB_BASE_VERSION)
100 AC_SUBST(LIBSILC_CURRENT)
101 AC_SUBST(LIBSILC_REVISION)
102 AC_SUBST(LIBSILC_AGE)
103 AC_SUBST(LIBSILCCLIENT_CURRENT)
104 AC_SUBST(LIBSILCCLIENT_REVISION)
105 AC_SUBST(LIBSILCCLIENT_AGE)
106 AC_SUBST(LIBSILCSERVER_CURRENT)
107 AC_SUBST(LIBSILCSERVER_REVISION)
108 AC_SUBST(LIBSILCSERVER_AGE)
109
110 # Check for big-endian machines
111 AC_C_BIGENDIAN
112
113 #ifdef SILC_DIST_SIM
114 # SIM modules directory
115 #
116 MODULESDIR="$silc_prefix/modules"
117 AC_ARG_WITH(simdir,
118   [[  --with-simdir=DIR       directory for SIM modules [PREFIX/modules]]],
119   [
120     case "$withval" in
121       no|yes)
122         ;;
123       *)
124         MODULESDIR="$withval"
125         ;;
126     esac
127   ])
128 AC_SUBST(MODULESDIR)
129 AC_DEFINE_UNQUOTED([SILC_MODULESDIR], "$MODULESDIR", [SILC_MODULESDIR])
130 #endif SILC_DIST_SIM
131
132 #ifdef SILC_DIST_TOOLKIT
133 # Stack trace checking
134 #
135 AC_MSG_CHECKING(whether to enable stack tracing)
136 AC_ARG_ENABLE(stack-trace,
137   [  --enable-stack-trace    enable memory stack trace],
138   [
139     case "${enableval}" in
140     yes)
141       AC_MSG_RESULT(yes)
142       AC_DEFINE([SILC_STACKTRACE], [], [SILC_STACKTRACE])
143       ;;
144     *)
145       AC_MSG_RESULT(no)
146       ;;
147     esac
148   ],
149     AC_MSG_RESULT(no)
150   )
151 #endif SILC_DIST_TOOLKIT
152
153 #ifdef SILC_DIST_INPLACE
154 #
155 # Profiling options (never delivered to distributions)
156 #
157 AC_MSG_CHECKING(whether to enable gprof)
158 AC_ARG_ENABLE(gprof,
159   [  --enable-gprof          enable gprof profiling],
160   [
161     case "${enableval}" in
162       yes)
163         AC_MSG_RESULT(yes)
164         SILC_ADD_CFLAGS(-pg)
165         LIBS="$LIBS -pg"
166         ;;
167       *)
168         AC_MSG_RESULT(no)
169         ;;
170     esac
171   ],
172   [
173     AC_MSG_RESULT(no)
174   ])
175
176 AC_MSG_CHECKING(whether to enable gcov)
177 AC_ARG_ENABLE(gcov,
178   [  --enable-gcov           enable gcov],
179   [
180     case "${enableval}" in
181       yes)
182         AC_MSG_RESULT(yes)
183         SILC_ADD_CFLAGS(-fprofile-arcs)
184         LIBS="$LIBS -lgcov"
185         ;;
186       *)
187         AC_MSG_RESULT(no)
188         ;;
189     esac
190   ],
191   [
192     AC_MSG_RESULT(no)
193   ])
194 #endif SILC_DIST_INPLACE
195
196 #
197 # Makefile outputs
198 #
199 AC_CONFIG_FILES(
200 lib/Makefile
201 lib/contrib/Makefile
202 lib/silccore/Makefile
203 #ifdef SILC_DIST_SIM
204 lib/silcsim/Makefile
205 #endif SILC_DIST_SIM
206 lib/silcske/Makefile
207 lib/silcutil/Makefile
208 lib/silcutil/unix/Makefile
209 lib/silcutil/win32/Makefile
210 lib/silcutil/beos/Makefile
211 lib/silcutil/os2/Makefile
212 lib/silcapputil/Makefile
213 #ifdef SILC_DIST_SFTP
214 lib/silcsftp/Makefile
215 #endif SILC_DIST_SFTP
216 #ifdef SILC_DIST_INPLACE
217 lib/silcutil/tests/Makefile
218 lib/silccore/tests/Makefile
219 lib/silcsftp/tests/Makefile
220 #endif SILC_DIST_INPLACE
221 )
222
223 #ifdef SILC_DIST_TOOLKIT
224 AC_CONFIG_FILES(
225 lib/silc.pc
226 lib/silcclient.pc
227 lib/silcserver.pc
228 )
229 #endif SILC_DIST_TOOLKIT
230
231 #ifdef SILC_DIST_CLIENTLIB
232 AC_CONFIG_FILES(
233 lib/silcclient/Makefile
234 lib/silcclient/tests/Makefile
235 )
236 #endif SILC_DIST_CLIENTLIB
237
238 #ifdef SILC_DIST_SERVERLIB
239 AC_CONFIG_FILES(
240 lib/silcserver/Makefile
241 lib/silcserver/tests/Makefile
242 )
243 #endif SILC_DIST_SERVERLIB
244
245 #ifdef SILC_DIST_ASN1
246 AC_CONFIG_FILES(
247 lib/silcasn1/Makefile
248 #ifdef SILC_DIST_INPLACE
249 lib/silcasn1/tests/Makefile
250 #endif SILC_DIST_INPLACE
251 )
252 #endif SILC_DIST_ASN1
253
254 #ifdef SILC_DIST_SKR
255 AC_CONFIG_FILES(
256 lib/silcskr/Makefile
257 #ifdef SILC_DIST_INPLACE
258 lib/silcskr/tests/Makefile
259 #endif SILC_DIST_INPLACE
260 )
261 #endif SILC_DIST_SKR
262
263 #ifdef SILC_DIST_HTTP
264 AC_CONFIG_FILES(
265 lib/silchttp/Makefile
266 lib/silchttp/tests/Makefile
267 )
268 #endif SILC_DIST_HTTP
269
270 #ifdef SILC_DIST_VCARD
271 AC_CONFIG_FILES(
272 lib/silcvcard/Makefile
273 )
274 #endif SILC_DIST_VCARD
275
276 fi      # compile_libs
277
278 #endif SILC_DIST_LIB