diff --git a/kasten/controllers/view/structures/struct2osd.in b/kasten/controllers/view/structures/struct2osd.in index 1e942b8..f7380a4 100755 --- a/kasten/controllers/view/structures/struct2osd.in +++ b/kasten/controllers/view/structures/struct2osd.in @@ -1,12 +1,18 @@ #!/bin/sh -if [ -z "`which gccxml 2> /dev/null`" ]; then - echo "You need gccxml to use this script."; - exit; +USE_CASTXML=1 + +if [ -z "`which castxml 2> /dev/null`" ]; then + USE_CASTXML=0 + + if [ -z "`which gccxml 2> /dev/null`" ]; then + echo "You need castxml or gccxml to use this script."; + exit; + fi fi; if [ -z "`which xsltproc 2> /dev/null`" ]; then - echo "You need xsltporc to use this script."; + echo "You need xsltproc to use this script."; echo "You can find it in the libxslt package."; exit; fi; @@ -25,7 +31,12 @@ GCCXML_FILE="${OSD_FILE%.*}.gcc.xml"; shift 2; STRUCTS="$@" -gccxml "$INPUT_FILE" -fxml="$GCCXML_FILE" || { echo "gccxml failed"; exit; }; +if [ ${USE_CASTXML} -eq 1 ] ; then + castxml --castxml-gccxml "$INPUT_FILE" -o "$GCCXML_FILE" || { echo "castxml failed"; exit; }; +else + gccxml "$INPUT_FILE" -fxml="$GCCXML_FILE" || { echo "gccxml failed"; exit; }; +fi + xsltproc --stringparam "structs" "$STRUCTS" "$XSL_CONVERTER" "$GCCXML_FILE" > "$OSD_FILE" || echo "xsltproc failed"; rm "$GCCXML_FILE";