X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fprocd.git;a=blobdiff_plain;f=make_capabilities_h.sh;fp=make_capabilities_h.sh;h=635e74099099d763cbd1dd8c3cdfe40de8918c0c;hp=0000000000000000000000000000000000000000;hb=51201235db9dad9fe1823d9de46ed90f5e160fd0;hpb=fafbf7338ec8304f2a0ec0ba76048fba2c01c07e diff --git a/make_capabilities_h.sh b/make_capabilities_h.sh new file mode 100755 index 0000000..635e740 --- /dev/null +++ b/make_capabilities_h.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +CC=$1 +[ -n "$TARGET_CC_NOCACHE" ] && CC=$TARGET_CC_NOCACHE + +echo "#include " +echo "static const char *capabilities_names[] = {" +echo "#include " | ${CC} -E -dM - | grep '#define CAP' | grep -vE '(CAP_TO|CAP_LAST_CAP)' | \ + awk '{print $3" "$2}' | sort -n | awk '{print " ["$1"]\t= \""tolower($2)"\","}' +echo "};"