2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([centericq], [4.22.0], [http://centericq.de/mailinglist.php])
6 AC_CONFIG_SRCDIR([config.h.in])
7 AC_CONFIG_HEADER([config.h])
17 ########################
18 # Checks for programs. #
19 ########################
27 AM_GNU_GETTEXT_VERSION([0.16.1])
29 AC_PROG_GCC_TRADITIONAL
31 #########################
32 # Checks for libraries. #
33 #########################
35 AS_HELP_STRING([--disable-yahoo], [Build without Yahoo!]),
36 build_yahoo="$enableval",
40 AS_HELP_STRING([--disable-aim], [Build without AIM]),
41 build_aim="$enableval",
45 AS_HELP_STRING([--disable-irc], [Build without IRC]),
46 build_irc="$enableval",
50 AS_HELP_STRING([--disable-jabber], [Build without Jabber]),
51 build_jabber="$enableval",
55 AS_HELP_STRING([--disable-gg], [Build without Gadu-Gadu]),
56 build_gg="$enableval",
60 AS_HELP_STRING([--disable-msn], [Build without MSN]),
61 build_msn="$enableval",
65 AS_HELP_STRING([--disable-rss], [Build without RSS reader]),
66 build_rss="$enableval",
70 AS_HELP_STRING([--disable-lj], [Build without LiveJournal client]),
71 build_lj="$enableval",
74 AC_ARG_ENABLE(locales-fix,
75 AS_HELP_STRING([--enable-locales-fix], [enables workaround for
76 broken locales. use this option if some of
77 characters in your texts in Chinese or Japanese
82 AS_HELP_STRING([--with-fribidi=[DIR]], [enable Hebrew and Arabic
83 support using fribidi library in DIR]),
84 [with_fribidi=$withval],
88 AS_HELP_STRING([--with-ssl], [enable SSL secured connections using
89 either OpenSSL or GnuTLS]),
94 AS_HELP_STRING([--with-openssl=[DIR]], [enable SSL secured
95 connections using the OpenSSL library in DIR
97 [with_openssl=$withval],
101 AS_HELP_STRING([--with-gpgme=[PATH]], [path to gpgme-config (auto)]),
102 [with_gpgme=$withval],
106 AS_HELP_STRING([--with-curl=[PATH]], [path to curl-config (auto)]),
107 [with_curl=$withval],
111 AS_HELP_STRING([--without-libjpeg], [Compile without JPEG token
112 support (for Gadu-Gadu registration)])
115 #####################
116 # Check for fribidi #
117 #####################
118 AC_MSG_CHECKING(whether to use fribidi)
124 if test "x$with_fribidi" = "xyes"; then
125 AC_PATH_PROG(FRIBIDI_CONFIG, fribidi-config, no)
126 if test x$FRIBIDI_CONFIG = xno; then
127 AC_MSG_ERROR([*** fribidi-config not found])
130 FRIBIDI_CFLAGS="`$FRIBIDI_CONFIG --cflags`"
131 CFLAGS="$CFLAGS $FRIBIDI_CFLAGS"
132 FRIBIDI_LIBS="`$FRIBIDI_CONFIG --libs`"
133 FRIBIDI_PC="fribidi,"
135 AC_CHECK_LIB(fribidi, fribidi_get_mirror_char, :, AC_MSG_ERROR([*** libfribidi not found.]), $FRIBIDI_LIBS)
136 AC_DEFINE(HAVE_FRIBIDI, 1, [has fribidi library])
139 AC_MSG_RESULT([$have_fribidi])
144 AC_MSG_CHECKING(for SSL)
147 if test "$with_ssl" != "no"; then
149 AC_MSG_CHECKING(for OpenSSL)
150 if test -z "$with_openssl"; then
151 for ac_dir in $with_openssl /usr/local /usr; do
152 if test -f "$ac_dir/include/openssl/ssl.h"; then
159 if test -n "$with_openssl" -a "$with_openssl" != "no"; then
160 if test "$with_openssl" = "yes"; then
163 AC_MSG_RESULT([found in $with_openssl])
164 CFLAGS="$CFLAGS -I${with_openssl}"
165 AC_DEFINE(HAVE_OPENSSL, 1, [use openssl])
166 AC_CHECK_LIB(crypto, main)
167 AC_CHECK_LIB(ssl, main)
169 AC_MSG_RESULT([not found or disabled])
172 AM_PATH_LIBGNUTLS_EXTRA(0.0.1, [
173 CXXFLAGS="$CXXFLAGS $LIBGNUTLS_CFLAGS"
174 LIBS="$LIBS $LIBGNUTLS_LIBS -lgnutls-extra"
175 AC_DEFINE(HAVE_GNUTLS, 1, [use gnutls]) with_ssl="yes" ])
178 AC_MSG_RESULT([disabled (use --with-ssl=[DIR] to enable)])
184 AC_MSG_CHECKING(for gpgme)
193 if test -x "$with_gpgme"; then
194 GPGME_CONFIG= "$with_gpgme"
196 AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no)
199 if test x$GPGME_CONFIG = xno; then
200 AC_MSG_ERROR([*** gpgme-config not found])
203 save_CFLAGS="$CFLAGS"
204 save_CXXFLAGS="$CXXFLAGS"
207 GPGME_CFLAGS="`$GPGME_CONFIG --cflags`"
208 GPGME_CXXFLAGS="`$GPGME_CONFIG --cflags`"
209 GPGME_LIBS="`$GPGME_CONFIG --libs`"
210 CFLAGS="$CFLAGS $GPGME_CFLAGS"
211 CXXFLAGS="$CXXFLAGS $GPGME_CXXFLAGS"
212 LIBS="$LIBS $GPGME_LIBS"
214 AC_MSG_CHECKING(for the OpenPGP protocol in gpgme)
219 if(!gpgme_new(&ctx)) if(!gpgme_set_protocol(ctx, GPGME_PROTOCOL_OpenPGP)) return 0;
222 ], opengpg_avail=yes, opengpg_avail=no, opengpg_avail=no)
223 AC_MSG_RESULT($opengpg_avail)
225 if test "$opengpg_avail" != "yes"; then
226 CFLAGS="$save_CFLAGS"
227 CXXFLAGS="$save_CXXFLAGS"
230 AC_DEFINE(HAVE_GPGME, 1, [has gpgme library])
237 AC_MSG_CHECKING(for cURL)
245 if test -x "$with_curl"; then
246 CURL_CONFIG= "$with_curl"
248 AC_PATH_PROG(CURL_CONFIG, curl-config, no)
251 if test x$CURL_CONFIG = xno; then
252 AC_MSG_ERROR([*** curl-config not found])
255 save_CFLAGS="$CFLAGS"
256 save_CXXFLAGS="$CXXFLAGS"
259 CURL_CFLAGS="`$CURL_CONFIG --cflags`"
260 CURL_CXXFLAGS="`$CURL_CONFIG --cflags`"
261 CURL_LIBS="`$CURL_CONFIG --libs`"
262 CFLAGS="$CFLAGS $CURL_CFLAGS"
263 CXXFLAGS="$CXXFLAGS $CURL_CXXFLAGS"
264 LIBS="$LIBS $CURL_LIBS"
266 AC_MSG_CHECKING(for SSL support in libcurl)
267 curlssl=`$CURL_CONFIG --feature | grep SSL`
268 if test -z "$curlssl"; then
276 AC_DEFINE(HAVE_CURL, 1, [has curl library])
280 #####################
281 # Check for libjpeg #
282 #####################
283 AC_MSG_CHECKING(for libjpeg (for Gadu-Gadu registration))
287 if test "x$with_libjpeg" != "xno"; then
290 AC_CHECK_LIB(jpeg, jpeg_start_decompress,
292 AC_CHECK_HEADERS(jpeglib.h,
294 AC_DEFINE(HAVE_LIBJPEG, 1, [define if you have libjpeg])
295 JPEG_LIBS="-ljpeg $LIBS"
296 LIBS="$LIBS $JPEG_LIBS"
306 LIBS="$LIBS $LIBICONV"
308 AC_CHECK_LIB(socket, socket)
309 AC_CHECK_LIB(nsl, gethostbyname)
310 AC_CHECK_LIB(ncurses, initscr,, [AC_CHECK_LIB(curses, initscr,, AC_MSG_ERROR(The ncurses terminal library is required in order to build the program))])
313 #include <sys/types.h>
314 #include <sys/socket.h>
315 ],[ socklen_t foo; ], ac_cv_c_socklen_t=yes, ac_cv_c_socklen_t=no)
317 if test "$ac_cv_c_socklen_t" = "no"; then
318 AC_DEFINE(socklen_t, int, [Define type of socklen_t for systems missing it])
323 LIBS="$LIBS -flat_namespace"
327 AM_CONDITIONAL(BUILD_YAHOO, test "x$build_yahoo" = xyes)
328 AM_CONDITIONAL(BUILD_AIM, test "x$build_aim" = xyes)
329 AM_CONDITIONAL(BUILD_IRC, test "x$build_irc" = xyes)
330 AM_CONDITIONAL(BUILD_JABBER, test "x$build_jabber" = xyes)
331 AM_CONDITIONAL(BUILD_GADU, test "x$build_gg" = xyes)
332 AM_CONDITIONAL(BUILD_MSN, test "x$build_msn" = xyes)
333 AM_CONDITIONAL(BUILD_RSS, test "x$build_rss" = xyes -o "x$build_lj" = xyes)
334 AM_CONDITIONAL(BUILD_LJ, test "x$build_lj" = xyes)
335 AM_CONDITIONAL(HAVE_FRIBIDI, test "x$have_fribidi" = xyes)
337 if test "$build_yahoo" = "yes"; then
338 AC_DEFINE(BUILD_YAHOO, 1, [build with yahoo support])
340 if test "$build_aim" = "yes"; then
341 AC_DEFINE(BUILD_AIM, 1, [build with aim support])
343 if test "$build_irc" = "yes";
344 then AC_DEFINE(BUILD_IRC, 1, [build with irc support])
346 if test "$build_jabber" = "yes"; then
347 if test $have_gpgme = no; then
348 AC_MSG_WARN([No GPG support in Jabber, since GPGME library not found or its setup not ok])
350 AC_DEFINE(BUILD_JABBER, 1, [build with jabber support])
352 if test "$build_gg" = "yes"; then
353 if test $have_libjpeg = no; then
354 AC_MSG_WARN([No jpeg support in Gadu-Gadu, you will not be able to register??????????])
356 AC_DEFINE(BUILD_GADU, 1, [build with gadu-gadu support])
358 if test "$build_msn" = "yes"; then
359 if test $have_curl = no; then
360 AC_MSG_ERROR([MSN cannot be built without the curl library.])
362 if test $curlssl = no; then
363 AC_MSG_ERROR([MSN requires libcurl built with SSL support.])
365 AC_DEFINE(BUILD_MSN, 1, [build with MSN support])
367 if test "$build_rss" = "yes" -o "$build_lj" = "yes"; then
368 AC_DEFINE(BUILD_RSS, 1, [build the integrated rss feeds reader])
370 if test "$build_lj" = "yes"; then
371 AC_DEFINE(BUILD_LJ, 1, [build the integrated livejournal client])
374 ############################
375 # Checks for header files. #
376 ############################
381 AC_CHECK_HEADERS([argz.h arpa/inet.h fcntl.h float.h inttypes.h langinfo.h libintl.h limits.h locale.h malloc.h netdb.h netinet/in.h stddef.h stdint.h stdio_ext.h stdlib.h string.h strings.h sys/ioctl.h sys/mount.h sys/param.h sys/socket.h sys/statvfs.h sys/time.h sys/vfs.h syslog.h unistd.h utmp.h wchar.h])
382 AC_CHECK_HEADERS([stdint.h sys/types.h],,)
386 AC_CHECK_HEADERS([vector iostream fstream string algorithm list memory iterator exception utility],, AC_MSG_ERROR([You need to have the libstdc++ headers installed]))
387 AC_CHECK_HEADERS([hash_map strstream ext/hash_map sstream],,)
390 ##################################################################
391 # Checks for typedefs, structures, and compiler characteristics. #
392 ##################################################################
402 AC_CHECK_TYPES([ptrdiff_t])
408 AC_SUBST(FRIBIDI_LIBS)
409 AC_SUBST(FRIBIDI_CFLAGS)
413 AC_SUBST(GPGME_CFLAGS)
414 AC_SUBST(GPGME_CXXFLAGS)
417 AC_SUBST(CURL_CFLAGS)
418 AC_SUBST(CURL_CXXFLAGS)
422 #################################
423 # Checks for library functions. #
424 #################################
425 AC_FUNC_CLOSEDIR_VOID
426 AC_FUNC_ERROR_AT_LINE
429 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
435 AC_FUNC_SELECT_ARGTYPES
440 AC_CHECK_FUNCS([__argz_count __argz_next __argz_stringify alarm atexit bzero dup2 floor getcwd gethostbyname gethostname gettimeofday inet_ntoa isascii memmove mempcpy memset mkdir modf munmap nl_langinfo putenv regcomp rmdir select setenv setlocale socket stpcpy strcasecmp strchr strcspn strdup strerror strncasecmp strpbrk strrchr strspn strstr strtol strtoul uname])
442 ########################
443 # Create output files. #
444 ########################
445 # also configure other packages
446 AC_CONFIG_SUBDIRS(connwrap firetalk kkconsui kkstrtext kksystr libgadu libicq2000 libjabber libmsn libyahoo2)
448 ALL_LINGUAS="zh_TW.Big5 uk sv ru ro pt_BR pl nl ms it hu fr es de cs bg"
449 AC_CONFIG_FILES([Makefile
462 Install prefix $prefix
463 Build shared libs $enable_shared
464 Build static libs $enable_static
468 Protocols and Clients:])
469 if test "x$build_yahoo" = xyes; then AC_MSG_RESULT([ Yahoo]); fi
470 if test "x$build_aim" = xyes; then AC_MSG_RESULT([ AIM]); fi
471 if test "x$build_jabber" = xyes; then AC_MSG_RESULT([ jabber]); fi
472 if test "x$build_gg" = xyes; then AC_MSG_RESULT([ Gadu-Gadu]); fi
473 if test "x$build_msn" = xyes; then AC_MSG_RESULT([ MSN Messenger]); fi
474 if test "x$build_rss" = xyes; then AC_MSG_RESULT([ RSS Reader]); fi
475 if test "x$build_lj" = xyes; then AC_MSG_RESULT([ LiveJournal client]); fi
476 if test "x$have_fribidi" = xyes; then AC_MSG_RESULT([ LiveJournal client]); fi