[gexiv2] Do not use linker script on darwin



commit 670b3e1d28281138bd72edb133d9cd022a8dd8e2
Author: Jens Georg <mail jensge org>
Date:   Mon Dec 25 18:41:56 2017 +0100

    Do not use linker script on darwin
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791941

 Makefile.am        |    8 +++++++-
 configure.ac       |   17 +++++++++++++++++
 gexiv2/meson.build |    6 +++++-
 3 files changed, 29 insertions(+), 2 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 9e8610b..eadfccb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -152,9 +152,15 @@ lib@PACKAGE_NAME@_la_SOURCES  = $(GEXIV2_sources) $(GEXIV2_public_HEADERS)
 lib@PACKAGE_NAME@_la_LIBADD   = $(EXIV2_LIBS) $(GLIB_LIBS)
 lib@PACKAGE_NAME@_la_CPPFLAGS = $(EXIV2_CFLAGS) $(GLIB_CFLAGS)
 
+if PLATFORM_DARWIN
+VERSION_SCRIPT_LDFLAGS=
+else
+VERSION_SCRIPT_LDFLAGS="-Wl,--version-script=$(srcdir)/gexiv2/gexiv2.map"
+endif
+
 lib@PACKAGE_NAME@_la_LDFLAGS  = \
        $(no_undefined) -export-dynamic -version-info $(GEXIV2_VERSION_INFO) \
-       -Wl,--version-script=$(srcdir)/gexiv2/gexiv2.map \
+       $(VERSION_SCRIPT_LDFLAGS) \
        $(WARN_LDFLAGS)
 
 clean-local:
diff --git a/configure.ac b/configure.ac
index 72440b2..2d9186f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -210,6 +210,23 @@ AC_MSG_RESULT([$target_or_host])
 # Check for Win32
 #################
 
+AC_MSG_CHECKING([OS X platform])
+case "$target_or_host" in
+    *-*-darwin*)
+        platform_darwin=yes
+    ;;
+    *)
+        platform_darwin=no
+    ;;
+esac
+AC_MSG_RESULT([$platform_darwin])
+AM_CONDITIONAL(PLATFORM_DARWIN, test "$platform_win32" = "yes")
+
+
+#################
+# Check for Win32
+#################
+
 AC_MSG_CHECKING([Win32 platform])
 case "$target_or_host" in
     *-*-mingw* | *-*-cygwin*)
diff --git a/gexiv2/meson.build b/gexiv2/meson.build
index 498bf21..9338601 100644
--- a/gexiv2/meson.build
+++ b/gexiv2/meson.build
@@ -35,7 +35,11 @@ install_headers(gexiv2_headers, subdir : 'gexiv2')
 
 # Static map file
 mapfile = 'gexiv2.map'
-vflag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), mapfile)
+if host_machine.system() == 'darwin'
+    vflag = ''
+else
+    vflag = '-Wl,--version-script,@0@/@1@'.format(meson.current_source_dir(), mapfile)
+endif
 
 gexiv2 = library('gexiv2',
                  ['gexiv2-metadata.cpp',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]