]> The Tcpdump Group git mirrors - tcpdump/blobdiff - build_common.sh
CI: Add warning exemptions for Sun C (suncc-5.15) on Solaris 10
[tcpdump] / build_common.sh
index cd43aa93331a5d1f908b2867866a5562c077e40e..ce9349edb7710f62a15c11d81e24869272ded915 100644 (file)
@@ -63,7 +63,7 @@ print_sysinfo() {
 cc_version_nocache() {
     : "${CC:?}"
     case `basename "$CC"` in
-    gcc*|egcc*|clang*)
+    gcc*|egcc*|clang*|tcc*)
         # GCC and Clang recognize --version, print to stdout and exit with 0.
         "$CC" --version
         ;;
@@ -151,6 +151,17 @@ cc_id_nocache() {
         return
     fi
 
+    # Examples of installed packages:
+    # "tcc version 0.9.27 (x86_64 Linux)"
+    # "tcc version 0.9.27 2023-07-05 mob@5b28165 (x86_64 OpenBSD)"
+    # Example of a development version:
+    # "tcc version 0.9.28rc 2024-04-28 mob@0aca8611 (x86_64 Linux)"
+    cc_id_guessed=`echo "$cc_id_firstline" | sed 's/^.*tcc version \([0-9\.rc]*\).*$/tcc-\1/'`
+    if [ "$cc_id_firstline" != "$cc_id_guessed" ]; then
+        echo "$cc_id_guessed"
+        return
+    fi
+
     # OpenBSD default GCC:
     # "gcc (GCC) 4.2.1 20070719"
     # RedHat GCC:
@@ -187,7 +198,7 @@ discard_cc_cache() {
 # warnings as errors.
 cc_werr_cflags() {
     case `cc_id` in
-    gcc-*|clang-*)
+    gcc-*|clang-*|tcc-*)
         echo '-Werror'
         ;;
     xlc-*)
@@ -246,7 +257,7 @@ os_id() {
         #   branch;
         # * "hrevNNNNN_MMMM_KK" for a CI build of a Gerrit review;
         # * something else for a build of a working copy with the changes not
-        #   yet commited.
+        #   yet committed.
         # With this system it is not clear which version components would be
         # meaningful to relate with the build result, so let's return the
         # complete version and leave any interpretation to the user.