Gitweb links:

...log 
http://git.netsurf-browser.org/buildsystem.git/shortlog/4cd825b00bd8298d3616d3b1b08fd1fbeea8d8dc
...commit 
http://git.netsurf-browser.org/buildsystem.git/commit/4cd825b00bd8298d3616d3b1b08fd1fbeea8d8dc
...tree 
http://git.netsurf-browser.org/buildsystem.git/tree/4cd825b00bd8298d3616d3b1b08fd1fbeea8d8dc

The branch, master has been updated
       via  4cd825b00bd8298d3616d3b1b08fd1fbeea8d8dc (commit)
      from  b4ba781fe22f356d7c53b1674dff91323af61458 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/buildsystem.git/commit/?id=4cd825b00bd8298d3616d3b1b08fd1fbeea8d8dc
commit 4cd825b00bd8298d3616d3b1b08fd1fbeea8d8dc
Author: Caleb Xu <[email protected]>
Commit: John-Mark Bell <[email protected]>

    makefiles: support building shared libs on Darwin
    
    On Darwin (macOS), the flags needed to create a shared
    library are different. Moreover, the extension is .dylib
    and the version portion of the soname is inserted between
    the library name and the libext, e.g. lifoo.1.2.3.dylib.
    
    Signed-off-by: Caleb Xu <[email protected]>

diff --git a/makefiles/Makefile.clang b/makefiles/Makefile.clang
index 50f8a82..bcd14e3 100644
--- a/makefiles/Makefile.clang
+++ b/makefiles/Makefile.clang
@@ -21,7 +21,12 @@ CXXSHR := -fPIC
 
 LDDBG := -g
 # Reevaluation is required here
-LDSHR = -shared -Wl,-soname,$(SONAME)
+ifeq ($(findstring darwin,$(HOST)),darwin)
+       LDSHR = -dynamiclib -install_name $(SONAME)
+else
+       LDSHR = -shared -Wl,-soname,$(SONAME)
+endif
+
 
 ARFLG := cru
 
diff --git a/makefiles/Makefile.gcc b/makefiles/Makefile.gcc
index b5119ac..4a9dff7 100644
--- a/makefiles/Makefile.gcc
+++ b/makefiles/Makefile.gcc
@@ -20,7 +20,11 @@ CXXSHR := -fPIC
 
 LDDBG := -g
 # Reevaluation is required here
-LDSHR = -shared -Wl,-soname,$(SONAME)
+ifeq ($(findstring darwin,$(HOST)),darwin)
+       LDSHR = -dynamiclib -install_name $(SONAME)
+else
+       LDSHR = -shared -Wl,-soname,$(SONAME)
+endif
 
 ARFLG := cru
 
diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools
index 112e7f8..e5504e7 100644
--- a/makefiles/Makefile.tools
+++ b/makefiles/Makefile.tools
@@ -478,7 +478,11 @@ LDFLAGS := $(LDFLAGS) $(OPTLDFLAGS)
 ifeq ($(COMPONENT_TYPE),lib-static)
   LIBEXT ?= .a
 else
-  LIBEXT ?= .so
+  ifeq ($(findstring darwin,$(HOST)),darwin)
+    LIBEXT ?= .dylib
+  else
+    LIBEXT ?= .so
+  endif
 endif
 
 # If we're building a shared library, modify the flags appropriately
diff --git a/makefiles/Makefile.top b/makefiles/Makefile.top
index caac166..0b0fe22 100644
--- a/makefiles/Makefile.top
+++ b/makefiles/Makefile.top
@@ -189,9 +189,17 @@ endif
 # Determine the output filename
 ifeq ($(findstring lib,$(COMPONENT_TYPE)),lib)
   ifeq ($(findstring lib-shared,$(COMPONENT_TYPE)),lib-shared)
-    SHAREDLIBNAME := lib$(COMPONENT)$(LIBEXT)
-    SONAME := $(SHAREDLIBNAME).$(major-version)
-    OUTPUT := $(BUILDDIR)/$(SHAREDLIBNAME).$(COMPONENT_VERSION)
+    ifeq ($(findstring darwin,$(HOST)),darwin)
+      # In macOS, shared lib filenames are of the form libfoo.dylib,
+      # libfoo.1.dylib, or libfoo.1.2.3.dylib
+      SONAME := lib$(COMPONENT).$(major-version)$(LIBEXT)
+      SHAREDLIBNAME := lib$(COMPONENT)$(LIBEXT)
+      OUTPUT := $(BUILDDIR)/lib$(COMPONENT).$(COMPONENT_VERSION)$(LIBEXT)
+    else
+      SHAREDLIBNAME := lib$(COMPONENT)$(LIBEXT)
+      SONAME := $(SHAREDLIBNAME).$(major-version)
+      OUTPUT := $(BUILDDIR)/$(SHAREDLIBNAME).$(COMPONENT_VERSION)
+    endif
   else
     OUTPUT := $(BUILDDIR)/lib$(COMPONENT)$(LIBEXT)
   endif


-----------------------------------------------------------------------

Summary of changes:
 makefiles/Makefile.clang |    7 ++++++-
 makefiles/Makefile.gcc   |    6 +++++-
 makefiles/Makefile.tools |    6 +++++-
 makefiles/Makefile.top   |   14 +++++++++++---
 4 files changed, 27 insertions(+), 6 deletions(-)

diff --git a/makefiles/Makefile.clang b/makefiles/Makefile.clang
index 50f8a82..bcd14e3 100644
--- a/makefiles/Makefile.clang
+++ b/makefiles/Makefile.clang
@@ -21,7 +21,12 @@ CXXSHR := -fPIC
 
 LDDBG := -g
 # Reevaluation is required here
-LDSHR = -shared -Wl,-soname,$(SONAME)
+ifeq ($(findstring darwin,$(HOST)),darwin)
+       LDSHR = -dynamiclib -install_name $(SONAME)
+else
+       LDSHR = -shared -Wl,-soname,$(SONAME)
+endif
+
 
 ARFLG := cru
 
diff --git a/makefiles/Makefile.gcc b/makefiles/Makefile.gcc
index b5119ac..4a9dff7 100644
--- a/makefiles/Makefile.gcc
+++ b/makefiles/Makefile.gcc
@@ -20,7 +20,11 @@ CXXSHR := -fPIC
 
 LDDBG := -g
 # Reevaluation is required here
-LDSHR = -shared -Wl,-soname,$(SONAME)
+ifeq ($(findstring darwin,$(HOST)),darwin)
+       LDSHR = -dynamiclib -install_name $(SONAME)
+else
+       LDSHR = -shared -Wl,-soname,$(SONAME)
+endif
 
 ARFLG := cru
 
diff --git a/makefiles/Makefile.tools b/makefiles/Makefile.tools
index 112e7f8..e5504e7 100644
--- a/makefiles/Makefile.tools
+++ b/makefiles/Makefile.tools
@@ -478,7 +478,11 @@ LDFLAGS := $(LDFLAGS) $(OPTLDFLAGS)
 ifeq ($(COMPONENT_TYPE),lib-static)
   LIBEXT ?= .a
 else
-  LIBEXT ?= .so
+  ifeq ($(findstring darwin,$(HOST)),darwin)
+    LIBEXT ?= .dylib
+  else
+    LIBEXT ?= .so
+  endif
 endif
 
 # If we're building a shared library, modify the flags appropriately
diff --git a/makefiles/Makefile.top b/makefiles/Makefile.top
index caac166..0b0fe22 100644
--- a/makefiles/Makefile.top
+++ b/makefiles/Makefile.top
@@ -189,9 +189,17 @@ endif
 # Determine the output filename
 ifeq ($(findstring lib,$(COMPONENT_TYPE)),lib)
   ifeq ($(findstring lib-shared,$(COMPONENT_TYPE)),lib-shared)
-    SHAREDLIBNAME := lib$(COMPONENT)$(LIBEXT)
-    SONAME := $(SHAREDLIBNAME).$(major-version)
-    OUTPUT := $(BUILDDIR)/$(SHAREDLIBNAME).$(COMPONENT_VERSION)
+    ifeq ($(findstring darwin,$(HOST)),darwin)
+      # In macOS, shared lib filenames are of the form libfoo.dylib,
+      # libfoo.1.dylib, or libfoo.1.2.3.dylib
+      SONAME := lib$(COMPONENT).$(major-version)$(LIBEXT)
+      SHAREDLIBNAME := lib$(COMPONENT)$(LIBEXT)
+      OUTPUT := $(BUILDDIR)/lib$(COMPONENT).$(COMPONENT_VERSION)$(LIBEXT)
+    else
+      SHAREDLIBNAME := lib$(COMPONENT)$(LIBEXT)
+      SONAME := $(SHAREDLIBNAME).$(major-version)
+      OUTPUT := $(BUILDDIR)/$(SHAREDLIBNAME).$(COMPONENT_VERSION)
+    endif
   else
     OUTPUT := $(BUILDDIR)/lib$(COMPONENT)$(LIBEXT)
   endif


-- 
NetSurf Project build system
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to