project('pidgin', 'c', meson_version : '>=0.37.0') # UPDATING VERSION NUMBERS FOR RELEASES # purple_micro_version += 1 # If any functions have been added to libpurple, Pidgin, or Finch: # purple_micro_version = 0 # purple_minor_version += 1 # If backwards compatibility has been broken in libpurple, Pidgin, or Finch: # purple_micro_version = 0 # purple_minor_version = 0 # purple_major_version += 1; # purple_version_suffix should be similar to one of the following: # For beta releases: 'beta2' # For code under development: 'devel' # For production releases: '' # If any code has changed in libgnt: # If any functions have been added to libgnt: # If backwards compatibility has been broken in libgnt: # gnt_major_version += 1; # gnt_version_suffix should be similar to one of the following: # For beta releases: 'beta2' # For code under development: 'devel' # For production releases: '' # Make sure to update finch/libgnt/configure.ac with libgnt version changes. purple_version_suffix = 'devel' purple_version = '@0@.@1@.@2@'.format(purple_major_version, purple_display_version = '@0@@1@'.format(purple_version, # the last version for Finch 2 was 2.8.10, # the first version for Finch 3 was 2.9.0 gnt_version_suffix = 'devel' gnt_version = '@0@.@1@.@2@'.format(gnt_major_version, gnt_display_version = '@0@@1@'.format(gnt_version, add_project_arguments('-DHAVE_CONFIG_H=1', language : 'c') conf = configuration_data() man_conf = configuration_data() pkg_conf = configuration_data() version_conf = configuration_data() conf.set_quoted('PACKAGE', meson.project_name()) conf.set_quoted('PACKAGE_NAME', meson.project_name()) conf.set_quoted('VERSION', purple_display_version) version_conf.set('PURPLE_MAJOR_VERSION', purple_major_version) version_conf.set('PURPLE_MINOR_VERSION', purple_minor_version) version_conf.set('PURPLE_MICRO_VERSION', purple_micro_version) version_conf.set('PURPLE_VERSION', purple_display_version) version_conf.set('PURPLE_API_VERSION', purple_lt_current - purple_minor_version) PURPLE_LIB_VERSION = '@0@.@1@.@2@'.format(purple_lt_current - purple_minor_version, version_conf.set('GNT_MAJOR_VERSION', gnt_major_version) version_conf.set('GNT_MINOR_VERSION', gnt_minor_version) version_conf.set('GNT_MICRO_VERSION', gnt_micro_version) version_conf.set('GNT_VERSION', gnt_display_version) version_conf.set('GNT_API_VERSION', gnt_lt_current - gnt_minor_version) GNT_LIB_VERSION = '@0@.@1@.@2@'.format(gnt_lt_current - gnt_minor_version, package_revision = vcs_tag( input : 'package_revision.h.in', output : 'package_revision.h', fallback : meson.project_version()) man_conf.set('VERSION', purple_display_version) man_conf.set('prefix', get_option('prefix')) # This is used for pkg-config files. This probably can be removed and the # builtin generator used instead once we drop the Autotools build. pkg_conf.set('VERSION', purple_display_version) pkg_conf.set('PURPLE_MAJOR_VERSION', purple_major_version) pkg_conf.set('prefix', get_option('prefix')) pkg_conf.set('exec_prefix', '${prefix}') pkg_conf.set('libdir', join_paths('${exec_prefix}', get_option('libdir'))) pkg_conf.set('includedir', join_paths('${prefix}', get_option('includedir'))) pkg_conf.set('datarootdir', join_paths('${prefix}', get_option('datadir'))) pkg_conf.set('datadir', '${datarootdir}') pkg_conf.set('sysconfdir', join_paths('${prefix}', get_option('sysconfdir'))) sedpath = find_program('sed') # Storing build arguments if meson.version().version_compare('>=0.42.0') meson.add_postconf_script('mkmesonconf.py') conf.set('HAVE_MESON_CONFIG', true) compiler = meson.get_compiler('c') if compiler.has_function('alloca') # FIXME: Probably not enough. conf.set('HAVE_ALLOCA_H', true) error('alloca could not be found') SUNCC = compiler.compiles('void main() {__SUNPRO_C;};') if host_machine.system() == 'windows' windows = import('windows') ws2_32 = compiler.find_library('ws2_32') dnsapi = compiler.find_library('dnsapi') if build_machine.system() != 'windows' conf.set('IS_WIN32_CROSS_COMPILED', true) conf.set('WIN32_LEAN_AND_MEAN', true) # Checks for header files. conf.set('HAVE_SYS_WAIT_H', compiler.has_header('sys/wait.h')) foreach h : ['fcntl.h', 'unistd.h', 'stdint.h'] if compiler.has_header(h) conf.set('HAVE_' + h.to_upper().underscorify(), true) error(h + ' is required.') # Checks for typedefs, structures, and compiler characteristics. time_t_size = compiler.sizeof('time_t', conf.set('SIZEOF_TIME_T', time_t_size) conf.set('WORDS_BIGENDIAN', host_machine.endian() != 'little') conf.set('USE_WIN32_FHS', IS_WIN32 and get_option('win32-dirs') == 'fhs') if get_option('win32-dirs') == 'fhs' foreach dir : ['bin', 'lib', 'data', 'sysconf', 'locale'] path = join_paths(get_option('prefix'), get_option(dir + 'dir')) conf.set('WIN32_FHS_@0@DIR'.format(dir.to_upper()), path) conf.set('PURPLE_LIBDIR', 'wpurple_lib_dir("purple-@0@")'.format(purple_major_version)) conf.set('PIDGIN_LIBDIR', 'wpurple_lib_dir("pidgin-@0@")'.format(purple_major_version)) 'wpurple_lib_dir("finch-@0@")'.format(purple_major_version)) conf.set('PURPLE_LIBDIR', 'wpurple_lib_dir(NULL)') conf.set('PIDGIN_LIBDIR', 'wpurple_lib_dir(NULL)') conf.set('FINCH_LIBDIR', 'wpurple_lib_dir(NULL)') conf.set('PURPLE_DATADIR', 'wpurple_data_dir()') conf.set('PURPLE_SYSCONFDIR', 'wpurple_sysconf_dir()') conf.set('PURPLE_LOCALEDIR', 'wpurple_locale_dir()') foreach dir : ['data', 'sysconf', 'locale'] path = join_paths(get_option('prefix'), get_option(dir + 'dir')) conf.set_quoted('PURPLE_@0@DIR'.format(dir.to_upper()), path) common_libdir = join_paths(get_option('prefix'), get_option('libdir')) conf.set_quoted('PURPLE_LIBDIR', join_paths(common_libdir, 'purple-@0@'.format(purple_major_version))) conf.set_quoted('PIDGIN_LIBDIR', join_paths(common_libdir, 'pidgin-@0@'.format(purple_major_version))) conf.set_quoted('FINCH_LIBDIR', join_paths(common_libdir, 'finch-@0@'.format(purple_major_version))) abslibdir = join_paths(get_option('prefix'), get_option('libdir')) PURPLE_PLUGINDIR = join_paths(abslibdir, 'purple-@0@'.format(purple_major_version)) conf.set_quoted('PURPLE_PLUGINDIR', PURPLE_PLUGINDIR) PIDGIN_PLUGINDIR = join_paths(abslibdir, 'pidgin-@0@'.format(purple_major_version)) conf.set_quoted('PIDGIN_PLUGINDIR', PIDGIN_PLUGINDIR) FINCH_PLUGINDIR = join_paths(abslibdir, 'finch-@0@'.format(purple_major_version)) conf.set_quoted('FINCH_PLUGINDIR', FINCH_PLUGINDIR) # Checks for library functions. foreach func : ['strdup'] conf.set('HAVE_' + func.to_upper(), compiler.has_function(func)) if not compiler.has_function('inet_aton') if not compiler.has_function('inet_aton', args : '-lresolv') # FIXME: Someone needs to link with -lresolv if needed. error('inet_aton not found') if compiler.has_function('gethostent', args : '-lnsl') conf.set('HAVE_LIBNSL', true) conf.set('HAVE_GETADDRINFO', true) conf.set('HAVE_INET_NTOP', true) if not compiler.has_function('socket') if not compiler.has_function('socket', args : '-lsocket') error('socket not found') # If all goes well, by this point the previous two checks will have # pulled in -lsocket and -lnsl if we need them. if compiler.has_function('getaddrinfo') conf.set('HAVE_GETADDRINFO', true) if compiler.has_function('getaddrinfo', args : '-lsocket -lnsl') conf.set('HAVE_GETADDRINFO', true) # FIXME: LIBS += declare_dependency(link_with : ['socket', 'nsl']) conf.set('HAVE_INET_NTOP', compiler.has_function('inet_ntop')) conf.set('HAVE_GETIFADDRS', compiler.has_function('getifaddrs')) # Check for socklen_t (in Unix98) socket_header = 'ws2tcpip.h' socket_header = 'sys/socket.h' if not compiler.has_header_symbol(socket_header, 'socklen_t') int accept(int, struct sockaddr *, size_t *); '''.format(socket_header) if compiler.compiles(code, name : 'socklen_t is size_t') conf.set('socklen_t', 'size_t') conf.set('socklen_t', 'int') # Some systems do not have sa_len field for struct sockaddr. conf.set('HAVE_STRUCT_SOCKADDR_SA_LEN', compiler.has_member('struct sockaddr', 'sa_len', prefix : '#include <@0@>'.format(socket_header))) # Check for v6-only sockets conf.set('HAVE_IPV6_V6ONLY', compiler.has_header_symbol(header, 'IPV6_V6ONLY')) # Windows and Haiku do not use libm for the math functions, they are part math = compiler.find_library('m') int main(int argc, char *argv[]) result = compiler.run(code, name : 'fileno()') conf.set('HAVE_FILENO', result.returncode() == 0) if (strftime(buf, sizeof(buf), "%z", localtime(&t)) != 5) fprintf(stderr, "strftime(\"%%z\") yields: \"%s\"\n", buf); return !((buf[0] == '-' || buf[0] == '+') && (buf[1] >= '0' && buf[1] <= '9') && (buf[2] >= '0' && buf[2] <= '9') && (buf[3] >= '0' && buf[3] <= '9') && (buf[4] >= '0' && buf[4] <= '9') result = compiler.run(code, name : 'the %z format string in strftime()') conf.set('HAVE_STRFTIME_Z_FORMAT', result.returncode() == 0) # before gettexting, in case iconv matters if host_machine.system() == 'darwin' if compiler.has_header('CoreFoundation/CoreFoundation.h') if compiler.has_header('IOKit/IOKitLib.h') conf.set('HAVE_IOKIT', true) IOKIT = dependency('appleframeworks', modules : ['IOKit', 'CoreFoundation']) if run_command('test', '-d', '/sw').returncode() == 0 #CPPFLAGS="$CPPFLAGS -I/sw/include" #LDFLAGS="$LDFLAGS -L/sw/lib" # ####################################################################### # # Disable creation and installation of translation files # ####################################################################### INSTALL_I18N = get_option('nls') intltool_merge = find_program('intltool-merge') # ####################################################################### # # Check for GLib 2.40 (required) # ####################################################################### glib = dependency('glib-2.0', version : '>= 2.40.0') gio = dependency('gio-2.0') gmodule = dependency('gmodule-2.0') gobject = dependency('gobject-2.0') gthread = dependency('gthread-2.0') if get_option('extraversion') != '' DISPLAY_VERSION = '@0@-@1@'.format(meson.project_version(), get_option('extraversion')) DISPLAY_VERSION = meson.project_version() conf.set_quoted('DISPLAY_VERSION', DISPLAY_VERSION) force_deps = not get_option('missing-dependencies') with_x = get_option('x') and not IS_WIN32 # ####################################################################### # # Check for GTK+ 2.18 and other things used by the GTK UI # ####################################################################### enable_enchant = get_option('enchant') enable_gevolution = get_option('gevolution') enable_cap = get_option('cap') enable_gestures = get_option('gestures') enable_gcr = get_option('gcr') # ####################################################################### # Check Pidgin dependencies # ####################################################################### gtk = dependency('gtk+-3.0', version : '>= 3.4.2') # We only really need Pango >= 1.4 for decent RTL support pango = dependency('pango', version : '>= 1.4.0') conf.set('HAVE_PANGO14', pango.found()) webkit = dependency('webkitgtk-3.0', version : '>= 1.3.7') ####################################################################### # Check if we should compile with enchant support ####################################################################### # We need enchant for spell checking dictionary enumeration, # because webkit1 doesn't have this. enchant = dependency('enchant', required : force_deps) use_enchant = enchant.found() conf.set('USE_ENCHANT', use_enchant) ####################################################################### # Check if we should compile with X support ####################################################################### conf.set('HAVE_X11', true) X11 development headers not found. Use -Dx=false if you do not need X11 support. ####################################################################### # Check for stuff needed by the Evolution integration plugin. ####################################################################### ['libedata-book-1.2', []], ['evolution-data-server-1.2', '>= 3.6'] EVOLUTION_ADDRESSBOOK = [] EVOLUTION_ADDRESSBOOK += [ dependency(dep[0], version : dep[1], required : force_deps) if not EVOLUTION_ADDRESSBOOK[-1].found() enable_gevolution = false conf.set('HAVE_EVOLUTION_ADDRESSBOOK', enable_gevolution) EVOLUTION_ADDRESSBOOK = [] ####################################################################### # Check for libsqlite3 (for the Contact Availability Prediction plugin) ####################################################################### SQLITE3 = dependency('sqlite3', version : '>= 3.3', required : force_deps) enable_cap = SQLITE3.found() ####################################################################### # Check for GCR for its certificate widgets ####################################################################### GCR = dependency('gcr-3', required : force_deps) conf.set('ENABLE_GCR', true) enable_gevolution = false ENABLE_GTK = get_option('gtkui') ####################################################################### # Check for ncurses and other things used by the console UI ####################################################################### enable_consoleui = get_option('consoleui') force_finch = enable_consoleui compiler.find_library('ncursesw', required : false), compiler.find_library('panelw', required : false) if not ncurses_libs[0].found() or not ncurses_libs[1].found() ncurses_sys_prefix = '/usr/$host/sys-root/mingw' ncurses_sys_prefix = '/usr' ncurses_sys_dirs = [ncurses_sys_prefix + '/include/ncursesw', ncurses_sys_prefix + '/include'] # Some distros put the headers in ncursesw/, some don't foreach location : ncurses_sys_dirs f = location + '/ncurses.h' if compiler.has_header_symbol(f, 'get_wch', prefix : '#define _XOPEN_SOURCE_EXTENDED') ncurses_inc += [include_directories(location)] # ncursesw was not found. Look for plain old ncurses compiler.find_library('ncurses', required : false), compiler.find_library('panel', required : false) enable_consoleui = ncurses_libs[0].found() and ncurses_libs[1].found() conf.set('NO_WIDECHAR', true) ncurses = declare_dependency( include_directories : ncurses_inc, dependencies : ncurses_libs if force_finch and not enable_consoleui Finch will not be built. You need to install ncursesw (or ncurses) and its development headers. #conf.set('HAVE_WCWIDTH', compiler.has_function('wcwidth')) ####################################################################### # Check for LibXML2 (required) ####################################################################### libxml = dependency('libxml-2.0', version : '>= 2.6.0') if libxml.version().version_compare('<2.6.18') message('Versions of libxml2 < 2.6.18 may contain bugs that could cause XMPP messages to be discarded.') ####################################################################### # Check for JSON-GLib (required) ####################################################################### json = dependency('json-glib-1.0', version : '>= 0.14.0') ####################################################################### ####################################################################### enable_gst = get_option('gstreamer') gstreamer = dependency('gstreamer-1.0', required : force_deps) conf.set('USE_GSTREAMER', true) ####################################################################### # Check for GStreamer Video ####################################################################### enable_gstvideo = enable_gst and get_option('gstreamer-video') gstreamer_video = dependency('gstreamer-video-1.0', if gstreamer_video.found() conf.set('USE_GSTVIDEO', true) ####################################################################### ####################################################################### if get_option('farstream') farstream = dependency('farstream-0.2', version : '>= 0.2.7', enable_farstream = farstream.found() ####################################################################### # Check for Voice and Video support ####################################################################### if enable_gst and enable_gstvideo and enable_farstream Dependencies for voice/video were not met. Install the necessary gstreamer and farstream packages first. Or use -Dvv=false if you do not need voice/video support. ####################################################################### # Check for Raw data streams support in Farstream ####################################################################### gstreamer_app = dependency('gstreamer-app-1.0', conf.set('USE_GSTAPP', true) conf.set('HAVE_MEDIA_APPLICATION', true) ####################################################################### # Check for Internationalized Domain Name support ####################################################################### idn = dependency('libidn', version : '>= 0.0.0', required : force_deps) conf.set('USE_IDN', idn.found()) ####################################################################### # Check for Meanwhile headers (for Sametime) ####################################################################### if get_option('meanwhile') meanwhile = dependency('meanwhile', version : ['>= 1.0.0', '< 2.0.0'], required : force_deps) enable_meanwhile = meanwhile.found() ####################################################################### # Check for Native Avahi headers (for Bonjour) ####################################################################### enable_avahi = get_option('avahi') if enable_avahi and IS_WIN32 # Attempt to autodetect Avahi avahi_client = dependency('avahi-client', required : false) avahi_glib = dependency('avahi-glib', required : false) if avahi_client.found() and avahi_glib.found() avahi = [avahi_client, avahi_glib] avahi development package not found. Use -Davahi=false if you do not need avahi (Bonjour) support. ####################################################################### # Check for SILC client includes and libraries ####################################################################### silc = dependency('silcclient', version : '>= 1.1', required : false) # SILC Toolkit >= 1.0.1 has a new MIME API conf.set('HAVE_SILCMIME_H', true) SILC development package not found. Use -Dsilc=false if you do not need SILC support. ####################################################################### # Check for Gadu-Gadu protocol library (libgadu) ####################################################################### enable_libgadu = get_option('libgadu') libgadu = dependency('libgadu', version : '>= 1.12.0', required : false) have_libgadu = libgadu.found() if not compiler.has_function('gg_is_gpl_compliant', dependencies : libgadu) libgadu is not compatible with the GPL when compiled with OpenSSL support. To link against libgadu, please recompile it using: ./configure --with-openssl=no Then rerun this Meson build if not have_libgadu and force_deps Libgadu development headers not found. Use -Dlibgadu=false if you do not need GG (GaduGadu) support. DEFAULT_PRPLS = ['bonjour', 'facebook', 'gg', 'irc', 'jabber', 'novell', 'oscar', 'sametime', 'silc', 'simple', 'zephyr'] ALL_PRPLS = DEFAULT_PRPLS + ['null'] dynamic_list = get_option('dynamic-prpls').split(',') static_list = get_option('static-prpls').split(',') if (static_list != [''] and static_list != []) and dynamic_list == ['all'] if static_list == ['all'] static_list = DEFAULT_PRPLS foreach prpl : static_list # The list was empty; do nothing. elif prpl == 'sametime' and not enable_meanwhile elif prpl == 'bonjour' and not enable_avahi elif prpl == 'silc' and not have_silc elif prpl == 'gg' and not have_libgadu elif prpl == 'zephyr' and IS_WIN32 foreach prpl : STATIC_PRPLS # Ugly special case for 'libsilcpurple.la': STATIC_LINK_LIBS.append('\$(top_builddir)/libpurple/protocols/@1@/lib@1@purple.la'.format(meson.build_root(), prpl)) # FIXME: Shouldn't be libtool: STATIC_LINK_LIBS.append('\$(top_builddir)/libpurple/protocols/@1@/lib@1@.la'.format(meson.build_root(), prpl)) extern_load.append('extern gboolean @0@_plugin_load();'.format(prpl)) load_proto.append('@0@_plugin_load();'.format(prpl)) extern_unload.append('extern gboolean @0@_plugin_unload();'.format(prpl)) unload_proto.append('@0@_plugin_unload();'.format(prpl)) STATIC_BONJOUR = STATIC_PRPLS.contains('bonjour') STATIC_FACEBOOK = STATIC_PRPLS.contains('facebook') STATIC_GG = STATIC_PRPLS.contains('gg') STATIC_IRC = STATIC_PRPLS.contains('irc') STATIC_JABBER = STATIC_PRPLS.contains('jabber') STATIC_NOVELL = STATIC_PRPLS.contains('novell') STATIC_OSCAR = STATIC_PRPLS.contains('oscar') or STATIC_PRPLS.contains('aim') or STATIC_PRPLS.contains('icq') STATIC_SAMETIME = STATIC_PRPLS.contains('sametime') STATIC_SILC = STATIC_PRPLS.contains('silc') STATIC_SIMPLE = STATIC_PRPLS.contains('simple') STATIC_ZEPHYR = STATIC_PRPLS.contains('zephyr') conf.set('STATIC_PROTO_LOAD', ' static void static_proto_load(void) { ' + ' '.join(load_proto) + ' }') conf.set('STATIC_PROTO_UNLOAD', ' '.join(extern_unload) + ' static void static_proto_unload(void) { ' + ' '.join(unload_proto) + ' }') if dynamic_list == ['all'] dynamic_list = DEFAULT_PRPLS foreach prpl : dynamic_list # The list was empty; do nothing. elif prpl == 'sametime' and not enable_meanwhile elif prpl == 'bonjour' and not enable_avahi elif prpl == 'silc' and not have_silc elif prpl == 'gg' and not have_libgadu elif prpl == 'zephyr' and IS_WIN32 DYNAMIC_BONJOUR = DYNAMIC_PRPLS.contains('bonjour') DYNAMIC_FACEBOOK = DYNAMIC_PRPLS.contains('facebook') DYNAMIC_GG = DYNAMIC_PRPLS.contains('gg ') DYNAMIC_IRC = DYNAMIC_PRPLS.contains('irc') DYNAMIC_JABBER = DYNAMIC_PRPLS.contains('jabber') DYNAMIC_NOVELL = DYNAMIC_PRPLS.contains('novell') DYNAMIC_NULL = DYNAMIC_PRPLS.contains('null') DYNAMIC_OSCAR = DYNAMIC_PRPLS.contains('oscar') or DYNAMIC_PRPLS.contains('aim') or DYNAMIC_PRPLS.contains('icq') DYNAMIC_SAMETIME = DYNAMIC_PRPLS.contains('sametime') DYNAMIC_SILC = DYNAMIC_PRPLS.contains('silc') DYNAMIC_SIMPLE = DYNAMIC_PRPLS.contains('simple') DYNAMIC_ZEPHYR = DYNAMIC_PRPLS.contains('zephyr') conf.set('HAVE_SYS_UTSNAME_H', compiler.has_header('sys/utsname.h')) compiler.has_function('uname')) '-DPURPLE_DISABLE_DEPRECATED', '-DPIDGIN_DISABLE_DEPRECATED', '-DFINCH_DISABLE_DEPRECATED', '-DGNT_DISABLE_DEPRECATED', if compiler.get_id() == 'gcc' # If it's set after the warning CFLAGS in the compiler invocation, it counteracts the -Wno... flags. # This leads to warnings we don't want. # CFLAGS=`echo $CFLAGS |$sedpath 's/-Wall//'` # ENABLE WARNINGS SUPPORTED BY THE VERSION OF GCC IN USE # Consider adding -Wbad-function-cast. # This leads to spurious warnings using GPOINTER_TO_INT(), et al. directly on a function call. # We'd need an intermediate variable. '-Wdeclaration-after-statement', '-Werror-implicit-function-declaration', '-Wextra -Wno-unused-parameter', '-Werror=format-security', '-Wmissing-declarations', if compiler.has_argument(newflag) add_project_arguments(newflag, language : 'c') # AC_MSG_CHECKING(for FORTIFY_SOURCE support) # AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <features.h>]], [[ # #if !(__GNUC_PREREQ (4, 1) \ # || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (4, 0)) \ # || (defined __GNUC_RH_RELEASE__ && __GNUC_PREREQ (3, 4) \ # && __GNUC_MINOR__ == 4 \ # && (__GNUC_PATCHLEVEL__ > 2 \ # || (__GNUC_PATCHLEVEL__ == 2 && __GNUC_RH_RELEASE__ >= 8)))) # #error No FORTIFY_SOURCE support # DEBUG_CFLAGS='$DEBUG_CFLAGS -Wp,-D_FORTIFY_SOURCE=2' add_project_arguments('-features=extensions', language : 'c') pidginpath = find_program('pidgin', required : false) if get_option('glib-errors-trace') if compiler.get_id() == 'clang' error('--enable-glib-errors-trace doesn\'t work with clang') conf.set('ENABLE_GLIBTRACE', true) add_project_arguments('-rdynamic', language : 'c') ####################################################################### # Check for D-Bus libraries ####################################################################### # dbus doesn't compile for win32 at the moment enable_dbus = get_option('dbus') and not IS_WIN32 dbus_binding_tool = find_program('dbus-binding-tool') enable_dbus = dbus_binding_tool.found() dbus = dependency('dbus-1', version : '>= 0.60', required : force_deps) dbus_glib = dependency('dbus-glib-1', version : '>= 0.60', required : force_deps) enable_dbus = dbus.found() and dbus_glib.found() conf.set('HAVE_DBUS', true) ####################################################################### # Check for Unity and Messaging Menu # Remove when Ubuntu 16.04 is EOL ####################################################################### enable_unity = get_option('unity-integration') dependency('unity', version : '>= 6.8'), dependency('messaging-menu', version : '>= 12.10') conf.set('USES_MM_CHAT_SECTION', 'X-MessagingMenu-UsesChatSection=true') conf.set('USES_MM_CHAT_SECTION', '') ####################################################################### # Check for Secret Service headers ####################################################################### enable_secret_service = get_option('secret-service') secretservice = dependency('libsecret-1', required : force_deps) enable_secret_service = false ####################################################################### # Check for GNOME Keyring headers ####################################################################### enable_gnome_keyring = get_option('gnome-keyring') and not IS_WIN32 gnome_keyring = dependency('gnome-keyring-1', required : force_deps) conf.set('HAVE_GNOMEKEYRING', true) enable_gnome_keyring = false ####################################################################### # Check for KWallet headers ####################################################################### enable_kwallet = get_option('kwallet') and not IS_WIN32 # Ensure C++ compiler works cxx_compiler = meson.get_compiler('cpp') qt4 = dependency('qt4', modules : 'Core', required : force_deps) enable_kwallet = qt4.found() # AC_MSG_CHECKING([for metaobject compiler]) # MOC=`$PKG_CONFIG --variable=moc_location QtCore` # if test -z '$with_kwallet_includes' || test -z '$with_kwallet_libs'; then # AC_CHECK_PROG(KDE4_CONFIG, kde4-config, kde4-config, no) # if test 'x$KDE4_CONFIG' = 'xno'; then # if test 'x$force_deps' = 'xyes'; then #kde4-config not found. $KDE4_CONFIG #Use -Dkwallet=false if you do not need KWallet support. # if test 'x$KDE4_CONFIG' != 'xno'; then # KWALLET_CXXFLAGS='$QT4_CFLAGS -I`$KDE4_CONFIG --path include`' # CPPFLAGS='$CPPFLAGS $KWALLET_CXXFLAGS' # AC_CHECK_HEADER([kwallet.h], , [ # if test 'x$force_deps' = 'xyes'; then #KWallet development headers not found. #Use -Dkwallet=false if you do not need KWallet support. # AC_MSG_CHECKING([for KWallet libraries]) # if test 'x$KDE4_CONFIG' != 'xno'; then # KWALLET_LIBS='-L`$KDE4_CONFIG --install lib`/kde4/devel -lkdeui' # KWALLET_LIBS='$KWALLET_LIBS' # LIBS='$LIBS $KWALLET_LIBS $QT4_LIBS' # AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <kwallet.h>], # [KWallet::Wallet::LocalWallet();])], [AC_MSG_RESULT([yes])], # if test 'x$force_deps' = 'xyes'; then #KWallet development libraries not found. #Use -Dkwallet=false if you do not need KWallet support. ####################################################################### # Check for GPlugin 0.0.17 ####################################################################### gplugin = dependency('gplugin', version : '>= 0.0.17') # GPLUGIN_REQ sets pkg-config requirements in the .pc file pkg_conf.set('GPLUGIN_REQ', ', gplugin') enable_introspection = dependency('gobject-introspection-1.0', version : '>= 1.30.0', required : false).found() enable_introspection = false conf.set('ENABLE_INTROSPECTION', true) ####################################################################### ####################################################################### # Python scripts are used to auto-generate about 3000 lines of C # and XML code that wraps (part of) the existing API so that # it is now accessible through D-Bus. if enable_dbus or enable_consoleui if meson.version().version_compare('>=0.38.0') python3_mod = import('python3') python = python3_mod.find_python() python = find_program('python3') # Check for Python headers (currently useful only for libgnt) python_dep = dependency('python3') conf.set('USE_PYTHON', python_dep.found()) ####################################################################### ####################################################################### ssl_certificates_dir = get_option('system-ssl-certs') SSL_CERTIFICATES_DIR = '' if ssl_certificates_dir != '' if run_command('test', '-d', ssl_certificates_dir).returncode() != 0 message(ssl_certificates_dir + ' does not exist. It may be OK when cross-compiling, but please make sure about it.') error(ssl_certificates_dir + ' does not exist, if this is the correct location please make sure that it exists.') SSL_CERTIFICATES_DIR = ssl_certificates_dir if SSL_CERTIFICATES_DIR != '' conf.set_quoted('SSL_CERTIFICATES_DIR', SSL_CERTIFICATES_DIR) INSTALL_SSL_CERTIFICATES = SSL_CERTIFICATES_DIR == '' conf.set('PURPLE_PLUGINS', 1) conf.set('PLUGINS_DEFINE', '#define PURPLE_PLUGINS 1') conf.set('PLUGINS_DEFINE', '#undef PURPLE_PLUGINS') ####################################################################### # Check for Nettle (Crypto Library) ####################################################################### enable_nettle = get_option('nettle') nettle = dependency('nettle', version : '>= 3.0') enable_nettle = nettle.found() conf.set('HAVE_NETTLE', enable_nettle) if not enable_nettle and force_deps Nettle development headers not found Use -Dnettle=false if you do not need it. ####################################################################### # Check for Cyrus-SASL (for xmpp/irc) ####################################################################### foreach func : ['snprintf', 'connect'] conf.set('HAVE_' + func.to_upper(), compiler.has_function(func)) enable_cyrus_sasl = get_option('cyrus-sasl') if compiler.has_function('sasl_client_init', args : '-lsasl2') conf.set('HAVE_CYRUS_SASL', true) sasl = declare_dependency(link_args : '-lsasl2') error('Cyrus SASL library not found') enable_cyrus_sasl = false ####################################################################### # Check for Kerberos (for Zephyr) ####################################################################### conf.set('ZEPHYR_INT32', 'long') kerberos = get_option('krb4') # KRB4_CFLAGS='-I${kerberos}/include' # if test -d '$kerberos/include/kerberosIV' ; then # KRB4_CFLAGS='$KRB4_CFLAGS -I${kerberos}/include/kerberosIV' # KRB4_LDFLAGS='-L${kerberos}/lib' elif run_command('test', '-d', '/usr/local/include/kerberosIV').returncode() == 0 # KRB4_CFLAGS='-I/usr/local/include/kerberosIV' elif run_command('test', '-d', '/usr/include/kerberosIV').returncode() == 0 # KRB4_CFLAGS='-I/usr/include/kerberosIV' conf.set('ZEPHYR_USES_KERBEROS', true) # AC_CHECK_LIB(krb4, krb_rd_req, # [KRB4_LIBS='-lkrb4 -ldes425 -lkrb5 -lk5crypto -lcom_err'], # [AC_CHECK_LIB(krb, krb_rd_req, # [KRB4_LIBS='-lkrb -ldes'], # [AC_MSG_ERROR([Kerberos 4 libraries not found])], # -ldes425 -lkrb5 -lk5crypto -lcom_err) # AC_CHECK_FUNCS(krb_set_key krb_rd_req krb_get_lrealm) # AC_CHECK_FUNCS(krb_get_err_text krb_log) ####################################################################### # Check for external libzephyr ####################################################################### zephyr = get_option('zephyr') ext_zephyr = dependency('zephyr', required : force_deps) zephyr = ext_zephyr.found() EXTERNAL_LIBZEPHYR = zephyr conf.set('LIBZEPHYR_EXT', EXTERNAL_LIBZEPHYR) #AC_MSG_CHECKING(for me pot o' gold) foreach func : ['gethostid', 'timegm'] conf.set('HAVE_' + func.to_upper(), compiler.has_function(func)) 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() conf.set('HAVE_' + header.to_upper().underscorify(), compiler.has_header(header)) # sys/sysctl.h on OpenBSD 4.2 requires sys/param.h # sys/sysctl.h on FreeBSD requires sys/types.h have_sys_param_h = compiler.has_header('sys/param.h') conf.set('HAVE_SYS_PARAM_H', have_sys_param_h) conf.set('HAVE_SYS_SYSCTL_H', compiler.has_header('sys/sysctl.h', prefix : prefix)) conf.set('HAVE_SYS_SOCKET_H', compiler.has_header('sys/socket.h')) #AC_VAR_TIMEZONE_EXTERNALS conf.set('HAVE_TM_GMTOFF', compiler.has_member('struct tm', 'tm_gmtoff', prefix : '#include<time.h>')) ####################################################################### # Disable pixmap installation ####################################################################### INSTALL_PIXMAPS = get_option('pixmaps-install') ####################################################################### # Tweak status tray icon installation directory ####################################################################### ENABLE_TRAYCOMPAT = get_option('trayicon-compat') ENABLE_DOC = get_option('doc') if meson.version().version_compare('<0.41.2') error('Meson 0.41.2 or newer is required to build documentation.') enable_debug = get_option('debug') conf.set('DEBUG', enable_debug) # So that config.h may be found. toplevel_inc = include_directories('.') configure_file(output : 'config.h', message('pidgin ' + purple_display_version) message('Build GTK+ UI................. : ' + get_option('gtkui').to_string()) message('Build console UI.............. : ' + enable_consoleui.to_string()) message('Build for X11................. : ' + with_x.to_string()) message('Enable Gestures............... : ' + enable_gestures.to_string()) message('Protocols to build dynamically : @0@'.format(DYNAMIC_PRPLS)) message('Protocols to link statically.. : @0@'.format(STATIC_PRPLS)) message('Build with GStreamer support.. : ' + enable_gst.to_string()) message('Build with D-Bus support...... : ' + enable_dbus.to_string()) message('Build with voice and video.... : ' + enable_vv.to_string()) message('Build with GNU Libidn......... : ' + get_option('idn').to_string()) if SSL_CERTIFICATES_DIR != '' message('SSL CA certificates directory. : ' + SSL_CERTIFICATES_DIR) message('Build with Nettle support..... : ' + enable_nettle.to_string()) message('Build with Cyrus SASL support. : ' + enable_cyrus_sasl.to_string()) message('Use kerberos 4 with zephyr.... : ' + kerberos.to_string()) message('Use external libzephyr........ : ' + zephyr.to_string()) message('Install pixmaps............... : ' + INSTALL_PIXMAPS.to_string()) message('Old tray icon compatibility... : ' + ENABLE_TRAYCOMPAT.to_string()) message('Install translations.......... : ' + INSTALL_I18N.to_string()) message('Has you....................... : yes') message('Build with Enchant support.... : ' + use_enchant.to_string()) message('Build with GCR widgets........ : ' + enable_gcr.to_string()) message('Build Unity integration plugin.: ' + enable_unity.to_string()) message('Build with GNOME Keyring...... : ' + enable_gnome_keyring.to_string()) message('Build with KWallet............ : ' + enable_kwallet.to_string()) message('Build with Secret Service..... : ' + enable_secret_service.to_string()) message('Build with plugin support..... : ' + PLUGINS.to_string()) message('Enable Introspection...........: ' + enable_introspection.to_string()) message('Win32 directory structure..... : ' + get_option('win32-dirs')) message('Print debugging messages...... : ' + enable_debug.to_string()) message('Generate documentation........ : ' + ENABLE_DOC.to_string()) bindir = join_paths(get_option('prefix'), get_option('bindir')) message('Pidgin will be installed in @0@.'.format(bindir)) message('Warning: You have an old copy of Pidgin at @0@.'.format(pidginpath.path())) message('Warning: You have disabled the installation of pixmap data, but Pidgin') message('still requires installed pixmaps. Be sure you know what you are doing.') message('Warning: You have disabled the building and installation of translation') message('data. This will prevent building Pidgin desktop files.') message('Be sure you know what you are doing.') message('configure complete, now type \'ninja\'')