a3a7eea93edffabeb59b4091ff81fe70fbe2b028
[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/silcapputil/Makefile
211 #ifdef SILC_DIST_SFTP
212 lib/silcsftp/Makefile
213 #endif SILC_DIST_SFTP
214 #ifdef SILC_DIST_INPLACE
215 lib/silcutil/tests/Makefile
216 lib/silccore/tests/Makefile
217 lib/silcsftp/tests/Makefile
218 #endif SILC_DIST_INPLACE
219 )
220
221 #ifdef SILC_DIST_TOOLKIT
222 AC_CONFIG_FILES(
223 lib/silc.pc
224 lib/silcclient.pc
225 lib/silcserver.pc
226 )
227 #endif SILC_DIST_TOOLKIT
228
229 #ifdef SILC_DIST_CLIENTLIB
230 AC_CONFIG_FILES(
231 lib/silcclient/Makefile
232 lib/silcclient/tests/Makefile
233 )
234 #endif SILC_DIST_CLIENTLIB
235
236 #ifdef SILC_DIST_SERVERLIB
237 AC_CONFIG_FILES(
238 lib/silcserver/Makefile
239 lib/silcserver/tests/Makefile
240 )
241 #endif SILC_DIST_SERVERLIB
242
243 #ifdef SILC_DIST_ASN1
244 AC_CONFIG_FILES(
245 lib/silcasn1/Makefile
246 #ifdef SILC_DIST_INPLACE
247 lib/silcasn1/tests/Makefile
248 #endif SILC_DIST_INPLACE
249 )
250 #endif SILC_DIST_ASN1
251
252 #ifdef SILC_DIST_SKR
253 AC_CONFIG_FILES(
254 lib/silcskr/Makefile
255 #ifdef SILC_DIST_INPLACE
256 lib/silcskr/tests/Makefile
257 #endif SILC_DIST_INPLACE
258 )
259 #endif SILC_DIST_SKR
260
261 #ifdef SILC_DIST_HTTP
262 AC_CONFIG_FILES(
263 lib/silchttp/Makefile
264 lib/silchttp/tests/Makefile
265 )
266 #endif SILC_DIST_HTTP
267
268 #ifdef SILC_DIST_VCARD
269 AC_CONFIG_FILES(
270 lib/silcvcard/Makefile
271 )
272 #endif SILC_DIST_VCARD
273
274 fi      # compile_libs
275
276 #endif SILC_DIST_LIB