adjust toolchain.sh for solaris

Sun, 26 Oct 2025 15:06:34 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 26 Oct 2025 15:06:34 +0100
changeset 153
751b3209bdb0
parent 152
c42810d73d88
child 154
121757311440

adjust toolchain.sh for solaris

src/main/resources/make/toolchain.sh file | annotate | diff | comparison | revisions
test/make/toolchain.sh file | annotate | diff | comparison | revisions
--- a/src/main/resources/make/toolchain.sh	Sun Oct 05 16:32:24 2025 +0200
+++ b/src/main/resources/make/toolchain.sh	Sun Oct 26 15:06:34 2025 +0100
@@ -3,12 +3,19 @@
 # toolchain detection
 #
 
+TAIL=tail
 if isplatform "bsd" && notisplatform "openbsd"; then
   C_COMPILERS="clang gcc cc"
   CPP_COMPILERS="clang++ g++ CC"
+elif isplatform "solaris"; then
+  C_COMPILERS="cc suncc gcc clang"
+  CPP_COMPILERS="CC sunCC g++ clang++"
+  if [ -f /usr/xpg4/bin/tail ]; then
+    TAIL=/usr/xpg4/bin/tail
+  fi
 else
-  C_COMPILERS="gcc clang suncc cc"
-  CPP_COMPILERS="g++ clang++ sunCC CC"
+  C_COMPILERS="gcc clang cc"
+  CPP_COMPILERS="g++ clang++ c++"
 fi
 unset TOOLCHAIN
 unset TOOLCHAIN_NAME
@@ -129,9 +136,9 @@
 parse_toolchain_properties()
 {
   info_file="$1"
-  TOOLCHAIN=`grep '^toolchain:' "$info_file" | tail -c +11`
+  TOOLCHAIN=`grep '^toolchain:' "$info_file" | $TAIL -c +11`
   TOOLCHAIN_NAME=`echo "$TOOLCHAIN" | cut -f1 -d' ' -`
-  TOOLCHAIN_WSIZE=`grep '^wsize:' "$info_file" | tail -c +7`
+  TOOLCHAIN_WSIZE=`grep '^wsize:' "$info_file" | $TAIL -c +7`
 }
 
 detect_c_compiler()
@@ -145,7 +152,7 @@
       TOOLCHAIN_CC=$CC
       "$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
       parse_toolchain_properties "$TEMP_DIR/checkcc_out"
-      TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | tail -c +13`
+      TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | $TAIL -c +13`
       echo "$CC"
       return 0
     else
@@ -159,7 +166,7 @@
         TOOLCHAIN_CC=$COMP
         "$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
         parse_toolchain_properties "$TEMP_DIR/checkcc_out"
-        TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | tail -c +13`
+        TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | $TAIL -c +13`
         echo "$COMP"
         return 0
       fi
--- a/test/make/toolchain.sh	Sun Oct 05 16:32:24 2025 +0200
+++ b/test/make/toolchain.sh	Sun Oct 26 15:06:34 2025 +0100
@@ -3,12 +3,19 @@
 # toolchain detection
 #
 
+TAIL=tail
 if isplatform "bsd" && notisplatform "openbsd"; then
   C_COMPILERS="clang gcc cc"
   CPP_COMPILERS="clang++ g++ CC"
+elif isplatform "solaris"; then
+  C_COMPILERS="cc suncc gcc clang"
+  CPP_COMPILERS="CC sunCC g++ clang++"
+  if [ -f /usr/xpg4/bin/tail ]; then
+    TAIL=/usr/xpg4/bin/tail
+  fi
 else
-  C_COMPILERS="gcc clang suncc cc"
-  CPP_COMPILERS="g++ clang++ sunCC CC"
+  C_COMPILERS="gcc clang cc"
+  CPP_COMPILERS="g++ clang++ c++"
 fi
 unset TOOLCHAIN
 unset TOOLCHAIN_NAME
@@ -129,9 +136,9 @@
 parse_toolchain_properties()
 {
   info_file="$1"
-  TOOLCHAIN=`grep '^toolchain:' "$info_file" | tail -c +11`
+  TOOLCHAIN=`grep '^toolchain:' "$info_file" | $TAIL -c +11`
   TOOLCHAIN_NAME=`echo "$TOOLCHAIN" | cut -f1 -d' ' -`
-  TOOLCHAIN_WSIZE=`grep '^wsize:' "$info_file" | tail -c +7`
+  TOOLCHAIN_WSIZE=`grep '^wsize:' "$info_file" | $TAIL -c +7`
 }
 
 detect_c_compiler()
@@ -145,7 +152,7 @@
       TOOLCHAIN_CC=$CC
       "$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
       parse_toolchain_properties "$TEMP_DIR/checkcc_out"
-      TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | tail -c +13`
+      TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | $TAIL -c +13`
       echo "$CC"
       return 0
     else
@@ -159,7 +166,7 @@
         TOOLCHAIN_CC=$COMP
         "$TEMP_DIR/checkcc" > "$TEMP_DIR/checkcc_out"
         parse_toolchain_properties "$TEMP_DIR/checkcc_out"
-        TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | tail -c +13`
+        TOOLCHAIN_CSTD=`grep '^stdcversion:' "$TEMP_DIR/checkcc_out" | $TAIL -c +13`
         echo "$COMP"
         return 0
       fi

mercurial