Skip to content

Commit

Permalink
CHANGE: included system/build/libc info on systems where available
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Feb 10, 2023
1 parent 4179920 commit 937c972
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions make/pre-make.r3
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@ str-version: reform [
target
build-date
git-commit
get-libc-version ;; musl, glibc_2.28,... or just none
]

ver3: version ver3/4: none ; trimmed version to just 3 parts
Expand Down
18 changes: 18 additions & 0 deletions make/tools/utils.reb
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,21 @@ binary-to-c: func [comp-data /local out data] [
]
head out
]

get-libc-version: function[][
tmp: copy ""
num: system/catalog/bitsets/numeric
try [
;; we may not be sure, if the output will be in the stdout or stderr
call/output/error/shell/wait "ldd --version" :tmp :tmp
parse tmp [
"musl " to end (ver: 'musl)
|
thru "GLIBC" some SP copy ver: [some num #"." some num] to end (
ver: to word! ajoin ["glibc_" ver]
)
]
]
ver
]

2 changes: 1 addition & 1 deletion src/boot/sysobj.reb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ product: 'core
; Next four fields are updated during build:
platform: none
version: 0.0.0
build: object [os: arch: vendor: sys: abi: compiler: target: date: git: none]
build: object [os: abi: sys: arch: libc: vendor: target: compiler: date: git: none]

user: construct [
name: none
Expand Down

0 comments on commit 937c972

Please sign in to comment.