summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gmail.com>2018-05-31 21:47:57 +0000
committerEmmanuele Bassi <ebassi@gmail.com>2018-05-31 21:47:57 +0000
commit092ae114f2cf1f39759d59d0f5ea7c71cd0e4d30 (patch)
tree983cf8572d790f7cfc1b445c4e75c845f249d675
parent6865a69acba32e346b92c074daca6c50d94b02a6 (diff)
parent12240b3f12bc82a14ffabc58bfba81e3523a495e (diff)
downloadgdk-pixbuf-092ae114f2cf1f39759d59d0f5ea7c71cd0e4d30.tar.gz
Merge branch 'macos-build' into 'master'
Fix the macOS build See merge request GNOME/gdk-pixbuf!5
-rw-r--r--contrib/gdk-pixbuf-xlib/meson.build1
-rw-r--r--meson.build36
2 files changed, 24 insertions, 13 deletions
diff --git a/contrib/gdk-pixbuf-xlib/meson.build b/contrib/gdk-pixbuf-xlib/meson.build
index 76841183a..25fbde41c 100644
--- a/contrib/gdk-pixbuf-xlib/meson.build
+++ b/contrib/gdk-pixbuf-xlib/meson.build
@@ -21,7 +21,6 @@ gdkpixbuf_xlib = library('gdk_pixbuf_xlib-2.0',
soversion: soversion,
version: libversion,
c_args: common_cflags + gdk_pixbuf_cflags + [
- '-DHAVE_CONFIG_H',
'-DSTDC_HEADERS',
],
link_args: common_ldflags,
diff --git a/meson.build b/meson.build
index 0fdb60d9a..a989b4069 100644
--- a/meson.build
+++ b/meson.build
@@ -85,16 +85,24 @@ if cc.has_function('lrint', dependencies: mathlib_dep)
gdk_pixbuf_conf.set('HAVE_LRINT', 1)
endif
+if cc.has_function('bind_textdomain_codeset', prefix: '#include <libintl.h>')
+ gdk_pixbuf_conf.set('HAVE_BIND_TEXTDOMAIN_CODESET', 1)
+endif
+
+if cc.has_function('setrlimit', prefix: '#include <sys/time.h>\n#include <sys/resource.h>')
+ gdk_pixbuf_conf.set('HAVE_SETRLIMIT', 1)
+endif
# We use links() because sigsetjmp() is often a macro hidden behind other macros
-gdk_pixbuf_conf.set('HAVE_SIGSETJMP',
- cc.links('''#define _POSIX_SOURCE
- #include <setjmp.h>
- int main (void) {
- sigjmp_buf env;
- sigsetjmp (env, 0);
- return 0;
- }''', name: 'sigsetjmp'))
+gdk_pixbuf_conf.set10('HAVE_SIGSETJMP',
+ cc.links('''#define _POSIX_SOURCE
+ #include <setjmp.h>
+ int main (void) {
+ sigjmp_buf env;
+ sigsetjmp (env, 0);
+ return 0;
+ }''', name: 'sigsetjmp'),
+)
# Common compiler and linker flags
common_cflags = []
@@ -162,19 +170,21 @@ endif
common_cflags += cc.get_supported_arguments(test_cflags)
-# Linker flags
if host_machine.system() == 'linux'
+ # Additional linker flags
test_ldflags = ['-Wl,-Bsymbolic', '-Wl,-z,relro', '-Wl,-z,now']
if meson.version().version_compare('>= 0.46.0')
common_ldflags += cc.get_supported_link_arguments(test_ldflags)
else
common_ldflags += test_ldflags
endif
+ gdk_pixbuf_conf.set('OS_LINUX', 1)
endif
-# Maintain compatibility with autotools on macOS
if host_machine.system() == 'darwin'
+ # Maintain compatibility with autotools on macOS
common_ldflags += [ '-compatibility_version 1', '-current_version 1.0', ]
+ gdk_pixbuf_conf.set('OS_DARWIN', 1)
endif
# Dependencies
@@ -294,8 +304,9 @@ if get_option('jpeg') and not native_windows_loaders
enabled_loaders += 'jpeg'
loaders_deps += jpeg_dep
- gdk_pixbuf_conf.set('HAVE_PROGRESSIVE_JPEG',
- cc.has_function('jpeg_simple_progression', dependencies: jpeg_dep))
+ gdk_pixbuf_conf.set10('HAVE_PROGRESSIVE_JPEG',
+ cc.has_function('jpeg_simple_progression',
+ dependencies: jpeg_dep))
endif
endif
endif
@@ -367,6 +378,7 @@ endif
gdk_pixbuf_conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
configure_file(output: 'config.h', configuration: gdk_pixbuf_conf)
+add_project_arguments([ '-DHAVE_CONFIG_H=1' ], language: 'c')
root_inc = include_directories('.')