Skip to content

Commit

Permalink
libselinux,libsemanage: fall back to gcc in exception.sh
Browse files Browse the repository at this point in the history
clang does not support -aux-info option. When exception.sh is run with
CC=clang, use gcc to build selinuxswig_python_exception.i and
semanageswig_python_exception.i.

This does not solve the issue of building libselinux and libsemanage
Python wrappers on a system without gcc. However parsing the result of
"gcc -aux-info" is easier than parsing the header files so stay with
this command at least for now.

Signed-off-by: Nicolas Iooss <[email protected]>
  • Loading branch information
fishilico authored and stephensmalley committed Nov 15, 2016
1 parent f1db7b7 commit db17f12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion libselinux/src/exception.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ echo "
;;
esac
}
${CC:-gcc} -x c -c -I../include - -aux-info temp.aux < ../include/selinux/selinux.h
if ! ${CC:-gcc} -x c -c -I../include - -aux-info temp.aux < ../include/selinux/selinux.h
then
# clang does not support -aux-info so fall back to gcc
gcc -x c -c -I../include - -aux-info temp.aux < ../include/selinux/selinux.h
fi
for i in `awk '/<stdin>.*extern int/ { print $6 }' temp.aux`; do except $i ; done
rm -f -- temp.aux -.o
6 changes: 5 additions & 1 deletion libsemanage/src/exception.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ echo "
}
"
}
${CC:-gcc} -x c -c -I../include - -aux-info temp.aux < ../include/semanage/semanage.h
if ! ${CC:-gcc} -x c -c -I../include - -aux-info temp.aux < ../include/semanage/semanage.h
then
# clang does not support -aux-info so fall back to gcc
gcc -x c -c -I../include - -aux-info temp.aux < ../include/semanage/semanage.h
fi
for i in `awk '/extern int/ { print $6 }' temp.aux`; do except $i ; done
rm -f -- temp.aux -.o

0 comments on commit db17f12

Please sign in to comment.