Remove unused Meson option for enchant.
[pidgin-git.git] / meson.build
blobec39b20d1f3b6bf461d7e4e07da71ce50e9ee388
1 # UPDATING VERSION NUMBERS FOR RELEASES
3 # The version number is:
4 #   <major>.<minor>.<micro><suffix>
6 # micro += 1
8 # If any functions have been added to libpurple, Pidgin, or Finch:
9 #   micro = 0
10 #   minor += 1
12 # If backwards compatibility has been broken in libpurple, Pidgin, or Finch:
13 #   micro = 0
14 #   minor = 0
15 #   major += 1
16 #   purple_soversion += 1
18 # suffix should be similar to one of the following:
19 #   For beta releases:          '-beta2'
20 #   For code under development: '-devel'
21 #   For production releases:    ''
23 project('pidgin', 'c',
24     version : '3.0.0-devel',
25     meson_version : '>=0.47.0')
26 purple_soversion = 20
28 parts = meson.project_version().split('-')
29 if parts.length() > 1
30   purple_version_suffix = parts[1]
31 else
32   purple_version_suffix = ''
33 endif
35 parts = parts[0].split('.')
36 purple_major_version = parts[0]
37 purple_minor_version = parts[1]
38 purple_micro_version = parts[2]
40 add_project_arguments('-DHAVE_CONFIG_H=1', language : 'c')
41 conf = configuration_data()
42 man_conf = configuration_data()
43 version_conf = configuration_data()
45 conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
46 conf.set_quoted('PACKAGE', meson.project_name())
47 conf.set_quoted('PACKAGE_NAME', meson.project_name())
48 conf.set_quoted('VERSION', meson.project_version())
50 version_conf.set('PURPLE_MAJOR_VERSION', purple_major_version)
51 version_conf.set('PURPLE_MINOR_VERSION', purple_minor_version)
52 version_conf.set('PURPLE_MICRO_VERSION', purple_micro_version)
53 version_conf.set('PURPLE_VERSION', meson.project_version())
54 version_conf.set('PURPLE_API_VERSION', purple_soversion)
56 PURPLE_LIB_VERSION = '@0@.@1@.@2@'.format(purple_soversion,
57                                           purple_minor_version,
58                                           purple_micro_version)
60 package_revision = vcs_tag(
61     input : 'package_revision.h.in',
62     output : 'package_revision.h',
63     fallback : meson.project_version())
65 # For man pages.
66 man_conf.set('VERSION', meson.project_version())
67 man_conf.set('prefix', get_option('prefix'))
69 # Used for pkg-config files.
70 pkgconfig = import('pkgconfig')
72 sedpath = find_program('sed')
74 # Storing build arguments
75 meson.add_postconf_script('mkmesonconf.py')
76 conf.set('HAVE_MESON_CONFIG', true)
78 # Checks for programs.
79 compiler = meson.get_compiler('c')
81 # Check for Sun compiler
82 SUNCC = compiler.compiles('void main() {__SUNPRO_C;};')
84 # Check for Win32
85 if host_machine.system() == 'windows'
86         windows = import('windows')
88         IS_WIN32 = true
89         ws2_32 = compiler.find_library('ws2_32')
90         dnsapi = compiler.find_library('dnsapi')
91         if build_machine.system() != 'windows'
92                 conf.set('IS_WIN32_CROSS_COMPILED', true)
93         endif
94         conf.set('WIN32_LEAN_AND_MEAN', true)
96         conf.set('LIBPIDGIN_DLL_NAMEW',
97             'L"libpidgin-@0@.dll"'.format(purple_soversion))
98 else
99         IS_WIN32 = false
100         ws2_32 = []
101         dnsapi = []
102 endif
104 # Checks for header files.
105 # AC_HEADER_SYS_WAIT:
106 conf.set('HAVE_SYS_WAIT_H', compiler.has_header('sys/wait.h'))
108 foreach h : ['fcntl.h', 'unistd.h', 'stdint.h']
109         if compiler.has_header(h)
110                 conf.set('HAVE_' + h.to_upper().underscorify(), true)
111         else
112                 error(h + ' is required.')
113         endif
114 endforeach
116 # Checks for typedefs, structures, and compiler characteristics.
117 time_t_size = compiler.sizeof('time_t',
118     prefix : '''
119 #include <stdio.h>
120 #include <time.h>
121 ''')
122 conf.set('SIZEOF_TIME_T', time_t_size)
124 conf.set('WORDS_BIGENDIAN', host_machine.endian() != 'little')
126 # Check for directories
127 if IS_WIN32
128         foreach dir : ['bin', 'lib', 'data', 'sysconf', 'locale']
129                 path = join_paths(get_option('prefix'), get_option(dir + 'dir'))
130                 conf.set_quoted('WIN32_FHS_@0@DIR'.format(dir.to_upper()), path)
131         endforeach
133         conf.set('PURPLE_LIBDIR',
134                  'wpurple_lib_dir("purple-@0@")'.format(purple_major_version))
135         conf.set('PIDGIN_LIBDIR',
136                  'wpurple_lib_dir("pidgin-@0@")'.format(purple_major_version))
137         conf.set('FINCH_LIBDIR',
138                  'wpurple_lib_dir("finch-@0@")'.format(purple_major_version))
140         conf.set('PURPLE_DATADIR', 'wpurple_data_dir()')
141         conf.set('PURPLE_SYSCONFDIR', 'wpurple_sysconf_dir()')
142         conf.set('PURPLE_LOCALEDIR', 'wpurple_locale_dir()')
143 else
144         foreach dir : ['data', 'sysconf', 'locale']
145                 path = join_paths(get_option('prefix'), get_option(dir + 'dir'))
146                 conf.set_quoted('PURPLE_@0@DIR'.format(dir.to_upper()), path)
147         endforeach
149         common_libdir = join_paths(get_option('prefix'), get_option('libdir'))
150         conf.set_quoted('PURPLE_LIBDIR',
151                         join_paths(common_libdir,
152                                    'purple-@0@'.format(purple_major_version)))
153         conf.set_quoted('PIDGIN_LIBDIR',
154                         join_paths(common_libdir,
155                                    'pidgin-@0@'.format(purple_major_version)))
156         conf.set_quoted('FINCH_LIBDIR',
157                         join_paths(common_libdir,
158                                    'finch-@0@'.format(purple_major_version)))
159 endif
161 abslibdir = join_paths(get_option('prefix'), get_option('libdir'))
162 PURPLE_PLUGINDIR = join_paths(abslibdir, 'purple-@0@'.format(purple_major_version))
163 conf.set_quoted('PURPLE_PLUGINDIR', PURPLE_PLUGINDIR)
164 PIDGIN_PLUGINDIR = join_paths(abslibdir, 'pidgin-@0@'.format(purple_major_version))
165 conf.set_quoted('PIDGIN_PLUGINDIR', PIDGIN_PLUGINDIR)
166 FINCH_PLUGINDIR = join_paths(abslibdir, 'finch-@0@'.format(purple_major_version))
167 conf.set_quoted('FINCH_PLUGINDIR', FINCH_PLUGINDIR)
169 # Check for inet_aton
170 if not IS_WIN32
171         if not compiler.has_function('inet_aton')
172                 if not compiler.has_function('inet_aton', args : '-lresolv')
173                         # FIXME: Someone needs to link with -lresolv if needed.
174                         error('inet_aton not found')
175                 endif
176         endif
177 endif
178 if compiler.has_function('gethostent', args : '-lnsl')
179         conf.set('HAVE_LIBNSL', true)
180 endif
181 if IS_WIN32
182         conf.set('HAVE_GETADDRINFO', true)
183         conf.set('HAVE_INET_NTOP', true)
184 else
185         if not compiler.has_function('socket')
186                 if not compiler.has_function('socket', args : '-lsocket')
187                         error('socket not found')
188                 endif
189         endif
190         # If all goes well, by this point the previous two checks will have
191         # pulled in -lsocket and -lnsl if we need them.
192         if compiler.has_function('getaddrinfo')
193                 conf.set('HAVE_GETADDRINFO', true)
194         else
195                 if compiler.has_function('getaddrinfo', args : '-lsocket -lnsl')
196                         conf.set('HAVE_GETADDRINFO', true)
197                         # FIXME: LIBS += declare_dependency(link_with : ['socket', 'nsl'])
198                 endif
199         endif
200         conf.set('HAVE_INET_NTOP',
201             compiler.has_function('inet_ntop'))
202 endif
203 conf.set('HAVE_GETIFADDRS',
204     compiler.has_function('getifaddrs'))
206 # Check for socklen_t (in Unix98)
207 if IS_WIN32
208         socket_header = 'ws2tcpip.h'
209 else
210         socket_header = 'sys/socket.h'
211 endif
212 if not compiler.has_header_symbol(socket_header, 'socklen_t')
213         code = '''
214 #include <sys/types.h>
215 #include <@0@>
216 int accept(int, struct sockaddr *, size_t *);
217 int main() {}
218 '''.format(socket_header)
219         if compiler.compiles(code, name : 'socklen_t is size_t')
220                 conf.set('socklen_t', 'size_t')
221         else
222                 conf.set('socklen_t', 'int')
223         endif
224 endif
226 # Some systems do not have sa_len field for struct sockaddr.
227 conf.set('HAVE_STRUCT_SOCKADDR_SA_LEN',
228     compiler.has_member('struct sockaddr', 'sa_len',
229         prefix : '#include <@0@>'.format(socket_header)))
231 # Check for v6-only sockets
232 if IS_WIN32
233         header = 'ws2tcpip.h'
234 else
235         header = 'netinet/in.h'
236 endif
237 conf.set('HAVE_IPV6_V6ONLY',
238     compiler.has_header_symbol(header, 'IPV6_V6ONLY'))
240 # Windows and Haiku do not use libm for the math functions, they are part
241 # of the C library
242 math = compiler.find_library('m')
244 # before gettexting, in case iconv matters
245 IOKIT = []
246 if host_machine.system() == 'darwin'
247         if compiler.has_header('CoreFoundation/CoreFoundation.h')
248                 if compiler.has_header('IOKit/IOKitLib.h')
249                         conf.set('HAVE_IOKIT', true)
250                         IOKIT = dependency('appleframeworks',
251                                            modules : ['IOKit', 'CoreFoundation'])
252                 endif
253         endif
255         if run_command('test', '-d', '/sw').returncode() == 0
256                 # FIXME: Not done...
257                 #CPPFLAGS="$CPPFLAGS -I/sw/include"
258                 #LDFLAGS="$LDFLAGS -L/sw/lib"
259         endif
260 endif
262 # #######################################################################
263 # # Disable creation and installation of translation files
264 # #######################################################################
266 INSTALL_I18N = get_option('nls')
268 if INSTALL_I18N
269         i18n = import('i18n')
271         subdir('po')
272 endif
274 # #######################################################################
275 # # Check for GLib 2.44 (required)
276 # #######################################################################
277 glib = dependency('glib-2.0', version : '>= 2.44.0')
278 gio = dependency('gio-2.0')
279 gobject = dependency('gobject-2.0')
280 gthread = dependency('gthread-2.0')
281 gnome = import('gnome')
283 if get_option('extraversion') != ''
284         DISPLAY_VERSION = '@0@-@1@'.format(meson.project_version(),
285                                            get_option('extraversion'))
286 else
287         DISPLAY_VERSION = meson.project_version()
288 endif
289 conf.set_quoted('DISPLAY_VERSION', DISPLAY_VERSION)
291 force_deps = not get_option('missing-dependencies')
293 # #######################################################################
294 # # Check for GTK+ 2.18 and other things used by the GTK UI
295 # #######################################################################
296 enable_gestures = get_option('gestures')
298 # #######################################################################
299 # Check Pidgin dependencies
300 # #######################################################################
301 if get_option('gtkui')
302         gtk = dependency('gtk+-3.0', version : '>= 3.20.0')
304         talkatu_dep = dependency('talkatu', version: '>=0.1.0', required : false)
305         if talkatu_dep.found()
306                 talkatu_gir = 'Talkatu-0.0'
307                 talkatu_include_directories = include_directories(
308                     join_paths(talkatu_dep.get_pkgconfig_variable('prefix'),
309                                'share/gir-1.0'))
310         else
311                 talkatu_proj = subproject('talkatu',
312                     default_options : [
313                         'doc=' + get_option('doc').to_string(),
314                         'gobject-introspection=' + get_option('introspection').to_string(),
315                         'nls=' + get_option('nls').to_string(),
316                     ]
317                 )
318                 talkatu_dep = talkatu_proj.get_variable('talkatu_dep')
319                 talkatu_gir = talkatu_proj.get_variable('talkatu_gir')[0]
320                 talkatu_include_directories = []
321         endif
322 endif   # GTK
324 ENABLE_GTK = get_option('gtkui')
327 #######################################################################
328 # Check if we should compile with X support
329 #######################################################################
330 with_x = get_option('x') and not IS_WIN32
332 if with_x
333         x11 = dependency('x11')
334         if x11.found()
335                 conf.set('HAVE_X11', true)
336         else
337                 with_x = false
338                 if force_deps
339                         error('''
340 X11 development headers not found.
341 Use -Dx=false if you do not need X11 support.
342 ''')
343                 endif
344         endif
345 else
346         x11 = []
347 endif
348 if not get_option('gtkui') or not with_x
349         enable_gestures = false
350 endif
352 #######################################################################
353 # Check for LibXML2 (required)
354 #######################################################################
355 libxml = dependency('libxml-2.0', version : '>= 2.6.0')
356 if libxml.version().version_compare('<2.6.18')
357         message('Versions of libxml2 < 2.6.18 may contain bugs that could cause XMPP messages to be discarded.')
358 endif
360 #######################################################################
361 # Check for JSON-GLib (required)
362 #######################################################################
364 json = dependency('json-glib-1.0', version : '>= 0.14.0')
366 #######################################################################
367 # Check for GStreamer
368 #######################################################################
370 enable_gst = get_option('gstreamer')
371 if enable_gst
372         gstreamer = dependency('gstreamer-1.0', required : force_deps)
373         if gstreamer.found()
374                 conf.set('USE_GSTREAMER', true)
375         else
376                 enable_gst = false
377         endif
378 else
379         gstreamer = []
380 endif
382 #######################################################################
383 # Check for GStreamer Video
384 #######################################################################
385 enable_gstvideo = enable_gst and get_option('gstreamer-video')
386 if enable_gstvideo
387         gstreamer_video = dependency('gstreamer-video-1.0',
388                                      required : false)
389         if gstreamer_video.found()
390                 conf.set('USE_GSTVIDEO', true)
391         else
392                 enable_gstvideo = false
393         endif
394 else
395         gstreamer_video = []
396 endif
398 #######################################################################
399 # Check for Farstream
400 #######################################################################
401 if get_option('farstream')
402         farstream = dependency('farstream-0.2', version : '>= 0.2.7',
403                                required : false)
404         enable_farstream = farstream.found()
405 else
406         farstream = []
407         enable_farstream = false
408 endif
410 #######################################################################
411 # Check for Voice and Video support
412 #######################################################################
413 if get_option('vv')
414         if enable_gst and enable_gstvideo and enable_farstream
415                 conf.set('USE_VV', true)
416                 enable_vv = true
417         else
418                 if force_deps
419                         error('''
420 Dependencies for voice/video were not met.
421 Install the necessary gstreamer and farstream packages first.
422 Or use -Dvv=false if you do not need voice/video support.
423                         ''')
424                 endif
425                 enable_vv = false
426         endif
427 else
428         enable_vv = false
429 endif
431 #######################################################################
432 # Check for Raw data streams support in Farstream
433 #######################################################################
434 if enable_vv
435         gstreamer_app = dependency('gstreamer-app-1.0',
436                                    required : false)
437         if gstreamer_app.found()
438                 conf.set('USE_GSTAPP', true)
439                 conf.set('HAVE_MEDIA_APPLICATION', true)
440         endif
441 else
442         gstreamer_app = []
443 endif
445 #######################################################################
446 # Check for Meanwhile headers (for Sametime)
447 #######################################################################
448 if get_option('meanwhile')
449         meanwhile = dependency('meanwhile', version : ['>= 1.0.0', '< 2.0.0'], required : force_deps)
450         gmime = dependency('gmime-3.0', version : '>= 3.0.0', required : force_deps)
451         enable_meanwhile = meanwhile.found() and gmime.found()
452 else
453         enable_meanwhile = false
454         meanwhile = []
455 endif
457 #######################################################################
458 # Check for Native Avahi headers (for Bonjour)
459 #######################################################################
461 enable_avahi = get_option('avahi')
462 avahi = []
463 if enable_avahi and IS_WIN32
464         # Just keep enabled.
465 elif enable_avahi
466         # Attempt to autodetect Avahi
467         avahi_client = dependency('avahi-client', required : false)
468         avahi_glib = dependency('avahi-glib', required : false)
469         if avahi_client.found() and avahi_glib.found()
470                 avahi = [avahi_client, avahi_glib]
471         else
472                 enable_avahi = false
473                 if force_deps
474                         error('''
475 avahi development package not found.
476 Use -Davahi=false if you do not need avahi (Bonjour) support.
477 ''')
478                 endif
479         endif
480 endif
483 #######################################################################
484 # Check for SILC client includes and libraries
485 #######################################################################
486 have_silc = false
487 if get_option('silc')
488         silc = dependency('silcclient', version : '>= 1.1', required : false)
489         if silc.found()
490                 have_silc = true
491                 # SILC Toolkit >= 1.0.1 has a new MIME API
492                 conf.set('HAVE_SILCMIME_H', true)
493         else
494                 if force_deps
495                         error('''
496 SILC development package not found.
497 Use -Dsilc=false if you do not need SILC support.
498 ''')
499                 endif
500         endif
501 endif
503 #######################################################################
504 # Check for Gadu-Gadu protocol library (libgadu)
505 #######################################################################
507 enable_libgadu = get_option('libgadu')
508 if enable_libgadu
509         libgadu = dependency('libgadu', version : '>= 1.12.0', required : false)
510         have_libgadu = libgadu.found()
512         if have_libgadu
513                 if not compiler.has_function('gg_is_gpl_compliant', dependencies : libgadu)
514                         have_libgadu = false
515                         message('''
516 libgadu is not compatible with the GPL when compiled with OpenSSL support.
518 To link against libgadu, please recompile it using:
519 ./configure --with-openssl=no
520 Then rerun this Meson build
521                         ''')
522                 endif
523         endif
525         if not have_libgadu and force_deps
526                 error('''
527 Libgadu development headers not found.
528 Use -Dlibgadu=false if you do not need GG (GaduGadu) support.
529 ''')
530         endif
531 else
532         have_libgadu = false
533 endif
536 DEFAULT_PRPLS = ['bonjour', 'facebook', 'gg', 'irc', 'jabber', 'novell',
537                  'null', 'oscar', 'sametime', 'silc', 'simple', 'zephyr']
538 ALL_PRPLS = DEFAULT_PRPLS + ['null']
540 dynamic_list = get_option('dynamic-prpls').split(',')
541 if dynamic_list == ['all']
542         dynamic_list = DEFAULT_PRPLS
543 endif
544 DYNAMIC_PRPLS = []
545 foreach prpl : dynamic_list
546         if prpl == ''
547                 # The list was empty; do nothing.
548         elif prpl == 'sametime' and not enable_meanwhile
549                 # Do nothing.
550         elif prpl == 'bonjour' and not enable_avahi
551                 # Do nothing.
552         elif prpl == 'silc' and not have_silc
553                 # Do nothing.
554         elif prpl == 'gg' and not have_libgadu
555                 # Do nothing.
556         elif prpl == 'zephyr' and IS_WIN32
557                 # Do nothing.
558         else
559                 DYNAMIC_PRPLS += [prpl]
560         endif
561 endforeach
563 DYNAMIC_BONJOUR = DYNAMIC_PRPLS.contains('bonjour')
564 DYNAMIC_FACEBOOK = DYNAMIC_PRPLS.contains('facebook')
565 DYNAMIC_GG  = DYNAMIC_PRPLS.contains('gg')
566 DYNAMIC_IRC = DYNAMIC_PRPLS.contains('irc')
567 DYNAMIC_JABBER = DYNAMIC_PRPLS.contains('jabber')
568 DYNAMIC_NOVELL = DYNAMIC_PRPLS.contains('novell')
569 DYNAMIC_NULL = DYNAMIC_PRPLS.contains('null')
570 DYNAMIC_OSCAR = DYNAMIC_PRPLS.contains('oscar') or DYNAMIC_PRPLS.contains('aim') or DYNAMIC_PRPLS.contains('icq')
571 DYNAMIC_SAMETIME = DYNAMIC_PRPLS.contains('sametime')
572 DYNAMIC_SILC = DYNAMIC_PRPLS.contains('silc')
573 DYNAMIC_SIMPLE = DYNAMIC_PRPLS.contains('simple')
574 DYNAMIC_ZEPHYR = DYNAMIC_PRPLS.contains('zephyr')
576 conf.set('HAVE_SYS_UTSNAME_H',
577     compiler.has_header('sys/utsname.h'))
578 conf.set('HAVE_UNAME',
579     compiler.has_function('uname'))
582 add_project_arguments(
583     '-DPURPLE_DISABLE_DEPRECATED',
584     '-DPIDGIN_DISABLE_DEPRECATED',
585     '-DFINCH_DISABLE_DEPRECATED',
586     '-DGNT_DISABLE_DEPRECATED',
587     language : 'c')
588 if get_option('buildtype') != 'plain' and compiler.get_id() == 'gcc'
589         # We enable -Wall later.
590         # If it's set after the warning CFLAGS in the compiler invocation, it counteracts the -Wno... flags.
591         # This leads to warnings we don't want.
592 #       CFLAGS=`echo $CFLAGS |$sedpath 's/-Wall//'`
594         # ENABLE WARNINGS SUPPORTED BY THE VERSION OF GCC IN USE
595         #
596         # Future Possibilities
597         #
598         # Consider adding -Wbad-function-cast.
599         #       This leads to spurious warnings using GPOINTER_TO_INT(), et al. directly on a function call.
600         #               We'd need an intermediate variable.
601         #
602         foreach newflag : [
603                         '-Waggregate-return',
604                         '-Wcast-align',
605                         '-Wdeclaration-after-statement',
606                         '-Wendif-labels',
607                         '-Werror-implicit-function-declaration',
608                         '-Wextra -Wno-unused-parameter',
609                         '-Wformat',
610                         '-Wformat-security',
611                         '-Werror=format-security',
612                         '-Winit-self',
613                         '-Wmissing-declarations',
614                         '-Wmissing-noreturn',
615                         '-Wmissing-prototypes',
616                         '-Wpointer-arith',
617                         '-Wfloat-equal',
618                         '-Wundef']
619                 if compiler.has_argument(newflag)
620                         add_project_arguments(newflag, language : 'c')
621                 endif
622         endforeach
624         if get_option('fortify')
625 #               AC_MSG_CHECKING(for FORTIFY_SOURCE support)
626 #               AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <features.h>]], [[
627 #                       #if !(__GNUC_PREREQ (4, 1) \
628 #                               || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (4, 0)) \
629 #                               || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (3, 4) \
630 #                                       && __GNUC_MINOR__ == 4 \
631 #                                       && (__GNUC_PATCHLEVEL__ > 2 \
632 #                                               || (__GNUC_PATCHLEVEL__ == 2 && __GNUC_RH_RELEASE__ >= 8))))
633 #                       #error No FORTIFY_SOURCE support
634 #                       #endif
635 #                               return 0;
636 #               ]])], [
637 #                       AC_MSG_RESULT(yes)
638 #                       DEBUG_CFLAGS='$DEBUG_CFLAGS -Wp,-D_FORTIFY_SOURCE=2'
639 #               ], [
640 #                       AC_MSG_RESULT(no)
641 #               ])
642         endif
643 endif
644 if get_option('buildtype') != 'plain' and SUNCC
645         add_project_arguments('-features=extensions', language : 'c')
646 endif
648 pidginpath = find_program('pidgin', required : false)
650 if get_option('glib-errors-trace')
651         if compiler.get_id() == 'clang'
652                 error('--enable-glib-errors-trace doesn\'t work with clang')
653         endif
654         conf.set('ENABLE_GLIBTRACE', true)
655         add_project_arguments('-rdynamic', language : 'c')
656 endif
658 #######################################################################
659 # Check for Unity and Messaging Menu
660 # Remove when Ubuntu 16.04 is EOL
661 #######################################################################
662 enable_unity = get_option('unity-integration')
663 if enable_unity
664         UNITY = [
665                 dependency('unity', version : '>= 6.8'),
666                 dependency('messaging-menu', version : '>= 12.10')
667         ]
668         conf.set('USES_MM_CHAT_SECTION', 'X-MessagingMenu-UsesChatSection=true')
669 else
670         conf.set('USES_MM_CHAT_SECTION', '')
671 endif
673 #######################################################################
674 # Check for Secret Service headers
675 #######################################################################
677 enable_secret_service = get_option('secret-service') and not IS_WIN32
678 if enable_secret_service
679         secretservice = dependency('libsecret-1', required : force_deps)
680         if secretservice.found()
681         else
682                 enable_secret_service = false
683         endif
684 endif
686 #######################################################################
687 # Check for KWallet headers
688 #######################################################################
690 enable_kwallet = get_option('kwallet') and not IS_WIN32
692 if enable_kwallet
693         # Ensure C++ compiler works
694         add_languages('cpp')
695         cxx_compiler = meson.get_compiler('cpp')
696         add_project_arguments('-DHAVE_CONFIG_H=1', language : 'cpp')
698         qt5 = import('qt5')
700         qt5_dep = dependency('qt5', modules: ['Core'])
702         kwallet = dependency('KF5Wallet')
703 endif
705 #######################################################################
706 # Check for GPlugin 0.28.0
707 #######################################################################
708 gplugin_dep = dependency('gplugin', version : '>= 0.28.0', required : false)
709 if gplugin_dep.found()
710         gplugin_gir = 'GPlugin-0.0'
711         gplugin_include_directories = include_directories(
712             join_paths(gplugin_dep.get_pkgconfig_variable('prefix'),
713                        'share/gir-1.0'))
714 else
715         gplugin_proj = subproject('gplugin',
716             default_options : [
717                 'doc=' + get_option('doc').to_string(),
718                 'gobject-introspection=' + get_option('introspection').to_string(),
719                 'nls=' + get_option('nls').to_string(),
720             ]
721         )
722         gplugin_dep = gplugin_proj.get_variable('gplugin_dep')
723         gplugin_gir = gplugin_proj.get_variable('gplugin_gir')[0]
724         gplugin_include_directories = []
725 endif
727 #######################################################################
728 # Check for GObject Introspection
729 #######################################################################
731 enable_introspection = get_option('introspection')
732 if enable_introspection
733         if dependency('gobject-introspection-1.0', version : '>= 1.30.0',
734                       required : force_deps).found()
735                 conf.set('ENABLE_INTROSPECTION', true)
736         else
737                 enable_introspection = false
738         endif
739 endif
741 if get_option('plugins')
742         PLUGINS = true
743 else
744         PLUGINS = false
745 endif
747 #######################################################################
748 # Check for Nettle (Crypto Library)
749 #######################################################################
751 enable_nettle = get_option('nettle')
753 if enable_nettle
754         nettle = dependency('nettle', version : '>= 3.0', required : false)
755         enable_nettle = nettle.found()
756         conf.set('HAVE_NETTLE', enable_nettle)
758         if not enable_nettle and force_deps
759                 error('''
760 Nettle development headers not found
761 Use -Dnettle=false if you do not need it.
762 ''')
763         endif
764 else
765         nettle = []
766 endif
768 #######################################################################
769 # Check for Cyrus-SASL (for xmpp/irc)
770 #######################################################################
771 foreach func : ['snprintf', 'connect']
772         conf.set('HAVE_' + func.to_upper(),
773             compiler.has_function(func))
774 endforeach
775 enable_cyrus_sasl = get_option('cyrus-sasl')
776 if enable_cyrus_sasl
777         sasl = dependency('libsasl2', version : '>= 2.0', required : false)
778         enable_cyrus_sasl = sasl.found()
779         conf.set('HAVE_CYRUS_SASL', enable_cyrus_sasl)
781         if not enable_cyrus_sasl and force_deps
782                 error('''
783 Cyrus SASL library not found
784 Use -Dcyrus-sasl=false if you do not need it.
785 ''')
786         endif
787 else
788         enable_cyrus_sasl = false
789         sasl = []
790 endif
792 #######################################################################
793 # Check for Kerberos (for Zephyr)
794 #######################################################################
795 conf.set('ZEPHYR_INT32', 'long')
796 #AC_SUBST(KRB4_CFLAGS)
797 #AC_SUBST(KRB4_LDFLAGS)
798 #AC_SUBST(KRB4_LIBS)
799 kerberos = get_option('krb4')
800 if kerberos
801         if kerberos != 'yes'
802 #               KRB4_CFLAGS='-I${kerberos}/include'
803 #               if test -d '$kerberos/include/kerberosIV' ; then
804 #                       KRB4_CFLAGS='$KRB4_CFLAGS -I${kerberos}/include/kerberosIV'
805 #               fi
806 #               KRB4_LDFLAGS='-L${kerberos}/lib'
807         elif run_command('test', '-d', '/usr/local/include/kerberosIV').returncode() == 0
808 #               KRB4_CFLAGS='-I/usr/local/include/kerberosIV'
809         elif run_command('test', '-d', '/usr/include/kerberosIV').returncode() == 0
810 #               KRB4_CFLAGS='-I/usr/include/kerberosIV'
811         endif
812         conf.set('ZEPHYR_USES_KERBEROS', true)
814 #       AC_CHECK_LIB(krb4, krb_rd_req,
815 #                       [KRB4_LIBS='-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err'],
816 #                       [AC_CHECK_LIB(krb, krb_rd_req,
817 #                               [KRB4_LIBS='-lkrb -ldes'],
818 #                               [AC_MSG_ERROR([Kerberos 4 libraries not found])],
819 #                               -ldes)],
820 #                       -ldes425 -lkrb5 -lk5crypto -lcom_err)
821 #       AC_CHECK_FUNCS(krb_set_key krb_rd_req krb_get_lrealm)
822 #       AC_CHECK_FUNCS(krb_get_err_text krb_log)
823         krb4 = []
824 endif
825 if not kerberos
826         krb4 = []
827 endif
829 #######################################################################
830 # Check for external libzephyr
831 #######################################################################
832 zephyr = get_option('zephyr')
833 if zephyr
834         ext_zephyr = dependency('zephyr', required : force_deps)
835         zephyr = ext_zephyr.found()
836 else
837         ext_zephyr = []
838 endif
839 EXTERNAL_LIBZEPHYR = zephyr
840 conf.set('LIBZEPHYR_EXT', EXTERNAL_LIBZEPHYR)
842 #AC_MSG_CHECKING(for me pot o' gold)
843 #AC_MSG_RESULT(no)
844 foreach func : ['timegm']
845         conf.set('HAVE_' + func.to_upper(),
846             compiler.has_function(func))
847 endforeach
848 foreach header : 'sgtty.h sys/cdefs.h sys/file.h sys/filio.h sys/ioctl.h sys/msgbuf.h sys/select.h sys/wait.h termios.h'.split()
849         conf.set('HAVE_' + header.to_upper().underscorify(),
850             compiler.has_header(header))
851 endforeach
853 # sys/sysctl.h on OpenBSD 4.2 requires sys/param.h
854 # sys/sysctl.h on FreeBSD requires sys/types.h
855 have_sys_param_h = compiler.has_header('sys/param.h')
856 conf.set('HAVE_SYS_PARAM_H', have_sys_param_h)
857 prefix = '''
858 #include <sys/types.h>
860 if have_sys_param_h
861         prefix += '''
862 #include <sys/param.h>
864 endif
865 conf.set('HAVE_SYS_SYSCTL_H',
866     compiler.has_header('sys/sysctl.h', prefix : prefix))
867 conf.set('HAVE_SYS_SOCKET_H',
868     compiler.has_header('sys/socket.h'))
869 #AC_VAR_TIMEZONE_EXTERNALS
871 #######################################################################
872 # Disable pixmap installation
873 #######################################################################
874 INSTALL_PIXMAPS = get_option('pixmaps-install')
876 # check for gtk-doc
877 ENABLE_DOC = get_option('doc')
879 enable_debug = get_option('console-logging')
880 conf.set('DEBUG', enable_debug)
882 # So that config.h may be found.
883 toplevel_inc = include_directories('.')
885 subdir('libpurple')
886 subdir('share/sounds')
887 subdir('finch')
888 subdir('pidgin')
889 subdir('doc')
891 configure_file(output : 'config.h',
892     configuration : conf)
894 message('')
895 message('pidgin ' + meson.project_version())
897 message('')
898 message('Build GTK+ UI................. : ' + get_option('gtkui').to_string())
899 message('Build console UI.............. : ' + enable_consoleui.to_string())
900 message('Build for X11................. : ' + with_x.to_string())
901 message('')
902 message('Enable Gestures............... : ' + enable_gestures.to_string())
903 message('Protocols to build dynamically : @0@'.format(DYNAMIC_PRPLS))
904 message('')
905 message('Build with GStreamer support.. : ' + enable_gst.to_string())
906 message('Build with voice and video.... : ' + enable_vv.to_string())
907 message('Build with GNU Libidn......... : ' + get_option('idn').to_string())
908 message('Build with Nettle support..... : ' + enable_nettle.to_string())
909 message('Build with Cyrus SASL support. : ' + enable_cyrus_sasl.to_string())
910 message('Use kerberos 4 with zephyr.... : ' + kerberos.to_string())
911 message('Use external libzephyr........ : ' + zephyr.to_string())
912 message('Install pixmaps............... : ' + INSTALL_PIXMAPS.to_string())
913 message('Install translations.......... : ' + INSTALL_I18N.to_string())
914 message('Has you....................... : yes')
915 message('')
916 message('Build Unity integration plugin.: ' + enable_unity.to_string())
917 message('')
918 message('Build with KWallet............ : ' + enable_kwallet.to_string())
919 message('Build with Secret Service..... : ' + enable_secret_service.to_string())
920 message('')
921 message('Build plugins................. : ' + PLUGINS.to_string())
922 message('Enable Introspection...........: ' + enable_introspection.to_string())
923 message('')
924 message('Print debugging messages...... : ' + enable_debug.to_string())
925 message('Generate documentation........ : ' + ENABLE_DOC.to_string())
926 message('')
927 bindir = join_paths(get_option('prefix'), get_option('bindir'))
928 message('Pidgin will be installed in @0@.'.format(bindir))
929 if pidginpath.found()
930         message('Warning: You have an old copy of Pidgin at @0@.'.format(pidginpath.path()))
931 endif
932 if not INSTALL_PIXMAPS
933         message('')
934         message('Warning: You have disabled the installation of pixmap data, but Pidgin')
935         message('still requires installed pixmaps.  Be sure you know what you are doing.')
936 endif
937 if not INSTALL_I18N
938         message('')
939         message('Warning: You have disabled the building and installation of translation')
940         message('data.  This will prevent building Pidgin desktop files.')
941         message('Be sure you know what you are doing.')
942 endif
943 message('')
944 message('configure complete, now type \'ninja\'')
945 message('')