blob: 33ceef804af511371d143c9c69035bf7718862c9 [file] [log] [blame]
Daniel J Walsh66d07602009-09-16 16:58:12 -04001function except() {
2case $1 in
3 selinux_file_context_cmp) # ignore
4 ;;
5 *)
6echo "
7%exception $1 {
Nicolas Iooss91cd4602019-11-11 11:11:13 +01008 \$action
Daniel J Walsh66d07602009-09-16 16:58:12 -04009 if (result < 0) {
10 PyErr_SetFromErrno(PyExc_OSError);
Nicolas Iooss79db6da2016-11-14 22:57:12 +010011 SWIG_fail;
Daniel J Walsh66d07602009-09-16 16:58:12 -040012 }
13}
14"
15;;
16esac
17}
Nicolas Iooss5815cc92019-11-11 10:49:37 +010018if ! ${CC:-gcc} -x c -c -I../include -o temp.o - -aux-info temp.aux < ../include/selinux/selinux.h
Nicolas Ioossdb17f122016-11-14 22:57:11 +010019then
20 # clang does not support -aux-info so fall back to gcc
Nicolas Iooss5815cc92019-11-11 10:49:37 +010021 gcc -x c -c -I../include -o temp.o - -aux-info temp.aux < ../include/selinux/selinux.h
Nicolas Ioossdb17f122016-11-14 22:57:11 +010022fi
Joshua Brindle95d81432009-09-24 13:46:12 -040023for i in `awk '/<stdin>.*extern int/ { print $6 }' temp.aux`; do except $i ; done
Nicolas Iooss5815cc92019-11-11 10:49:37 +010024rm -f -- temp.aux temp.o