Added libt2n-gccxml.sh wrapper script to filter new, unknown gccxml -pthread option
[libt2n] / libt2n-gccxml.sh
diff --git a/libt2n-gccxml.sh b/libt2n-gccxml.sh
new file mode 100755 (executable)
index 0000000..162d792
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# Filter "-pthread" option from newer gcc versions
+# as it's currently unsupported in gccxml.
+EOO=0
+while [[ $1 ]]; do
+if ! ((EOO)); then
+  case "$1" in
+    -pthread)
+      shift
+      ;;
+    --)
+      EOO=1
+      OPTIONS+=("$1")
+      shift
+      ;;
+    *)
+      OPTIONS+=("$1")
+      shift
+      ;;
+  esac
+else
+  OPTIONS+=("$1")
+  shift
+fi
+done
+
+gccxml "${OPTIONS[@]}"