Blame | Last modification | View Log | Download
#!/bin/sh# Little Utility Application to get the OpenZwave Build Configuration## You can use it in Makefiles etc as:# gcc `ozw_config --Libs` `ozw_config --Cflags` test.c -o testechoerr() { echo "$@" 1>&2; }function getValue {IFS="=: "while read -r name valuedoif [ "--"$name = $1 ]thenecho "${value//\"/}" | tr -d '\r\n'fidone <<< $inputfile}pcfile=@pkgconfigfile@key=$1if [ "$key" = "--with-pc" ]thenpcfile=$2key=$3fiif [ ! -f $pcfile ]thenechoerr "$pcfile does not exist"exit 128fiinputfile=`cat $pcfile | grep -vE '^(\s*$|#)'`if [ ! -z $key ] || [ "$key" = "--help" ]thenif [ "$key" = "--Libs" ]thenvalue="-L$(getValue "--libdir") -lopenzwave"elif [ "$key" = "--Cflags" ]thenvalue="-I$(getValue "--includedir")"elsevalue=$(getValue $key)fiif [ ! -z "$value" ]thenecho $valueelseexit 128fielseecho "OpenZWave Build Configuration Utility"echo ""echo "Options Available:"echo "--with-pc <file> - Use a Alternative pc file"echo ""echo "Get Build Variables:"IFS="=: "while read -r name valuedoecho "--${name//\"/}"done <<< $inputfilefi