diff options
author | midipix <writeonce@midipix.org> | 2020-08-16 16:05:11 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2020-08-16 18:04:03 +0000 |
commit | cffad07a9034f540839e0b15203e4d5936c0011e (patch) | |
tree | e1ac4531afa54e1eb32a52b2acc1190d1e933484 /sofort/ccenv/ccenv.sh | |
parent | 1e5cb41c3b9ce5ecf1adf01671c407a416ecc8be (diff) | |
download | ptycon-cffad07a9034f540839e0b15203e4d5936c0011e.tar.bz2 ptycon-cffad07a9034f540839e0b15203e4d5936c0011e.tar.xz |
build system: ccenv: added +ccenv_set_os_dso_format() [binary or archive].
Diffstat (limited to 'sofort/ccenv/ccenv.sh')
-rw-r--r-- | sofort/ccenv/ccenv.sh | 52 |
1 files changed, 52 insertions, 0 deletions
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 |