1 project('pidgin', 'c', meson_version : '>=0.37.0')
3 # UPDATING VERSION NUMBERS FOR RELEASES
5 # purple_micro_version += 1
7 # If any functions have been added to libpurple, Pidgin, or Finch:
8 # purple_micro_version = 0
9 # purple_minor_version += 1
10 # purple_lt_current += 1
12 # If backwards compatibility has been broken in libpurple, Pidgin, or Finch:
13 # purple_micro_version = 0
14 # purple_minor_version = 0
15 # purple_major_version += 1;
16 # purple_lt_current += 1
18 # purple_version_suffix should be similar to one of the following:
19 # For beta releases: 'beta2'
20 # For code under development: 'devel'
21 # For production releases: ''
23 # Make sure to update finch/libgnt/meson.build with libgnt version changes.
25 purple_lt_current = 20
26 purple_major_version = 3
27 purple_minor_version = 0
28 purple_micro_version = 0
29 purple_version_suffix = 'devel'
30 purple_version = '@0@.@1@.@2@'.format(purple_major_version,
33 purple_display_version = '@0@@1@'.format(purple_version,
34 purple_version_suffix)
36 add_project_arguments('-DHAVE_CONFIG_H=1', language : 'c')
37 conf = configuration_data()
38 man_conf = configuration_data()
39 purple_h_conf = configuration_data()
40 version_conf = configuration_data()
42 conf.set_quoted('PACKAGE', meson.project_name())
43 conf.set_quoted('PACKAGE_NAME', meson.project_name())
44 conf.set_quoted('VERSION', purple_display_version)
46 version_conf.set('PURPLE_MAJOR_VERSION', purple_major_version)
47 version_conf.set('PURPLE_MINOR_VERSION', purple_minor_version)
48 version_conf.set('PURPLE_MICRO_VERSION', purple_micro_version)
49 version_conf.set('PURPLE_VERSION', purple_display_version)
50 version_conf.set('PURPLE_API_VERSION',
51 purple_lt_current - purple_minor_version)
53 PURPLE_LIB_VERSION = '@0@.@1@.@2@'.format(purple_lt_current - purple_minor_version,
57 package_revision = vcs_tag(
58 input : 'package_revision.h.in',
59 output : 'package_revision.h',
60 fallback : meson.project_version())
63 man_conf.set('VERSION', purple_display_version)
64 man_conf.set('prefix', get_option('prefix'))
66 # Used for pkg-config files.
67 pkgconfig = import('pkgconfig')
69 sedpath = find_program('sed')
71 # Storing build arguments
72 if meson.version().version_compare('>=0.42.0')
73 meson.add_postconf_script('mkmesonconf.py')
74 conf.set('HAVE_MESON_CONFIG', true)
77 # Checks for programs.
78 compiler = meson.get_compiler('c')
80 # Check for Sun compiler
81 SUNCC = compiler.compiles('void main() {__SUNPRO_C;};')
84 if host_machine.system() == 'windows'
85 windows = import('windows')
88 ws2_32 = compiler.find_library('ws2_32')
89 dnsapi = compiler.find_library('dnsapi')
90 if build_machine.system() != 'windows'
91 conf.set('IS_WIN32_CROSS_COMPILED', true)
93 conf.set('WIN32_LEAN_AND_MEAN', true)
95 conf.set('LIBPIDGIN_DLL_NAMEW',
96 'L"libpidgin-@0@.dll"'.format(purple_lt_current))
103 # Checks for header files.
104 # AC_HEADER_SYS_WAIT:
105 conf.set('HAVE_SYS_WAIT_H', compiler.has_header('sys/wait.h'))
107 foreach h : ['fcntl.h', 'unistd.h', 'stdint.h']
108 if compiler.has_header(h)
109 conf.set('HAVE_' + h.to_upper().underscorify(), true)
111 error(h + ' is required.')
115 # Checks for typedefs, structures, and compiler characteristics.
116 time_t_size = compiler.sizeof('time_t',
121 conf.set('SIZEOF_TIME_T', time_t_size)
123 conf.set('WORDS_BIGENDIAN', host_machine.endian() != 'little')
125 # Check for directories
127 foreach dir : ['bin', 'lib', 'data', 'sysconf', 'locale']
128 path = join_paths(get_option('prefix'), get_option(dir + 'dir'))
129 conf.set_quoted('WIN32_FHS_@0@DIR'.format(dir.to_upper()), path)
132 conf.set('PURPLE_LIBDIR',
133 'wpurple_lib_dir("purple-@0@")'.format(purple_major_version))
134 conf.set('PIDGIN_LIBDIR',
135 'wpurple_lib_dir("pidgin-@0@")'.format(purple_major_version))
136 conf.set('FINCH_LIBDIR',
137 'wpurple_lib_dir("finch-@0@")'.format(purple_major_version))
139 conf.set('PURPLE_DATADIR', 'wpurple_data_dir()')
140 conf.set('PURPLE_SYSCONFDIR', 'wpurple_sysconf_dir()')
141 conf.set('PURPLE_LOCALEDIR', 'wpurple_locale_dir()')
143 foreach dir : ['data', 'sysconf', 'locale']
144 path = join_paths(get_option('prefix'), get_option(dir + 'dir'))
145 conf.set_quoted('PURPLE_@0@DIR'.format(dir.to_upper()), path)
148 common_libdir = join_paths(get_option('prefix'), get_option('libdir'))
149 conf.set_quoted('PURPLE_LIBDIR',
150 join_paths(common_libdir,
151 'purple-@0@'.format(purple_major_version)))
152 conf.set_quoted('PIDGIN_LIBDIR',
153 join_paths(common_libdir,
154 'pidgin-@0@'.format(purple_major_version)))
155 conf.set_quoted('FINCH_LIBDIR',
156 join_paths(common_libdir,
157 'finch-@0@'.format(purple_major_version)))
160 abslibdir = join_paths(get_option('prefix'), get_option('libdir'))
161 PURPLE_PLUGINDIR = join_paths(abslibdir, 'purple-@0@'.format(purple_major_version))
162 conf.set_quoted('PURPLE_PLUGINDIR', PURPLE_PLUGINDIR)
163 PIDGIN_PLUGINDIR = join_paths(abslibdir, 'pidgin-@0@'.format(purple_major_version))
164 conf.set_quoted('PIDGIN_PLUGINDIR', PIDGIN_PLUGINDIR)
165 FINCH_PLUGINDIR = join_paths(abslibdir, 'finch-@0@'.format(purple_major_version))
166 conf.set_quoted('FINCH_PLUGINDIR', FINCH_PLUGINDIR)
168 # Check for inet_aton
170 if not compiler.has_function('inet_aton')
171 if not compiler.has_function('inet_aton', args : '-lresolv')
172 # FIXME: Someone needs to link with -lresolv if needed.
173 error('inet_aton not found')
177 if compiler.has_function('gethostent', args : '-lnsl')
178 conf.set('HAVE_LIBNSL', true)
181 conf.set('HAVE_GETADDRINFO', true)
182 conf.set('HAVE_INET_NTOP', true)
184 if not compiler.has_function('socket')
185 if not compiler.has_function('socket', args : '-lsocket')
186 error('socket not found')
189 # If all goes well, by this point the previous two checks will have
190 # pulled in -lsocket and -lnsl if we need them.
191 if compiler.has_function('getaddrinfo')
192 conf.set('HAVE_GETADDRINFO', true)
194 if compiler.has_function('getaddrinfo', args : '-lsocket -lnsl')
195 conf.set('HAVE_GETADDRINFO', true)
196 # FIXME: LIBS += declare_dependency(link_with : ['socket', 'nsl'])
199 conf.set('HAVE_INET_NTOP',
200 compiler.has_function('inet_ntop'))
202 conf.set('HAVE_GETIFADDRS',
203 compiler.has_function('getifaddrs'))
205 # Check for socklen_t (in Unix98)
207 socket_header = 'ws2tcpip.h'
209 socket_header = 'sys/socket.h'
211 if not compiler.has_header_symbol(socket_header, 'socklen_t')
213 #include <sys/types.h>
215 int accept(int, struct sockaddr *, size_t *);
217 '''.format(socket_header)
218 if compiler.compiles(code, name : 'socklen_t is size_t')
219 conf.set('socklen_t', 'size_t')
221 conf.set('socklen_t', 'int')
225 # Some systems do not have sa_len field for struct sockaddr.
226 conf.set('HAVE_STRUCT_SOCKADDR_SA_LEN',
227 compiler.has_member('struct sockaddr', 'sa_len',
228 prefix : '#include <@0@>'.format(socket_header)))
230 # Check for v6-only sockets
232 header = 'ws2tcpip.h'
234 header = 'netinet/in.h'
236 conf.set('HAVE_IPV6_V6ONLY',
237 compiler.has_header_symbol(header, 'IPV6_V6ONLY'))
239 # Windows and Haiku do not use libm for the math functions, they are part
241 math = compiler.find_library('m')
243 # before gettexting, in case iconv matters
245 if host_machine.system() == 'darwin'
246 if compiler.has_header('CoreFoundation/CoreFoundation.h')
247 if compiler.has_header('IOKit/IOKitLib.h')
248 conf.set('HAVE_IOKIT', true)
249 IOKIT = dependency('appleframeworks',
250 modules : ['IOKit', 'CoreFoundation'])
254 if run_command('test', '-d', '/sw').returncode() == 0
256 #CPPFLAGS="$CPPFLAGS -I/sw/include"
257 #LDFLAGS="$LDFLAGS -L/sw/lib"
261 # #######################################################################
262 # # Disable creation and installation of translation files
263 # #######################################################################
265 INSTALL_I18N = get_option('nls')
268 conf.set('ENABLE_NLS', true)
270 i18n = import('i18n')
275 # #######################################################################
276 # # Check for GLib 2.40 (required)
277 # #######################################################################
278 glib = dependency('glib-2.0', version : '>= 2.40.0')
279 gio = dependency('gio-2.0')
280 gobject = dependency('gobject-2.0')
281 gthread = dependency('gthread-2.0')
282 gnome = import('gnome')
284 if get_option('extraversion') != ''
285 DISPLAY_VERSION = '@0@-@1@'.format(meson.project_version(),
286 get_option('extraversion'))
288 DISPLAY_VERSION = meson.project_version()
290 conf.set_quoted('DISPLAY_VERSION', DISPLAY_VERSION)
292 force_deps = not get_option('missing-dependencies')
294 # #######################################################################
295 # # Check for GTK+ 2.18 and other things used by the GTK UI
296 # #######################################################################
297 enable_gestures = get_option('gestures')
298 enable_gcr = get_option('gcr')
300 # #######################################################################
301 # Check Pidgin dependencies
302 # #######################################################################
303 if get_option('gtkui')
304 gtk = dependency('gtk+-3.0', version : '>= 3.10.0')
305 # We only really need Pango >= 1.4 for decent RTL support
306 pango = dependency('pango', version : '>= 1.4.0')
307 conf.set('HAVE_PANGO14', pango.found())
309 webkit = dependency('webkitgtk-3.0', version : '>= 1.3.7')
311 #######################################################################
312 # Check if we should compile with enchant support
313 #######################################################################
314 # We need enchant for spell checking dictionary enumeration,
315 # because webkit1 doesn't have this.
316 enable_enchant = get_option('enchant')
318 enchant = dependency('enchant', required : force_deps)
319 enable_enchant = enchant.found()
320 conf.set('USE_ENCHANT', enable_enchant)
325 #######################################################################
326 # Check for GCR for its certificate widgets
327 #######################################################################
329 GCR = dependency('gcr-3', required : force_deps)
331 conf.set('ENABLE_GCR', true)
342 enable_enchant = false
345 ENABLE_GTK = get_option('gtkui')
348 #######################################################################
349 # Check if we should compile with X support
350 #######################################################################
351 with_x = get_option('x') and not IS_WIN32
354 x11 = dependency('x11')
356 conf.set('HAVE_X11', true)
361 X11 development headers not found.
362 Use -Dx=false if you do not need X11 support.
369 if not get_option('gtkui') or not with_x
370 enable_gestures = false
373 #######################################################################
374 # Check for LibXML2 (required)
375 #######################################################################
376 libxml = dependency('libxml-2.0', version : '>= 2.6.0')
377 if libxml.version().version_compare('<2.6.18')
378 message('Versions of libxml2 < 2.6.18 may contain bugs that could cause XMPP messages to be discarded.')
381 #######################################################################
382 # Check for JSON-GLib (required)
383 #######################################################################
385 json = dependency('json-glib-1.0', version : '>= 0.14.0')
387 #######################################################################
388 # Check for GStreamer
389 #######################################################################
391 enable_gst = get_option('gstreamer')
393 gstreamer = dependency('gstreamer-1.0', required : force_deps)
395 conf.set('USE_GSTREAMER', true)
403 #######################################################################
404 # Check for GStreamer Video
405 #######################################################################
406 enable_gstvideo = enable_gst and get_option('gstreamer-video')
408 gstreamer_video = dependency('gstreamer-video-1.0',
410 if gstreamer_video.found()
411 conf.set('USE_GSTVIDEO', true)
413 enable_gstvideo = false
419 #######################################################################
420 # Check for Farstream
421 #######################################################################
422 if get_option('farstream')
423 farstream = dependency('farstream-0.2', version : '>= 0.2.7',
425 enable_farstream = farstream.found()
428 enable_farstream = false
431 #######################################################################
432 # Check for Voice and Video support
433 #######################################################################
435 if enable_gst and enable_gstvideo and enable_farstream
436 conf.set('USE_VV', true)
441 Dependencies for voice/video were not met.
442 Install the necessary gstreamer and farstream packages first.
443 Or use -Dvv=false if you do not need voice/video support.
452 #######################################################################
453 # Check for Raw data streams support in Farstream
454 #######################################################################
456 gstreamer_app = dependency('gstreamer-app-1.0',
458 if gstreamer_app.found()
459 conf.set('USE_GSTAPP', true)
460 conf.set('HAVE_MEDIA_APPLICATION', true)
466 #######################################################################
467 # Check for Internationalized Domain Name support
468 #######################################################################
471 idn = dependency('libidn', version : '>= 0.0.0', required : force_deps)
472 conf.set('USE_IDN', idn.found())
477 #######################################################################
478 # Check for Meanwhile headers (for Sametime)
479 #######################################################################
480 if get_option('meanwhile')
481 meanwhile = dependency('meanwhile', version : ['>= 1.0.0', '< 2.0.0'], required : force_deps)
482 enable_meanwhile = meanwhile.found()
484 enable_meanwhile = false
488 #######################################################################
489 # Check for Native Avahi headers (for Bonjour)
490 #######################################################################
492 enable_avahi = get_option('avahi')
494 if enable_avahi and IS_WIN32
497 # Attempt to autodetect Avahi
498 avahi_client = dependency('avahi-client', required : false)
499 avahi_glib = dependency('avahi-glib', required : false)
500 if avahi_client.found() and avahi_glib.found()
501 avahi = [avahi_client, avahi_glib]
506 avahi development package not found.
507 Use -Davahi=false if you do not need avahi (Bonjour) support.
514 #######################################################################
515 # Check for SILC client includes and libraries
516 #######################################################################
518 if get_option('silc')
519 silc = dependency('silcclient', version : '>= 1.1', required : false)
522 # SILC Toolkit >= 1.0.1 has a new MIME API
523 conf.set('HAVE_SILCMIME_H', true)
527 SILC development package not found.
528 Use -Dsilc=false if you do not need SILC support.
534 #######################################################################
535 # Check for Gadu-Gadu protocol library (libgadu)
536 #######################################################################
538 enable_libgadu = get_option('libgadu')
540 libgadu = dependency('libgadu', version : '>= 1.12.0', required : false)
541 have_libgadu = libgadu.found()
544 if not compiler.has_function('gg_is_gpl_compliant', dependencies : libgadu)
547 libgadu is not compatible with the GPL when compiled with OpenSSL support.
549 To link against libgadu, please recompile it using:
550 ./configure --with-openssl=no
551 Then rerun this Meson build
556 if not have_libgadu and force_deps
558 Libgadu development headers not found.
559 Use -Dlibgadu=false if you do not need GG (GaduGadu) support.
567 DEFAULT_PRPLS = ['bonjour', 'facebook', 'gg', 'irc', 'jabber', 'novell',
568 'oscar', 'sametime', 'silc', 'simple', 'zephyr']
569 ALL_PRPLS = DEFAULT_PRPLS + ['null']
571 dynamic_list = get_option('dynamic-prpls').split(',')
572 static_list = get_option('static-prpls').split(',')
573 if (static_list != [''] and static_list != []) and dynamic_list == ['all']
577 if static_list == ['all']
578 static_list = DEFAULT_PRPLS
581 foreach prpl : static_list
583 # The list was empty; do nothing.
584 elif prpl == 'sametime' and not enable_meanwhile
586 elif prpl == 'bonjour' and not enable_avahi
588 elif prpl == 'silc' and not have_silc
590 elif prpl == 'gg' and not have_libgadu
592 elif prpl == 'zephyr' and IS_WIN32
595 STATIC_PRPLS += [prpl]
598 STATIC_LINK_LIBS = []
603 foreach prpl : STATIC_PRPLS
604 # Ugly special case for 'libsilcpurple.la':
606 STATIC_LINK_LIBS.append('\$(top_builddir)/libpurple/protocols/@1@/lib@1@purple.la'.format(meson.build_root(), prpl))
608 # FIXME: Shouldn't be libtool:
609 STATIC_LINK_LIBS.append('\$(top_builddir)/libpurple/protocols/@1@/lib@1@.la'.format(meson.build_root(), prpl))
611 extern_load.append('extern gboolean @0@_plugin_load();'.format(prpl))
612 load_proto.append('@0@_plugin_load();'.format(prpl))
613 extern_unload.append('extern gboolean @0@_plugin_unload();'.format(prpl))
614 unload_proto.append('@0@_plugin_unload();'.format(prpl))
616 STATIC_BONJOUR = STATIC_PRPLS.contains('bonjour')
617 STATIC_FACEBOOK = STATIC_PRPLS.contains('facebook')
618 STATIC_GG = STATIC_PRPLS.contains('gg')
619 STATIC_IRC = STATIC_PRPLS.contains('irc')
620 STATIC_JABBER = STATIC_PRPLS.contains('jabber')
621 STATIC_NOVELL = STATIC_PRPLS.contains('novell')
622 STATIC_OSCAR = STATIC_PRPLS.contains('oscar') or STATIC_PRPLS.contains('aim') or STATIC_PRPLS.contains('icq')
623 STATIC_SAMETIME = STATIC_PRPLS.contains('sametime')
624 STATIC_SILC = STATIC_PRPLS.contains('silc')
625 STATIC_SIMPLE = STATIC_PRPLS.contains('simple')
626 STATIC_ZEPHYR = STATIC_PRPLS.contains('zephyr')
627 conf.set('STATIC_PROTO_LOAD',
628 ' '.join(extern_load) +
629 ' static void static_proto_load(void) { ' + ' '.join(load_proto) + ' }')
630 conf.set('STATIC_PROTO_UNLOAD',
631 ' '.join(extern_unload) +
632 ' static void static_proto_unload(void) { ' + ' '.join(unload_proto) + ' }')
634 if dynamic_list == ['all']
635 dynamic_list = DEFAULT_PRPLS
638 foreach prpl : dynamic_list
640 # The list was empty; do nothing.
641 elif prpl == 'sametime' and not enable_meanwhile
643 elif prpl == 'bonjour' and not enable_avahi
645 elif prpl == 'silc' and not have_silc
647 elif prpl == 'gg' and not have_libgadu
649 elif prpl == 'zephyr' and IS_WIN32
652 DYNAMIC_PRPLS += [prpl]
656 DYNAMIC_BONJOUR = DYNAMIC_PRPLS.contains('bonjour')
657 DYNAMIC_FACEBOOK = DYNAMIC_PRPLS.contains('facebook')
658 DYNAMIC_GG = DYNAMIC_PRPLS.contains('gg')
659 DYNAMIC_IRC = DYNAMIC_PRPLS.contains('irc')
660 DYNAMIC_JABBER = DYNAMIC_PRPLS.contains('jabber')
661 DYNAMIC_NOVELL = DYNAMIC_PRPLS.contains('novell')
662 DYNAMIC_NULL = DYNAMIC_PRPLS.contains('null')
663 DYNAMIC_OSCAR = DYNAMIC_PRPLS.contains('oscar') or DYNAMIC_PRPLS.contains('aim') or DYNAMIC_PRPLS.contains('icq')
664 DYNAMIC_SAMETIME = DYNAMIC_PRPLS.contains('sametime')
665 DYNAMIC_SILC = DYNAMIC_PRPLS.contains('silc')
666 DYNAMIC_SIMPLE = DYNAMIC_PRPLS.contains('simple')
667 DYNAMIC_ZEPHYR = DYNAMIC_PRPLS.contains('zephyr')
669 conf.set('HAVE_SYS_UTSNAME_H',
670 compiler.has_header('sys/utsname.h'))
671 conf.set('HAVE_UNAME',
672 compiler.has_function('uname'))
675 add_project_arguments(
676 '-DPURPLE_DISABLE_DEPRECATED',
677 '-DPIDGIN_DISABLE_DEPRECATED',
678 '-DFINCH_DISABLE_DEPRECATED',
679 '-DGNT_DISABLE_DEPRECATED',
681 if compiler.get_id() == 'gcc'
682 # We enable -Wall later.
683 # If it's set after the warning CFLAGS in the compiler invocation, it counteracts the -Wno... flags.
684 # This leads to warnings we don't want.
685 # CFLAGS=`echo $CFLAGS |$sedpath 's/-Wall//'`
687 # ENABLE WARNINGS SUPPORTED BY THE VERSION OF GCC IN USE
689 # Future Possibilities
691 # Consider adding -Wbad-function-cast.
692 # This leads to spurious warnings using GPOINTER_TO_INT(), et al. directly on a function call.
693 # We'd need an intermediate variable.
696 '-Waggregate-return',
698 '-Wdeclaration-after-statement',
700 '-Werror-implicit-function-declaration',
701 '-Wextra -Wno-unused-parameter',
704 '-Werror=format-security',
706 '-Wmissing-declarations',
707 '-Wmissing-noreturn',
708 '-Wmissing-prototypes',
712 if compiler.has_argument(newflag)
713 add_project_arguments(newflag, language : 'c')
717 if get_option('fortify')
718 # AC_MSG_CHECKING(for FORTIFY_SOURCE support)
719 # AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <features.h>]], [[
720 # #if !(__GNUC_PREREQ (4, 1) \
721 # || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (4, 0)) \
722 # || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (3, 4) \
723 # && __GNUC_MINOR__ == 4 \
724 # && (__GNUC_PATCHLEVEL__ > 2 \
725 # || (__GNUC_PATCHLEVEL__ == 2 && __GNUC_RH_RELEASE__ >= 8))))
726 # #error No FORTIFY_SOURCE support
731 # DEBUG_CFLAGS='$DEBUG_CFLAGS -Wp,-D_FORTIFY_SOURCE=2'
738 add_project_arguments('-features=extensions', language : 'c')
741 pidginpath = find_program('pidgin', required : false)
743 if get_option('glib-errors-trace')
744 if compiler.get_id() == 'clang'
745 error('--enable-glib-errors-trace doesn\'t work with clang')
747 conf.set('ENABLE_GLIBTRACE', true)
748 add_project_arguments('-rdynamic', language : 'c')
751 #######################################################################
752 # Check for D-Bus libraries
753 #######################################################################
755 # dbus doesn't compile for win32 at the moment
756 enable_dbus = get_option('dbus') and not IS_WIN32
759 dbus_binding_tool = find_program('dbus-binding-tool')
760 enable_dbus = dbus_binding_tool.found()
764 dbus = dependency('dbus-1', version : '>= 0.60', required : force_deps)
765 dbus_glib = dependency('dbus-glib-1', version : '>= 0.60', required : force_deps)
766 enable_dbus = dbus.found() and dbus_glib.found()
773 conf.set('HAVE_DBUS', true)
776 #######################################################################
777 # Check for Unity and Messaging Menu
778 # Remove when Ubuntu 16.04 is EOL
779 #######################################################################
780 enable_unity = get_option('unity-integration')
783 dependency('unity', version : '>= 6.8'),
784 dependency('messaging-menu', version : '>= 12.10')
786 conf.set('USES_MM_CHAT_SECTION', 'X-MessagingMenu-UsesChatSection=true')
788 conf.set('USES_MM_CHAT_SECTION', '')
791 #######################################################################
792 # Check for Secret Service headers
793 #######################################################################
795 enable_secret_service = get_option('secret-service') and not IS_WIN32
796 if enable_secret_service
797 secretservice = dependency('libsecret-1', required : force_deps)
798 if secretservice.found()
800 enable_secret_service = false
804 #######################################################################
805 # Check for KWallet headers
806 #######################################################################
808 enable_kwallet = get_option('kwallet') and not IS_WIN32
809 enable_kwallet = false
812 # Ensure C++ compiler works
814 cxx_compiler = meson.get_compiler('cpp')
816 qt4 = dependency('qt4', modules : 'Core', required : force_deps)
817 enable_kwallet = qt4.found()
821 # AC_MSG_CHECKING([for metaobject compiler])
822 # MOC=`$PKG_CONFIG --variable=moc_location QtCore`
824 # AC_MSG_RESULT([$MOC])
826 # KWALLET_CXXFLAGS=''
828 # if test -z '$with_kwallet_includes' || test -z '$with_kwallet_libs'; then
829 # AC_CHECK_PROG(KDE4_CONFIG, kde4-config, kde4-config, no)
830 # if test 'x$KDE4_CONFIG' = 'xno'; then
831 # enable_kwallet = false
832 # if test 'x$force_deps' = 'xyes'; then
834 #kde4-config not found. $KDE4_CONFIG
835 #Use -Dkwallet=false if you do not need KWallet support.
843 # if test 'x$KDE4_CONFIG' != 'xno'; then
844 # KWALLET_CXXFLAGS='$QT4_CFLAGS -I`$KDE4_CONFIG --path include`'
846 # CPPFLAGS='$CPPFLAGS $KWALLET_CXXFLAGS'
847 # AC_CHECK_HEADER([kwallet.h], , [
848 # enable_kwallet = false
849 # if test 'x$force_deps' = 'xyes'; then
851 #KWallet development headers not found.
852 #Use -Dkwallet=false if you do not need KWallet support.
859 # AC_MSG_CHECKING([for KWallet libraries])
860 # if test 'x$KDE4_CONFIG' != 'xno'; then
861 # KWALLET_LIBS='-L`$KDE4_CONFIG --install lib`/kde4/devel -lkdeui'
863 # KWALLET_LIBS='-lkdeui'
865 # KWALLET_LIBS='$KWALLET_LIBS'
866 # LIBS='$LIBS $KWALLET_LIBS $QT4_LIBS'
867 # AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <kwallet.h>],
868 # [KWallet::Wallet::LocalWallet();])], [AC_MSG_RESULT([yes])],
871 # enable_kwallet = false
872 # if test 'x$force_deps' = 'xyes'; then
874 #KWallet development libraries not found.
875 #Use -Dkwallet=false if you do not need KWallet support.
881 #######################################################################
882 # Check for GPlugin 0.0.17
883 #######################################################################
884 if get_option('plugins')
885 gplugin = dependency('gplugin', version : '>= 0.0.17')
886 # GPLUGIN_REQ sets pkg-config requirements in the .pc file
887 GPLUGIN_REQ = ['gplugin']
893 #######################################################################
894 # Check for GObject Introspection
895 #######################################################################
897 enable_introspection = get_option('introspection')
898 if enable_introspection
899 if dependency('gobject-introspection-1.0', version : '>= 1.30.0',
900 required : force_deps).found()
901 conf.set('ENABLE_INTROSPECTION', true)
903 enable_introspection = false
907 #######################################################################
909 #######################################################################
911 # Python scripts are used to auto-generate about 3000 lines of C
912 # and XML code that wraps (part of) the existing API so that
913 # it is now accessible through D-Bus.
916 if meson.version().version_compare('>=0.38.0')
917 python3_mod = import('python3')
918 python = python3_mod.find_python()
920 python = find_program('python3')
924 #######################################################################
926 #######################################################################
928 ssl_certificates_dir = get_option('system-ssl-certs')
930 SSL_CERTIFICATES_DIR = ''
931 if ssl_certificates_dir != ''
932 if run_command('test', '-d', ssl_certificates_dir).returncode() != 0
934 message(ssl_certificates_dir + ' does not exist. It may be OK when cross-compiling, but please make sure about it.')
936 error(ssl_certificates_dir + ' does not exist, if this is the correct location please make sure that it exists.')
939 SSL_CERTIFICATES_DIR = ssl_certificates_dir
941 if SSL_CERTIFICATES_DIR != ''
942 conf.set_quoted('SSL_CERTIFICATES_DIR', SSL_CERTIFICATES_DIR)
944 INSTALL_SSL_CERTIFICATES = SSL_CERTIFICATES_DIR == ''
946 if get_option('plugins')
947 conf.set('PURPLE_PLUGINS', 1)
949 purple_h_conf.set('PLUGINS_DEFINE', '#define PURPLE_PLUGINS 1')
952 purple_h_conf.set('PLUGINS_DEFINE', '#undef PURPLE_PLUGINS')
955 #######################################################################
956 # Check for Nettle (Crypto Library)
957 #######################################################################
959 enable_nettle = get_option('nettle')
962 nettle = dependency('nettle', version : '>= 3.0', required : false)
963 enable_nettle = nettle.found()
964 conf.set('HAVE_NETTLE', enable_nettle)
966 if not enable_nettle and force_deps
968 Nettle development headers not found
969 Use -Dnettle=false if you do not need it.
976 #######################################################################
977 # Check for Cyrus-SASL (for xmpp/irc)
978 #######################################################################
979 foreach func : ['snprintf', 'connect']
980 conf.set('HAVE_' + func.to_upper(),
981 compiler.has_function(func))
983 enable_cyrus_sasl = get_option('cyrus-sasl')
985 sasl = dependency('libsasl2', version : '>= 2.0', required : false)
986 enable_cyrus_sasl = sasl.found()
987 conf.set('HAVE_CYRUS_SASL', enable_cyrus_sasl)
989 if not enable_cyrus_sasl and force_deps
991 Cyrus SASL library not found
992 Use -Dcyrus-sasl=false if you do not need it.
996 enable_cyrus_sasl = false
1000 #######################################################################
1001 # Check for Kerberos (for Zephyr)
1002 #######################################################################
1003 conf.set('ZEPHYR_INT32', 'long')
1004 #AC_SUBST(KRB4_CFLAGS)
1005 #AC_SUBST(KRB4_LDFLAGS)
1006 #AC_SUBST(KRB4_LIBS)
1007 kerberos = get_option('krb4')
1009 if kerberos != 'yes'
1010 # KRB4_CFLAGS='-I${kerberos}/include'
1011 # if test -d '$kerberos/include/kerberosIV' ; then
1012 # KRB4_CFLAGS='$KRB4_CFLAGS -I${kerberos}/include/kerberosIV'
1014 # KRB4_LDFLAGS='-L${kerberos}/lib'
1015 elif run_command('test', '-d', '/usr/local/include/kerberosIV').returncode() == 0
1016 # KRB4_CFLAGS='-I/usr/local/include/kerberosIV'
1017 elif run_command('test', '-d', '/usr/include/kerberosIV').returncode() == 0
1018 # KRB4_CFLAGS='-I/usr/include/kerberosIV'
1020 conf.set('ZEPHYR_USES_KERBEROS', true)
1022 # AC_CHECK_LIB(krb4, krb_rd_req,
1023 # [KRB4_LIBS='-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err'],
1024 # [AC_CHECK_LIB(krb, krb_rd_req,
1025 # [KRB4_LIBS='-lkrb -ldes'],
1026 # [AC_MSG_ERROR([Kerberos 4 libraries not found])],
1028 # -ldes425 -lkrb5 -lk5crypto -lcom_err)
1029 # AC_CHECK_FUNCS(krb_set_key krb_rd_req krb_get_lrealm)
1030 # AC_CHECK_FUNCS(krb_get_err_text krb_log)
1037 #######################################################################
1038 # Check for external libzephyr
1039 #######################################################################
1040 zephyr = get_option('zephyr')
1042 ext_zephyr = dependency('zephyr', required : force_deps)
1043 zephyr = ext_zephyr.found()
1047 EXTERNAL_LIBZEPHYR = zephyr
1048 conf.set('LIBZEPHYR_EXT', EXTERNAL_LIBZEPHYR)
1050 #AC_MSG_CHECKING(for me pot o' gold)
1052 foreach func : ['gethostid', 'timegm']
1053 conf.set('HAVE_' + func.to_upper(),
1054 compiler.has_function(func))
1056 foreach header : 'paths.h sgtty.h sys/cdefs.h sys/file.h sys/filio.h sys/ioctl.h sys/msgbuf.h sys/select.h sys/uio.h sys/utsname.h sys/wait.h termios.h'.split()
1057 conf.set('HAVE_' + header.to_upper().underscorify(),
1058 compiler.has_header(header))
1061 # sys/sysctl.h on OpenBSD 4.2 requires sys/param.h
1062 # sys/sysctl.h on FreeBSD requires sys/types.h
1063 have_sys_param_h = compiler.has_header('sys/param.h')
1064 conf.set('HAVE_SYS_PARAM_H', have_sys_param_h)
1066 #include <sys/types.h>
1070 #include <sys/param.h>
1073 conf.set('HAVE_SYS_SYSCTL_H',
1074 compiler.has_header('sys/sysctl.h', prefix : prefix))
1075 conf.set('HAVE_SYS_SOCKET_H',
1076 compiler.has_header('sys/socket.h'))
1077 #AC_VAR_TIMEZONE_EXTERNALS
1079 conf.set('HAVE_TM_GMTOFF',
1080 compiler.has_member('struct tm', 'tm_gmtoff',
1081 prefix : '#include<time.h>'))
1083 #######################################################################
1084 # Disable pixmap installation
1085 #######################################################################
1086 INSTALL_PIXMAPS = get_option('pixmaps-install')
1089 ENABLE_DOC = get_option('doc')
1091 if meson.version().version_compare('<0.41.2')
1093 error('Meson 0.41.2 or newer is required to build documentation.')
1099 enable_debug = get_option('debug')
1100 conf.set('DEBUG', enable_debug)
1102 # So that config.h may be found.
1103 toplevel_inc = include_directories('.')
1106 subdir('share/sounds')
1107 subdir('share/ca-certs')
1112 configure_file(output : 'config.h',
1113 configuration : conf)
1116 message('pidgin ' + purple_display_version)
1119 message('Build GTK+ UI................. : ' + get_option('gtkui').to_string())
1120 message('Build console UI.............. : ' + enable_consoleui.to_string())
1121 message('Build for X11................. : ' + with_x.to_string())
1123 message('Enable Gestures............... : ' + enable_gestures.to_string())
1124 message('Protocols to build dynamically : @0@'.format(DYNAMIC_PRPLS))
1125 message('Protocols to link statically.. : @0@'.format(STATIC_PRPLS))
1127 message('Build with GStreamer support.. : ' + enable_gst.to_string())
1128 message('Build with D-Bus support...... : ' + enable_dbus.to_string())
1129 message('Build with voice and video.... : ' + enable_vv.to_string())
1130 message('Build with GNU Libidn......... : ' + get_option('idn').to_string())
1131 if SSL_CERTIFICATES_DIR != ''
1132 message('SSL CA certificates directory. : ' + SSL_CERTIFICATES_DIR)
1134 message('Build with Nettle support..... : ' + enable_nettle.to_string())
1135 message('Build with Cyrus SASL support. : ' + enable_cyrus_sasl.to_string())
1136 message('Use kerberos 4 with zephyr.... : ' + kerberos.to_string())
1137 message('Use external libzephyr........ : ' + zephyr.to_string())
1138 message('Install pixmaps............... : ' + INSTALL_PIXMAPS.to_string())
1139 message('Install translations.......... : ' + INSTALL_I18N.to_string())
1140 message('Has you....................... : yes')
1142 message('Build with Enchant support.... : ' + enable_enchant.to_string())
1143 message('Build with GCR widgets........ : ' + enable_gcr.to_string())
1144 message('Build Unity integration plugin.: ' + enable_unity.to_string())
1146 message('Build with KWallet............ : ' + enable_kwallet.to_string())
1147 message('Build with Secret Service..... : ' + enable_secret_service.to_string())
1149 message('Build with plugin support..... : ' + PLUGINS.to_string())
1150 message('Enable Introspection...........: ' + enable_introspection.to_string())
1152 message('Print debugging messages...... : ' + enable_debug.to_string())
1153 message('Generate documentation........ : ' + ENABLE_DOC.to_string())
1155 bindir = join_paths(get_option('prefix'), get_option('bindir'))
1156 message('Pidgin will be installed in @0@.'.format(bindir))
1157 if pidginpath.found()
1158 message('Warning: You have an old copy of Pidgin at @0@.'.format(pidginpath.path()))
1160 if not INSTALL_PIXMAPS
1162 message('Warning: You have disabled the installation of pixmap data, but Pidgin')
1163 message('still requires installed pixmaps. Be sure you know what you are doing.')
1167 message('Warning: You have disabled the building and installation of translation')
1168 message('data. This will prevent building Pidgin desktop files.')
1169 message('Be sure you know what you are doing.')
1172 message('configure complete, now type \'ninja\'')