Convert Pidgin plugins to libsoup.
[pidgin-git.git] / meson.build
blobb57102c7f80ddd7ab84af1380778fa925b5c1f0d
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 #######################################################################
292 # Check for GObject Introspection
293 #######################################################################
295 enable_introspection = dependency('gobject-introspection-1.0', version : '>= 1.30.0',
296                                   required : get_option('introspection')).found()
297 conf.set('ENABLE_INTROSPECTION', enable_introspection)
299 # #######################################################################
300 # # Check for GTK+ 2.18 and other things used by the GTK UI
301 # #######################################################################
302 # #######################################################################
303 # Check Pidgin dependencies
304 # #######################################################################
305 if get_option('gtkui')
306         gtk = dependency('gtk+-3.0', version : '>= 3.20.0')
308         talkatu_dep = dependency('talkatu', version: '>=0.1.0', required : false)
309         if talkatu_dep.found()
310                 talkatu_gir = 'Talkatu-0.0'
311                 talkatu_include_directories = include_directories(
312                     join_paths(talkatu_dep.get_pkgconfig_variable('prefix'),
313                                'share/gir-1.0'))
314         else
315                 talkatu_proj = subproject('talkatu',
316                     default_options : [
317                         'doc=' + get_option('doc').to_string(),
318                         'gobject-introspection=' + enable_introspection.to_string(),
319                         'nls=' + get_option('nls').to_string(),
320                     ]
321                 )
322                 talkatu_dep = talkatu_proj.get_variable('talkatu_dep')
323                 talkatu_gir = talkatu_proj.get_variable('talkatu_gir')[0]
324                 talkatu_include_directories = []
325         endif
326 endif   # GTK
328 ENABLE_GTK = get_option('gtkui')
331 #######################################################################
332 # Check if we should compile with X support
333 #######################################################################
334 if IS_WIN32
335         x11 = disabler()
336 else
337         x11 = dependency('x11', required : get_option('x'))
338 endif
339 conf.set('HAVE_X11', x11.found())
341 enable_gestures = get_option('gestures')
342 if not get_option('gtkui') or not x11.found()
343         enable_gestures = false
344 endif
346 #######################################################################
347 # Check for LibXML2 (required)
348 #######################################################################
349 libxml = dependency('libxml-2.0', version : '>= 2.6.0')
350 if libxml.version().version_compare('<2.6.18')
351         message('Versions of libxml2 < 2.6.18 may contain bugs that could cause XMPP messages to be discarded.')
352 endif
354 #######################################################################
355 # Check for JSON-GLib (required)
356 #######################################################################
358 json = dependency('json-glib-1.0', version : '>= 0.14.0')
360 #######################################################################
361 # Check for libsoup (required)
362 #######################################################################
364 libsoup = dependency('libsoup-2.4', version : '>= 2.42')
366 #######################################################################
367 # Check for GStreamer
368 #######################################################################
370 gstreamer = dependency('gstreamer-1.0', required : get_option('gstreamer'))
371 conf.set('USE_GSTREAMER', gstreamer.found())
373 #######################################################################
374 # Check for GStreamer Video
375 #######################################################################
376 if gstreamer.found()
377         gstreamer_video = dependency('gstreamer-video-1.0',
378                                      required : get_option('gstreamer-video'))
379         conf.set('USE_GSTVIDEO', gstreamer_video.found())
380 else
381         gstreamer_video = disabler()
382 endif
384 #######################################################################
385 # Check for Farstream
386 #######################################################################
387 farstream = dependency('farstream-0.2', version : '>= 0.2.7',
388                        required : get_option('farstream'))
390 #######################################################################
391 # Check for Voice and Video support
392 #######################################################################
393 if get_option('vv').enabled() or get_option('vv').auto()
394         if gstreamer.found() and gstreamer_video.found() and farstream.found()
395                 conf.set('USE_VV', true)
396                 enable_vv = true
397         else
398                 if get_option('vv').enabled()
399                         error('''
400 Dependencies for voice/video were not met.
401 Install the necessary gstreamer and farstream packages first.
402 Or use -Dvv=disabled if you do not need voice/video support.
403                         ''')
404                 endif
405                 enable_vv = false
406         endif
407 else
408         enable_vv = false
409 endif
411 #######################################################################
412 # Check for Raw data streams support in Farstream
413 #######################################################################
414 if enable_vv
415         gstreamer_app = dependency('gstreamer-app-1.0',
416                                    required : false)
417         if gstreamer_app.found()
418                 conf.set('USE_GSTAPP', true)
419                 conf.set('HAVE_MEDIA_APPLICATION', true)
420         endif
421 else
422         gstreamer_app = []
423 endif
425 #######################################################################
426 # Check for Meanwhile headers (for Sametime)
427 #######################################################################
428 meanwhile = dependency('meanwhile', version : ['>= 1.0.0', '< 2.0.0'], required : get_option('meanwhile'))
429 gmime = dependency('gmime-3.0', version : '>= 3.0.0', required : get_option('meanwhile'))
430 enable_meanwhile = meanwhile.found() and gmime.found()
432 #######################################################################
433 # Check for Native Avahi headers (for Bonjour)
434 #######################################################################
436 if IS_WIN32
437         # Just keep enabled.
438         enable_avahi = get_option('avahi').enabled() or get_option('avahi').auto()
439         avahi = []
440 else
441         # Attempt to autodetect Avahi
442         avahi_client = dependency('avahi-client', required : get_option('avahi'))
443         avahi_glib = dependency('avahi-glib', required : get_option('avahi'))
444         avahi = [avahi_client, avahi_glib]
445         enable_avahi = avahi_client.found() and avahi_glib.found()
446 endif
449 #######################################################################
450 # Check for SILC client includes and libraries
451 #######################################################################
452 silc = dependency('silcclient', version : '>= 1.1', required : get_option('silc'))
454 #######################################################################
455 # Check for Gadu-Gadu protocol library (libgadu)
456 #######################################################################
458 libgadu = dependency('libgadu', version : '>= 1.12.0', required : get_option('libgadu'))
460 if libgadu.found()
461         if not compiler.has_function('gg_is_gpl_compliant', dependencies : libgadu)
462                 if get_option('libgadu').auto()
463                         libgadu = disabler()
464                 else
465                         message('''
466 libgadu is not compatible with the GPL when compiled with OpenSSL support.
468 To link against libgadu, please recompile it using:
469 ./configure --with-openssl=no
470 Then rerun this Meson build
471                         ''')
472                 endif
473         endif
474 endif
477 DEFAULT_PRPLS = ['bonjour', 'facebook', 'gg', 'irc', 'jabber', 'novell',
478                  'null', 'oscar', 'sametime', 'silc', 'simple', 'zephyr']
479 ALL_PRPLS = DEFAULT_PRPLS + ['null']
481 dynamic_list = get_option('dynamic-prpls').split(',')
482 if dynamic_list == ['all']
483         dynamic_list = DEFAULT_PRPLS
484 endif
485 DYNAMIC_PRPLS = []
486 foreach prpl : dynamic_list
487         if prpl == ''
488                 # The list was empty; do nothing.
489         elif prpl == 'sametime' and not enable_meanwhile
490                 # Do nothing.
491         elif prpl == 'bonjour' and not enable_avahi
492                 # Do nothing.
493         elif prpl == 'silc' and not silc.found()
494                 # Do nothing.
495         elif prpl == 'gg' and not libgadu.found()
496                 # Do nothing.
497         elif prpl == 'zephyr' and IS_WIN32
498                 # Do nothing.
499         else
500                 DYNAMIC_PRPLS += [prpl]
501         endif
502 endforeach
504 DYNAMIC_BONJOUR = DYNAMIC_PRPLS.contains('bonjour')
505 DYNAMIC_FACEBOOK = DYNAMIC_PRPLS.contains('facebook')
506 DYNAMIC_GG  = DYNAMIC_PRPLS.contains('gg')
507 DYNAMIC_IRC = DYNAMIC_PRPLS.contains('irc')
508 DYNAMIC_JABBER = DYNAMIC_PRPLS.contains('jabber')
509 DYNAMIC_NOVELL = DYNAMIC_PRPLS.contains('novell')
510 DYNAMIC_NULL = DYNAMIC_PRPLS.contains('null')
511 DYNAMIC_OSCAR = DYNAMIC_PRPLS.contains('oscar') or DYNAMIC_PRPLS.contains('aim') or DYNAMIC_PRPLS.contains('icq')
512 DYNAMIC_SAMETIME = DYNAMIC_PRPLS.contains('sametime')
513 DYNAMIC_SILC = DYNAMIC_PRPLS.contains('silc')
514 DYNAMIC_SIMPLE = DYNAMIC_PRPLS.contains('simple')
515 DYNAMIC_ZEPHYR = DYNAMIC_PRPLS.contains('zephyr')
517 conf.set('HAVE_SYS_UTSNAME_H',
518     compiler.has_header('sys/utsname.h'))
519 conf.set('HAVE_UNAME',
520     compiler.has_function('uname'))
523 add_project_arguments(
524     '-DPURPLE_DISABLE_DEPRECATED',
525     '-DPIDGIN_DISABLE_DEPRECATED',
526     '-DFINCH_DISABLE_DEPRECATED',
527     '-DGNT_DISABLE_DEPRECATED',
528     language : 'c')
529 if get_option('buildtype') != 'plain' and compiler.get_id() == 'gcc'
530         # We enable -Wall later.
531         # If it's set after the warning CFLAGS in the compiler invocation, it counteracts the -Wno... flags.
532         # This leads to warnings we don't want.
533 #       CFLAGS=`echo $CFLAGS |$sedpath 's/-Wall//'`
535         # ENABLE WARNINGS SUPPORTED BY THE VERSION OF GCC IN USE
536         #
537         # Future Possibilities
538         #
539         # Consider adding -Wbad-function-cast.
540         #       This leads to spurious warnings using GPOINTER_TO_INT(), et al. directly on a function call.
541         #               We'd need an intermediate variable.
542         #
543         foreach newflag : [
544                         '-Waggregate-return',
545                         '-Wcast-align',
546                         '-Wdeclaration-after-statement',
547                         '-Wendif-labels',
548                         '-Werror-implicit-function-declaration',
549                         '-Wextra -Wno-unused-parameter',
550                         '-Wformat',
551                         '-Wformat-security',
552                         '-Werror=format-security',
553                         '-Winit-self',
554                         '-Wmissing-declarations',
555                         '-Wmissing-noreturn',
556                         '-Wmissing-prototypes',
557                         '-Wpointer-arith',
558                         '-Wfloat-equal',
559                         '-Wundef']
560                 if compiler.has_argument(newflag)
561                         add_project_arguments(newflag, language : 'c')
562                 endif
563         endforeach
564 endif
565 if get_option('buildtype') != 'plain' and SUNCC
566         add_project_arguments('-features=extensions', language : 'c')
567 endif
569 pidginpath = find_program('pidgin', required : false)
571 if get_option('glib-errors-trace')
572         if compiler.get_id() == 'clang'
573                 error('--enable-glib-errors-trace doesn\'t work with clang')
574         endif
575         conf.set('ENABLE_GLIBTRACE', true)
576         add_project_arguments('-rdynamic', language : 'c')
577 endif
579 #######################################################################
580 # Check for Unity and Messaging Menu
581 # Remove when Ubuntu 16.04 is EOL
582 #######################################################################
583 UNITY = [
584         dependency('unity', version : '>= 6.8', required : get_option('unity-integration')),
585         dependency('messaging-menu', version : '>= 12.10', required : get_option('unity-integration'))
587 enable_unity = UNITY[0].found() and UNITY[1].found()
588 if enable_unity
589         conf.set('USES_MM_CHAT_SECTION', 'X-MessagingMenu-UsesChatSection=true')
590 else
591         conf.set('USES_MM_CHAT_SECTION', '')
592 endif
594 #######################################################################
595 # Check for Secret Service headers
596 #######################################################################
598 if IS_WIN32
599         secretservice = disabler()
600 else
601         secretservice = dependency('libsecret-1', required : get_option('secret-service'))
602 endif
604 #######################################################################
605 # Check for KWallet headers
606 #######################################################################
608 if IS_WIN32
609         kwallet = disabler()
610 else
611         # Ensure C++ compiler works
612         add_languages('cpp')
613         cxx_compiler = meson.get_compiler('cpp')
614         add_project_arguments('-DHAVE_CONFIG_H=1', language : 'cpp')
616         qt5 = import('qt5')
618         qt5_dep = dependency('qt5', modules: ['Core'], required : get_option('kwallet'))
620         kwallet = dependency('KF5Wallet', required : get_option('kwallet'))
621 endif
623 #######################################################################
624 # Check for GPlugin 0.28.0
625 #######################################################################
626 gplugin_dep = dependency('gplugin', version : '>= 0.28.0', required : false)
627 if gplugin_dep.found()
628         gplugin_gir = 'GPlugin-0.0'
629         gplugin_include_directories = include_directories(
630             join_paths(gplugin_dep.get_pkgconfig_variable('prefix'),
631                        'share/gir-1.0'))
632 else
633         gplugin_proj = subproject('gplugin',
634             default_options : [
635                 'doc=' + get_option('doc').to_string(),
636                 'gobject-introspection=' + enable_introspection.to_string(),
637                 'nls=' + get_option('nls').to_string(),
638             ]
639         )
640         gplugin_dep = gplugin_proj.get_variable('gplugin_dep')
641         gplugin_gir = gplugin_proj.get_variable('gplugin_gir')[0]
642         gplugin_include_directories = []
643 endif
645 PLUGINS = get_option('plugins')
647 #######################################################################
648 # Check for Nettle (Crypto Library)
649 #######################################################################
651 nettle = dependency('nettle', version : '>= 3.0', required : get_option('nettle'))
652 conf.set('HAVE_NETTLE', nettle.found())
654 #######################################################################
655 # Check for Cyrus-SASL (for xmpp/irc)
656 #######################################################################
657 foreach func : ['snprintf', 'connect']
658         conf.set('HAVE_' + func.to_upper(),
659             compiler.has_function(func))
660 endforeach
661 sasl = dependency('libsasl2', version : '>= 2.0', required : get_option('cyrus-sasl'))
662 conf.set('HAVE_CYRUS_SASL', sasl.found())
664 #######################################################################
665 # Check for external libzephyr
666 #######################################################################
667 ext_zephyr = dependency('zephyr', required : get_option('zephyr'))
668 EXTERNAL_LIBZEPHYR = ext_zephyr.found()
669 conf.set('LIBZEPHYR_EXT', EXTERNAL_LIBZEPHYR)
671 #######################################################################
672 # Check for Kerberos (for Zephyr)
673 #######################################################################
674 conf.set('ZEPHYR_INT32', 'long')
675 #AC_SUBST(KRB4_CFLAGS)
676 #AC_SUBST(KRB4_LDFLAGS)
677 #AC_SUBST(KRB4_LIBS)
678 kerberos = get_option('krb4')
679 if kerberos
680         if kerberos != 'yes'
681 #               KRB4_CFLAGS='-I${kerberos}/include'
682 #               if test -d '$kerberos/include/kerberosIV' ; then
683 #                       KRB4_CFLAGS='$KRB4_CFLAGS -I${kerberos}/include/kerberosIV'
684 #               fi
685 #               KRB4_LDFLAGS='-L${kerberos}/lib'
686         elif run_command('test', '-d', '/usr/local/include/kerberosIV').returncode() == 0
687 #               KRB4_CFLAGS='-I/usr/local/include/kerberosIV'
688         elif run_command('test', '-d', '/usr/include/kerberosIV').returncode() == 0
689 #               KRB4_CFLAGS='-I/usr/include/kerberosIV'
690         endif
691         conf.set('ZEPHYR_USES_KERBEROS', true)
693 #       AC_CHECK_LIB(krb4, krb_rd_req,
694 #                       [KRB4_LIBS='-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err'],
695 #                       [AC_CHECK_LIB(krb, krb_rd_req,
696 #                               [KRB4_LIBS='-lkrb -ldes'],
697 #                               [AC_MSG_ERROR([Kerberos 4 libraries not found])],
698 #                               -ldes)],
699 #                       -ldes425 -lkrb5 -lk5crypto -lcom_err)
700 #       AC_CHECK_FUNCS(krb_set_key krb_rd_req krb_get_lrealm)
701 #       AC_CHECK_FUNCS(krb_get_err_text krb_log)
702         krb4 = []
703 endif
704 if not kerberos
705         krb4 = []
706 endif
708 #AC_MSG_CHECKING(for me pot o' gold)
709 #AC_MSG_RESULT(no)
710 foreach func : ['timegm']
711         conf.set('HAVE_' + func.to_upper(),
712             compiler.has_function(func))
713 endforeach
714 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()
715         conf.set('HAVE_' + header.to_upper().underscorify(),
716             compiler.has_header(header))
717 endforeach
719 # sys/sysctl.h on OpenBSD 4.2 requires sys/param.h
720 # sys/sysctl.h on FreeBSD requires sys/types.h
721 have_sys_param_h = compiler.has_header('sys/param.h')
722 conf.set('HAVE_SYS_PARAM_H', have_sys_param_h)
723 prefix = '''
724 #include <sys/types.h>
726 if have_sys_param_h
727         prefix += '''
728 #include <sys/param.h>
730 endif
731 conf.set('HAVE_SYS_SYSCTL_H',
732     compiler.has_header('sys/sysctl.h', prefix : prefix))
733 conf.set('HAVE_SYS_SOCKET_H',
734     compiler.has_header('sys/socket.h'))
735 #AC_VAR_TIMEZONE_EXTERNALS
737 #######################################################################
738 # Disable pixmap installation
739 #######################################################################
740 INSTALL_PIXMAPS = get_option('pixmaps-install')
742 # check for gtk-doc
743 ENABLE_DOC = get_option('doc')
745 enable_debug = get_option('console-logging')
746 conf.set('DEBUG', enable_debug)
748 # So that config.h may be found.
749 toplevel_inc = include_directories('.')
751 subdir('libpurple')
752 subdir('share/sounds')
753 subdir('finch')
754 subdir('pidgin')
755 subdir('doc')
757 configure_file(output : 'config.h',
758     configuration : conf)
760 message('')
761 message('pidgin ' + meson.project_version())
763 message('')
764 message('Build GTK+ UI................. : ' + get_option('gtkui').to_string())
765 message('Build console UI.............. : ' + enable_consoleui.to_string())
766 message('Build for X11................. : ' + x11.found().to_string())
767 message('')
768 message('Enable Gestures............... : ' + enable_gestures.to_string())
769 message('Protocols to build dynamically : @0@'.format(DYNAMIC_PRPLS))
770 message('')
771 message('Build with GStreamer support.. : ' + gstreamer.found().to_string())
772 message('Build with voice and video.... : ' + enable_vv.to_string())
773 message('Build with GNU Libidn......... : ' + idn.found().to_string())
774 message('Build with Nettle support..... : ' + nettle.found().to_string())
775 message('Build with Cyrus SASL support. : ' + sasl.found().to_string())
776 message('Use external libzephyr........ : ' + EXTERNAL_LIBZEPHYR.to_string())
777 if not EXTERNAL_LIBZEPHYR
778 message('Use kerberos 4 with zephyr.... : ' + kerberos.to_string())
779 endif
780 message('Install pixmaps............... : ' + INSTALL_PIXMAPS.to_string())
781 message('Install translations.......... : ' + INSTALL_I18N.to_string())
782 message('Has you....................... : yes')
783 message('')
784 message('Build Unity integration plugin.: ' + enable_unity.to_string())
785 message('')
786 message('Build with KWallet............ : ' + kwallet.found().to_string())
787 message('Build with Secret Service..... : ' + secretservice.found().to_string())
788 message('')
789 message('Build plugins................. : ' + PLUGINS.to_string())
790 message('Enable Introspection...........: ' + enable_introspection.to_string())
791 message('')
792 message('Print debugging messages...... : ' + enable_debug.to_string())
793 message('Generate documentation........ : ' + ENABLE_DOC.to_string())
794 message('')
795 bindir = join_paths(get_option('prefix'), get_option('bindir'))
796 message('Pidgin will be installed in @0@.'.format(bindir))
797 if pidginpath.found()
798         message('Warning: You have an old copy of Pidgin at @0@.'.format(pidginpath.path()))
799 endif
800 if not INSTALL_PIXMAPS
801         message('')
802         message('Warning: You have disabled the installation of pixmap data, but Pidgin')
803         message('still requires installed pixmaps.  Be sure you know what you are doing.')
804 endif
805 if not INSTALL_I18N
806         message('')
807         message('Warning: You have disabled the building and installation of translation')
808         message('data.  This will prevent building Pidgin desktop files.')
809         message('Be sure you know what you are doing.')
810 endif
811 message('')
812 message('configure complete, now type \'ninja\'')
813 message('')