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: ''
24 # If any code has changed in libgnt:
25 # gnt_micro_version += 1
27 # If any functions have been added to libgnt:
28 # gnt_micro_version = 0
29 # gnt_minor_version += 1
32 # If backwards compatibility has been broken in libgnt:
33 # gnt_micro_version = 0
34 # gnt_minor_version = 0
35 # gnt_major_version += 1;
38 # gnt_version_suffix should be similar to one of the following:
39 # For beta releases: 'beta2'
40 # For code under development: 'devel'
41 # For production releases: ''
43 # Make sure to update finch/libgnt/configure.ac with libgnt version changes.
45 purple_lt_current = 20
46 purple_major_version = 3
47 purple_minor_version = 0
48 purple_micro_version = 0
49 purple_version_suffix = 'devel'
50 purple_version = '@0@.@1@.@2@'.format(purple_major_version,
53 purple_display_version = '@0@@1@'.format(purple_version,
54 purple_version_suffix)
56 # the last version for Finch 2 was 2.8.10,
57 # the first version for Finch 3 was 2.9.0
62 gnt_version_suffix = 'devel'
63 gnt_version = '@0@.@1@.@2@'.format(gnt_major_version,
66 gnt_display_version = '@0@@1@'.format(gnt_version,
70 add_project_arguments('-DHAVE_CONFIG_H=1', language : 'c')
71 conf = configuration_data()
72 man_conf = configuration_data()
73 version_conf = configuration_data()
75 conf.set_quoted('PACKAGE', meson.project_name())
76 conf.set_quoted('PACKAGE_NAME', meson.project_name())
77 conf.set_quoted('VERSION', purple_display_version)
79 version_conf.set('PURPLE_MAJOR_VERSION', purple_major_version)
80 version_conf.set('PURPLE_MINOR_VERSION', purple_minor_version)
81 version_conf.set('PURPLE_MICRO_VERSION', purple_micro_version)
82 version_conf.set('PURPLE_VERSION', purple_display_version)
83 version_conf.set('PURPLE_API_VERSION',
84 purple_lt_current - purple_minor_version)
86 PURPLE_LIB_VERSION = '@0@.@1@.@2@'.format(purple_lt_current - purple_minor_version,
90 version_conf.set('GNT_MAJOR_VERSION', gnt_major_version)
91 version_conf.set('GNT_MINOR_VERSION', gnt_minor_version)
92 version_conf.set('GNT_MICRO_VERSION', gnt_micro_version)
93 version_conf.set('GNT_VERSION', gnt_display_version)
94 version_conf.set('GNT_API_VERSION', gnt_lt_current - gnt_minor_version)
96 GNT_LIB_VERSION = '@0@.@1@.@2@'.format(gnt_lt_current - gnt_minor_version,
100 package_revision = vcs_tag(
101 input : 'package_revision.h.in',
102 output : 'package_revision.h',
103 fallback : meson.project_version())
106 man_conf.set('VERSION', purple_display_version)
107 man_conf.set('prefix', get_option('prefix'))
109 # Used for pkg-config files.
110 pkgconfig = import('pkgconfig')
112 sedpath = find_program('sed')
114 # Storing build arguments
115 if meson.version().version_compare('>=0.42.0')
116 meson.add_postconf_script('mkmesonconf.py')
117 conf.set('HAVE_MESON_CONFIG', true)
120 # Checks for programs.
121 compiler = meson.get_compiler('c')
123 if compiler.has_function('alloca') # FIXME: Probably not enough.
124 conf.set('HAVE_ALLOCA_H', true)
126 error('alloca could not be found')
129 # Check for Sun compiler
130 SUNCC = compiler.compiles('void main() {__SUNPRO_C;};')
133 if host_machine.system() == 'windows'
134 windows = import('windows')
137 ws2_32 = compiler.find_library('ws2_32')
138 dnsapi = compiler.find_library('dnsapi')
139 if build_machine.system() != 'windows'
140 conf.set('IS_WIN32_CROSS_COMPILED', true)
142 conf.set('WIN32_LEAN_AND_MEAN', true)
149 # Checks for header files.
150 # AC_HEADER_SYS_WAIT:
151 conf.set('HAVE_SYS_WAIT_H', compiler.has_header('sys/wait.h'))
153 foreach h : ['fcntl.h', 'unistd.h', 'stdint.h']
154 if compiler.has_header(h)
155 conf.set('HAVE_' + h.to_upper().underscorify(), true)
157 error(h + ' is required.')
161 # Checks for typedefs, structures, and compiler characteristics.
162 time_t_size = compiler.sizeof('time_t',
167 conf.set('SIZEOF_TIME_T', time_t_size)
169 conf.set('WORDS_BIGENDIAN', host_machine.endian() != 'little')
171 conf.set('USE_WIN32_FHS',
172 IS_WIN32 and get_option('win32-dirs') == 'fhs')
174 # Check for directories
176 if get_option('win32-dirs') == 'fhs'
177 foreach dir : ['bin', 'lib', 'data', 'sysconf', 'locale']
178 path = join_paths(get_option('prefix'), get_option(dir + 'dir'))
179 conf.set('WIN32_FHS_@0@DIR'.format(dir.to_upper()), path)
182 conf.set('PURPLE_LIBDIR',
183 'wpurple_lib_dir("purple-@0@")'.format(purple_major_version))
184 conf.set('PIDGIN_LIBDIR',
185 'wpurple_lib_dir("pidgin-@0@")'.format(purple_major_version))
186 conf.set('FINCH_LIBDIR',
187 'wpurple_lib_dir("finch-@0@")'.format(purple_major_version))
189 conf.set('PURPLE_LIBDIR', 'wpurple_lib_dir(NULL)')
190 conf.set('PIDGIN_LIBDIR', 'wpurple_lib_dir(NULL)')
191 conf.set('FINCH_LIBDIR', 'wpurple_lib_dir(NULL)')
194 conf.set('PURPLE_DATADIR', 'wpurple_data_dir()')
195 conf.set('PURPLE_SYSCONFDIR', 'wpurple_sysconf_dir()')
196 conf.set('PURPLE_LOCALEDIR', 'wpurple_locale_dir()')
198 foreach dir : ['data', 'sysconf', 'locale']
199 path = join_paths(get_option('prefix'), get_option(dir + 'dir'))
200 conf.set_quoted('PURPLE_@0@DIR'.format(dir.to_upper()), path)
203 common_libdir = join_paths(get_option('prefix'), get_option('libdir'))
204 conf.set_quoted('PURPLE_LIBDIR',
205 join_paths(common_libdir,
206 'purple-@0@'.format(purple_major_version)))
207 conf.set_quoted('PIDGIN_LIBDIR',
208 join_paths(common_libdir,
209 'pidgin-@0@'.format(purple_major_version)))
210 conf.set_quoted('FINCH_LIBDIR',
211 join_paths(common_libdir,
212 'finch-@0@'.format(purple_major_version)))
215 abslibdir = join_paths(get_option('prefix'), get_option('libdir'))
216 PURPLE_PLUGINDIR = join_paths(abslibdir, 'purple-@0@'.format(purple_major_version))
217 conf.set_quoted('PURPLE_PLUGINDIR', PURPLE_PLUGINDIR)
218 PIDGIN_PLUGINDIR = join_paths(abslibdir, 'pidgin-@0@'.format(purple_major_version))
219 conf.set_quoted('PIDGIN_PLUGINDIR', PIDGIN_PLUGINDIR)
220 FINCH_PLUGINDIR = join_paths(abslibdir, 'finch-@0@'.format(purple_major_version))
221 conf.set_quoted('FINCH_PLUGINDIR', FINCH_PLUGINDIR)
223 # Checks for library functions.
224 foreach func : ['strdup']
225 conf.set('HAVE_' + func.to_upper(),
226 compiler.has_function(func))
229 # Check for inet_aton
231 if not compiler.has_function('inet_aton')
232 if not compiler.has_function('inet_aton', args : '-lresolv')
233 # FIXME: Someone needs to link with -lresolv if needed.
234 error('inet_aton not found')
238 if compiler.has_function('gethostent', args : '-lnsl')
239 conf.set('HAVE_LIBNSL', true)
242 conf.set('HAVE_GETADDRINFO', true)
243 conf.set('HAVE_INET_NTOP', true)
245 if not compiler.has_function('socket')
246 if not compiler.has_function('socket', args : '-lsocket')
247 error('socket not found')
250 # If all goes well, by this point the previous two checks will have
251 # pulled in -lsocket and -lnsl if we need them.
252 if compiler.has_function('getaddrinfo')
253 conf.set('HAVE_GETADDRINFO', true)
255 if compiler.has_function('getaddrinfo', args : '-lsocket -lnsl')
256 conf.set('HAVE_GETADDRINFO', true)
257 # FIXME: LIBS += declare_dependency(link_with : ['socket', 'nsl'])
260 conf.set('HAVE_INET_NTOP',
261 compiler.has_function('inet_ntop'))
263 conf.set('HAVE_GETIFADDRS',
264 compiler.has_function('getifaddrs'))
266 # Check for socklen_t (in Unix98)
268 socket_header = 'ws2tcpip.h'
270 socket_header = 'sys/socket.h'
272 if not compiler.has_header_symbol(socket_header, 'socklen_t')
274 #include <sys/types.h>
276 int accept(int, struct sockaddr *, size_t *);
278 '''.format(socket_header)
279 if compiler.compiles(code, name : 'socklen_t is size_t')
280 conf.set('socklen_t', 'size_t')
282 conf.set('socklen_t', 'int')
286 # Some systems do not have sa_len field for struct sockaddr.
287 conf.set('HAVE_STRUCT_SOCKADDR_SA_LEN',
288 compiler.has_member('struct sockaddr', 'sa_len',
289 prefix : '#include <@0@>'.format(socket_header)))
291 # Check for v6-only sockets
293 header = 'ws2tcpip.h'
295 header = 'netinet/in.h'
297 conf.set('HAVE_IPV6_V6ONLY',
298 compiler.has_header_symbol(header, 'IPV6_V6ONLY'))
300 # Windows and Haiku do not use libm for the math functions, they are part
302 math = compiler.find_library('m')
307 int main(int argc, char *argv[])
316 result = compiler.run(code, name : 'fileno()')
317 conf.set('HAVE_FILENO', result.returncode() == 0)
326 time_t t = time(NULL);
328 if (strftime(buf, sizeof(buf), "%z", localtime(&t)) != 5)
331 fprintf(stderr, "strftime(\"%%z\") yields: \"%s\"\n", buf);
333 return !((buf[0] == '-' || buf[0] == '+') &&
334 (buf[1] >= '0' && buf[1] <= '9') &&
335 (buf[2] >= '0' && buf[2] <= '9') &&
336 (buf[3] >= '0' && buf[3] <= '9') &&
337 (buf[4] >= '0' && buf[4] <= '9')
341 result = compiler.run(code, name : 'the %z format string in strftime()')
342 conf.set('HAVE_STRFTIME_Z_FORMAT', result.returncode() == 0)
344 # before gettexting, in case iconv matters
346 if host_machine.system() == 'darwin'
347 if compiler.has_header('CoreFoundation/CoreFoundation.h')
348 if compiler.has_header('IOKit/IOKitLib.h')
349 conf.set('HAVE_IOKIT', true)
350 IOKIT = dependency('appleframeworks',
351 modules : ['IOKit', 'CoreFoundation'])
355 if run_command('test', '-d', '/sw').returncode() == 0
357 #CPPFLAGS="$CPPFLAGS -I/sw/include"
358 #LDFLAGS="$LDFLAGS -L/sw/lib"
362 # #######################################################################
363 # # Disable creation and installation of translation files
364 # #######################################################################
366 INSTALL_I18N = get_option('nls')
371 intltool_merge = find_program('intltool-merge')
374 # #######################################################################
375 # # Check for GLib 2.40 (required)
376 # #######################################################################
377 glib = dependency('glib-2.0', version : '>= 2.40.0')
378 gio = dependency('gio-2.0')
379 gmodule = dependency('gmodule-2.0')
380 gobject = dependency('gobject-2.0')
381 gthread = dependency('gthread-2.0')
382 gnome = import('gnome')
384 if get_option('extraversion') != ''
385 DISPLAY_VERSION = '@0@-@1@'.format(meson.project_version(),
386 get_option('extraversion'))
388 DISPLAY_VERSION = meson.project_version()
390 conf.set_quoted('DISPLAY_VERSION', DISPLAY_VERSION)
392 force_deps = not get_option('missing-dependencies')
394 with_x = get_option('x') and not IS_WIN32
396 # #######################################################################
397 # # Check for GTK+ 2.18 and other things used by the GTK UI
398 # #######################################################################
399 enable_enchant = get_option('enchant')
400 enable_gevolution = get_option('gevolution')
401 enable_cap = get_option('cap')
402 enable_gestures = get_option('gestures')
403 enable_gcr = get_option('gcr')
405 # #######################################################################
406 # Check Pidgin dependencies
407 # #######################################################################
408 if get_option('gtkui')
409 gtk = dependency('gtk+-3.0', version : '>= 3.4.2')
410 # We only really need Pango >= 1.4 for decent RTL support
411 pango = dependency('pango', version : '>= 1.4.0')
412 conf.set('HAVE_PANGO14', pango.found())
414 webkit = dependency('webkitgtk-3.0', version : '>= 1.3.7')
416 #######################################################################
417 # Check if we should compile with enchant support
418 #######################################################################
419 # We need enchant for spell checking dictionary enumeration,
420 # because webkit1 doesn't have this.
424 enchant = dependency('enchant', required : force_deps)
425 use_enchant = enchant.found()
426 conf.set('USE_ENCHANT', use_enchant)
431 #######################################################################
432 # Check if we should compile with X support
433 #######################################################################
435 x11 = dependency('x11')
437 conf.set('HAVE_X11', true)
442 X11 development headers not found.
443 Use -Dx=false if you do not need X11 support.
449 enable_gestures = false
453 #######################################################################
454 # Check for stuff needed by the Evolution integration plugin.
455 #######################################################################
458 ['libebook-1.2', []],
459 ['libedata-book-1.2', []],
460 ['evolution-data-server-1.2', '>= 3.6']
462 EVOLUTION_ADDRESSBOOK = []
463 foreach dep : evo_deps
464 EVOLUTION_ADDRESSBOOK += [
465 dependency(dep[0], version : dep[1], required : force_deps)
467 if not EVOLUTION_ADDRESSBOOK[-1].found()
468 enable_gevolution = false
472 conf.set('HAVE_EVOLUTION_ADDRESSBOOK', enable_gevolution)
473 if not enable_gevolution
474 EVOLUTION_ADDRESSBOOK = []
477 #######################################################################
478 # Check for libsqlite3 (for the Contact Availability Prediction plugin)
479 #######################################################################
481 SQLITE3 = dependency('sqlite3', version : '>= 3.3', required : force_deps)
482 enable_cap = SQLITE3.found()
485 #######################################################################
486 # Check for GCR for its certificate widgets
487 #######################################################################
489 GCR = dependency('gcr-3', required : force_deps)
491 conf.set('ENABLE_GCR', true)
503 enable_gevolution = false
507 ENABLE_GTK = get_option('gtkui')
510 #######################################################################
511 # Check for ncurses and other things used by the console UI
512 #######################################################################
515 enable_consoleui = get_option('consoleui')
516 force_finch = enable_consoleui
519 compiler.find_library('ncursesw', required : false),
520 compiler.find_library('panelw', required : false)
522 if not ncurses_libs[0].found() or not ncurses_libs[1].found()
523 enable_consoleui = false
528 ncurses_sys_prefix = '/usr/$host/sys-root/mingw'
530 ncurses_sys_prefix = '/usr'
533 ncurses_sys_dirs = [ncurses_sys_prefix + '/include/ncursesw',
534 ncurses_sys_prefix + '/include']
537 # Some distros put the headers in ncursesw/, some don't
538 found_ncurses_h = false
539 foreach location : ncurses_sys_dirs
540 f = location + '/ncurses.h'
541 if not found_ncurses_h
542 if compiler.has_header_symbol(f, 'get_wch',
543 prefix : '#define _XOPEN_SOURCE_EXTENDED')
545 ncurses_inc += [include_directories(location)]
547 found_ncurses_h = true
552 if not found_ncurses_h
555 enable_consoleui = false
558 # ncursesw was not found. Look for plain old ncurses
560 compiler.find_library('ncurses', required : false),
561 compiler.find_library('panel', required : false)
563 enable_consoleui = ncurses_libs[0].found() and ncurses_libs[1].found()
564 conf.set('NO_WIDECHAR', true)
567 ncurses = declare_dependency(
568 include_directories : ncurses_inc,
569 dependencies : ncurses_libs
572 if force_finch and not enable_consoleui
575 Finch will not be built. You need to install ncursesw (or ncurses) and its development headers.
580 #conf.set('HAVE_WCWIDTH', compiler.has_function('wcwidth'))
582 #######################################################################
583 # Check for LibXML2 (required)
584 #######################################################################
585 libxml = dependency('libxml-2.0', version : '>= 2.6.0')
586 if libxml.version().version_compare('<2.6.18')
587 message('Versions of libxml2 < 2.6.18 may contain bugs that could cause XMPP messages to be discarded.')
590 #######################################################################
591 # Check for JSON-GLib (required)
592 #######################################################################
594 json = dependency('json-glib-1.0', version : '>= 0.14.0')
596 #######################################################################
597 # Check for GStreamer
598 #######################################################################
600 enable_gst = get_option('gstreamer')
602 gstreamer = dependency('gstreamer-1.0', required : force_deps)
604 conf.set('USE_GSTREAMER', true)
612 #######################################################################
613 # Check for GStreamer Video
614 #######################################################################
615 enable_gstvideo = enable_gst and get_option('gstreamer-video')
617 gstreamer_video = dependency('gstreamer-video-1.0',
619 if gstreamer_video.found()
620 conf.set('USE_GSTVIDEO', true)
622 enable_gstvideo = false
628 #######################################################################
629 # Check for Farstream
630 #######################################################################
631 if get_option('farstream')
632 farstream = dependency('farstream-0.2', version : '>= 0.2.7',
634 enable_farstream = farstream.found()
637 enable_farstream = false
640 #######################################################################
641 # Check for Voice and Video support
642 #######################################################################
644 if enable_gst and enable_gstvideo and enable_farstream
645 conf.set('USE_VV', true)
650 Dependencies for voice/video were not met.
651 Install the necessary gstreamer and farstream packages first.
652 Or use -Dvv=false if you do not need voice/video support.
661 #######################################################################
662 # Check for Raw data streams support in Farstream
663 #######################################################################
665 gstreamer_app = dependency('gstreamer-app-1.0',
667 if gstreamer_app.found()
668 conf.set('USE_GSTAPP', true)
669 conf.set('HAVE_MEDIA_APPLICATION', true)
675 #######################################################################
676 # Check for Internationalized Domain Name support
677 #######################################################################
680 idn = dependency('libidn', version : '>= 0.0.0', required : force_deps)
681 conf.set('USE_IDN', idn.found())
686 #######################################################################
687 # Check for Meanwhile headers (for Sametime)
688 #######################################################################
689 if get_option('meanwhile')
690 meanwhile = dependency('meanwhile', version : ['>= 1.0.0', '< 2.0.0'], required : force_deps)
691 enable_meanwhile = meanwhile.found()
693 enable_meanwhile = false
697 #######################################################################
698 # Check for Native Avahi headers (for Bonjour)
699 #######################################################################
701 enable_avahi = get_option('avahi')
703 if enable_avahi and IS_WIN32
706 # Attempt to autodetect Avahi
707 avahi_client = dependency('avahi-client', required : false)
708 avahi_glib = dependency('avahi-glib', required : false)
709 if avahi_client.found() and avahi_glib.found()
710 avahi = [avahi_client, avahi_glib]
715 avahi development package not found.
716 Use -Davahi=false if you do not need avahi (Bonjour) support.
723 #######################################################################
724 # Check for SILC client includes and libraries
725 #######################################################################
727 if get_option('silc')
728 silc = dependency('silcclient', version : '>= 1.1', required : false)
731 # SILC Toolkit >= 1.0.1 has a new MIME API
732 conf.set('HAVE_SILCMIME_H', true)
736 SILC development package not found.
737 Use -Dsilc=false if you do not need SILC support.
743 #######################################################################
744 # Check for Gadu-Gadu protocol library (libgadu)
745 #######################################################################
747 enable_libgadu = get_option('libgadu')
749 libgadu = dependency('libgadu', version : '>= 1.12.0', required : false)
750 have_libgadu = libgadu.found()
753 if not compiler.has_function('gg_is_gpl_compliant', dependencies : libgadu)
756 libgadu is not compatible with the GPL when compiled with OpenSSL support.
758 To link against libgadu, please recompile it using:
759 ./configure --with-openssl=no
760 Then rerun this Meson build
765 if not have_libgadu and force_deps
767 Libgadu development headers not found.
768 Use -Dlibgadu=false if you do not need GG (GaduGadu) support.
776 DEFAULT_PRPLS = ['bonjour', 'facebook', 'gg', 'irc', 'jabber', 'novell',
777 'oscar', 'sametime', 'silc', 'simple', 'zephyr']
778 ALL_PRPLS = DEFAULT_PRPLS + ['null']
780 dynamic_list = get_option('dynamic-prpls').split(',')
781 static_list = get_option('static-prpls').split(',')
782 if (static_list != [''] and static_list != []) and dynamic_list == ['all']
786 if static_list == ['all']
787 static_list = DEFAULT_PRPLS
790 foreach prpl : static_list
792 # The list was empty; do nothing.
793 elif prpl == 'sametime' and not enable_meanwhile
795 elif prpl == 'bonjour' and not enable_avahi
797 elif prpl == 'silc' and not have_silc
799 elif prpl == 'gg' and not have_libgadu
801 elif prpl == 'zephyr' and IS_WIN32
804 STATIC_PRPLS += [prpl]
807 STATIC_LINK_LIBS = []
812 foreach prpl : STATIC_PRPLS
813 # Ugly special case for 'libsilcpurple.la':
815 STATIC_LINK_LIBS.append('\$(top_builddir)/libpurple/protocols/@1@/lib@1@purple.la'.format(meson.build_root(), prpl))
817 # FIXME: Shouldn't be libtool:
818 STATIC_LINK_LIBS.append('\$(top_builddir)/libpurple/protocols/@1@/lib@1@.la'.format(meson.build_root(), prpl))
820 extern_load.append('extern gboolean @0@_plugin_load();'.format(prpl))
821 load_proto.append('@0@_plugin_load();'.format(prpl))
822 extern_unload.append('extern gboolean @0@_plugin_unload();'.format(prpl))
823 unload_proto.append('@0@_plugin_unload();'.format(prpl))
825 STATIC_BONJOUR = STATIC_PRPLS.contains('bonjour')
826 STATIC_FACEBOOK = STATIC_PRPLS.contains('facebook')
827 STATIC_GG = STATIC_PRPLS.contains('gg')
828 STATIC_IRC = STATIC_PRPLS.contains('irc')
829 STATIC_JABBER = STATIC_PRPLS.contains('jabber')
830 STATIC_NOVELL = STATIC_PRPLS.contains('novell')
831 STATIC_OSCAR = STATIC_PRPLS.contains('oscar') or STATIC_PRPLS.contains('aim') or STATIC_PRPLS.contains('icq')
832 STATIC_SAMETIME = STATIC_PRPLS.contains('sametime')
833 STATIC_SILC = STATIC_PRPLS.contains('silc')
834 STATIC_SIMPLE = STATIC_PRPLS.contains('simple')
835 STATIC_ZEPHYR = STATIC_PRPLS.contains('zephyr')
836 conf.set('STATIC_PROTO_LOAD',
837 ' '.join(extern_load) +
838 ' static void static_proto_load(void) { ' + ' '.join(load_proto) + ' }')
839 conf.set('STATIC_PROTO_UNLOAD',
840 ' '.join(extern_unload) +
841 ' static void static_proto_unload(void) { ' + ' '.join(unload_proto) + ' }')
843 if dynamic_list == ['all']
844 dynamic_list = DEFAULT_PRPLS
847 foreach prpl : dynamic_list
849 # The list was empty; do nothing.
850 elif prpl == 'sametime' and not enable_meanwhile
852 elif prpl == 'bonjour' and not enable_avahi
854 elif prpl == 'silc' and not have_silc
856 elif prpl == 'gg' and not have_libgadu
858 elif prpl == 'zephyr' and IS_WIN32
861 DYNAMIC_PRPLS += [prpl]
865 DYNAMIC_BONJOUR = DYNAMIC_PRPLS.contains('bonjour')
866 DYNAMIC_FACEBOOK = DYNAMIC_PRPLS.contains('facebook')
867 DYNAMIC_GG = DYNAMIC_PRPLS.contains('gg')
868 DYNAMIC_IRC = DYNAMIC_PRPLS.contains('irc')
869 DYNAMIC_JABBER = DYNAMIC_PRPLS.contains('jabber')
870 DYNAMIC_NOVELL = DYNAMIC_PRPLS.contains('novell')
871 DYNAMIC_NULL = DYNAMIC_PRPLS.contains('null')
872 DYNAMIC_OSCAR = DYNAMIC_PRPLS.contains('oscar') or DYNAMIC_PRPLS.contains('aim') or DYNAMIC_PRPLS.contains('icq')
873 DYNAMIC_SAMETIME = DYNAMIC_PRPLS.contains('sametime')
874 DYNAMIC_SILC = DYNAMIC_PRPLS.contains('silc')
875 DYNAMIC_SIMPLE = DYNAMIC_PRPLS.contains('simple')
876 DYNAMIC_ZEPHYR = DYNAMIC_PRPLS.contains('zephyr')
878 conf.set('HAVE_SYS_UTSNAME_H',
879 compiler.has_header('sys/utsname.h'))
880 conf.set('HAVE_UNAME',
881 compiler.has_function('uname'))
884 add_project_arguments(
885 '-DPURPLE_DISABLE_DEPRECATED',
886 '-DPIDGIN_DISABLE_DEPRECATED',
887 '-DFINCH_DISABLE_DEPRECATED',
888 '-DGNT_DISABLE_DEPRECATED',
890 if compiler.get_id() == 'gcc'
891 # We enable -Wall later.
892 # If it's set after the warning CFLAGS in the compiler invocation, it counteracts the -Wno... flags.
893 # This leads to warnings we don't want.
894 # CFLAGS=`echo $CFLAGS |$sedpath 's/-Wall//'`
896 # ENABLE WARNINGS SUPPORTED BY THE VERSION OF GCC IN USE
898 # Future Possibilities
900 # Consider adding -Wbad-function-cast.
901 # This leads to spurious warnings using GPOINTER_TO_INT(), et al. directly on a function call.
902 # We'd need an intermediate variable.
905 '-Waggregate-return',
907 '-Wdeclaration-after-statement',
909 '-Werror-implicit-function-declaration',
910 '-Wextra -Wno-unused-parameter',
912 '-Werror=format-security',
914 '-Wmissing-declarations',
915 '-Wmissing-noreturn',
916 '-Wmissing-prototypes',
920 if compiler.has_argument(newflag)
921 add_project_arguments(newflag, language : 'c')
925 if get_option('fortify')
926 # AC_MSG_CHECKING(for FORTIFY_SOURCE support)
927 # AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <features.h>]], [[
928 # #if !(__GNUC_PREREQ (4, 1) \
929 # || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (4, 0)) \
930 # || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (3, 4) \
931 # && __GNUC_MINOR__ == 4 \
932 # && (__GNUC_PATCHLEVEL__ > 2 \
933 # || (__GNUC_PATCHLEVEL__ == 2 && __GNUC_RH_RELEASE__ >= 8))))
934 # #error No FORTIFY_SOURCE support
939 # DEBUG_CFLAGS='$DEBUG_CFLAGS -Wp,-D_FORTIFY_SOURCE=2'
946 add_project_arguments('-features=extensions', language : 'c')
949 pidginpath = find_program('pidgin', required : false)
951 if get_option('glib-errors-trace')
952 if compiler.get_id() == 'clang'
953 error('--enable-glib-errors-trace doesn\'t work with clang')
955 conf.set('ENABLE_GLIBTRACE', true)
956 add_project_arguments('-rdynamic', language : 'c')
959 #######################################################################
960 # Check for D-Bus libraries
961 #######################################################################
963 # dbus doesn't compile for win32 at the moment
964 enable_dbus = get_option('dbus') and not IS_WIN32
967 dbus_binding_tool = find_program('dbus-binding-tool')
968 enable_dbus = dbus_binding_tool.found()
972 dbus = dependency('dbus-1', version : '>= 0.60', required : force_deps)
973 dbus_glib = dependency('dbus-glib-1', version : '>= 0.60', required : force_deps)
974 enable_dbus = dbus.found() and dbus_glib.found()
981 conf.set('HAVE_DBUS', true)
984 #######################################################################
985 # Check for Unity and Messaging Menu
986 # Remove when Ubuntu 16.04 is EOL
987 #######################################################################
988 enable_unity = get_option('unity-integration')
991 dependency('unity', version : '>= 6.8'),
992 dependency('messaging-menu', version : '>= 12.10')
994 conf.set('USES_MM_CHAT_SECTION', 'X-MessagingMenu-UsesChatSection=true')
996 conf.set('USES_MM_CHAT_SECTION', '')
999 #######################################################################
1000 # Check for Secret Service headers
1001 #######################################################################
1003 enable_secret_service = get_option('secret-service')
1004 if enable_secret_service
1005 secretservice = dependency('libsecret-1', required : force_deps)
1006 if secretservice.found()
1008 enable_secret_service = false
1012 #######################################################################
1013 # Check for GNOME Keyring headers
1014 #######################################################################
1016 enable_gnome_keyring = get_option('gnome-keyring') and not IS_WIN32
1018 if enable_gnome_keyring
1019 gnome_keyring = dependency('gnome-keyring-1', required : force_deps)
1020 if gnome_keyring.found()
1021 conf.set('HAVE_GNOMEKEYRING', true)
1023 enable_gnome_keyring = false
1029 #######################################################################
1030 # Check for KWallet headers
1031 #######################################################################
1033 enable_kwallet = get_option('kwallet') and not IS_WIN32
1034 enable_kwallet = false
1037 # Ensure C++ compiler works
1038 add_languages('cpp')
1039 cxx_compiler = meson.get_compiler('cpp')
1041 qt4 = dependency('qt4', modules : 'Core', required : force_deps)
1042 enable_kwallet = qt4.found()
1046 # AC_MSG_CHECKING([for metaobject compiler])
1047 # MOC=`$PKG_CONFIG --variable=moc_location QtCore`
1049 # AC_MSG_RESULT([$MOC])
1051 # KWALLET_CXXFLAGS=''
1053 # if test -z '$with_kwallet_includes' || test -z '$with_kwallet_libs'; then
1054 # AC_CHECK_PROG(KDE4_CONFIG, kde4-config, kde4-config, no)
1055 # if test 'x$KDE4_CONFIG' = 'xno'; then
1056 # enable_kwallet = false
1057 # if test 'x$force_deps' = 'xyes'; then
1059 #kde4-config not found. $KDE4_CONFIG
1060 #Use -Dkwallet=false if you do not need KWallet support.
1068 # if test 'x$KDE4_CONFIG' != 'xno'; then
1069 # KWALLET_CXXFLAGS='$QT4_CFLAGS -I`$KDE4_CONFIG --path include`'
1071 # CPPFLAGS='$CPPFLAGS $KWALLET_CXXFLAGS'
1072 # AC_CHECK_HEADER([kwallet.h], , [
1073 # enable_kwallet = false
1074 # if test 'x$force_deps' = 'xyes'; then
1076 #KWallet development headers not found.
1077 #Use -Dkwallet=false if you do not need KWallet support.
1084 # AC_MSG_CHECKING([for KWallet libraries])
1085 # if test 'x$KDE4_CONFIG' != 'xno'; then
1086 # KWALLET_LIBS='-L`$KDE4_CONFIG --install lib`/kde4/devel -lkdeui'
1088 # KWALLET_LIBS='-lkdeui'
1090 # KWALLET_LIBS='$KWALLET_LIBS'
1091 # LIBS='$LIBS $KWALLET_LIBS $QT4_LIBS'
1092 # AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <kwallet.h>],
1093 # [KWallet::Wallet::LocalWallet();])], [AC_MSG_RESULT([yes])],
1096 # enable_kwallet = false
1097 # if test 'x$force_deps' = 'xyes'; then
1099 #KWallet development libraries not found.
1100 #Use -Dkwallet=false if you do not need KWallet support.
1106 #######################################################################
1107 # Check for GPlugin 0.0.17
1108 #######################################################################
1109 if get_option('plugins')
1110 gplugin = dependency('gplugin', version : '>= 0.0.17')
1111 # GPLUGIN_REQ sets pkg-config requirements in the .pc file
1112 GPLUGIN_REQ = ['gplugin']
1113 enable_introspection = dependency('gobject-introspection-1.0',
1114 version : '>= 1.30.0', required : false).found()
1118 enable_introspection = false
1121 if enable_introspection
1122 conf.set('ENABLE_INTROSPECTION', true)
1125 #######################################################################
1127 #######################################################################
1129 # Python scripts are used to auto-generate about 3000 lines of C
1130 # and XML code that wraps (part of) the existing API so that
1131 # it is now accessible through D-Bus.
1133 if enable_dbus or enable_consoleui
1134 if meson.version().version_compare('>=0.38.0')
1135 python3_mod = import('python3')
1136 python = python3_mod.find_python()
1138 python = find_program('python3')
1142 # Check for Python headers (currently useful only for libgnt)
1144 python_dep = dependency('python3')
1145 conf.set('USE_PYTHON', python_dep.found())
1148 #######################################################################
1150 #######################################################################
1152 ssl_certificates_dir = get_option('system-ssl-certs')
1154 SSL_CERTIFICATES_DIR = ''
1155 if ssl_certificates_dir != ''
1156 if run_command('test', '-d', ssl_certificates_dir).returncode() != 0
1158 message(ssl_certificates_dir + ' does not exist. It may be OK when cross-compiling, but please make sure about it.')
1160 error(ssl_certificates_dir + ' does not exist, if this is the correct location please make sure that it exists.')
1163 SSL_CERTIFICATES_DIR = ssl_certificates_dir
1165 if SSL_CERTIFICATES_DIR != ''
1166 conf.set_quoted('SSL_CERTIFICATES_DIR', SSL_CERTIFICATES_DIR)
1168 INSTALL_SSL_CERTIFICATES = SSL_CERTIFICATES_DIR == ''
1170 if get_option('plugins')
1171 conf.set('PURPLE_PLUGINS', 1)
1173 conf.set('PLUGINS_DEFINE', '#define PURPLE_PLUGINS 1')
1176 conf.set('PLUGINS_DEFINE', '#undef PURPLE_PLUGINS')
1179 #######################################################################
1180 # Check for Nettle (Crypto Library)
1181 #######################################################################
1183 enable_nettle = get_option('nettle')
1186 nettle = dependency('nettle', version : '>= 3.0')
1187 enable_nettle = nettle.found()
1188 conf.set('HAVE_NETTLE', enable_nettle)
1190 if not enable_nettle and force_deps
1192 Nettle development headers not found
1193 Use -Dnettle=false if you do not need it.
1198 #######################################################################
1199 # Check for Cyrus-SASL (for xmpp/irc)
1200 #######################################################################
1201 foreach func : ['snprintf', 'connect']
1202 conf.set('HAVE_' + func.to_upper(),
1203 compiler.has_function(func))
1205 enable_cyrus_sasl = get_option('cyrus-sasl')
1206 if enable_cyrus_sasl
1207 if compiler.has_function('sasl_client_init', args : '-lsasl2')
1208 conf.set('HAVE_CYRUS_SASL', true)
1209 sasl = declare_dependency(link_args : '-lsasl2')
1211 error('Cyrus SASL library not found')
1214 enable_cyrus_sasl = false
1218 #######################################################################
1219 # Check for Kerberos (for Zephyr)
1220 #######################################################################
1221 conf.set('ZEPHYR_INT32', 'long')
1222 #AC_SUBST(KRB4_CFLAGS)
1223 #AC_SUBST(KRB4_LDFLAGS)
1224 #AC_SUBST(KRB4_LIBS)
1225 kerberos = get_option('krb4')
1227 if kerberos != 'yes'
1228 # KRB4_CFLAGS='-I${kerberos}/include'
1229 # if test -d '$kerberos/include/kerberosIV' ; then
1230 # KRB4_CFLAGS='$KRB4_CFLAGS -I${kerberos}/include/kerberosIV'
1232 # KRB4_LDFLAGS='-L${kerberos}/lib'
1233 elif run_command('test', '-d', '/usr/local/include/kerberosIV').returncode() == 0
1234 # KRB4_CFLAGS='-I/usr/local/include/kerberosIV'
1235 elif run_command('test', '-d', '/usr/include/kerberosIV').returncode() == 0
1236 # KRB4_CFLAGS='-I/usr/include/kerberosIV'
1238 conf.set('ZEPHYR_USES_KERBEROS', true)
1240 # AC_CHECK_LIB(krb4, krb_rd_req,
1241 # [KRB4_LIBS='-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err'],
1242 # [AC_CHECK_LIB(krb, krb_rd_req,
1243 # [KRB4_LIBS='-lkrb -ldes'],
1244 # [AC_MSG_ERROR([Kerberos 4 libraries not found])],
1246 # -ldes425 -lkrb5 -lk5crypto -lcom_err)
1247 # AC_CHECK_FUNCS(krb_set_key krb_rd_req krb_get_lrealm)
1248 # AC_CHECK_FUNCS(krb_get_err_text krb_log)
1255 #######################################################################
1256 # Check for external libzephyr
1257 #######################################################################
1258 zephyr = get_option('zephyr')
1260 ext_zephyr = dependency('zephyr', required : force_deps)
1261 zephyr = ext_zephyr.found()
1265 EXTERNAL_LIBZEPHYR = zephyr
1266 conf.set('LIBZEPHYR_EXT', EXTERNAL_LIBZEPHYR)
1268 #AC_MSG_CHECKING(for me pot o' gold)
1270 foreach func : ['gethostid', 'timegm']
1271 conf.set('HAVE_' + func.to_upper(),
1272 compiler.has_function(func))
1274 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()
1275 conf.set('HAVE_' + header.to_upper().underscorify(),
1276 compiler.has_header(header))
1279 # sys/sysctl.h on OpenBSD 4.2 requires sys/param.h
1280 # sys/sysctl.h on FreeBSD requires sys/types.h
1281 have_sys_param_h = compiler.has_header('sys/param.h')
1282 conf.set('HAVE_SYS_PARAM_H', have_sys_param_h)
1284 #include <sys/types.h>
1288 #include <sys/param.h>
1291 conf.set('HAVE_SYS_SYSCTL_H',
1292 compiler.has_header('sys/sysctl.h', prefix : prefix))
1293 conf.set('HAVE_SYS_SOCKET_H',
1294 compiler.has_header('sys/socket.h'))
1295 #AC_VAR_TIMEZONE_EXTERNALS
1297 conf.set('HAVE_TM_GMTOFF',
1298 compiler.has_member('struct tm', 'tm_gmtoff',
1299 prefix : '#include<time.h>'))
1301 #######################################################################
1302 # Disable pixmap installation
1303 #######################################################################
1304 INSTALL_PIXMAPS = get_option('pixmaps-install')
1306 #######################################################################
1307 # Tweak status tray icon installation directory
1308 #######################################################################
1309 ENABLE_TRAYCOMPAT = get_option('trayicon-compat')
1312 ENABLE_DOC = get_option('doc')
1314 if meson.version().version_compare('<0.41.2')
1316 error('Meson 0.41.2 or newer is required to build documentation.')
1322 enable_debug = get_option('debug')
1323 conf.set('DEBUG', enable_debug)
1325 PURPLE_AVAILABLE = true
1327 # So that config.h may be found.
1328 toplevel_inc = include_directories('.')
1331 subdir('share/sounds')
1332 subdir('share/ca-certs')
1337 configure_file(output : 'config.h',
1338 configuration : conf)
1341 message('pidgin ' + purple_display_version)
1344 message('Build GTK+ UI................. : ' + get_option('gtkui').to_string())
1345 message('Build console UI.............. : ' + enable_consoleui.to_string())
1346 message('Build for X11................. : ' + with_x.to_string())
1348 message('Enable Gestures............... : ' + enable_gestures.to_string())
1349 message('Protocols to build dynamically : @0@'.format(DYNAMIC_PRPLS))
1350 message('Protocols to link statically.. : @0@'.format(STATIC_PRPLS))
1352 message('Build with GStreamer support.. : ' + enable_gst.to_string())
1353 message('Build with D-Bus support...... : ' + enable_dbus.to_string())
1354 message('Build with voice and video.... : ' + enable_vv.to_string())
1355 message('Build with GNU Libidn......... : ' + get_option('idn').to_string())
1356 if SSL_CERTIFICATES_DIR != ''
1357 message('SSL CA certificates directory. : ' + SSL_CERTIFICATES_DIR)
1359 message('Build with Nettle support..... : ' + enable_nettle.to_string())
1360 message('Build with Cyrus SASL support. : ' + enable_cyrus_sasl.to_string())
1361 message('Use kerberos 4 with zephyr.... : ' + kerberos.to_string())
1362 message('Use external libzephyr........ : ' + zephyr.to_string())
1363 message('Install pixmaps............... : ' + INSTALL_PIXMAPS.to_string())
1364 message('Old tray icon compatibility... : ' + ENABLE_TRAYCOMPAT.to_string())
1365 message('Install translations.......... : ' + INSTALL_I18N.to_string())
1366 message('Has you....................... : yes')
1368 message('Build with Enchant support.... : ' + use_enchant.to_string())
1369 message('Build with GCR widgets........ : ' + enable_gcr.to_string())
1370 message('Build Unity integration plugin.: ' + enable_unity.to_string())
1372 message('Build with GNOME Keyring...... : ' + enable_gnome_keyring.to_string())
1373 message('Build with KWallet............ : ' + enable_kwallet.to_string())
1374 message('Build with Secret Service..... : ' + enable_secret_service.to_string())
1376 message('Build with plugin support..... : ' + PLUGINS.to_string())
1377 message('Enable Introspection...........: ' + enable_introspection.to_string())
1381 message('Win32 directory structure..... : ' + get_option('win32-dirs'))
1385 message('Print debugging messages...... : ' + enable_debug.to_string())
1386 message('Generate documentation........ : ' + ENABLE_DOC.to_string())
1388 bindir = join_paths(get_option('prefix'), get_option('bindir'))
1389 message('Pidgin will be installed in @0@.'.format(bindir))
1390 if pidginpath.found()
1391 message('Warning: You have an old copy of Pidgin at @0@.'.format(pidginpath.path()))
1393 if not INSTALL_PIXMAPS
1395 message('Warning: You have disabled the installation of pixmap data, but Pidgin')
1396 message('still requires installed pixmaps. Be sure you know what you are doing.')
1400 message('Warning: You have disabled the building and installation of translation')
1401 message('data. This will prevent building Pidgin desktop files.')
1402 message('Be sure you know what you are doing.')
1405 message('configure complete, now type \'ninja\'')