Skip to content

Commit 5ec46df

Browse files
authored
Merge pull request #297 from tboox/solaris
improve envs for solaris
2 parents 8bbfd79 + c1ea7ae commit 5ec46df

File tree

4 files changed

+20
-1
lines changed

4 files changed

+20
-1
lines changed

.github/workflows/solaris.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@ jobs:
2525
with:
2626
usesh: true
2727
prepare: |
28-
pkgutil -y -i socat git gmake bash gcc4g++ || pkgutil -y -i socat git gmake bash gcc5g++ || pkg install -y developer/gcc || true
28+
# Try OpenCSW first (for older Solaris)
29+
if command -v pkgutil >/dev/null 2>&1; then
30+
pkgutil -U || true
31+
pkgutil -y -i socat git gmake bash gcc4g++ 2>/dev/null || pkgutil -y -i socat git gmake bash gcc5g++ 2>/dev/null || true
32+
fi
33+
# Try IPS (for newer Solaris)
34+
if command -v pkg >/dev/null 2>&1; then
35+
pkg install --accept developer/gcc developer/build/gnu-make developer/versioning/git || true
36+
fi
2937
run: |
3038
cd $GITHUB_WORKSPACE
3139
bash ./configure

src/tbox/platform/stdfile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
# include <unistd.h>
3737
# include <sys/select.h>
3838
# include <errno.h>
39+
# include <string.h>
3940
#endif
4041

4142
/* //////////////////////////////////////////////////////////////////////////////////////

src/xmake.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ set_languages "c99"
1313
set_configvar "_GNU_SOURCE" 1
1414
set_configvar "_REENTRANT" 1
1515

16+
# ensure POSIX/XOPEN features are available on Solaris (for setenv, unsetenv, clock_gettime, etc.)
17+
if is_plat "solaris"; then
18+
add_defines "_POSIX_C_SOURCE=200112L" "_XOPEN_SOURCE=600"
19+
fi
20+
1621
# add build modes
1722
if is_mode "debug"; then
1823
add_defines "__tb_debug__"

xmake.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ set_languages(stdc)
1212
set_configvar("_GNU_SOURCE", 1)
1313
set_configvar("_REENTRANT", 1)
1414

15+
-- ensure POSIX/XOPEN features are available on Solaris (for setenv, unsetenv, clock_gettime, etc.)
16+
if is_plat("solaris") then
17+
add_defines("_POSIX_C_SOURCE=200112L", "_XOPEN_SOURCE=600")
18+
end
19+
1520
-- add module directories
1621
add_moduledirs("xmake")
1722

0 commit comments

Comments
 (0)