23017
23023
{ (exit 1); exit 1; }; }
23021
for ac_header in selinux/selinux.h selinux/avc.h
23023
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
23024
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
23025
{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
23026
$as_echo_n "checking for $ac_header... " >&6; }
23027
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
23028
$as_echo_n "(cached) " >&6
23030
ac_res=`eval 'as_val=${'$as_ac_Header'}
23031
$as_echo "$as_val"'`
23032
{ $as_echo "$as_me:$LINENO: result: $ac_res" >&5
23033
$as_echo "$ac_res" >&6; }
23035
# Is the header compilable?
23036
{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
23037
$as_echo_n "checking $ac_header usability... " >&6; }
23038
cat >conftest.$ac_ext <<_ACEOF
23041
cat confdefs.h >>conftest.$ac_ext
23042
cat >>conftest.$ac_ext <<_ACEOF
23043
/* end confdefs.h. */
23044
$ac_includes_default
23045
#include <$ac_header>
23047
rm -f conftest.$ac_objext
23048
if { (ac_try="$ac_compile"
23049
case "(($ac_try" in
23050
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23051
*) ac_try_echo=$ac_try;;
23053
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
23054
$as_echo "$ac_try_echo") >&5
23055
(eval "$ac_compile") 2>conftest.er1
23057
grep -v '^ *+' conftest.er1 >conftest.err
23059
cat conftest.err >&5
23060
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23061
(exit $ac_status); } && {
23062
test -z "$ac_c_werror_flag" ||
23063
test ! -s conftest.err
23064
} && test -s conftest.$ac_objext; then
23065
ac_header_compiler=yes
23067
$as_echo "$as_me: failed program was:" >&5
23068
sed 's/^/| /' conftest.$ac_ext >&5
23070
ac_header_compiler=no
23073
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23074
{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
23075
$as_echo "$ac_header_compiler" >&6; }
23077
# Is the header present?
23078
{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
23079
$as_echo_n "checking $ac_header presence... " >&6; }
23080
cat >conftest.$ac_ext <<_ACEOF
23083
cat confdefs.h >>conftest.$ac_ext
23084
cat >>conftest.$ac_ext <<_ACEOF
23085
/* end confdefs.h. */
23086
#include <$ac_header>
23088
if { (ac_try="$ac_cpp conftest.$ac_ext"
23089
case "(($ac_try" in
23090
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23091
*) ac_try_echo=$ac_try;;
23093
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
23094
$as_echo "$ac_try_echo") >&5
23095
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
23097
grep -v '^ *+' conftest.er1 >conftest.err
23099
cat conftest.err >&5
23100
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23101
(exit $ac_status); } >/dev/null && {
23102
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
23103
test ! -s conftest.err
23105
ac_header_preproc=yes
23107
$as_echo "$as_me: failed program was:" >&5
23108
sed 's/^/| /' conftest.$ac_ext >&5
23110
ac_header_preproc=no
23113
rm -f conftest.err conftest.$ac_ext
23114
{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
23115
$as_echo "$ac_header_preproc" >&6; }
23117
# So? What about this header?
23118
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
23120
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
23121
$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
23122
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
23123
$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
23124
ac_header_preproc=yes
23127
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
23128
$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
23129
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
23130
$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
23131
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
23132
$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
23133
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
23134
$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
23135
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
23136
$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
23137
{ $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
23138
$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
23140
## ---------------------------------------------------------------------- ##
23141
## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg ##
23142
## ---------------------------------------------------------------------- ##
23144
) | sed "s/^/$as_me: WARNING: /" >&2
23147
{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
23148
$as_echo_n "checking for $ac_header... " >&6; }
23149
if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
23150
$as_echo_n "(cached) " >&6
23152
eval "$as_ac_Header=\$ac_header_preproc"
23154
ac_res=`eval 'as_val=${'$as_ac_Header'}
23155
$as_echo "$as_val"'`
23156
{ $as_echo "$as_me:$LINENO: result: $ac_res" >&5
23157
$as_echo "$ac_res" >&6; }
23160
as_val=`eval 'as_val=${'$as_ac_Header'}
23161
$as_echo "$as_val"'`
23162
if test "x$as_val" = x""yes; then
23163
cat >>confdefs.h <<_ACEOF
23164
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
23168
{ { $as_echo "$as_me:$LINENO: error: SELinux include files not found" >&5
23169
$as_echo "$as_me: error: SELinux include files not found" >&2;}
23170
{ (exit 1); exit 1; }; }
23176
{ $as_echo "$as_me:$LINENO: checking for avc_init in -lselinux" >&5
23177
$as_echo_n "checking for avc_init in -lselinux... " >&6; }
23178
if test "${ac_cv_lib_selinux_avc_init+set}" = set; then
23179
$as_echo_n "(cached) " >&6
23181
ac_check_lib_save_LIBS=$LIBS
23182
LIBS="-lselinux $LIBS"
23183
cat >conftest.$ac_ext <<_ACEOF
23186
cat confdefs.h >>conftest.$ac_ext
23187
cat >>conftest.$ac_ext <<_ACEOF
23188
/* end confdefs.h. */
23190
/* Override any GCC internal prototype to avoid an error.
23191
Use char because int might match the return type of a GCC
23192
builtin and then its argument prototype would still apply. */
23200
return avc_init ();
23205
rm -f conftest.$ac_objext conftest$ac_exeext
23206
if { (ac_try="$ac_link"
23207
case "(($ac_try" in
23208
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23209
*) ac_try_echo=$ac_try;;
23211
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
23212
$as_echo "$ac_try_echo") >&5
23213
(eval "$ac_link") 2>conftest.er1
23215
grep -v '^ *+' conftest.er1 >conftest.err
23217
cat conftest.err >&5
23218
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23219
(exit $ac_status); } && {
23220
test -z "$ac_c_werror_flag" ||
23221
test ! -s conftest.err
23222
} && test -s conftest$ac_exeext && {
23223
test "$cross_compiling" = yes ||
23224
$as_test_x conftest$ac_exeext
23226
ac_cv_lib_selinux_avc_init=yes
23228
$as_echo "$as_me: failed program was:" >&5
23229
sed 's/^/| /' conftest.$ac_ext >&5
23231
ac_cv_lib_selinux_avc_init=no
23234
rm -rf conftest.dSYM
23235
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
23236
conftest$ac_exeext conftest.$ac_ext
23237
LIBS=$ac_check_lib_save_LIBS
23239
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_selinux_avc_init" >&5
23240
$as_echo "$ac_cv_lib_selinux_avc_init" >&6; }
23241
if test "x$ac_cv_lib_selinux_avc_init" = x""yes; then
23242
cat >>confdefs.h <<_ACEOF
23243
#define HAVE_LIBSELINUX 1
23246
LIBS="-lselinux $LIBS"
23249
{ { $as_echo "$as_me:$LINENO: error: SELinux library not found" >&5
23250
$as_echo "$as_me: error: SELinux library not found" >&2;}
23251
{ (exit 1); exit 1; }; }
23255
23026
for ac_header in libaudit.h
23257
23028
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
23485
23256
{ (exit 1); exit 1; }; }
23488
{ $as_echo "$as_me:$LINENO: checking whether avc_netlink_acquire_fd is declared" >&5
23489
$as_echo_n "checking whether avc_netlink_acquire_fd is declared... " >&6; }
23490
if test "${ac_cv_have_decl_avc_netlink_acquire_fd+set}" = set; then
23491
$as_echo_n "(cached) " >&6
23493
cat >conftest.$ac_ext <<_ACEOF
23496
cat confdefs.h >>conftest.$ac_ext
23497
cat >>conftest.$ac_ext <<_ACEOF
23498
/* end confdefs.h. */
23499
#include <selinux/avc.h>
23504
#ifndef avc_netlink_acquire_fd
23505
(void) avc_netlink_acquire_fd;
23512
rm -f conftest.$ac_objext
23513
if { (ac_try="$ac_compile"
23514
case "(($ac_try" in
23515
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
23516
*) ac_try_echo=$ac_try;;
23518
eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
23519
$as_echo "$ac_try_echo") >&5
23520
(eval "$ac_compile") 2>conftest.er1
23522
grep -v '^ *+' conftest.er1 >conftest.err
23524
cat conftest.err >&5
23525
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23526
(exit $ac_status); } && {
23527
test -z "$ac_c_werror_flag" ||
23528
test ! -s conftest.err
23529
} && test -s conftest.$ac_objext; then
23530
ac_cv_have_decl_avc_netlink_acquire_fd=yes
23532
$as_echo "$as_me: failed program was:" >&5
23533
sed 's/^/| /' conftest.$ac_ext >&5
23535
ac_cv_have_decl_avc_netlink_acquire_fd=no
23538
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
23540
{ $as_echo "$as_me:$LINENO: result: $ac_cv_have_decl_avc_netlink_acquire_fd" >&5
23541
$as_echo "$ac_cv_have_decl_avc_netlink_acquire_fd" >&6; }
23542
if test "x$ac_cv_have_decl_avc_netlink_acquire_fd" = x""yes; then
23544
cat >>confdefs.h <<\_ACEOF
23545
#define HAVE_AVC_NETLINK_ACQUIRE_FD 1
23261
{ $as_echo "$as_me:$LINENO: checking for SELINUX" >&5
23262
$as_echo_n "checking for SELINUX... " >&6; }
23264
if test -n "$SELINUX_CFLAGS"; then
23265
pkg_cv_SELINUX_CFLAGS="$SELINUX_CFLAGS"
23266
elif test -n "$PKG_CONFIG"; then
23267
if test -n "$PKG_CONFIG" && \
23268
{ ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$LIBSELINUX\"") >&5
23269
($PKG_CONFIG --exists --print-errors "$LIBSELINUX") 2>&5
23271
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23272
(exit $ac_status); }; then
23273
pkg_cv_SELINUX_CFLAGS=`$PKG_CONFIG --cflags "$LIBSELINUX" 2>/dev/null`
23280
if test -n "$SELINUX_LIBS"; then
23281
pkg_cv_SELINUX_LIBS="$SELINUX_LIBS"
23282
elif test -n "$PKG_CONFIG"; then
23283
if test -n "$PKG_CONFIG" && \
23284
{ ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"\$LIBSELINUX\"") >&5
23285
($PKG_CONFIG --exists --print-errors "$LIBSELINUX") 2>&5
23287
$as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
23288
(exit $ac_status); }; then
23289
pkg_cv_SELINUX_LIBS=`$PKG_CONFIG --libs "$LIBSELINUX" 2>/dev/null`
23299
if test $pkg_failed = yes; then
23301
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
23302
_pkg_short_errors_supported=yes
23304
_pkg_short_errors_supported=no
23306
if test $_pkg_short_errors_supported = yes; then
23307
SELINUX_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$LIBSELINUX" 2>&1`
23309
SELINUX_PKG_ERRORS=`$PKG_CONFIG --print-errors "$LIBSELINUX" 2>&1`
23311
# Put the nasty error message in config.log where it belongs
23312
echo "$SELINUX_PKG_ERRORS" >&5
23314
{ { $as_echo "$as_me:$LINENO: error: Package requirements ($LIBSELINUX) were not met:
23316
$SELINUX_PKG_ERRORS
23318
Consider adjusting the PKG_CONFIG_PATH environment variable if you
23319
installed software in a non-standard prefix.
23321
Alternatively, you may set the environment variables SELINUX_CFLAGS
23322
and SELINUX_LIBS to avoid the need to call pkg-config.
23323
See the pkg-config man page for more details.
23325
$as_echo "$as_me: error: Package requirements ($LIBSELINUX) were not met:
23327
$SELINUX_PKG_ERRORS
23329
Consider adjusting the PKG_CONFIG_PATH environment variable if you
23330
installed software in a non-standard prefix.
23332
Alternatively, you may set the environment variables SELINUX_CFLAGS
23333
and SELINUX_LIBS to avoid the need to call pkg-config.
23334
See the pkg-config man page for more details.
23336
{ (exit 1); exit 1; }; }
23337
elif test $pkg_failed = untried; then
23338
{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
23339
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
23340
{ { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it
23341
is in your PATH or set the PKG_CONFIG environment variable to the full
23342
path to pkg-config.
23344
Alternatively, you may set the environment variables SELINUX_CFLAGS
23345
and SELINUX_LIBS to avoid the need to call pkg-config.
23346
See the pkg-config man page for more details.
23348
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
23349
See \`config.log' for more details." >&5
23350
$as_echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it
23351
is in your PATH or set the PKG_CONFIG environment variable to the full
23352
path to pkg-config.
23354
Alternatively, you may set the environment variables SELINUX_CFLAGS
23355
and SELINUX_LIBS to avoid the need to call pkg-config.
23356
See the pkg-config man page for more details.
23358
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
23359
See \`config.log' for more details." >&2;}
23360
{ (exit 1); exit 1; }; }; }
23362
SELINUX_CFLAGS=$pkg_cv_SELINUX_CFLAGS
23363
SELINUX_LIBS=$pkg_cv_SELINUX_LIBS
23364
{ $as_echo "$as_me:$LINENO: result: yes" >&5
23365
$as_echo "yes" >&6; }
23368
SELINUX_LIBS="$SELINUX_LIBS -laudit"
23551
23370
cat >>confdefs.h <<\_ACEOF
23552
23371
#define XSELINUX 1
23555
SELINUX_LIB="-lselinux -laudit"
23558
23376
if test "x$XCSECURITY" = xyes; then