Merged silc_1_0_branch to trunk.
[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 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/silcske"
35 #ifdef SILC_DIST_SFTP
36 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcsftp"
37 #endif SILC_DIST_SFTP
38 #ifdef SILC_DIST_SIM
39 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcsim"
40 #endif SILC_DIST_SIM
41 #ifdef SILC_DIST_CLIENT
42 SILC_LIB_INCLUDES="$SILC_LIB_INCLUDES -I$SILC_TOP_SRCDIR/lib/silcclient"
43 #endif SILC_DIST_CLIENT
44
45 ##
46 ## Library versioning.
47 ##
48 # Do the releases and library versioning according to following rules:
49 #
50 #  - If any code has changed in library, increment [LIB]_REVISION
51 #  - If functions were added, removed or changed, set [LIB]_REVISION to 0
52 #  - If functions were added, removed or changed, increment [LIB]_CURRENT
53 #  - If functions were added, increment [LIB]_AGE
54 #  - If functions were removed, set [LIB]_AGE to 0
55 #
56 # where [LIB] is LIBSILC and LIBSILCCLIENT, and where "functions" means
57 # functions public interfaces.
58 #
59 # The LIB_BASE_VERSION defines the SILC software major.minor version and
60 # it is increment only when these version numbers actually change.
61 #
62
63 # Base version for libraries.  Do not change this unless SILC version
64 # changes too.
65 LIB_BASE_VERSION=1.0
66
67 # libsilc versions
68 LIBSILC_CURRENT=5               # prev = 4
69 LIBSILC_REVISION=0              # prev = 0
70 LIBSILC_AGE=3                   # prev = 3
71
72 # libsilcclient versions
73 LIBSILCCLIENT_CURRENT=4         # prev = 4
74 LIBSILCCLIENT_REVISION=0        # prev = 0
75 LIBSILCCLIENT_AGE=3             # prev = 3
76
77 # Substitute the version numbers
78 AC_SUBST(LIB_BASE_VERSION)
79 AC_SUBST(LIBSILC_CURRENT)
80 AC_SUBST(LIBSILC_REVISION)
81 AC_SUBST(LIBSILC_AGE)
82 AC_SUBST(LIBSILCCLIENT_CURRENT)
83 AC_SUBST(LIBSILCCLIENT_REVISION)
84 AC_SUBST(LIBSILCCLIENT_AGE)
85
86 #ifdef SILC_DIST_SIM
87 # SIM modules directory
88 #
89 MODULESDIR="$silc_prefix/modules"
90 AC_ARG_WITH(simdir,
91   [[  --with-simdir=DIR       directory for SIM modules [PREFIX/modules]]],
92   [
93     case "$withval" in
94       no|yes)
95         ;;
96       *)
97         MODULESDIR="$withval"
98         ;;
99     esac
100   ])
101 AC_SUBST(MODULESDIR)
102 AC_DEFINE_UNQUOTED([SILC_MODULESDIR], "$MODULESDIR", [SILC_MODULESDIR])
103 #endif SILC_DIST_SIM
104
105 #ifdef SILC_DIST_TOOLKIT
106 # Stack trace checking
107 #
108 AC_MSG_CHECKING(whether to enable stack tracing)
109 AC_ARG_ENABLE(stack-trace,
110   [  --enable-stack-trace    enable memory stack trace],
111   [
112     case "${enableval}" in
113     yes)
114       AC_MSG_RESULT(yes)
115       AC_DEFINE([SILC_STACKTRACE], [], [SILC_STACKTRACE])
116       ;;
117     *)
118       AC_MSG_RESULT(no)
119       ;;
120     esac
121   ],
122     AC_MSG_RESULT(no)
123   )
124 #endif SILC_DIST_TOOLKIT
125
126 #
127 # Makefile outputs
128 #
129 AC_CONFIG_FILES(
130 lib/Makefile
131 lib/contrib/Makefile
132 lib/silccore/Makefile
133 lib/silccrypt/Makefile
134 #ifdef SILC_DIST_SIM
135 lib/silcsim/Makefile
136 #endif SILC_DIST_SIM
137 lib/silcske/Makefile
138 lib/silcutil/Makefile
139 lib/silcutil/unix/Makefile
140 lib/silcutil/win32/Makefile
141 lib/silcutil/beos/Makefile
142 lib/silcutil/os2/Makefile
143 lib/silcutil/epoc/Makefile
144 #ifdef SILC_DIST_SFTP
145 lib/silcsftp/Makefile
146 #endif SILC_DIST_SFTP
147 #ifdef SILC_DIST_INPLACE
148 lib/silcutil/tests/Makefile
149 lib/silccrypt/tests/Makefile
150 lib/silccore/tests/Makefile
151 lib/silcsftp/tests/Makefile
152 #endif SILC_DIST_INPLACE
153 )
154
155 #ifdef SILC_DIST_TOOLKIT
156 AC_CONFIG_FILES(
157 lib/silc.pc
158 lib/silcclient.pc
159 )
160 #endif SILC_DIST_TOOLKIT
161
162 #ifdef SILC_DIST_CLIENTLIB
163 AC_CONFIG_FILES(lib/silcclient/Makefile)
164 #endif SILC_DIST_CLIENTLIB
165
166 fi      # compile_libs
167
168 #endif SILC_DIST_LIB