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 #########################
34 AC_ARG_ENABLE(yahoo, [ --disable-yahoo Build without Yahoo!], build_yahoo="$enableval", build_yahoo="yes")
35 AC_ARG_ENABLE(aim, [ --disable-aim Build without AIM], build_aim="$enableval", build_aim="yes")
36 AC_ARG_ENABLE(irc, [ --disable-irc Build without IRC], build_irc="$enableval", build_irc="yes")
37 AC_ARG_ENABLE(jabber, [ --disable-jabber Build without Jabber], build_jabber="$enableval", build_jabber="yes")
38 AC_ARG_ENABLE(gg, [ --disable-gg Build without Gadu-Gadu], build_gg="$enableval", build_gg="yes")
39 AC_ARG_ENABLE(msn, [ --disable-msn Build without MSN], build_msn="$enableval", build_msn="yes")
40 AC_ARG_ENABLE(rss, [ --disable-rss Build without RSS reader], build_rss="$enableval", build_rss="yes")
41 AC_ARG_ENABLE(lj, [ --disable-lj Build without LiveJournal client], build_lj="$enableval", build_lj="yes")
42 AC_ARG_ENABLE(locales-fix, [ --enable-locales-fix enables workaround for broken locales. use this option if some of characters in your texts in Chinese or Japanese diappear])
44 AC_ARG_WITH(fribidi, [ --with-fribidi=[DIR] enable Hebrew and Arabic support using fribidi library in DIR], [with_fribidi=$withval], [with_fribidi=no])
45 AC_ARG_WITH(ssl, [ --with-ssl enable SSL secured connections using either OpenSSL or GnuTLS], [with_ssl=$withval], [with_ssl=no])
46 AC_ARG_WITH(openssl, [ --with-openssl=[DIR] enable SSL secured connections using the OpenSSL library in DIR (optional)], [with_openssl=$withval], [with_openssl=no])
47 AC_ARG_WITH(openssl, [ --with-gpgme=[PATH] path to gpgme-config (auto)], [with_gpgme=$withval], [with_gpgme=no])
48 AC_ARG_WITH(curl, [ --with-curl=[PATH] path to curl-config (auto)], [with_curl=$withval], [with_curl=no])
49 AC_ARG_WITH(libjpeg, [ --without-libjpeg Compile without JPEG token support (for Gadu-Gadu registration)])
54 AC_MSG_CHECKING(wether to use fribidi)
60 if test "x$with_fribidi" = "xyes"; then
61 AC_PATH_PROG(FRIBIDI_CONFIG, fribidi-config, no)
62 if test x$FRIBIDI_CONFIG = xno; then
63 AC_MSG_ERROR([*** fribidi-config not found])
66 FRIBIDI_CFLAGS="`$FRIBIDI_CONFIG --cflags`"
67 CFLAGS="$CFLAGS $FRIBIDI_CFLAGS"
68 FRIBIDI_LIBS="`$FRIBIDI_CONFIG --libs`"
71 AC_CHECK_LIB(fribidi, fribidi_get_mirror_char, :, AC_MSG_ERROR([*** libfribidi not found.]), $FRIBIDI_LIBS)
72 AC_DEFINE(HAVE_FRIBIDI, 1, [has fribidi library])
75 AC_MSG_RESULT([$have_fribidi])
80 AC_MSG_CHECKING(for SSL)
83 if test "$with_ssl" != "no"; then
85 AC_MSG_CHECKING(for OpenSSL)
86 if test -z "$with_openssl"; then
87 for ac_dir in $with_openssl /usr/local /usr; do
88 if test -f "$ac_dir/include/openssl/ssl.h"; then
95 if test -n "$with_openssl" -a "$with_openssl" != "no"; then
96 if test "$with_openssl" = "yes"; then
99 CFLAGS="$CFLAGS -I${with_openssl}"
100 AC_DEFINE(HAVE_OPENSSL, 1, [use openssl])
101 AC_CHECK_LIB(crypto, main)
102 AC_CHECK_LIB(ssl, main)
103 AC_MSG_RESULT([found in $with_openssl])
107 AM_PATH_LIBGNUTLS_EXTRA(0.0.1, [
108 CXXFLAGS="$CXXFLAGS $LIBGNUTLS_CFLAGS"
109 LIBS="$LIBS $LIBGNUTLS_LIBS -lgnutls-extra"
110 AC_DEFINE(HAVE_GNUTLS, 1, [use gnutls]) with_ssl="yes" ])
111 AC_MSG_RESULT([not found or disabled])
114 AC_MSG_RESULT([disabled (use --with-ssl=[DIR] to enable)])
120 AC_MSG_CHECKING(for gpgme)
129 if test -x "$with_gpgme"; then
130 GPGME_CONFIG= "$with_gpgme"
132 AC_PATH_PROG(GPGME_CONFIG, gpgme-config, no)
135 if test x$GPGME_CONFIG = xno; then
136 AC_MSG_ERROR([*** gpgme-config not found])
139 save_CFLAGS="$CFLAGS"
140 save_CXXFLAGS="$CXXFLAGS"
143 GPGME_CFLAGS="`$GPGME_CONFIG --cflags`"
144 GPGME_CXXFLAGS="`$GPGME_CONFIG --cflags`"
145 GPGME_LIBS="`$GPGME_CONFIG --libs`"
146 CFLAGS="$CFLAGS $GPGME_CFLAGS"
147 CXXFLAGS="$CXXFLAGS $GPGME_CXXFLAGS"
148 LIBS="$LIBS $GPGME_LIBS"
150 AC_MSG_CHECKING(for the OpenPGP protocol in gpgme)
155 if(!gpgme_new(&ctx)) if(!gpgme_set_protocol(ctx, GPGME_PROTOCOL_OpenPGP)) return 0;
158 ], opengpg_avail=yes, opengpg_avail=no, opengpg_avail=no)
159 AC_MSG_RESULT($opengpg_avail)
161 if test "$opengpg_avail" != "yes"; then
162 CFLAGS="$save_CFLAGS"
163 CXXFLAGS="$save_CXXFLAGS"
166 AC_DEFINE(HAVE_GPGME, 1, [has gpgme library])
173 AC_MSG_CHECKING(for cURL)
181 if test -x "$with_curl"; then
182 CURL_CONFIG= "$with_curl"
184 AC_PATH_PROG(CURL_CONFIG, curl-config, no)
187 if test x$CURL_CONFIG = xno; then
188 AC_MSG_ERROR([*** curl-config not found])
191 save_CFLAGS="$CFLAGS"
192 save_CXXFLAGS="$CXXFLAGS"
195 CURL_CFLAGS="`$CURL_CONFIG --cflags`"
196 CURL_CXXFLAGS="`$CURL_CONFIG --cflags`"
197 CURL_LIBS="`$CURL_CONFIG --libs`"
198 CFLAGS="$CFLAGS $CURL_CFLAGS"
199 CXXFLAGS="$CXXFLAGS $CURL_CXXFLAGS"
200 LIBS="$LIBS $CURL_LIBS"
202 AC_MSG_CHECKING(for SSL support in libcurl)
203 curlssl=`$CURL_CONFIG --feature | grep SSL`
204 if test -z "$curlssl"; then
212 AC_DEFINE(HAVE_CURL, 1, [has curl library])
216 #####################
217 # Check for libjpeg #
218 #####################
219 AC_MSG_CHECKING(for libjpeg (for Gadu-Gadu registration))
223 if test "x$with_libjpeg" != "xno"; then
226 AC_CHECK_LIB(jpeg, jpeg_start_decompress,
228 AC_CHECK_HEADERS(jpeglib.h,
230 AC_DEFINE(HAVE_LIBJPEG, 1, [define if you have libjpeg])
231 JPEG_LIBS="-ljpeg $LIBS"
232 LIBS="$LIBS $JPEG_LIBS"
242 LIBS="$LIBS $LIBICONV"
244 AC_CHECK_LIB(socket, socket)
245 AC_CHECK_LIB(nsl, gethostbyname)
246 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))])
249 #include <sys/types.h>
250 #include <sys/socket.h>
251 ],[ socklen_t foo; ], ac_cv_c_socklen_t=yes, ac_cv_c_socklen_t=no)
253 if test "$ac_cv_c_socklen_t" = "no"; then
254 AC_DEFINE(socklen_t, int, [Define type of socklen_t for systems missing it])
259 LIBS="$LIBS -flat_namespace"
263 AM_CONDITIONAL(BUILD_YAHOO, test "x$build_yahoo" = xyes)
264 AM_CONDITIONAL(BUILD_AIM, test "x$build_aim" = xyes)
265 AM_CONDITIONAL(BUILD_IRC, test "x$build_irc" = xyes)
266 AM_CONDITIONAL(BUILD_JABBER, test "x$build_jabber" = xyes)
267 AM_CONDITIONAL(BUILD_GADU, test "x$build_gg" = xyes)
268 AM_CONDITIONAL(BUILD_MSN, test "x$build_msn" = xyes)
269 AM_CONDITIONAL(BUILD_RSS, test "x$build_rss" = xyes -o "x$build_lj" = xyes)
270 AM_CONDITIONAL(BUILD_LJ, test "x$build_lj" = xyes)
271 AM_CONDITIONAL(HAVE_FRIBIDI, test "x$have_fribidi" = xyes)
273 if test "$build_yahoo" = "yes"; then
274 AC_DEFINE(BUILD_YAHOO, 1, [build with yahoo support])
276 if test "$build_aim" = "yes"; then
277 AC_DEFINE(BUILD_AIM, 1, [build with aim support])
279 if test "$build_irc" = "yes";
280 then AC_DEFINE(BUILD_IRC, 1, [build with irc support])
282 if test "$build_jabber" = "yes"; then
283 if test $have_gpgme = no; then
284 AC_MSG_WARN([No GPG support in Jabber, since GPGME library not found or its setup not ok])
286 AC_DEFINE(BUILD_JABBER, 1, [build with jabber support])
288 if test "$build_gg" = "yes"; then
289 if test $have_libjpeg = no; then
290 AC_MSG_WARN([No jpeg support in Gadu-Gadu, you will not be able to register??????????])
292 AC_DEFINE(BUILD_GADU, 1, [build with gadu-gadu support])
294 if test "$build_msn" = "yes"; then
295 if test $have_curl = no; then
296 AC_MSG_ERROR([MSN cannot be built without the curl library.])
298 if test $curlssl = no; then
299 AC_MSG_ERROR([MSN requires libcurl built with SSL support.])
301 AC_DEFINE(BUILD_MSN, 1, [build with MSN support])
303 if test "$build_rss" = "yes" -o "$build_lj" = "yes"; then
304 AC_DEFINE(BUILD_RSS, 1, [build the integrated rss feeds reader])
306 if test "$build_lj" = "yes"; then
307 AC_DEFINE(BUILD_LJ, 1, [build the integrated livejournal client])
310 ############################
311 # Checks for header files. #
312 ############################
317 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])
318 AC_CHECK_HEADERS([stdint.h sys/types.h],,)
322 AC_CHECK_HEADERS([vector iostream fstream string algorithm list memory iterator exception utility],, AC_MSG_ERROR([You need to have the libstdc++ headers installed]))
323 AC_CHECK_HEADERS([hash_map strstream ext/hash_map sstream],,)
326 ##################################################################
327 # Checks for typedefs, structures, and compiler characteristics. #
328 ##################################################################
338 AC_CHECK_TYPES([ptrdiff_t])
344 AC_SUBST(FRIBIDI_LIBS)
345 AC_SUBST(FRIBIDI_CFLAGS)
349 AC_SUBST(GPGME_CFLAGS)
350 AC_SUBST(GPGME_CXXFLAGS)
353 AC_SUBST(CURL_CFLAGS)
354 AC_SUBST(CURL_CXXFLAGS)
358 #################################
359 # Checks for library functions. #
360 #################################
361 AC_FUNC_CLOSEDIR_VOID
362 AC_FUNC_ERROR_AT_LINE
365 AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
371 AC_FUNC_SELECT_ARGTYPES
376 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])
378 ########################
379 # Create output files. #
380 ########################
381 # also configure other packages
382 AC_CONFIG_SUBDIRS(connwrap firetalk kkconsui kkstrtext kksystr libgadu libicq2000 libjabber libmsn libyahoo2)
384 ALL_LINGUAS="zh_TW.Big5 uk sv ru ro pt_BR pl nl ms it hu fr es de cs bg"
385 AC_CONFIG_FILES([Makefile
398 Install prefix $prefix
399 Build shared libs $enable_shared
400 Build static libs $enable_static
404 Protocols and Clients:])
405 if test "x$build_yahoo" = xyes; then AC_MSG_RESULT([ Yahoo]); fi
406 if test "x$build_aim" = xyes; then AC_MSG_RESULT([ AIM]); fi
407 if test "x$build_jabber" = xyes; then AC_MSG_RESULT([ jabber]); fi
408 if test "x$build_gg" = xyes; then AC_MSG_RESULT([ Gadu-Gadu]); fi
409 if test "x$build_msn" = xyes; then AC_MSG_RESULT([ MSN Messenger]); fi
410 if test "x$build_rss" = xyes; then AC_MSG_RESULT([ RSS Reader]); fi
411 if test "x$build_lj" = xyes; then AC_MSG_RESULT([ LiveJournal client]); fi
412 if test "x$have_fribidi" = xyes; then AC_MSG_RESULT([ LiveJournal client]); fi