2016-12-20 23:37:24 +01:00
|
|
|
configure_file(input : 'glibconfig.h.in', output : 'glibconfig.h',
|
|
|
|
install : true,
|
2016-12-09 20:30:22 +01:00
|
|
|
install_dir : join_paths(get_option('libdir'), 'glib-2.0/include'),
|
2016-12-20 23:37:24 +01:00
|
|
|
configuration : glibconfig_conf)
|
2013-08-07 22:41:12 +02:00
|
|
|
|
|
|
|
subdir('libcharset')
|
2017-07-21 15:03:05 +02:00
|
|
|
if not use_system_pcre
|
2016-12-20 23:37:24 +01:00
|
|
|
subdir('pcre')
|
|
|
|
endif
|
2017-07-17 09:51:54 +02:00
|
|
|
if have_good_vsnprintf and have_good_snprintf
|
|
|
|
gnulib_lib = []
|
|
|
|
else
|
|
|
|
subdir('gnulib')
|
|
|
|
endif
|
2013-08-07 22:41:12 +02:00
|
|
|
|
2016-03-07 12:13:24 +01:00
|
|
|
glib_headers = [
|
|
|
|
'glib.h',
|
|
|
|
'glib-unix.h',
|
|
|
|
'glib-object.h',
|
|
|
|
]
|
2016-12-09 20:30:22 +01:00
|
|
|
install_headers(glib_headers, subdir : 'glib-2.0')
|
2016-03-07 12:13:24 +01:00
|
|
|
|
|
|
|
glib_deprecated_headers = [
|
|
|
|
'deprecated/gallocator.h',
|
|
|
|
'deprecated/gcache.h',
|
|
|
|
'deprecated/gcompletion.h',
|
|
|
|
'deprecated/gmain.h',
|
|
|
|
'deprecated/grel.h',
|
|
|
|
'deprecated/gthread.h',
|
|
|
|
]
|
2016-12-09 20:30:22 +01:00
|
|
|
install_headers(glib_deprecated_headers, subdir : 'glib-2.0/glib/deprecated')
|
2016-03-07 12:13:24 +01:00
|
|
|
|
|
|
|
glib_sub_headers = [
|
|
|
|
'glib-autocleanups.h',
|
|
|
|
'galloca.h',
|
|
|
|
'garray.h',
|
|
|
|
'gasyncqueue.h',
|
|
|
|
'gatomic.h',
|
|
|
|
'gbacktrace.h',
|
|
|
|
'gbase64.h',
|
|
|
|
'gbitlock.h',
|
|
|
|
'gbookmarkfile.h',
|
|
|
|
'gbytes.h',
|
|
|
|
'gcharset.h',
|
|
|
|
'gchecksum.h',
|
|
|
|
'gconvert.h',
|
|
|
|
'gdataset.h',
|
|
|
|
'gdate.h',
|
|
|
|
'gdatetime.h',
|
|
|
|
'gdir.h',
|
|
|
|
'genviron.h',
|
|
|
|
'gerror.h',
|
|
|
|
'gfileutils.h',
|
|
|
|
'ggettext.h',
|
|
|
|
'ghash.h',
|
|
|
|
'ghmac.h',
|
|
|
|
'ghook.h',
|
|
|
|
'ghostutils.h',
|
|
|
|
'gi18n.h',
|
|
|
|
'gi18n-lib.h',
|
|
|
|
'giochannel.h',
|
|
|
|
'gkeyfile.h',
|
|
|
|
'glist.h',
|
|
|
|
'gmacros.h',
|
|
|
|
'gmain.h',
|
|
|
|
'gmappedfile.h',
|
|
|
|
'gmarkup.h',
|
|
|
|
'gmem.h',
|
|
|
|
'gmessages.h',
|
|
|
|
'gnode.h',
|
|
|
|
'goption.h',
|
|
|
|
'gpattern.h',
|
|
|
|
'gpoll.h',
|
|
|
|
'gprimes.h',
|
|
|
|
'gqsort.h',
|
|
|
|
'gquark.h',
|
|
|
|
'gqueue.h',
|
|
|
|
'grand.h',
|
|
|
|
'gregex.h',
|
|
|
|
'gscanner.h',
|
|
|
|
'gsequence.h',
|
|
|
|
'gshell.h',
|
|
|
|
'gslice.h',
|
|
|
|
'gslist.h',
|
|
|
|
'gspawn.h',
|
|
|
|
'gstdio.h',
|
|
|
|
'gstrfuncs.h',
|
|
|
|
'gtestutils.h',
|
|
|
|
'gstring.h',
|
|
|
|
'gstringchunk.h',
|
|
|
|
'gthread.h',
|
|
|
|
'gthreadpool.h',
|
|
|
|
'gtimer.h',
|
|
|
|
'gtimezone.h',
|
|
|
|
'gtrashstack.h',
|
|
|
|
'gtree.h',
|
|
|
|
'gtypes.h',
|
2017-05-22 12:07:19 +02:00
|
|
|
'guuid.h',
|
2016-03-07 12:13:24 +01:00
|
|
|
'gunicode.h',
|
|
|
|
'gurifuncs.h',
|
|
|
|
'gutils.h',
|
|
|
|
'gvarianttype.h',
|
|
|
|
'gvariant.h',
|
|
|
|
'gversion.h',
|
|
|
|
'gversionmacros.h',
|
|
|
|
'gwin32.h',
|
|
|
|
'gprintf.h',
|
|
|
|
]
|
2016-12-09 20:30:22 +01:00
|
|
|
install_headers(glib_sub_headers, subdir : 'glib-2.0/glib')
|
2016-03-07 12:13:24 +01:00
|
|
|
|
2013-08-07 22:41:12 +02:00
|
|
|
deprecated_sources = [
|
2016-12-09 20:30:22 +01:00
|
|
|
'deprecated/gallocator.c',
|
|
|
|
'deprecated/gcache.c',
|
|
|
|
'deprecated/gcompletion.c',
|
|
|
|
'deprecated/grel.c',
|
|
|
|
'deprecated/gthread-deprecated.c'
|
|
|
|
]
|
2013-08-07 22:41:12 +02:00
|
|
|
|
|
|
|
glib_sources = [
|
2016-12-09 20:30:22 +01:00
|
|
|
'garray.c',
|
|
|
|
'gasyncqueue.c',
|
|
|
|
'gatomic.c',
|
|
|
|
'gbacktrace.c',
|
|
|
|
'gbase64.c',
|
|
|
|
'gbitlock.c',
|
|
|
|
'gbookmarkfile.c',
|
|
|
|
'gbytes.c',
|
|
|
|
'gcharset.c',
|
|
|
|
'gchecksum.c',
|
|
|
|
'gconvert.c',
|
|
|
|
'gdataset.c',
|
|
|
|
'gdate.c',
|
|
|
|
'gdatetime.c',
|
|
|
|
'gdir.c',
|
|
|
|
'genviron.c',
|
|
|
|
'gerror.c',
|
|
|
|
'gfileutils.c',
|
|
|
|
'ggettext.c',
|
|
|
|
'ghash.c',
|
|
|
|
'ghmac.c',
|
|
|
|
'ghook.c',
|
|
|
|
'ghostutils.c',
|
|
|
|
'giochannel.c',
|
|
|
|
'gkeyfile.c',
|
|
|
|
'glib-init.c',
|
|
|
|
'glib-private.c',
|
|
|
|
'glist.c',
|
|
|
|
'gmain.c',
|
|
|
|
'gmappedfile.c',
|
|
|
|
'gmarkup.c',
|
|
|
|
'gmem.c',
|
|
|
|
'gmessages.c',
|
|
|
|
'gnode.c',
|
|
|
|
'goption.c',
|
|
|
|
'gpattern.c',
|
|
|
|
'gpoll.c',
|
|
|
|
'gprimes.c',
|
|
|
|
'gqsort.c',
|
|
|
|
'gquark.c',
|
|
|
|
'gqueue.c',
|
|
|
|
'grand.c',
|
|
|
|
'gregex.c',
|
|
|
|
'gscanner.c',
|
|
|
|
'gsequence.c',
|
|
|
|
'gshell.c',
|
|
|
|
'gslice.c',
|
|
|
|
'gslist.c',
|
|
|
|
'gstdio.c',
|
|
|
|
'gstrfuncs.c',
|
|
|
|
'gstring.c',
|
|
|
|
'gstringchunk.c',
|
|
|
|
'gtestutils.c',
|
|
|
|
'gthread.c',
|
|
|
|
'gthreadpool.c',
|
|
|
|
'gtimer.c',
|
|
|
|
'gtimezone.c',
|
|
|
|
'gtranslit.c',
|
|
|
|
'gtrashstack.c',
|
|
|
|
'gtree.c',
|
|
|
|
'guniprop.c',
|
|
|
|
'gutf8.c',
|
|
|
|
'gunibreak.c',
|
|
|
|
'gunicollate.c',
|
|
|
|
'gunidecomp.c',
|
|
|
|
'gurifuncs.c',
|
|
|
|
'gutils.c',
|
2017-08-25 17:05:03 +02:00
|
|
|
'guuid.c',
|
2016-12-09 20:30:22 +01:00
|
|
|
'gvariant.c',
|
|
|
|
'gvariant-core.c',
|
|
|
|
'gvariant-parser.c',
|
|
|
|
'gvariant-serialiser.c',
|
|
|
|
'gvarianttypeinfo.c',
|
|
|
|
'gvarianttype.c',
|
|
|
|
'gversion.c',
|
|
|
|
'gwakeup.c',
|
|
|
|
'gprintf.c',
|
|
|
|
]
|
2013-08-07 22:41:12 +02:00
|
|
|
|
2016-12-20 23:37:24 +01:00
|
|
|
if host_system == 'windows'
|
|
|
|
thread_src = ['gthread-win32.c']
|
|
|
|
plat_src = ['gwin32.c', 'gspawn-win32.c', 'giowin32.c']
|
|
|
|
platform_deps = [winsock2, cc.find_library('winmm')]
|
|
|
|
else
|
|
|
|
thread_src = ['gthread-posix.c']
|
|
|
|
plat_src = ['glib-unix.c', 'gspawn.c', 'giounix.c']
|
|
|
|
platform_deps = []
|
|
|
|
endif
|
|
|
|
|
2017-01-25 18:02:51 +01:00
|
|
|
if enable_dtrace
|
|
|
|
glib_dtrace_obj = dtrace_obj_gen.process('glib_probes.d')
|
|
|
|
glib_dtrace_hdr = dtrace_hdr_gen.process('glib_probes.d')
|
|
|
|
else
|
|
|
|
glib_dtrace_obj = []
|
|
|
|
glib_dtrace_hdr = []
|
|
|
|
endif
|
|
|
|
|
2017-07-25 10:28:29 +02:00
|
|
|
pcre_static_args = []
|
|
|
|
|
|
|
|
if use_pcre_static_flag
|
|
|
|
pcre_static_args = ['-DPCRE_STATIC']
|
|
|
|
endif
|
|
|
|
|
2016-12-20 23:37:24 +01:00
|
|
|
libglib = shared_library('glib-2.0',
|
2017-01-25 18:02:51 +01:00
|
|
|
glib_dtrace_obj, glib_dtrace_hdr,
|
2016-12-20 23:37:24 +01:00
|
|
|
sources : [deprecated_sources, glib_sources, thread_src, plat_src],
|
|
|
|
version : library_version,
|
|
|
|
soversion : soversion,
|
|
|
|
install : true,
|
|
|
|
# intl.lib is not compatible with SAFESEH
|
|
|
|
link_args : noseh_link_args,
|
|
|
|
include_directories : configinc,
|
2017-07-17 09:51:54 +02:00
|
|
|
link_with : [charset_lib, gnulib_lib],
|
2016-12-20 23:37:24 +01:00
|
|
|
dependencies : [pcre, thread_dep, libintl, librt] + libiconv + platform_deps,
|
2017-07-25 10:28:29 +02:00
|
|
|
c_args : ['-DG_LOG_DOMAIN="GLib"', '-DGLIB_COMPILATION'] + pcre_static_args + glib_hidden_visibility_args
|
2016-12-20 23:37:24 +01:00
|
|
|
)
|
2013-08-07 22:41:12 +02:00
|
|
|
|
2016-12-20 23:37:24 +01:00
|
|
|
libglib_dep = declare_dependency(link_with : libglib,
|
|
|
|
# We sadly need to export configinc here because everyone includes <glib/*.h>
|
|
|
|
include_directories : [configinc, glibinc])
|
2016-03-07 12:13:24 +01:00
|
|
|
|
2016-12-20 23:37:24 +01:00
|
|
|
# On Windows, glib needs a spawn helper for g_spawn* API
|
|
|
|
if host_system == 'windows'
|
|
|
|
if host_machine.cpu_family() == 'x86'
|
|
|
|
executable('gspawn-win32-helper', 'gspawn-win32-helper.c',
|
|
|
|
install : true,
|
|
|
|
gui_app : true,
|
|
|
|
c_args : ['-DHAVE_CONFIG_H=1'],
|
|
|
|
include_directories : configinc,
|
2017-03-21 17:36:22 +01:00
|
|
|
dependencies : [libintl, libglib_dep])
|
2016-12-20 23:37:24 +01:00
|
|
|
executable('gspawn-win32-helper-console', 'gspawn-win32-helper.c',
|
|
|
|
install : true,
|
|
|
|
c_args : ['-DHAVE_CONFIG_H=1', '-DHELPER_CONSOLE'],
|
|
|
|
include_directories : configinc,
|
2017-03-21 17:36:22 +01:00
|
|
|
dependencies : [libintl, libglib_dep])
|
2016-12-20 23:37:24 +01:00
|
|
|
else
|
|
|
|
executable('gspawn-win64-helper', 'gspawn-win32-helper.c',
|
|
|
|
install : true,
|
|
|
|
gui_app : true,
|
|
|
|
c_args : ['-DHAVE_CONFIG_H=1'],
|
|
|
|
include_directories : configinc,
|
2017-03-21 17:36:22 +01:00
|
|
|
dependencies : [libintl, libglib_dep])
|
2016-12-20 23:37:24 +01:00
|
|
|
executable('gspawn-win64-helper-console', 'gspawn-win32-helper.c',
|
|
|
|
install : true,
|
|
|
|
c_args : ['-DHAVE_CONFIG_H=1', '-DHELPER_CONSOLE'],
|
|
|
|
include_directories : configinc,
|
2017-03-21 17:36:22 +01:00
|
|
|
dependencies : [libintl, libglib_dep])
|
2016-12-20 23:37:24 +01:00
|
|
|
endif
|
|
|
|
else
|
2017-01-26 11:49:47 +01:00
|
|
|
gtester = executable('gtester', 'gtester.c',
|
2016-12-20 23:37:24 +01:00
|
|
|
install : true,
|
|
|
|
c_args : ['-DHAVE_CONFIG_H=1'],
|
|
|
|
include_directories : configinc,
|
|
|
|
dependencies : [libglib_dep])
|
|
|
|
endif
|
2016-03-07 12:13:24 +01:00
|
|
|
|
2016-12-06 14:07:03 +01:00
|
|
|
install_data('gtester-report', install_dir : get_option('bindir'))
|
2017-07-27 10:48:11 +02:00
|
|
|
|
2016-12-21 02:04:47 +01:00
|
|
|
install_data('glib_gdb.py', install_dir : join_paths(glib_pkgdatadir, 'gdb'))
|
2016-12-06 14:07:03 +01:00
|
|
|
|
|
|
|
gdb_conf = configuration_data()
|
|
|
|
gdb_conf.set('datadir', glib_datadir)
|
|
|
|
configure_file(
|
|
|
|
input: 'libglib-gdb.py.in',
|
|
|
|
output: 'libglib-2.0.so.@0@-gdb.py'.format(library_version),
|
|
|
|
configuration: gdb_conf,
|
|
|
|
install: true,
|
2017-07-27 10:48:11 +02:00
|
|
|
install_dir: join_paths(get_option('datadir'), 'gdb/auto-load' + get_option('libdir'))
|
2016-12-06 14:07:03 +01:00
|
|
|
)
|
|
|
|
|
2017-01-25 18:02:51 +01:00
|
|
|
if enable_systemtap
|
|
|
|
glib_stp = configure_file(input : 'glib.stp.in',
|
|
|
|
output : '@0@.stp'.format(libglib.full_path().split('/').get(-1)),
|
|
|
|
configuration : stp_cdata,
|
|
|
|
install_dir : tapset_install_dir,
|
|
|
|
install : true)
|
|
|
|
endif
|
|
|
|
|
2016-12-20 23:37:24 +01:00
|
|
|
# gtester doesn't work on native windows
|
|
|
|
if cc.get_id() != 'msvc'
|
|
|
|
subdir('tests')
|
|
|
|
endif
|