summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2020-08-16 16:05:11 +0000
committermidipix <writeonce@midipix.org>2020-08-16 18:04:03 +0000
commit89ad20a8983186128637a03757a889aa2d4a3526 (patch)
tree2fbd57b5a656d5c0b4a79eab22b94af48266289d
parent94daee90a7c18e3bd05c3b3d79e5d93329559c8d (diff)
downloadperk-89ad20a8983186128637a03757a889aa2d4a3526.tar.bz2
perk-89ad20a8983186128637a03757a889aa2d4a3526.tar.xz
build system: ccenv: added +ccenv_set_os_dso_format() [binary or archive].
-rw-r--r--sofort/ccenv/ccenv.in1
-rw-r--r--sofort/ccenv/ccenv.sh52
-rw-r--r--sofort/ccenv/ccenv.vars1
3 files changed, 54 insertions, 0 deletions
diff --git a/sofort/ccenv/ccenv.in b/sofort/ccenv/ccenv.in
index a8a07e3..61f9897 100644
--- a/sofort/ccenv/ccenv.in
+++ b/sofort/ccenv/ccenv.in
@@ -25,6 +25,7 @@ CC_HOST = @ccenv_cc_host@
CC_BITS = @ccenv_cc_bits@
CC_ARFMT = @ccenv_cc_arfmt@
+CC_SOFMT = @ccenv_cc_sofmt@
CC_BINFMT = @ccenv_cc_binfmt@
CC_UNDERSCORE = @ccenv_cc_underscore@
diff --git a/sofort/ccenv/ccenv.sh b/sofort/ccenv/ccenv.sh
index 8de220c..9ef0fba 100644
--- a/sofort/ccenv/ccenv.sh
+++ b/sofort/ccenv/ccenv.sh
@@ -1039,6 +1039,57 @@ ccenv_set_os_semantics()
ccenv_attr_epilog "$ccenv_os_semantics"
}
+ccenv_set_os_dso_format()
+{
+ ccenv_attr_prolog 'os dso format'
+
+ case "$ccenv_cc_arfmt" in
+ common )
+ ccenv_cc_sofmt="$ccenv_cc_binfmt"
+ ;;
+
+ bigaf )
+ ccenv_libgcc_s_a_header=$(od -b -N8 \
+ $($ccenv_cc -print-file-name=libgcc_s.a) \
+ 2>/dev/null \
+ | head -n1)
+
+ ccenv_libgcc_s_so_header=$(od -b -N8 \
+ $($ccenv_cc -print-file-name=libgcc_s.so) \
+ 2>/dev/null \
+ | head -n1)
+
+ if [ "$ccenv_libgcc_s_a_header" = "$ccenv_bigaf_header" ]; then
+ ccenv_cc_sofmt='bigaf'
+ elif [ "$ccenv_libgcc_s_so_header" = "$ccenv_bigaf_header" ]; then
+ ccenv_cc_sofmt='bigaf'
+ else
+ ccenv_cc_sofmt="$ccenv_cc_binfmt"
+ fi
+ ;;
+
+ aiaff )
+ ccenv_libgcc_s_a_header=$(od -b -N8 \
+ $($ccenv_cc -print-file-name=libgcc_s.a) \
+ | head -n1)
+
+ ccenv_libgcc_s_so_header=$(od -b -N8 \
+ $($ccenv_cc -print-file-name=libgcc_s.so) \
+ | head -n1)
+
+ if [ "$ccenv_libgcc_s_a_header" = "$ccenv_aiaff_header" ]; then
+ ccenv_cc_sofmt='aiaff'
+ elif [ "$ccenv_libgcc_s_so_header" = "$ccenv_aiaff_header" ]; then
+ ccenv_cc_sofmt='aiaff'
+ else
+ ccenv_cc_sofmt="$ccenv_cc_binfmt"
+ fi
+ ;;
+ esac
+
+ ccenv_attr_epilog "$ccenv_cc_sofmt"
+}
+
ccenv_set_os_dso_exrules()
{
ccenv_attr_prolog 'os dso exrules'
@@ -1335,6 +1386,7 @@ ccenv_set_toolchain_variables()
ccenv_set_os
ccenv_set_os_flags
ccenv_set_os_semantics
+ ccenv_set_os_dso_format
ccenv_set_os_dso_exrules
ccenv_set_os_dso_linkage
ccenv_set_os_dso_patterns
diff --git a/sofort/ccenv/ccenv.vars b/sofort/ccenv/ccenv.vars
index 6d9fc3a..07552af 100644
--- a/sofort/ccenv/ccenv.vars
+++ b/sofort/ccenv/ccenv.vars
@@ -25,6 +25,7 @@ ccenv_cc_host=
ccenv_cc_bits=
ccenv_cc_arfmt=
+ccenv_cc_sofmt=
ccenv_cc_binfmt=
ccenv_cc_underscore=