Daniel J Walsh | 66d0760 | 2009-09-16 16:58:12 -0400 | [diff] [blame] | 1 | function except() { |
| 2 | case $1 in |
| 3 | selinux_file_context_cmp) # ignore |
| 4 | ;; |
| 5 | *) |
| 6 | echo " |
| 7 | %exception $1 { |
Nicolas Iooss | 91cd460 | 2019-11-11 11:11:13 +0100 | [diff] [blame] | 8 | \$action |
Daniel J Walsh | 66d0760 | 2009-09-16 16:58:12 -0400 | [diff] [blame] | 9 | if (result < 0) { |
| 10 | PyErr_SetFromErrno(PyExc_OSError); |
Nicolas Iooss | 79db6da | 2016-11-14 22:57:12 +0100 | [diff] [blame] | 11 | SWIG_fail; |
Daniel J Walsh | 66d0760 | 2009-09-16 16:58:12 -0400 | [diff] [blame] | 12 | } |
| 13 | } |
| 14 | " |
| 15 | ;; |
| 16 | esac |
| 17 | } |
Nicolas Iooss | 5815cc9 | 2019-11-11 10:49:37 +0100 | [diff] [blame] | 18 | if ! ${CC:-gcc} -x c -c -I../include -o temp.o - -aux-info temp.aux < ../include/selinux/selinux.h |
Nicolas Iooss | db17f12 | 2016-11-14 22:57:11 +0100 | [diff] [blame] | 19 | then |
| 20 | # clang does not support -aux-info so fall back to gcc |
Nicolas Iooss | 5815cc9 | 2019-11-11 10:49:37 +0100 | [diff] [blame] | 21 | gcc -x c -c -I../include -o temp.o - -aux-info temp.aux < ../include/selinux/selinux.h |
Nicolas Iooss | db17f12 | 2016-11-14 22:57:11 +0100 | [diff] [blame] | 22 | fi |
Joshua Brindle | 95d8143 | 2009-09-24 13:46:12 -0400 | [diff] [blame] | 23 | for i in `awk '/<stdin>.*extern int/ { print $6 }' temp.aux`; do except $i ; done |
Nicolas Iooss | 5815cc9 | 2019-11-11 10:49:37 +0100 | [diff] [blame] | 24 | rm -f -- temp.aux temp.o |