summaryrefslogtreecommitdiff
path: root/makefiles/Makefile.gcc
diff options
context:
space:
mode:
authorCaleb Xu <calebcenter@live.com>2023-06-30 23:50:54 -0400
committerJohn-Mark Bell <jmb@netsurf-browser.org>2023-09-16 22:33:46 +0100
commit4cd825b00bd8298d3616d3b1b08fd1fbeea8d8dc (patch)
tree47a55f9b8b1e621d4f9c07c9b6e70a59b116d06f /makefiles/Makefile.gcc
parentb4ba781fe22f356d7c53b1674dff91323af61458 (diff)
downloadbuildsystem-4cd825b00bd8298d3616d3b1b08fd1fbeea8d8dc.tar.gz
buildsystem-4cd825b00bd8298d3616d3b1b08fd1fbeea8d8dc.tar.bz2
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 <calebcenter@live.com>
Diffstat (limited to 'makefiles/Makefile.gcc')
-rw-r--r--makefiles/Makefile.gcc6
1 files changed, 5 insertions, 1 deletions
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