qa.sh: Add ncc/nccnav support
diff --git a/expat/qa.sh b/expat/qa.sh
index a2e15c4..0dce871 100755
--- a/expat/qa.sh
+++ b/expat/qa.sh
@@ -9,8 +9,10 @@
 : ${CLANG_CC:=clang}
 : ${CLANG_CXX:=clang++}
 
+: ${AR:=ar}
 : ${CC:="${CLANG_CC}"}
 : ${CXX:="${CLANG_CXX}"}
+: ${LD:=ld}
 : ${MAKE:=make}
 
 : ${BASE_FLAGS:="-pipe -Wall -Wextra -pedantic -Wno-overlength-strings"}
@@ -49,6 +51,13 @@
         # http://clang.llvm.org/docs/MemorySanitizer.html
         BASE_FLAGS+=" -fsanitize=memory -fno-omit-frame-pointer -g -O2"
         ;;
+    ncc)
+        # http://students.ceid.upatras.gr/~sxanth/ncc/
+        local CC="ncc -ncgcc -ncld -ncfabs"
+        local AR=nccar
+        local LD=nccld
+        BASE_FLAGS+=" -fPIC"
+        ;;
     undefined)
         # http://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
         BASE_FLAGS+=" -fsanitize=undefined"
@@ -56,7 +65,7 @@
         ;;
     *)
         echo "Usage:" 1>&2
-        echo "  ${0##*/} (address|coverage|memory|undefined)" 1>&2
+        echo "  ${0##*/} (address|coverage|memory|ncc|undefined)" 1>&2
         exit 1
         ;;
     esac
@@ -69,16 +78,28 @@
 
         RUN CC="${CC}" CFLAGS="${CFLAGS}" \
                 CXX="${CXX}" CXXFLAGS="${CXXFLAGS}" \
+                AR="${AR}" \
+                LD="${LD}" \
                 ./configure "$@"
 
         RUN "${MAKE}" clean all
-        RUN "${MAKE}" check run-xmltest
+
+        case "${mode}" in
+        ncc)
+            ;;
+        *)
+            RUN "${MAKE}" check run-xmltest
+            ;;
+        esac
     ) || exit 1
 
     case "${mode}" in
     coverage)
         find -name '*.gcda' | sort | xargs gcov
         ;;
+    ncc)
+        RUN nccnav ./.libs/libexpat.a.nccout
+        ;;
     esac
 }