1 function except() { 2 case $1 in 3 selinux_file_context_cmp) # ignore 4 ;; 5 *) 6 echo " 7 %exception $1 { 8 \$action 9 if (result < 0) { 10 PyErr_SetFromErrno(PyExc_OSError); 11 SWIG_fail; 12 } 13 } 14 " 15 ;; 16 esac 17 } 18 if ! ${CC:-gcc} -x c -c -I../include - -aux-info temp.aux < ../include/selinux/selinux.h 19 then 20 # clang does not support -aux-info so fall back to gcc 21 gcc -x c -c -I../include - -aux-info temp.aux < ../include/selinux/selinux.h 22 fi 23 for i in `awk '/<stdin>.*extern int/ { print $6 }' temp.aux`; do except $i ; done 24 rm -f -- temp.aux -.o 25