1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | AC_INIT(Jabber Windowgram Client, |
---|
3 | beta5, |
---|
4 | jadestorm@users.sourceforge.net, |
---|
5 | jwgc) |
---|
6 | AC_CONFIG_SRCDIR([config.h.in]) |
---|
7 | AM_CONFIG_HEADER([config.h]) |
---|
8 | AC_CANONICAL_HOST |
---|
9 | AM_INIT_AUTOMAKE |
---|
10 | |
---|
11 | dnl OS specific options. |
---|
12 | case "$host" in |
---|
13 | *-*-netbsd*) |
---|
14 | need_dash_r=1 |
---|
15 | ;; |
---|
16 | *-*-solaris*) |
---|
17 | need_dash_r=1 |
---|
18 | ;; |
---|
19 | esac |
---|
20 | |
---|
21 | dnl Custom args we care about. |
---|
22 | AC_ARG_WITH(default-server, |
---|
23 | [ --with-default-server=SERVER change default server (jabber.org)], |
---|
24 | [ |
---|
25 | AC_DEFINE_UNQUOTED([DEFSERVER], "$withval", |
---|
26 | [Default server (other than jabber.org)]) |
---|
27 | ] |
---|
28 | ) |
---|
29 | AC_ARG_WITH(default-port, |
---|
30 | [ --with-default-port=PORT change default port (5222)], |
---|
31 | [ |
---|
32 | AC_DEFINE_UNQUOTED([DEFPORT], "$withval", |
---|
33 | [Default port (other than 5222)]) |
---|
34 | ] |
---|
35 | ) |
---|
36 | AC_ARG_WITH(default-sslport, |
---|
37 | [ --with-default-sslport=PORT change default ssl port (5223)], |
---|
38 | [ |
---|
39 | AC_DEFINE_UNQUOTED([DEFSSLPORT], "$withval", |
---|
40 | [Default ssl port (other than 5223)]) |
---|
41 | ] |
---|
42 | ) |
---|
43 | AC_ARG_WITH(default-resource, |
---|
44 | [ --with-default-resource=RESOURCE change default resource (jwgc)], |
---|
45 | [ |
---|
46 | AC_DEFINE_UNQUOTED([DEFRESOURCE], "$withval", |
---|
47 | [Default resource (other than jwgc)]) |
---|
48 | ] |
---|
49 | ) |
---|
50 | AC_ARG_WITH(default-presence, |
---|
51 | [ --with-default-presence=PRESENCE change default presence (available)], |
---|
52 | [ |
---|
53 | AC_DEFINE_UNQUOTED([DEFPRESENCE], "$withval", |
---|
54 | [Default presence (other than available)]) |
---|
55 | ] |
---|
56 | ) |
---|
57 | AC_ARG_WITH(default-priority, |
---|
58 | [ --with-default-priority=PRIORITY change default priority (0)], |
---|
59 | [ |
---|
60 | AC_DEFINE_UNQUOTED([DEFPRIORITY], "$withval", |
---|
61 | [Default priority (other than 0)]) |
---|
62 | ] |
---|
63 | ) |
---|
64 | AC_ARG_WITH(default-usessl, |
---|
65 | [ --with-default-usessl=BOOL default ssl usage (false)], |
---|
66 | [ |
---|
67 | AC_DEFINE_UNQUOTED([DEFUSESSL], "$withval", |
---|
68 | [Default ssl usage (other than false)]) |
---|
69 | ] |
---|
70 | ) |
---|
71 | AC_ARG_WITH(default-usegpg, |
---|
72 | [ --with-default-usegpg=BOOL default gpg usage (false)], |
---|
73 | [ |
---|
74 | AC_DEFINE_UNQUOTED([DEFUSEGPG], "$withval", |
---|
75 | [Default gpg usage (other than false)]) |
---|
76 | ] |
---|
77 | ) |
---|
78 | AC_ARG_WITH(desc-user, |
---|
79 | [ --with-desc-user=FILENAME user desc filename (.jwgc.desc)], |
---|
80 | [ |
---|
81 | AC_DEFINE_UNQUOTED([USRDESC], "$withval", |
---|
82 | [User desc filename (other than .jwgc.desc)]) |
---|
83 | ] |
---|
84 | ) |
---|
85 | AC_ARG_WITH(desc-default, |
---|
86 | [ --with-desc-default=FILENAME default desc filename (jwgc.desc)], |
---|
87 | [ |
---|
88 | AC_DEFINE_UNQUOTED([DEFDESC], "$withval", |
---|
89 | [Default desc filename (other than jwgc.desc)]) |
---|
90 | ] |
---|
91 | ) |
---|
92 | AC_ARG_WITH(vars-default, |
---|
93 | [ --with-vars-default=FILENAME default vars filename (jwgc.vars)], |
---|
94 | [ |
---|
95 | AC_DEFINE_UNQUOTED([DEFVARS], "$withval", |
---|
96 | [Default vars filename (other than jwgc.vars)]) |
---|
97 | ] |
---|
98 | ) |
---|
99 | AC_ARG_WITH(vars-user, |
---|
100 | [ --with-vars-user=FILENAME user vars filename (.jwgc.vars)], |
---|
101 | [ |
---|
102 | AC_DEFINE_UNQUOTED([USRVARS], "$withval", |
---|
103 | [User vars filename (other than .jwgc.vars)]) |
---|
104 | ] |
---|
105 | ) |
---|
106 | AC_ARG_WITH(vars-fixed, |
---|
107 | [ --with-vars-fixed=FILENAME fixed vars filename (jwgc.vars.fixed)], |
---|
108 | [ |
---|
109 | AC_DEFINE_UNQUOTED([FIXEDVARS], "$withval", |
---|
110 | [Fixed vars filename (other than jwgc.vars.fixed)]) |
---|
111 | ] |
---|
112 | ) |
---|
113 | AC_ARG_WITH(ssl-dir, |
---|
114 | [ --with-ssl-dir=PATH path to OpenSSL installation], |
---|
115 | [ |
---|
116 | CFLAGS="$CFLAGS -I${withval}/include" |
---|
117 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
---|
118 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
---|
119 | if test -n "${need_dash_r}"; then |
---|
120 | LDFLAGS="$LDFLAGS -R${withval}/lib" |
---|
121 | fi |
---|
122 | ] |
---|
123 | ) |
---|
124 | AC_ARG_WITH(ssl-include, |
---|
125 | [ --with-ssl-include=PATH path to OpenSSL header files], |
---|
126 | [ |
---|
127 | CFLAGS="$CFLAGS -I${withval}" |
---|
128 | CPPFLAGS="$CPPFLAGS -I${withval}" |
---|
129 | ] |
---|
130 | ) |
---|
131 | AC_ARG_WITH(ssl-lib, |
---|
132 | [ --with-ssl-lib=PATH path to OpenSSL libraries], |
---|
133 | [ |
---|
134 | LDFLAGS="$LDFLAGS -L${withval}" |
---|
135 | if test -n "${need_dash_r}"; then |
---|
136 | LDFLAGS="$LDFLAGS -R${withval}" |
---|
137 | fi |
---|
138 | ] |
---|
139 | ) |
---|
140 | AC_ARG_WITH(gpgme-dir, |
---|
141 | [ --with-gpgme-dir=PATH path to GPGME installation], |
---|
142 | [ |
---|
143 | CFLAGS="$CFLAGS -I${withval}/include" |
---|
144 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
---|
145 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
---|
146 | if test -n "${need_dash_r}"; then |
---|
147 | LDFLAGS="$LDFLAGS -R${withval}/lib" |
---|
148 | fi |
---|
149 | ] |
---|
150 | ) |
---|
151 | AC_ARG_WITH(gpgme-include, |
---|
152 | [ --with-gpgme-include=PATH path to GPGME header files], |
---|
153 | [ |
---|
154 | CFLAGS="$CFLAGS -I${withval}" |
---|
155 | CPPFLAGS="$CPPFLAGS -I${withval}" |
---|
156 | ] |
---|
157 | ) |
---|
158 | AC_ARG_WITH(gpgme-lib, |
---|
159 | [ --with-gpgme-lib=PATH path to GPGME libraries], |
---|
160 | [ |
---|
161 | LDFLAGS="$LDFLAGS -L${withval}" |
---|
162 | if test -n "${need_dash_r}"; then |
---|
163 | LDFLAGS="$LDFLAGS -R${withval}" |
---|
164 | fi |
---|
165 | ] |
---|
166 | ) |
---|
167 | AC_ARG_WITH(iconv-dir, |
---|
168 | [ --with-iconv-dir=PATH path to iconv installation], |
---|
169 | [ |
---|
170 | CFLAGS="$CFLAGS -I${withval}/include" |
---|
171 | CPPFLAGS="$CPPFLAGS -I${withval}/include" |
---|
172 | LDFLAGS="$LDFLAGS -L${withval}/lib" |
---|
173 | if test -n "${need_dash_r}"; then |
---|
174 | LDFLAGS="$LDFLAGS -R${withval}/lib" |
---|
175 | fi |
---|
176 | ] |
---|
177 | ) |
---|
178 | AC_ARG_WITH(iconv-include, |
---|
179 | [ --with-iconv-include=PATH path to iconv header files], |
---|
180 | [ |
---|
181 | CFLAGS="$CFLAGS -I${withval}" |
---|
182 | CPPFLAGS="$CPPFLAGS -I${withval}" |
---|
183 | ] |
---|
184 | ) |
---|
185 | AC_ARG_WITH(iconv-lib, |
---|
186 | [ --with-iconv-lib=PATH path to iconv libraries], |
---|
187 | [ |
---|
188 | LDFLAGS="$LDFLAGS -L${withval}" |
---|
189 | if test -n "${need_dash_r}"; then |
---|
190 | LDFLAGS="$LDFLAGS -R${withval}" |
---|
191 | fi |
---|
192 | ] |
---|
193 | ) |
---|
194 | AC_ARG_ENABLE(nodebug, |
---|
195 | [ --enable-nodebug disable debugging functionality], |
---|
196 | [ |
---|
197 | AC_DEFINE([NODEBUG], 1, |
---|
198 | [Disable debugging functionality]) |
---|
199 | ] |
---|
200 | ) |
---|
201 | |
---|
202 | dnl Checks for programs. |
---|
203 | AC_PROG_CC |
---|
204 | AC_PROG_INSTALL |
---|
205 | AC_PROG_AWK |
---|
206 | AC_PROG_YACC |
---|
207 | AC_PROG_RANLIB |
---|
208 | AC_PROG_MAKE_SET |
---|
209 | |
---|
210 | dnl Check some initial paths and such. |
---|
211 | AC_PATH_X |
---|
212 | CFLAGS="$CFLAGS -I${x_includes}" |
---|
213 | CPPFLAGS="$CPPFLAGS -I${x_includes}" |
---|
214 | LDFLAGS="$LDFLAGS -L${x_libraries}" |
---|
215 | if test -n "${need_dash_r}"; then |
---|
216 | LDFLAGS="$LDFLAGS -R${x_libraries}" |
---|
217 | fi |
---|
218 | |
---|
219 | dnl Checks for libraries. |
---|
220 | AC_CHECK_LIB(X11, XrmInitialize) |
---|
221 | AC_CHECK_LIB(termcap, tgetent) |
---|
222 | AC_FUNC_CHECK(connect, :, [AC_CHECK_LIB(socket, socket) |
---|
223 | AC_CHECK_LIB(nsl, gethostbyname)]) |
---|
224 | AC_CHECK_LIB(resolv, res_send) |
---|
225 | AC_CHECK_LIB(curses, tgetstr, [TLIB=-lcurses], [TLIB=-ltermcap]) |
---|
226 | AC_CHECK_LIB(gen, regcmp, [RLIB=-lgen]) |
---|
227 | AC_CHECK_LIB(ssl, kssl_krb5_free_data_contents, [CFLAGS="$CFLAGS -DOPENSSL_NO_KRB5" CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_KRB5" LDFLAGS="$LDFLAGS"]) |
---|
228 | AC_CHECK_LIB(ssl, SSL_new) |
---|
229 | AC_CHECK_LIB(crypto, SSLeay) |
---|
230 | AC_CHECK_LIB(gpgme, gpgme_new) |
---|
231 | AC_CHECK_LIB(iconv, libiconv) |
---|
232 | AC_CHECK_LIB(iconv, locale_charset, :, [AC_CHECK_LIB(charset, locale_charset)]) |
---|
233 | |
---|
234 | dnl Checks for header files. |
---|
235 | AC_HEADER_STDC |
---|
236 | AC_HEADER_TIME |
---|
237 | AC_HEADER_DIRENT |
---|
238 | AC_HEADER_SYS_WAIT |
---|
239 | AC_CHECK_HEADERS([ \ |
---|
240 | gpgme.h \ |
---|
241 | arpa/inet.h \ |
---|
242 | ctype.h \ |
---|
243 | errno.h \ |
---|
244 | fcntl.h \ |
---|
245 | libgen.h \ |
---|
246 | math.h \ |
---|
247 | netdb.h \ |
---|
248 | netinet/in.h \ |
---|
249 | nameser.h \ |
---|
250 | resolv.h \ |
---|
251 | openssl/ssl.h \ |
---|
252 | pwd.h \ |
---|
253 | regex.h \ |
---|
254 | regexp.h \ |
---|
255 | setjmp.h \ |
---|
256 | signal.h \ |
---|
257 | stdarg.h \ |
---|
258 | stddef.h \ |
---|
259 | stdio.h \ |
---|
260 | stdlib.h \ |
---|
261 | string.h \ |
---|
262 | strings.h \ |
---|
263 | syslog.h \ |
---|
264 | sys/param.h \ |
---|
265 | sys/socket.h \ |
---|
266 | sys/stat.h \ |
---|
267 | sys/time.h \ |
---|
268 | sys/types.h \ |
---|
269 | sys/un.h \ |
---|
270 | termio.h \ |
---|
271 | termios.h \ |
---|
272 | time.h \ |
---|
273 | unistd.h \ |
---|
274 | varargs.h \ |
---|
275 | wait.h \ |
---|
276 | windows.h \ |
---|
277 | iconv.h \ |
---|
278 | libcharset.h \ |
---|
279 | ]) |
---|
280 | |
---|
281 | dnl Checks for typedefs, structures, and compiler characteristics. |
---|
282 | AC_C_CONST |
---|
283 | AC_STRUCT_TM |
---|
284 | AC_TYPE_SIZE_T |
---|
285 | AC_DEFINE_UNQUOTED([MACHINE_TYPE], "$host", [Canonical machine type.]) |
---|
286 | |
---|
287 | dnl Checks for library functions. |
---|
288 | AC_FUNC_ERROR_AT_LINE |
---|
289 | AC_FUNC_FORK |
---|
290 | AC_FUNC_GETPGRP |
---|
291 | AC_PROG_GCC_TRADITIONAL |
---|
292 | AC_FUNC_MALLOC |
---|
293 | AC_FUNC_MEMCMP |
---|
294 | AC_FUNC_SETPGRP |
---|
295 | AC_TYPE_SIGNAL |
---|
296 | AC_FUNC_STRFTIME |
---|
297 | AC_FUNC_WAIT3 |
---|
298 | AC_CHECK_FUNCS([ \ |
---|
299 | bzero \ |
---|
300 | dup2 \ |
---|
301 | gethostbyname \ |
---|
302 | gethostname \ |
---|
303 | getpass \ |
---|
304 | getpassphrase \ |
---|
305 | gettimeofday \ |
---|
306 | isascii \ |
---|
307 | memmove \ |
---|
308 | memset \ |
---|
309 | modf \ |
---|
310 | re_comp \ |
---|
311 | regcmp \ |
---|
312 | regcomp \ |
---|
313 | select \ |
---|
314 | socket \ |
---|
315 | strcasecmp \ |
---|
316 | strchr \ |
---|
317 | strdup \ |
---|
318 | strerror \ |
---|
319 | strncasecmp \ |
---|
320 | strrchr \ |
---|
321 | strstr \ |
---|
322 | usleep \ |
---|
323 | waitpid \ |
---|
324 | ]) |
---|
325 | |
---|
326 | dnl Create files necessary to compile jwgc. |
---|
327 | AC_CONFIG_FILES([ |
---|
328 | Makefile |
---|
329 | lib/Makefile |
---|
330 | lib/libxode/Makefile |
---|
331 | lib/libjabber/Makefile |
---|
332 | lib/libjwgc/Makefile |
---|
333 | clients/Makefile |
---|
334 | clients/jwgc/Makefile |
---|
335 | clients/jlocate/Makefile |
---|
336 | clients/jwrite/Makefile |
---|
337 | clients/jctl/Makefile |
---|
338 | clients/jstat/Makefile |
---|
339 | ]) |
---|
340 | AC_OUTPUT |
---|