Fix broken gg enabling.
[pidgin-git.git] / meson.build
blob5f72d866c987eb382b20c36ccb2714aba52cb110
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
30 #   gnt_lt_current += 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;
36 #   gnt_lt_current += 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,
51                                       purple_minor_version,
52                                       purple_micro_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
58 gnt_lt_current = 9
59 gnt_major_version = 2
60 gnt_minor_version = 9
61 gnt_micro_version = 0
62 gnt_version_suffix = 'devel'
63 gnt_version = '@0@.@1@.@2@'.format(gnt_major_version,
64                                    gnt_minor_version,
65                                    gnt_micro_version)
66 gnt_display_version = '@0@@1@'.format(gnt_version,
67                                       gnt_version_suffix)
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,
87                                           purple_minor_version,
88                                           purple_micro_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,
97                                        gnt_minor_version,
98                                        gnt_micro_version)
100 package_revision = vcs_tag(
101     input : 'package_revision.h.in',
102     output : 'package_revision.h',
103     fallback : meson.project_version())
105 # For man pages.
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)
118 endif
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)
125 else
126         error('alloca could not be found')
127 endif
129 # Check for Sun compiler
130 SUNCC = compiler.compiles('void main() {__SUNPRO_C;};')
132 # Check for Win32
133 if host_machine.system() == 'windows'
134         windows = import('windows')
136         IS_WIN32 = true
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)
141         endif
142         conf.set('WIN32_LEAN_AND_MEAN', true)
143 else
144         IS_WIN32 = false
145         ws2_32 = []
146         dnsapi = []
147 endif
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)
156         else
157                 error(h + ' is required.')
158         endif
159 endforeach
161 # Checks for typedefs, structures, and compiler characteristics.
162 time_t_size = compiler.sizeof('time_t',
163     prefix : '''
164 #include <stdio.h>
165 #include <time.h>
166 ''')
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
175 if IS_WIN32
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)
180                 endforeach
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))
188         else
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)')
192         endif
194         conf.set('PURPLE_DATADIR', 'wpurple_data_dir()')
195         conf.set('PURPLE_SYSCONFDIR', 'wpurple_sysconf_dir()')
196         conf.set('PURPLE_LOCALEDIR', 'wpurple_locale_dir()')
197 else
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)
201         endforeach
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)))
213 endif
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))
227 endforeach
229 # Check for inet_aton
230 if not IS_WIN32
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')
235                 endif
236         endif
237 endif
238 if compiler.has_function('gethostent', args : '-lnsl')
239         conf.set('HAVE_LIBNSL', true)
240 endif
241 if IS_WIN32
242         conf.set('HAVE_GETADDRINFO', true)
243         conf.set('HAVE_INET_NTOP', true)
244 else
245         if not compiler.has_function('socket')
246                 if not compiler.has_function('socket', args : '-lsocket')
247                         error('socket not found')
248                 endif
249         endif
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)
254         else
255                 if compiler.has_function('getaddrinfo', args : '-lsocket -lnsl')
256                         conf.set('HAVE_GETADDRINFO', true)
257                         # FIXME: LIBS += declare_dependency(link_with : ['socket', 'nsl'])
258                 endif
259         endif
260         conf.set('HAVE_INET_NTOP',
261             compiler.has_function('inet_ntop'))
262 endif
263 conf.set('HAVE_GETIFADDRS',
264     compiler.has_function('getifaddrs'))
266 # Check for socklen_t (in Unix98)
267 if IS_WIN32
268         socket_header = 'ws2tcpip.h'
269 else
270         socket_header = 'sys/socket.h'
271 endif
272 if not compiler.has_header_symbol(socket_header, 'socklen_t')
273         code = '''
274 #include <sys/types.h>
275 #include <@0@>
276 int accept(int, struct sockaddr *, size_t *);
277 int main() {}
278 '''.format(socket_header)
279         if compiler.compiles(code, name : 'socklen_t is size_t')
280                 conf.set('socklen_t', 'size_t')
281         else
282                 conf.set('socklen_t', 'int')
283         endif
284 endif
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
292 if IS_WIN32
293         header = 'ws2tcpip.h'
294 else
295         header = 'netinet/in.h'
296 endif
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
301 # of the C library
302 math = compiler.find_library('m')
304 code = '''
305 #include <stdio.h>
307 int main(int argc, char *argv[])
309         int fd;
311         fd = fileno(stdout);
313         return !(fd > 0);
316 result = compiler.run(code, name : 'fileno()')
317 conf.set('HAVE_FILENO', result.returncode() == 0)
319 code = '''
320 #include <time.h>
321 #include <stdio.h>
323 int main()
325         char buf[64];
326         time_t t = time(NULL);
328         if (strftime(buf, sizeof(buf), "%z", localtime(&t)) != 5)
329                 return 1;
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')
338                 );
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
345 IOKIT = []
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'])
352                 endif
353         endif
355         if run_command('test', '-d', '/sw').returncode() == 0
356                 # FIXME: Not done...
357                 #CPPFLAGS="$CPPFLAGS -I/sw/include"
358                 #LDFLAGS="$LDFLAGS -L/sw/lib"
359         endif
360 endif
362 # #######################################################################
363 # # Disable creation and installation of translation files
364 # #######################################################################
366 INSTALL_I18N = get_option('nls')
368 if INSTALL_I18N
369         subdir('po')
371         intltool_merge = find_program('intltool-merge')
372 endif
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'))
387 else
388         DISPLAY_VERSION = meson.project_version()
389 endif
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.
421         use_enchant = false
422         if enable_enchant
423                 use_enchant = true
424                 enchant = dependency('enchant', required : force_deps)
425                 use_enchant = enchant.found()
426                 conf.set('USE_ENCHANT', use_enchant)
427         else
428                 enchant = []
429         endif
431         #######################################################################
432         # Check if we should compile with X support
433         #######################################################################
434         if with_x
435                 x11 = dependency('x11')
436                 if x11.found()
437                         conf.set('HAVE_X11', true)
438                 else
439                         with_x = false
440                         if force_deps
441                                 error('''
442 X11 development headers not found.
443 Use -Dx=false if you do not need X11 support.
444 ''')
445                         endif
446                 endif
447         endif
448         if not with_x
449                 enable_gestures = false
450                 x11 = []
451         endif
453         #######################################################################
454         # Check for stuff needed by the Evolution integration plugin.
455         #######################################################################
456         if enable_gevolution
457                 evo_deps = [
458                     ['libebook-1.2', []],
459                     ['libedata-book-1.2', []],
460                     ['evolution-data-server-1.2', '>= 3.6']
461                 ]
462                 EVOLUTION_ADDRESSBOOK = []
463                 foreach dep : evo_deps
464                         EVOLUTION_ADDRESSBOOK += [
465                             dependency(dep[0], version : dep[1], required : force_deps)
466                         ]
467                         if not EVOLUTION_ADDRESSBOOK[-1].found()
468                                 enable_gevolution = false
469                         endif
470                 endforeach
471         endif
472         conf.set('HAVE_EVOLUTION_ADDRESSBOOK', enable_gevolution)
473         if not enable_gevolution
474                 EVOLUTION_ADDRESSBOOK = []
475         endif
477         #######################################################################
478         # Check for libsqlite3 (for the Contact Availability Prediction plugin)
479         #######################################################################
480         if enable_cap
481                 SQLITE3 = dependency('sqlite3', version : '>= 3.3', required : force_deps)
482                 enable_cap = SQLITE3.found()
483         endif
485         #######################################################################
486         # Check for GCR for its certificate widgets
487         #######################################################################
488         if enable_gcr
489                 GCR = dependency('gcr-3', required : force_deps)
490                 if GCR.found()
491                         conf.set('ENABLE_GCR', true)
492                 else
493                         enable_gcr = false
494                 endif
495         else
496                 GCR = []
497         endif
500 else    # GTK
501         enable_cap = false
502         enable_gcr = false
503         enable_gevolution = false
504         use_enchant = false
505 endif   # GTK
507 ENABLE_GTK = get_option('gtkui')
510 #######################################################################
511 # Check for ncurses and other things used by the console UI
512 #######################################################################
513 ncurses_inc = []
514 ncurses_libs = []
515 enable_consoleui = get_option('consoleui')
516 force_finch = enable_consoleui
517 if enable_consoleui
518         ncurses_libs = [
519                 compiler.find_library('ncursesw', required : false),
520                 compiler.find_library('panelw', required : false)
521         ]
522         if not ncurses_libs[0].found() or not ncurses_libs[1].found()
523                 enable_consoleui = false
524         endif
526         if IS_WIN32
527                 # FIXME: $host ?
528                 ncurses_sys_prefix = '/usr/$host/sys-root/mingw'
529         else
530                 ncurses_sys_prefix = '/usr'
531         endif
533         ncurses_sys_dirs = [ncurses_sys_prefix + '/include/ncursesw',
534                             ncurses_sys_prefix + '/include']
536         if enable_consoleui
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')
544                                         if location != '.'
545                                                 ncurses_inc += [include_directories(location)]
546                                         endif
547                                         found_ncurses_h = true
548                                 endif
549                         endif
550                 endforeach
552                 if not found_ncurses_h
553                         ncurses_inc = []
554                         ncurses_libs = []
555                         enable_consoleui = false
556                 endif
557         else
558                 # ncursesw was not found. Look for plain old ncurses
559                 ncurses_libs = [
560                         compiler.find_library('ncurses', required : false),
561                         compiler.find_library('panel', required : false)
562                 ]
563                 enable_consoleui = ncurses_libs[0].found() and ncurses_libs[1].found()
564                 conf.set('NO_WIDECHAR', true)
565         endif
566 endif
567 ncurses = declare_dependency(
568     include_directories : ncurses_inc,
569     dependencies : ncurses_libs
572 if force_finch and not enable_consoleui
573         error('''
575 Finch will not be built. You need to install ncursesw (or ncurses) and its development headers.
577 ''')
578 endif
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.')
588 endif
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')
601 if enable_gst
602         gstreamer = dependency('gstreamer-1.0', required : force_deps)
603         if gstreamer.found()
604                 conf.set('USE_GSTREAMER', true)
605         else
606                 enable_gst = false
607         endif
608 else
609         gstreamer = []
610 endif
612 #######################################################################
613 # Check for GStreamer Video
614 #######################################################################
615 enable_gstvideo = enable_gst and get_option('gstreamer-video')
616 if enable_gstvideo
617         gstreamer_video = dependency('gstreamer-video-1.0',
618                                      required : false)
619         if gstreamer_video.found()
620                 conf.set('USE_GSTVIDEO', true)
621         else
622                 enable_gstvideo = false
623         endif
624 else
625         gstreamer_video = []
626 endif
628 #######################################################################
629 # Check for Farstream
630 #######################################################################
631 if get_option('farstream')
632         farstream = dependency('farstream-0.2', version : '>= 0.2.7',
633                                required : false)
634         enable_farstream = farstream.found()
635 else
636         farstream = []
637         enable_farstream = false
638 endif
640 #######################################################################
641 # Check for Voice and Video support
642 #######################################################################
643 if get_option('vv')
644         if enable_gst and enable_gstvideo and enable_farstream
645                 conf.set('USE_VV', true)
646                 enable_vv = true
647         else
648                 if force_deps
649                         error('''
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.
653                         ''')
654                 endif
655                 enable_vv = false
656         endif
657 else
658         enable_vv = false
659 endif
661 #######################################################################
662 # Check for Raw data streams support in Farstream
663 #######################################################################
664 if enable_vv
665         gstreamer_app = dependency('gstreamer-app-1.0',
666                                    required : false)
667         if gstreamer_app.found()
668                 conf.set('USE_GSTAPP', true)
669                 conf.set('HAVE_MEDIA_APPLICATION', true)
670         endif
671 else
672         gstreamer_app = []
673 endif
675 #######################################################################
676 # Check for Internationalized Domain Name support
677 #######################################################################
679 if get_option('idn')
680         idn = dependency('libidn', version : '>= 0.0.0', required : force_deps)
681         conf.set('USE_IDN', idn.found())
682 else
683         idn = []
684 endif
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()
692 else
693         enable_meanwhile = false
694         meanwhile = []
695 endif
697 #######################################################################
698 # Check for Native Avahi headers (for Bonjour)
699 #######################################################################
701 enable_avahi = get_option('avahi')
702 avahi = []
703 if enable_avahi and IS_WIN32
704         # Just keep enabled.
705 elif enable_avahi
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]
711         else
712                 enable_avahi = false
713                 if force_deps
714                         error('''
715 avahi development package not found.
716 Use -Davahi=false if you do not need avahi (Bonjour) support.
717 ''')
718                 endif
719         endif
720 endif
723 #######################################################################
724 # Check for SILC client includes and libraries
725 #######################################################################
726 have_silc = false
727 if get_option('silc')
728         silc = dependency('silcclient', version : '>= 1.1', required : false)
729         if silc.found()
730                 have_silc = true
731                 # SILC Toolkit >= 1.0.1 has a new MIME API
732                 conf.set('HAVE_SILCMIME_H', true)
733         else
734                 if force_deps
735                         error('''
736 SILC development package not found.
737 Use -Dsilc=false if you do not need SILC support.
738 ''')
739                 endif
740         endif
741 endif
743 #######################################################################
744 # Check for Gadu-Gadu protocol library (libgadu)
745 #######################################################################
747 enable_libgadu = get_option('libgadu')
748 if enable_libgadu
749         libgadu = dependency('libgadu', version : '>= 1.12.0', required : false)
750         have_libgadu = libgadu.found()
752         if have_libgadu
753                 if not compiler.has_function('gg_is_gpl_compliant', dependencies : libgadu)
754                         have_libgadu = false
755                         message('''
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
761                         ''')
762                 endif
763         endif
765         if not have_libgadu and force_deps
766                 error('''
767 Libgadu development headers not found.
768 Use -Dlibgadu=false if you do not need GG (GaduGadu) support.
769 ''')
770         endif
771 else
772         have_libgadu = false
773 endif
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']
783         dynamic_list = []
784 endif
786 if static_list == ['all']
787         static_list = DEFAULT_PRPLS
788 endif
789 STATIC_PRPLS = []
790 foreach prpl : static_list
791         if prpl == ''
792                 # The list was empty; do nothing.
793         elif prpl == 'sametime' and not enable_meanwhile
794                 # Do nothing
795         elif prpl == 'bonjour' and not enable_avahi
796                 # Do nothing
797         elif prpl == 'silc' and not have_silc
798                 # Do nothing
799         elif prpl == 'gg' and not have_libgadu
800                 # Do nothing
801         elif prpl == 'zephyr' and IS_WIN32
802                 # Do nothing
803         else
804                 STATIC_PRPLS += [prpl]
805         endif
806 endforeach
807 STATIC_LINK_LIBS = []
808 extern_load = []
809 load_proto = []
810 extern_unload = []
811 unload_proto = []
812 foreach prpl : STATIC_PRPLS
813         # Ugly special case for 'libsilcpurple.la':
814         if prpl == 'silc'
815                 STATIC_LINK_LIBS.append('\$(top_builddir)/libpurple/protocols/@1@/lib@1@purple.la'.format(meson.build_root(), prpl))
816         else
817                 # FIXME: Shouldn't be libtool:
818                 STATIC_LINK_LIBS.append('\$(top_builddir)/libpurple/protocols/@1@/lib@1@.la'.format(meson.build_root(), prpl))
819         endif
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))
824 endforeach
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
845 endif
846 DYNAMIC_PRPLS = []
847 foreach prpl : dynamic_list
848         if prpl == ''
849                 # The list was empty; do nothing.
850         elif prpl == 'sametime' and not enable_meanwhile
851                 # Do nothing.
852         elif prpl == 'bonjour' and not enable_avahi
853                 # Do nothing.
854         elif prpl == 'silc' and not have_silc
855                 # Do nothing.
856         elif prpl == 'gg' and not have_libgadu
857                 # Do nothing.
858         elif prpl == 'zephyr' and IS_WIN32
859                 # Do nothing.
860         else
861                 DYNAMIC_PRPLS += [prpl]
862         endif
863 endforeach
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',
889     language : 'c')
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
897         #
898         # Future Possibilities
899         #
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.
903         #
904         foreach newflag : [
905                         '-Waggregate-return',
906                         '-Wcast-align',
907                         '-Wdeclaration-after-statement',
908                         '-Wendif-labels',
909                         '-Werror-implicit-function-declaration',
910                         '-Wextra -Wno-unused-parameter',
911                         '-Wformat-security',
912                         '-Werror=format-security',
913                         '-Winit-self',
914                         '-Wmissing-declarations',
915                         '-Wmissing-noreturn',
916                         '-Wmissing-prototypes',
917                         '-Wpointer-arith',
918                         '-Wfloat-equal',
919                         '-Wundef']
920                 if compiler.has_argument(newflag)
921                         add_project_arguments(newflag, language : 'c')
922                 endif
923         endforeach
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
935 #                       #endif
936 #                               return 0;
937 #               ]])], [
938 #                       AC_MSG_RESULT(yes)
939 #                       DEBUG_CFLAGS='$DEBUG_CFLAGS -Wp,-D_FORTIFY_SOURCE=2'
940 #               ], [
941 #                       AC_MSG_RESULT(no)
942 #               ])
943         endif
944 endif
945 if SUNCC
946         add_project_arguments('-features=extensions', language : 'c')
947 endif
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')
954         endif
955         conf.set('ENABLE_GLIBTRACE', true)
956         add_project_arguments('-rdynamic', language : 'c')
957 endif
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
966 if enable_dbus
967         dbus_binding_tool = find_program('dbus-binding-tool')
968         enable_dbus = dbus_binding_tool.found()
969 endif
971 if enable_dbus
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()
975 else
976         dbus = []
977         dbus_glib = []
978 endif
980 if enable_dbus
981         conf.set('HAVE_DBUS', true)
982 endif
984 #######################################################################
985 # Check for Unity and Messaging Menu
986 # Remove when Ubuntu 16.04 is EOL
987 #######################################################################
988 enable_unity = get_option('unity-integration')
989 if enable_unity
990         UNITY = [
991                 dependency('unity', version : '>= 6.8'),
992                 dependency('messaging-menu', version : '>= 12.10')
993         ]
994         conf.set('USES_MM_CHAT_SECTION', 'X-MessagingMenu-UsesChatSection=true')
995 else
996         conf.set('USES_MM_CHAT_SECTION', '')
997 endif
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()
1007         else
1008                 enable_secret_service = false
1009         endif
1010 endif
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)
1022         else
1023                 enable_gnome_keyring = false
1024         endif
1025 else
1026         gnome_keyring = []
1027 endif
1029 #######################################################################
1030 # Check for KWallet headers
1031 #######################################################################
1033 enable_kwallet = get_option('kwallet') and not IS_WIN32
1034 enable_kwallet = false
1036 if enable_kwallet
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()
1043 endif
1045 if enable_kwallet
1046 #       AC_MSG_CHECKING([for metaobject compiler])
1047 #       MOC=`$PKG_CONFIG --variable=moc_location QtCore`
1048 #       AC_SUBST(MOC)
1049 #       AC_MSG_RESULT([$MOC])
1051 #       KWALLET_CXXFLAGS=''
1052 #       KWALLET_LIBS=''
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
1058 #                               AC_MSG_ERROR([
1059 #kde4-config not found. $KDE4_CONFIG
1060 #Use -Dkwallet=false if you do not need KWallet support.
1062 #                       fi
1063 #               fi
1064 #       fi
1065 endif
1067 if enable_kwallet
1068 #       if test 'x$KDE4_CONFIG' != 'xno'; then
1069 #               KWALLET_CXXFLAGS='$QT4_CFLAGS -I`$KDE4_CONFIG --path include`'
1070 #       fi
1071 #       CPPFLAGS='$CPPFLAGS $KWALLET_CXXFLAGS'
1072 #       AC_CHECK_HEADER([kwallet.h], , [
1073 #               enable_kwallet = false
1074 #               if test 'x$force_deps' = 'xyes'; then
1075 #                       AC_MSG_ERROR([
1076 #KWallet development headers not found.
1077 #Use -Dkwallet=false if you do not need KWallet support.
1079 #               fi
1081 endif
1083 if enable_kwallet
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'
1087 #       else
1088 #               KWALLET_LIBS='-lkdeui'
1089 #       fi
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])],
1094 #               [
1095 #                       AC_MSG_RESULT(no)
1096 #                       enable_kwallet = false
1097 #                       if test 'x$force_deps' = 'xyes'; then
1098 #                               AC_MSG_ERROR([
1099 #KWallet development libraries not found.
1100 #Use -Dkwallet=false if you do not need KWallet support.
1102 #                       fi
1103 #               ])
1104 endif
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()
1115 else
1116         gplugin = []
1117         GPLUGIN_REQ = []
1118         enable_introspection = false
1119 endif
1121 if enable_introspection
1122         conf.set('ENABLE_INTROSPECTION', true)
1123 endif
1125 #######################################################################
1126 # Check for Python
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()
1137         else
1138                 python = find_program('python3')
1139         endif
1140 endif
1142 # Check for Python headers (currently useful only for libgnt)
1143 if enable_consoleui
1144         python_dep = dependency('python3')
1145         conf.set('USE_PYTHON', python_dep.found())
1146 endif
1148 #######################################################################
1149 # SSL support
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
1157                 if IS_WIN32
1158                         message(ssl_certificates_dir + ' does not exist. It may be OK when cross-compiling, but please make sure about it.')
1159                 else
1160                         error(ssl_certificates_dir + ' does not exist, if this is the correct location please make sure that it exists.')
1161                 endif
1162         endif
1163         SSL_CERTIFICATES_DIR = ssl_certificates_dir
1164 endif
1165 if SSL_CERTIFICATES_DIR != ''
1166         conf.set_quoted('SSL_CERTIFICATES_DIR', SSL_CERTIFICATES_DIR)
1167 endif
1168 INSTALL_SSL_CERTIFICATES = SSL_CERTIFICATES_DIR == ''
1170 if get_option('plugins')
1171         conf.set('PURPLE_PLUGINS', 1)
1172         PLUGINS = true
1173         conf.set('PLUGINS_DEFINE', '#define PURPLE_PLUGINS 1')
1174 else
1175         PLUGINS = false
1176         conf.set('PLUGINS_DEFINE', '#undef PURPLE_PLUGINS')
1177 endif
1179 #######################################################################
1180 # Check for Nettle (Crypto Library)
1181 #######################################################################
1183 enable_nettle = get_option('nettle')
1185 if enable_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
1191                 error('''
1192 Nettle development headers not found
1193 Use -Dnettle=false if you do not need it.
1194 ''')
1195         endif
1196 endif
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))
1204 endforeach
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')
1210         else
1211                 error('Cyrus SASL library not found')
1212         endif
1213 else
1214         enable_cyrus_sasl = false
1215         sasl = []
1216 endif
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')
1226 if kerberos
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'
1231 #               fi
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'
1237         endif
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])],
1245 #                               -ldes)],
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)
1249         krb4 = []
1250 endif
1251 if not kerberos
1252         krb4 = []
1253 endif
1255 #######################################################################
1256 # Check for external libzephyr
1257 #######################################################################
1258 zephyr = get_option('zephyr')
1259 if zephyr
1260         ext_zephyr = dependency('zephyr', required : force_deps)
1261         zephyr = ext_zephyr.found()
1262 else
1263         ext_zephyr = []
1264 endif
1265 EXTERNAL_LIBZEPHYR = zephyr
1266 conf.set('LIBZEPHYR_EXT', EXTERNAL_LIBZEPHYR)
1268 #AC_MSG_CHECKING(for me pot o' gold)
1269 #AC_MSG_RESULT(no)
1270 foreach func : ['gethostid', 'timegm']
1271         conf.set('HAVE_' + func.to_upper(),
1272             compiler.has_function(func))
1273 endforeach
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))
1277 endforeach
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)
1283 prefix = '''
1284 #include <sys/types.h>
1286 if have_sys_param_h
1287         prefix += '''
1288 #include <sys/param.h>
1290 endif
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')
1311 # check for gtk-doc
1312 ENABLE_DOC = get_option('doc')
1313 if ENABLE_DOC
1314         if meson.version().version_compare('<0.41.2')
1315                 if force_deps
1316                         error('Meson 0.41.2 or newer is required to build documentation.')
1317                 endif
1318                 ENABLE_DOC = false
1319         endif
1320 endif
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('.')
1330 subdir('libpurple')
1331 subdir('share/sounds')
1332 subdir('share/ca-certs')
1333 subdir('finch')
1334 subdir('pidgin')
1335 subdir('doc')
1337 configure_file(output : 'config.h',
1338     configuration : conf)
1340 message('')
1341 message('pidgin ' + purple_display_version)
1343 message('')
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())
1347 message('')
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))
1351 message('')
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)
1358 endif
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')
1367 message('')
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())
1371 message('')
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())
1375 message('')
1376 message('Build with plugin support..... : ' + PLUGINS.to_string())
1377 message('Enable Introspection...........: ' + enable_introspection.to_string())
1379 if IS_WIN32
1380         message('')
1381         message('Win32 directory structure..... : ' + get_option('win32-dirs'))
1382 endif
1384 message('')
1385 message('Print debugging messages...... : ' + enable_debug.to_string())
1386 message('Generate documentation........ : ' + ENABLE_DOC.to_string())
1387 message('')
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()))
1392 endif
1393 if not INSTALL_PIXMAPS
1394         message('')
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.')
1397 endif
1398 if not INSTALL_I18N
1399         message('')
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.')
1403 endif
1404 message('')
1405 message('configure complete, now type \'ninja\'')
1406 message('')