summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-08-16 17:00:44 +0000
committermidipix <writeonce@midipix.org>2020-08-16 18:04:02 +0000
commite2f6d2dd83381f010eb626c0dfcfad075740e43b (patch)
treeeb58e3d2f33006d4643635bae1533406189350e1
parent882922f46e4971711510ccba2af77635126cce95 (diff)
downloadntux-e2f6d2dd83381f010eb626c0dfcfad075740e43b.tar.bz2
ntux-e2f6d2dd83381f010eb626c0dfcfad075740e43b.tar.xz
build system: shared library logic: support dso-implemented-as-archive targets.
-rw-r--r--Makefile.in5
-rw-r--r--sofort/ccenv/ccenv.sh14
-rw-r--r--sofort/config/config.vars3
3 files changed, 21 insertions, 1 deletions
diff --git a/Makefile.in b/Makefile.in
index aacac6a..925e6a4 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -114,6 +114,9 @@ DISABLE_STATIC = @disable_static@
USE_CUSTOM_CFGDEFS = @use_custom_cfgdefs@
USE_CUSTOM_USRDEFS = @use_custom_usrdefs@
+SHARED_LIB_CMD = @shared_lib_cmd@
+SHARED_LIB_LDFLAGS = @shared_lib_ldflags@
+
.cflags-host:
@printf '%s' "$(CFLAGS)"
@@ -160,7 +163,7 @@ src/%.o: $(SOURCE_DIR)/src/%.c $(ALL_HEADERS) host.tag tree.tag
$(CC) -c -o $@ $< $(CFLAGS_STATIC)
lib/%$(OS_LIB_PREFIXED_SUFFIX)$(VER_XYZ)$(OS_LIB_SUFFIXED_SUFFIX):
- $(CC) -shared -o $@ $^ $(LDFLAGS_SHARED)
+ $(SHARED_LIB_CMD) $@ $^ $(SHARED_LIB_LDFLAGS)
lib/%$(OS_ARCHIVE_EXT):
mkdir -p lib
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh
index 9ef0fba..f996333 100644
--- a/sofort/ccenv/ccenv.sh
+++ b/sofort/ccenv/ccenv.sh
@@ -1087,6 +1087,20 @@ ccenv_set_os_dso_format()
;;
esac
+ if [ "$ccenv_cfgtype" = 'host' ]; then
+ case "$ccenv_cc_sofmt" in
+ bigaf | aiaff )
+ mb_shared_lib_cmd='$(AR) -rcs'
+ mb_shared_lib_ldflags=
+ ;;
+
+ * )
+ mb_shared_lib_cmd='$(CC) -shared -o'
+ mb_shared_lib_ldflags='$(LDFLAGS_SHARED)'
+ ;;
+ esac
+ fi
+
ccenv_attr_epilog "$ccenv_cc_sofmt"
}
diff --git a/sofort/config/config.vars b/sofort/config/config.vars
index 524b746..6f7fbbc 100644
--- a/sofort/config/config.vars
+++ b/sofort/config/config.vars
@@ -131,3 +131,6 @@ disable_static
use_custom_cfgdefs
use_custom_usrdefs
+
+shared_lib_cmd
+shared_lib_ldflags