2 # Process this file with autoconf to produce a configure script.
5 AC_INIT([centerim], [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)])
189 if test x"$with_gpgme" = x"no"; then
190 AC_MSG_CHECKING(for gpgme)
192 if test -x "$with_gpgme"; then
193 GPGME_CONFIG= "$with_gpgme"
195 AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no)
198 if test x$GPGME_CONFIG = xno; then
204 save_CFLAGS="$CFLAGS"
205 save_CXXFLAGS="$CXXFLAGS"
208 GPGME_CFLAGS="`$GPGME_CONFIG --cflags`"
209 GPGME_CXXFLAGS="`$GPGME_CONFIG --cflags`"
210 GPGME_LIBS="`$GPGME_CONFIG --libs`"
211 CFLAGS="$CFLAGS $GPGME_CFLAGS"
212 CXXFLAGS="$CXXFLAGS $GPGME_CXXFLAGS"
213 LIBS="$LIBS $GPGME_LIBS"
215 AC_MSG_CHECKING(for the OpenPGP protocol in gpgme)
220 if(!gpgme_new(&ctx)) if(!gpgme_set_protocol(ctx, GPGME_PROTOCOL_OpenPGP)) return 0;
223 ], opengpg_avail=yes, opengpg_avail=no, opengpg_avail=no)
224 AC_MSG_RESULT([$opengpg_avail])
226 if test "$opengpg_avail" != "yes"; then
227 CFLAGS="$save_CFLAGS"
228 CXXFLAGS="$save_CXXFLAGS"
231 AC_DEFINE(HAVE_GPGME, 1, [has gpgme library])
238 AC_MSG_CHECKING(for cURL)
246 if test -x "$with_curl"; then
247 CURL_CONFIG= "$with_curl"
249 AC_PATH_PROG(CURL_CONFIG, curl-config, no)
252 if test x$CURL_CONFIG = xno; then
253 AC_MSG_ERROR([*** curl-config not found])
256 save_CFLAGS="$CFLAGS"
257 save_CXXFLAGS="$CXXFLAGS"
260 CURL_CFLAGS="`$CURL_CONFIG --cflags`"
261 CURL_CXXFLAGS="`$CURL_CONFIG --cflags`"
262 CURL_LIBS="`$CURL_CONFIG --libs`"
263 CFLAGS="$CFLAGS $CURL_CFLAGS"
264 CXXFLAGS="$CXXFLAGS $CURL_CXXFLAGS"
265 LIBS="$LIBS $CURL_LIBS"
267 AC_MSG_CHECKING(for SSL support in libcurl)
268 curlssl=`$CURL_CONFIG --feature | grep SSL`
269 if test -z "$curlssl"; then
277 AC_DEFINE(HAVE_CURL, 1, [has curl library])
281 #####################
282 # Check for libjpeg #
283 #####################
284 AC_MSG_CHECKING(for libjpeg (for Gadu-Gadu registration))
288 if test "x$with_libjpeg" != "xno"; then
291 AC_CHECK_LIB(jpeg, jpeg_start_decompress,
293 AC_CHECK_HEADERS(jpeglib.h,
295 AC_DEFINE(HAVE_LIBJPEG, 1, [define if you have libjpeg])
296 JPEG_LIBS="-ljpeg $LIBS"
297 LIBS="$LIBS $JPEG_LIBS"
307 LIBS="$LIBS $LIBICONV"
309 AC_CHECK_LIB(socket, socket)
310 AC_CHECK_LIB(nsl, gethostbyname)
311 AC_CHECK_LIB(ncursesw, get_wch,, [AC_CHECK_LIB(ncurses, initscr,,
312 [AC_CHECK_LIB(curses, initscr,,
313 AC_MSG_ERROR(The ncurses terminal library is
314 required in order to build the
318 #include <sys/types.h>
319 #include <sys/socket.h>
320 ],[ socklen_t foo; ], ac_cv_c_socklen_t=yes, ac_cv_c_socklen_t=no)
322 if test "$ac_cv_c_socklen_t" = "no"; then
323 AC_DEFINE(socklen_t, int, [Define type of socklen_t for systems missing it])
328 LIBS="$LIBS -flat_namespace"
332 AM_CONDITIONAL(BUILD_YAHOO, test "x$build_yahoo" = xyes)
333 AM_CONDITIONAL(BUILD_AIM, test "x$build_aim" = xyes)
334 AM_CONDITIONAL(BUILD_IRC, test "x$build_irc" = xyes)
335 AM_CONDITIONAL(BUILD_FIRETALK, test "x$build_irc" = xyes -o "x$build_aim" = xyes)
336 AM_CONDITIONAL(BUILD_JABBER, test "x$build_jabber" = xyes)
337 AM_CONDITIONAL(BUILD_GADU, test "x$build_gg" = xyes)
338 AM_CONDITIONAL(BUILD_MSN, test "x$build_msn" = xyes)
339 AM_CONDITIONAL(BUILD_RSS, test "x$build_rss" = xyes -o "x$build_lj" = xyes)
340 AM_CONDITIONAL(BUILD_LJ, test "x$build_lj" = xyes)
341 AM_CONDITIONAL(HAVE_FRIBIDI, test "x$have_fribidi" = xyes)
343 if test "$build_yahoo" = "yes"; then
344 AC_DEFINE(BUILD_YAHOO, 1, [build with yahoo support])
346 if test "$build_aim" = "yes"; then
347 AC_DEFINE(BUILD_AIM, 1, [build with aim support])
349 if test "$build_irc" = "yes";
350 then AC_DEFINE(BUILD_IRC, 1, [build with irc support])
352 if test "$build_jabber" = "yes"; then
353 if test $have_gpgme = no; then
354 AC_MSG_WARN([No GPG support in Jabber, since GPGME library not found or its setup not ok])
356 AC_DEFINE(BUILD_JABBER, 1, [build with jabber support])
358 if test "$build_gg" = "yes"; then
359 if test $have_libjpeg = no; then
360 AC_MSG_WARN([No jpeg support in Gadu-Gadu, you will not be able to register??????????])
362 AC_DEFINE(BUILD_GADU, 1, [build with gadu-gadu support])
364 if test "$build_msn" = "yes"; then
365 if test $have_curl = no; then
366 AC_MSG_ERROR([MSN cannot be built without the curl library.])
368 if test $curlssl = no; then
369 AC_MSG_ERROR([MSN requires libcurl built with SSL support.])
371 AC_DEFINE(BUILD_MSN, 1, [build with MSN support])
373 if test "$build_rss" = "yes" -o "$build_lj" = "yes"; then
374 AC_DEFINE(BUILD_RSS, 1, [build the integrated rss feeds reader])
376 if test "$build_lj" = "yes"; then
377 AC_DEFINE(BUILD_LJ, 1, [build the integrated livejournal client])
380 ############################
381 # Checks for header files. #
382 ############################
387 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])
388 AC_CHECK_HEADERS([stdint.h sys/types.h],,)
392 AC_CHECK_HEADERS([vector iostream fstream string algorithm list memory iterator exception utility],, AC_MSG_ERROR([You need to have the libstdc++ headers installed]))
393 AC_CHECK_HEADERS([hash_map strstream ext/hash_map sstream],,)
396 ##################################################################
397 # Checks for typedefs, structures, and compiler characteristics. #
398 ##################################################################
408 AC_CHECK_TYPES([ptrdiff_t])
414 AC_SUBST(FRIBIDI_LIBS)
415 AC_SUBST(FRIBIDI_CFLAGS)
419 AC_SUBST(GPGME_CFLAGS)
420 AC_SUBST(GPGME_CXXFLAGS)
423 AC_SUBST(CURL_CFLAGS)
424 AC_SUBST(CURL_CXXFLAGS)
428 #################################
429 # Checks for library functions. #
430 #################################
431 AC_FUNC_CLOSEDIR_VOID
432 AC_FUNC_ERROR_AT_LINE
435 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
441 AC_FUNC_SELECT_ARGTYPES
446 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])
448 ########################
449 # Create output files. #
450 ########################
451 # also configure other packages
452 AC_CONFIG_SUBDIRS(connwrap firetalk kkconsui kkstrtext kksystr libgadu libicq2000 libjabber libmsn libyahoo2)
454 ALL_LINGUAS="zh_TW.Big5 uk sv ru ro pt_BR pl nl ms it hu fr es de cs bg"
455 AC_CONFIG_FILES([Makefile
468 Install prefix $prefix
469 Build shared libs $enable_shared
470 Build static libs $enable_static
474 Protocols and Clients:])
475 if test "x$build_yahoo" = xyes; then AC_MSG_RESULT([ Yahoo]); fi
476 if test "x$build_aim" = xyes; then AC_MSG_RESULT([ AIM]); fi
477 if test "x$build_jabber" = xyes; then AC_MSG_RESULT([ jabber]); fi
478 if test "x$build_gg" = xyes; then AC_MSG_RESULT([ Gadu-Gadu]); fi
479 if test "x$build_msn" = xyes; then AC_MSG_RESULT([ MSN Messenger]); fi
480 if test "x$build_rss" = xyes; then AC_MSG_RESULT([ RSS Reader]); fi
481 if test "x$build_lj" = xyes; then AC_MSG_RESULT([ LiveJournal client]); fi
482 if test "x$have_fribidi" = xyes; then AC_MSG_RESULT([ LiveJournal client]); fi