2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([centerim], [4.22.1], [http://sourceforge.net/projects/centerim])
6 AC_CONFIG_SRCDIR([config.h.in])
7 AC_CONFIG_HEADER([config.h])
8 AM_INIT_AUTOMAKE([-Wall])
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-icq], [Build without ICQ]),
36 build_icq="$enableval",
40 AS_HELP_STRING([--disable-yahoo], [Build without Yahoo!]),
41 build_yahoo="$enableval",
45 AS_HELP_STRING([--disable-aim], [Build without AIM]),
46 build_aim="$enableval",
50 AS_HELP_STRING([--disable-irc], [Build without IRC]),
51 build_irc="$enableval",
55 AS_HELP_STRING([--disable-jabber], [Build without Jabber]),
56 build_jabber="$enableval",
60 AS_HELP_STRING([--disable-gg], [Build without Gadu-Gadu]),
61 build_gg="$enableval",
65 AS_HELP_STRING([--disable-msn], [Build without MSN]),
66 build_msn="$enableval",
70 AS_HELP_STRING([--disable-rss], [Build without RSS reader]),
71 build_rss="$enableval",
75 AS_HELP_STRING([--disable-lj], [Build without LiveJournal client]),
76 build_lj="$enableval",
79 AC_ARG_ENABLE(locales-fix,
80 AS_HELP_STRING([--enable-locales-fix], [enables workaround for
81 broken locales. use this option if some of
82 characters in your texts in Chinese or Japanese
87 AS_HELP_STRING([--with-fribidi=[DIR]], [enable Hebrew and Arabic
88 support using fribidi library in DIR]),
89 [with_fribidi=$withval],
93 AS_HELP_STRING([--with-ssl], [enable SSL secured connections using
94 either OpenSSL or GnuTLS (auto)]),
98 AS_HELP_STRING([--with-openssl=[DIR]], [enable SSL secured
99 connections using the OpenSSL library in DIR
101 [with_openssl=$withval]
104 AS_HELP_STRING([--with-gpgme=[PATH]], [path to gpgme-config (auto)]),
105 [with_gpgme=$withval],
109 AS_HELP_STRING([--with-curl=[PATH]], [path to curl-config (auto)]),
110 [with_curl=$withval],
114 AS_HELP_STRING([--without-libjpeg], [Compile without JPEG token
115 support (for Gadu-Gadu registration)])
118 #####################
119 # Check for fribidi #
120 #####################
121 AC_MSG_CHECKING(whether to use fribidi)
127 if test "x$with_fribidi" = "xyes"; then
128 AC_PATH_PROG(FRIBIDI_CONFIG, fribidi-config, no)
129 if test x$FRIBIDI_CONFIG = xno; then
130 AC_MSG_ERROR([*** fribidi-config not found])
133 FRIBIDI_CFLAGS="`$FRIBIDI_CONFIG --cflags`"
134 CFLAGS="$CFLAGS $FRIBIDI_CFLAGS"
135 FRIBIDI_LIBS="`$FRIBIDI_CONFIG --libs`"
136 FRIBIDI_PC="fribidi,"
138 AC_CHECK_LIB(fribidi, fribidi_get_mirror_char, :, AC_MSG_ERROR([*** libfribidi not found.]), $FRIBIDI_LIBS)
139 AC_DEFINE(HAVE_FRIBIDI, 1, [has fribidi library])
142 AC_MSG_RESULT([$have_fribidi])
147 AC_MSG_CHECKING(for SSL)
150 if test "$with_ssl" != "no"; then
152 AC_MSG_CHECKING(for OpenSSL)
153 if test -z "$with_openssl" -o x"$with_openssl" = xyes; then
154 for ac_dir in $with_openssl /usr/local /usr; do
155 if test -f "$ac_dir/include/openssl/ssl.h"; then
162 if test -n "$with_openssl" -a "$with_openssl" != "no"; 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(crypto, SSLeay_add_all_algorithms, [
168 AC_DEFINE(HAVE_SSLEAY, 1, [use SSLeay])
171 AC_CHECK_LIB(ssl, main)
172 ac_configure_args="$ac_configure_args --with-ssl --with-openssl=$with_openssl"
174 AC_MSG_RESULT([not found or disabled])
177 AM_PATH_LIBGNUTLS_EXTRA(0.0.1, [
178 AC_CHECK_LIB(lzo, lzo1x_1_compress, [], [
179 echo "lzo compression is required.";
182 CXXFLAGS="$CXXFLAGS $LIBGNUTLS_CFLAGS"
183 LIBS="$LIBS $LIBGNUTLS_LIBS -lgnutls-extra"
184 AC_DEFINE(HAVE_GNUTLS, 1, [use gnutls])
186 ac_configure_args="$ac_configure_args --with-ssl"
190 AC_MSG_RESULT([disabled (use --with-ssl=[DIR] to enable)])
201 if test x"$with_gpgme" = x"no"; then
202 AC_MSG_CHECKING(for gpgme)
204 AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no)
206 if test x$GPGME_CONFIG = xno; then
211 save_CFLAGS="$CFLAGS"
212 save_CXXFLAGS="$CXXFLAGS"
215 GPGME_CFLAGS="`$GPGME_CONFIG --cflags`"
216 GPGME_CXXFLAGS="`$GPGME_CONFIG --cflags`"
217 GPGME_LIBS="`$GPGME_CONFIG --libs`"
218 CFLAGS="$CFLAGS $GPGME_CFLAGS"
219 CXXFLAGS="$CXXFLAGS $GPGME_CXXFLAGS"
220 LIBS="$LIBS $GPGME_LIBS"
222 AC_MSG_CHECKING(for the OpenPGP protocol in gpgme)
227 if(!gpgme_new(&ctx)) if(!gpgme_set_protocol(ctx, GPGME_PROTOCOL_OpenPGP)) return 0;
230 ], opengpg_avail=yes, opengpg_avail=no, opengpg_avail=no)
231 AC_MSG_RESULT([$opengpg_avail])
233 if test "$opengpg_avail" != "yes"; then
234 CFLAGS="$save_CFLAGS"
235 CXXFLAGS="$save_CXXFLAGS"
238 AC_DEFINE(HAVE_GPGME, 1, [has gpgme library])
242 GPGME_CONFIG= "$with_gpgme"
248 AC_MSG_CHECKING(for cURL)
255 if test -x "$with_curl"; then
256 CURL_CONFIG= "$with_curl"
258 AC_PATH_PROG(CURL_CONFIG, curl-config, no)
261 if test x$CURL_CONFIG = xno; then
262 AC_MSG_ERROR([*** curl-config not found])
265 save_CFLAGS="$CFLAGS"
266 save_CXXFLAGS="$CXXFLAGS"
269 CURL_CFLAGS="`$CURL_CONFIG --cflags`"
270 CURL_CXXFLAGS="`$CURL_CONFIG --cflags`"
271 CURL_LIBS="`$CURL_CONFIG --libs`"
272 CFLAGS="$CFLAGS $CURL_CFLAGS"
273 CXXFLAGS="$CXXFLAGS $CURL_CXXFLAGS"
274 LIBS="$LIBS $CURL_LIBS"
276 AC_MSG_CHECKING(for SSL support in libcurl)
277 curlssl=`$CURL_CONFIG --feature | grep SSL`
278 if test -z "$curlssl"; then
286 AC_DEFINE(HAVE_CURL, 1, [has curl library])
289 #####################
290 # Check for libjpeg #
291 #####################
292 AC_MSG_CHECKING(for libjpeg (for Gadu-Gadu registration))
296 if test "x$with_libjpeg" != "xno"; then
299 AC_CHECK_LIB(jpeg, jpeg_start_decompress,
301 AC_CHECK_HEADERS(jpeglib.h,
303 AC_DEFINE(HAVE_LIBJPEG, 1, [define if you have libjpeg])
304 JPEG_LIBS="-ljpeg $LIBS"
305 LIBS="$LIBS $JPEG_LIBS"
315 LIBS="$LIBS $LIBICONV"
317 AC_CHECK_LIB(socket, socket)
318 AC_CHECK_LIB(nsl, gethostbyname)
319 AC_CHECK_LIB(ncursesw, get_wch,, [AC_CHECK_LIB(ncurses, initscr,,
320 [AC_CHECK_LIB(curses, initscr,,
321 AC_MSG_ERROR(The ncurses terminal library is required in order to build the program))])])
324 #include <sys/types.h>
325 #include <sys/socket.h>
326 ],[ socklen_t foo; ], ac_cv_c_socklen_t=yes, ac_cv_c_socklen_t=no)
328 if test "$ac_cv_c_socklen_t" = "no"; then
329 AC_DEFINE(socklen_t, int, [Define type of socklen_t for systems missing it])
334 LIBS="$LIBS -flat_namespace"
338 AM_CONDITIONAL(BUILD_ICQ, test "x$build_icq" = xyes)
339 AM_CONDITIONAL(BUILD_YAHOO, test "x$build_yahoo" = xyes)
340 AM_CONDITIONAL(BUILD_AIM, test "x$build_aim" = xyes)
341 AM_CONDITIONAL(BUILD_IRC, test "x$build_irc" = xyes)
342 AM_CONDITIONAL(BUILD_FIRETALK, test "x$build_irc" = xyes -o "x$build_aim" = xyes)
343 AM_CONDITIONAL(BUILD_JABBER, test "x$build_jabber" = xyes)
344 AM_CONDITIONAL(BUILD_GADU, test "x$build_gg" = xyes)
345 AM_CONDITIONAL(BUILD_MSN, test "x$build_msn" = xyes)
346 AM_CONDITIONAL(BUILD_RSS, test "x$build_rss" = xyes -o "x$build_lj" = xyes)
347 AM_CONDITIONAL(BUILD_LJ, test "x$build_lj" = xyes)
348 AM_CONDITIONAL(HAVE_FRIBIDI, test "x$have_fribidi" = xyes)
350 if test "$build_icq" = "yes"; then
351 AC_DEFINE(BUILD_ICQ, 1, [build with ICQ support])
353 if test "$build_yahoo" = "yes"; then
354 AC_DEFINE(BUILD_YAHOO, 1, [build with yahoo support])
356 if test "$build_aim" = "yes"; then
357 AC_DEFINE(BUILD_AIM, 1, [build with aim support])
359 if test "$build_irc" = "yes";
360 then AC_DEFINE(BUILD_IRC, 1, [build with irc support])
362 if test "$build_jabber" = "yes"; then
363 if test $have_gpgme = no; then
364 AC_MSG_WARN([No GPG support in Jabber, since GPGME library not found or its setup not ok])
366 AC_DEFINE(BUILD_JABBER, 1, [build with jabber support])
368 if test "$build_gg" = "yes"; then
369 if test $have_libjpeg = no; then
370 AC_MSG_WARN([No jpeg support in Gadu-Gadu, you will not be able to register??????????])
372 AC_DEFINE(BUILD_GADU, 1, [build with gadu-gadu support])
374 if test "$build_msn" = "yes"; then
375 if test $have_curl = no; then
376 AC_MSG_ERROR([MSN cannot be built without the curl library.])
378 if test $curlssl = no; then
379 AC_MSG_ERROR([MSN requires libcurl built with SSL support.])
381 AC_DEFINE(BUILD_MSN, 1, [build with MSN support])
383 if test "$build_rss" = "yes" -o "$build_lj" = "yes"; then
384 AC_DEFINE(BUILD_RSS, 1, [build the integrated rss feeds reader])
386 if test "$build_lj" = "yes"; then
387 AC_DEFINE(BUILD_LJ, 1, [build the integrated livejournal client])
390 ############################
391 # Checks for header files. #
392 ############################
397 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])
398 AC_CHECK_HEADERS([stdint.h sys/types.h],,)
402 AC_CHECK_HEADERS([vector iostream fstream string algorithm list memory iterator exception utility],, AC_MSG_ERROR([You need to have the libstdc++ headers installed]))
403 AC_CHECK_HEADERS([hash_map strstream ext/hash_map sstream],,)
406 ##################################################################
407 # Checks for typedefs, structures, and compiler characteristics. #
408 ##################################################################
418 AC_CHECK_TYPES([ptrdiff_t])
424 AC_SUBST(FRIBIDI_LIBS)
425 AC_SUBST(FRIBIDI_CFLAGS)
429 AC_SUBST(GPGME_CFLAGS)
430 AC_SUBST(GPGME_CXXFLAGS)
432 AC_SUBST(GNUTLS_LIBS)
433 AC_SUBST(GNUTLS_CFLAGS)
434 AC_SUBST(GNUTLS_CXXFLAGS)
437 AC_SUBST(CURL_CFLAGS)
438 AC_SUBST(CURL_CXXFLAGS)
442 #################################
443 # Checks for library functions. #
444 #################################
445 AC_FUNC_CLOSEDIR_VOID
446 AC_FUNC_ERROR_AT_LINE
449 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
455 AC_FUNC_SELECT_ARGTYPES
460 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])
462 ########################
463 # Create output files. #
464 ########################
465 # also configure other packages
466 AC_CONFIG_SUBDIRS(connwrap firetalk kkconsui kkstrtext kksystr libgadu libicq2000 libjabber libmsn libyahoo2)
468 ALL_LINGUAS="zh_TW.Big5 uk sv ru ro pt_BR pl nl ms it hu fr es de cs bg"
469 AC_CONFIG_FILES([Makefile
482 Install prefix $prefix
483 Build shared libs $enable_shared
484 Build static libs $enable_static
488 Protocols and Clients:])
489 if test "x$build_icq" = xyes; then AC_MSG_RESULT([ ICQ]); fi
490 if test "x$build_yahoo" = xyes; then AC_MSG_RESULT([ Yahoo]); fi
491 if test "x$build_aim" = xyes; then AC_MSG_RESULT([ AIM]); fi
492 if test "x$build_jabber" = xyes; then AC_MSG_RESULT([ jabber]); fi
493 if test "x$build_gg" = xyes; then AC_MSG_RESULT([ Gadu-Gadu]); fi
494 if test "x$build_msn" = xyes; then AC_MSG_RESULT([ MSN Messenger]); fi
495 if test "x$build_rss" = xyes; then AC_MSG_RESULT([ RSS Reader]); fi
496 if test "x$build_lj" = xyes; then AC_MSG_RESULT([ LiveJournal client]); fi
497 if test "x$have_fribidi" = xyes; then AC_MSG_RESULT([ LiveJournal client]); fi
498 if test "x$with_ssl" = xno; then
500 WARNING: SSL disabled (This means no Google Talk)
503 if test "x$have_gpgme" = xno; then
505 WARNING: GPGME disabled (This means no encrypted messages between users)