mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-13 15:56:23 +01:00
Merge branch 'macos-static-libintl' into 'master'
meson: Fix detection of static libintl on macOS See merge request GNOME/glib!2109
This commit is contained in:
commit
d64d46dc42
10
meson.build
10
meson.build
@ -2052,13 +2052,13 @@ endif
|
|||||||
# FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
|
# FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible
|
||||||
# implementations. This could be extended if issues are found in some platforms.
|
# implementations. This could be extended if issues are found in some platforms.
|
||||||
libintl_deps = []
|
libintl_deps = []
|
||||||
if cc.has_function('ngettext')
|
if cc.has_function('ngettext', args : osx_ldflags)
|
||||||
have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')
|
have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset')
|
||||||
else
|
else
|
||||||
# First just find the bare library.
|
# First just find the bare library.
|
||||||
libintl = cc.find_library('intl', required : false)
|
libintl = cc.find_library('intl', required : false)
|
||||||
# The bare library probably won't link without help if it's static.
|
# The bare library probably won't link without help if it's static.
|
||||||
if libintl.found() and not cc.has_function('ngettext', dependencies : libintl)
|
if libintl.found() and not cc.has_function('ngettext', args : osx_ldflags, dependencies : libintl)
|
||||||
libintl_iconv = cc.find_library('iconv', required : false)
|
libintl_iconv = cc.find_library('iconv', required : false)
|
||||||
# libintl supports different threading APIs, which may not
|
# libintl supports different threading APIs, which may not
|
||||||
# require additional flags, but it defaults to using pthreads if
|
# require additional flags, but it defaults to using pthreads if
|
||||||
@ -2068,10 +2068,10 @@ else
|
|||||||
# also defining the macros with the -pthread flag.
|
# also defining the macros with the -pthread flag.
|
||||||
libintl_pthread = cc.find_library('pthread', required : false)
|
libintl_pthread = cc.find_library('pthread', required : false)
|
||||||
# Try linking with just libiconv.
|
# Try linking with just libiconv.
|
||||||
if libintl_iconv.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_iconv])
|
if libintl_iconv.found() and cc.has_function('ngettext', args : osx_ldflags, dependencies : [libintl, libintl_iconv])
|
||||||
libintl_deps += [libintl_iconv]
|
libintl_deps += [libintl_iconv]
|
||||||
# Then also try linking with pthreads.
|
# Then also try linking with pthreads.
|
||||||
elif libintl_iconv.found() and libintl_pthread.found() and cc.has_function('ngettext', dependencies : [libintl, libintl_iconv, libintl_pthread])
|
elif libintl_iconv.found() and libintl_pthread.found() and cc.has_function('ngettext', args : osx_ldflags, dependencies : [libintl, libintl_iconv, libintl_pthread])
|
||||||
libintl_deps += [libintl_iconv, libintl_pthread]
|
libintl_deps += [libintl_iconv, libintl_pthread]
|
||||||
else
|
else
|
||||||
libintl = disabler()
|
libintl = disabler()
|
||||||
@ -2083,7 +2083,7 @@ else
|
|||||||
have_bind_textdomain_codeset = true # proxy-libintl supports it
|
have_bind_textdomain_codeset = true # proxy-libintl supports it
|
||||||
else
|
else
|
||||||
libintl_deps = [libintl] + libintl_deps
|
libintl_deps = [libintl] + libintl_deps
|
||||||
have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset',
|
have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', args : osx_ldflags,
|
||||||
dependencies : libintl_deps)
|
dependencies : libintl_deps)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user