improve `configure' tests for cross-compilation

Use compile and link tests instead of run tests, where
possible.

Based on a patch from Tobias
This commit is contained in:
Matthew Flatt 2013-02-14 17:32:26 -07:00
parent ca8ad3b88b
commit 74a3e14f9c
2 changed files with 180 additions and 329 deletions

463
src/configure vendored
View File

@ -4267,53 +4267,38 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
msg="for inline keyword" msg="for inline keyword"
{ echo "$as_me:$LINENO: checking $msg" >&5 { echo "$as_me:$LINENO: checking $msg" >&5
echo $ECHO_N "checking $msg... $ECHO_C" >&6; } echo $ECHO_N "checking $msg... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then cat >conftest.$ac_ext <<_ACEOF
inline=no
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
static inline int foo() { return 0; } static inline int foo() { return 0; }
int main() { int main() {
return foo(); return foo();
} }
_ACEOF _ACEOF
rm -f conftest$ac_exeext rm -f conftest.$ac_objext
if { (ac_try="$ac_link" if { (ac_try="$ac_compile"
case "(($ac_try" in case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;; *) ac_try_echo=$ac_try;;
esac esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5 (eval "$ac_compile") 2>conftest.er1
ac_status=$? ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext' (exit $ac_status); } && {
{ (case "(($ac_try" in test -z "$ac_c_werror_flag" ||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; test ! -s conftest.err
*) ac_try_echo=$ac_try;; } && test -s conftest.$ac_objext; then
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
inline=yes inline=yes
else else
echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) inline=no
inline=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$inline" = "no" ; then if test "$inline" = "no" ; then
MZOPTIONS="$MZOPTIONS -DNO_INLINE_KEYWORD" MZOPTIONS="$MZOPTIONS -DNO_INLINE_KEYWORD"
fi fi
@ -4323,54 +4308,39 @@ echo "${ECHO_T}$inline" >&6; }
msg="for noinline attribute" msg="for noinline attribute"
{ echo "$as_me:$LINENO: checking $msg" >&5 { echo "$as_me:$LINENO: checking $msg" >&5
echo $ECHO_N "checking $msg... $ECHO_C" >&6; } echo $ECHO_N "checking $msg... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then cat >conftest.$ac_ext <<_ACEOF
noinline=no
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
static int foo() __attribute__ ((noinline)); static int foo() __attribute__ ((noinline));
static int foo() { return 0; } static int foo() { return 0; }
int main() { int main() {
return foo(); return foo();
} }
_ACEOF _ACEOF
rm -f conftest$ac_exeext rm -f conftest.$ac_objext
if { (ac_try="$ac_link" if { (ac_try="$ac_compile"
case "(($ac_try" in case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;; *) ac_try_echo=$ac_try;;
esac esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5 (eval "$ac_compile") 2>conftest.er1
ac_status=$? ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext' (exit $ac_status); } && {
{ (case "(($ac_try" in test -z "$ac_c_werror_flag" ||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; test ! -s conftest.err
*) ac_try_echo=$ac_try;; } && test -s conftest.$ac_objext; then
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
noinline=yes noinline=yes
else else
echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) noinline=no
noinline=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$noinline" = "yes" ; then if test "$noinline" = "yes" ; then
cat >>confdefs.h <<\_ACEOF cat >>confdefs.h <<\_ACEOF
@ -4378,21 +4348,13 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF _ACEOF
fi fi
{ echo "$as_me:$LINENO: result: $inline" >&5 { echo "$as_me:$LINENO: result: $noinline" >&5
echo "${ECHO_T}$inline" >&6; } echo "${ECHO_T}$noinline" >&6; }
msg="for GNU preprocessor" msg="for GNU preprocessor"
{ echo "$as_me:$LINENO: checking $msg" >&5 { echo "$as_me:$LINENO: checking $msg" >&5
echo $ECHO_N "checking $msg... $ECHO_C" >&6; } echo $ECHO_N "checking $msg... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then cat >conftest.$ac_ext <<_ACEOF
using_gnu_cpp=no
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int main () { int main () {
#ifdef __GNUC__ #ifdef __GNUC__
return 0; return 0;
@ -4401,39 +4363,32 @@ int main () {
#endif #endif
} }
_ACEOF _ACEOF
rm -f conftest$ac_exeext rm -f conftest.$ac_objext
if { (ac_try="$ac_link" if { (ac_try="$ac_compile"
case "(($ac_try" in case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;; *) ac_try_echo=$ac_try;;
esac esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5 (eval "$ac_compile") 2>conftest.er1
ac_status=$? ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext' (exit $ac_status); } && {
{ (case "(($ac_try" in test -z "$ac_c_werror_flag" ||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; test ! -s conftest.err
*) ac_try_echo=$ac_try;; } && test -s conftest.$ac_objext; then
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
using_gnu_cpp=yes using_gnu_cpp=yes
else else
echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) using_gnu_cpp=no
using_gnu_cpp=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$using_gnu_cpp" = "yes" ; then if test "$using_gnu_cpp" = "yes" ; then
XFORMFLAGS="$XFORMFLAGS --keep-lines" XFORMFLAGS="$XFORMFLAGS --keep-lines"
case "$build_os" in case "$build_os" in
@ -5221,15 +5176,7 @@ fi
msg="for mbsrtowcs" msg="for mbsrtowcs"
{ echo "$as_me:$LINENO: checking $msg" >&5 { echo "$as_me:$LINENO: checking $msg" >&5
echo $ECHO_N "checking $msg... $ECHO_C" >&6; } echo $ECHO_N "checking $msg... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then cat >conftest.$ac_ext <<_ACEOF
mbsrtowcs=no
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <wchar.h> #include <wchar.h>
#include <strings.h> #include <strings.h>
int main() { int main() {
@ -5240,39 +5187,34 @@ cat >>conftest.$ac_ext <<_ACEOF
return 0; return 0;
} }
_ACEOF _ACEOF
rm -f conftest$ac_exeext rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link" if { (ac_try="$ac_link"
case "(($ac_try" in case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;; *) ac_try_echo=$ac_try;;
esac esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5 (eval "$ac_link") 2>conftest.er1
ac_status=$? ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext' (exit $ac_status); } && {
{ (case "(($ac_try" in test -z "$ac_c_werror_flag" ||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; test ! -s conftest.err
*) ac_try_echo=$ac_try;; } && test -s conftest$ac_exeext &&
esac $as_test_x conftest$ac_exeext; then
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
mbsrtowcs=yes mbsrtowcs=yes
else else
echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) mbsrtowcs=no
mbsrtowcs=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
if test "$mbsrtowcs" = "no" ; then if test "$mbsrtowcs" = "no" ; then
MZOPTIONS="$MZOPTIONS -DNO_MBTOWC_FUNCTIONS" MZOPTIONS="$MZOPTIONS -DNO_MBTOWC_FUNCTIONS"
fi fi
@ -5283,15 +5225,7 @@ if test "${try_poll_syscall}" = "yes" ; then
msg="for poll" msg="for poll"
{ echo "$as_me:$LINENO: checking $msg" >&5 { echo "$as_me:$LINENO: checking $msg" >&5
echo $ECHO_N "checking $msg... $ECHO_C" >&6; } echo $ECHO_N "checking $msg... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then
use_poll=no
else
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <poll.h> #include <poll.h>
int main() { int main() {
struct pollfd pfd; struct pollfd pfd;
@ -5302,39 +5236,34 @@ cat >>conftest.$ac_ext <<_ACEOF
return 0; return 0;
} }
_ACEOF _ACEOF
rm -f conftest$ac_exeext rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link" if { (ac_try="$ac_link"
case "(($ac_try" in case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;; *) ac_try_echo=$ac_try;;
esac esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5 (eval "$ac_link") 2>conftest.er1
ac_status=$? ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext' (exit $ac_status); } && {
{ (case "(($ac_try" in test -z "$ac_c_werror_flag" ||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; test ! -s conftest.err
*) ac_try_echo=$ac_try;; } && test -s conftest$ac_exeext &&
esac $as_test_x conftest$ac_exeext; then
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
use_poll=yes use_poll=yes
else else
echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) use_poll=no
use_poll=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $use_poll" >&5 { echo "$as_me:$LINENO: result: $use_poll" >&5
echo "${ECHO_T}$use_poll" >&6; } echo "${ECHO_T}$use_poll" >&6; }
if test "${use_poll}" = "yes" ; then if test "${use_poll}" = "yes" ; then
@ -5350,15 +5279,7 @@ if test "${try_epoll_syscall}" = "yes" ; then
msg="for epoll" msg="for epoll"
{ echo "$as_me:$LINENO: checking $msg" >&5 { echo "$as_me:$LINENO: checking $msg" >&5
echo $ECHO_N "checking $msg... $ECHO_C" >&6; } echo $ECHO_N "checking $msg... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then
use_epoll=no
else
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/epoll.h> #include <sys/epoll.h>
int main() { int main() {
int fd; int fd;
@ -5369,39 +5290,34 @@ cat >>conftest.$ac_ext <<_ACEOF
return 0; return 0;
} }
_ACEOF _ACEOF
rm -f conftest$ac_exeext rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link" if { (ac_try="$ac_link"
case "(($ac_try" in case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;; *) ac_try_echo=$ac_try;;
esac esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5 (eval "$ac_link") 2>conftest.er1
ac_status=$? ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext' (exit $ac_status); } && {
{ (case "(($ac_try" in test -z "$ac_c_werror_flag" ||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; test ! -s conftest.err
*) ac_try_echo=$ac_try;; } && test -s conftest$ac_exeext &&
esac $as_test_x conftest$ac_exeext; then
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
use_epoll=yes use_epoll=yes
else else
echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) use_epoll=no
use_epoll=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $use_epoll" >&5 { echo "$as_me:$LINENO: result: $use_epoll" >&5
echo "${ECHO_T}$use_epoll" >&6; } echo "${ECHO_T}$use_epoll" >&6; }
if test "${use_epoll}" = "yes" ; then if test "${use_epoll}" = "yes" ; then
@ -5417,15 +5333,7 @@ if test "${try_kqueue_syscall}" = "yes" ; then
msg="for kqueue" msg="for kqueue"
{ echo "$as_me:$LINENO: checking $msg" >&5 { echo "$as_me:$LINENO: checking $msg" >&5
echo $ECHO_N "checking $msg... $ECHO_C" >&6; } echo $ECHO_N "checking $msg... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then
use_kqueue=no
else
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h> #include <sys/types.h>
#include <sys/event.h> #include <sys/event.h>
#include <sys/time.h> #include <sys/time.h>
@ -5439,39 +5347,34 @@ cat >>conftest.$ac_ext <<_ACEOF
return 0; return 0;
} }
_ACEOF _ACEOF
rm -f conftest$ac_exeext rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link" if { (ac_try="$ac_link"
case "(($ac_try" in case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;; *) ac_try_echo=$ac_try;;
esac esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5 (eval "$ac_link") 2>conftest.er1
ac_status=$? ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext' (exit $ac_status); } && {
{ (case "(($ac_try" in test -z "$ac_c_werror_flag" ||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; test ! -s conftest.err
*) ac_try_echo=$ac_try;; } && test -s conftest$ac_exeext &&
esac $as_test_x conftest$ac_exeext; then
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
use_kqueue=yes use_kqueue=yes
else else
echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) use_kqueue=no
use_kqueue=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $use_kqueue" >&5 { echo "$as_me:$LINENO: result: $use_kqueue" >&5
echo "${ECHO_T}$use_kqueue" >&6; } echo "${ECHO_T}$use_kqueue" >&6; }
if test "${use_kqueue}" = "yes" ; then if test "${use_kqueue}" = "yes" ; then
@ -5590,15 +5493,7 @@ if test "${check_for_mprotect}" = "yes" ; then
msg="for mmap and mprotect" msg="for mmap and mprotect"
{ echo "$as_me:$LINENO: checking $msg" >&5 { echo "$as_me:$LINENO: checking $msg" >&5
echo $ECHO_N "checking $msg... $ECHO_C" >&6; } echo $ECHO_N "checking $msg... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then
use_mprotect=no
else
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/mman.h> #include <sys/mman.h>
#include <fcntl.h> #include <fcntl.h>
int main() { int main() {
@ -5608,39 +5503,34 @@ cat >>conftest.$ac_ext <<_ACEOF
return 0; return 0;
} }
_ACEOF _ACEOF
rm -f conftest$ac_exeext rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link" if { (ac_try="$ac_link"
case "(($ac_try" in case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;; *) ac_try_echo=$ac_try;;
esac esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5 (eval "$ac_link") 2>conftest.er1
ac_status=$? ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext' (exit $ac_status); } && {
{ (case "(($ac_try" in test -z "$ac_c_werror_flag" ||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; test ! -s conftest.err
*) ac_try_echo=$ac_try;; } && test -s conftest$ac_exeext &&
esac $as_test_x conftest$ac_exeext; then
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
use_mprotect=yes use_mprotect=yes
else else
echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) use_mprotect=no
use_mprotect=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $use_mprotect" >&5 { echo "$as_me:$LINENO: result: $use_mprotect" >&5
echo "${ECHO_T}$use_mprotect" >&6; } echo "${ECHO_T}$use_mprotect" >&6; }
if test "${use_mprotect}" = "yes" ; then if test "${use_mprotect}" = "yes" ; then
@ -8722,15 +8612,7 @@ if test "${enable_mzrt}" = "yes" ; then
msg="for compare-and-swap" msg="for compare-and-swap"
{ echo "$as_me:$LINENO: checking $msg" >&5 { echo "$as_me:$LINENO: checking $msg" >&5
echo $ECHO_N "checking $msg... $ECHO_C" >&6; } echo $ECHO_N "checking $msg... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then
cas_available=no
else
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int check1(long *addr, long old, long new_val) { int check1(long *addr, long old, long new_val) {
return __sync_bool_compare_and_swap(addr, old, new_val); return __sync_bool_compare_and_swap(addr, old, new_val);
} }
@ -8742,39 +8624,34 @@ int check1(long *addr, long old, long new_val) {
return !check1(&l, 2, 4) || !check2(&s, 3, 6); return !check1(&l, 2, 4) || !check2(&s, 3, 6);
} }
_ACEOF _ACEOF
rm -f conftest$ac_exeext rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link" if { (ac_try="$ac_link"
case "(($ac_try" in case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;; *) ac_try_echo=$ac_try;;
esac esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5 (eval "$ac_link") 2>conftest.er1
ac_status=$? ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext' (exit $ac_status); } && {
{ (case "(($ac_try" in test -z "$ac_c_werror_flag" ||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; test ! -s conftest.err
*) ac_try_echo=$ac_try;; } && test -s conftest$ac_exeext &&
esac $as_test_x conftest$ac_exeext; then
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
cas_available=yes cas_available=yes
else else
echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) cas_available=no
cas_available=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $cas_available" >&5 { echo "$as_me:$LINENO: result: $cas_available" >&5
echo "${ECHO_T}$cas_available" >&6; } echo "${ECHO_T}$cas_available" >&6; }
if test "${cas_available}" = "yes" ; then if test "${cas_available}" = "yes" ; then
@ -8809,54 +8686,41 @@ _ACEOF
msg="whether pthread_rwlock is available" msg="whether pthread_rwlock is available"
{ echo "$as_me:$LINENO: checking $msg" >&5 { echo "$as_me:$LINENO: checking $msg" >&5
echo $ECHO_N "checking $msg... $ECHO_C" >&6; } echo $ECHO_N "checking $msg... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then
rwlockavail=no
else
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <pthread.h> #include <pthread.h>
pthread_rwlock_t l; pthread_rwlock_t l;
int main() { int main() {
return pthread_rwlock_init(&l, NULL); return pthread_rwlock_init(&l, NULL);
} }
_ACEOF _ACEOF
rm -f conftest$ac_exeext rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link" if { (ac_try="$ac_link"
case "(($ac_try" in case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;; *) ac_try_echo=$ac_try;;
esac esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5 (eval "$ac_link") 2>conftest.er1
ac_status=$? ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext' (exit $ac_status); } && {
{ (case "(($ac_try" in test -z "$ac_c_werror_flag" ||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; test ! -s conftest.err
*) ac_try_echo=$ac_try;; } && test -s conftest$ac_exeext &&
esac $as_test_x conftest$ac_exeext; then
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
rwlockavail=yes rwlockavail=yes
else else
echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) rwlockavail=no
rwlockavail=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
{ echo "$as_me:$LINENO: result: $rwlockavail" >&5 { echo "$as_me:$LINENO: result: $rwlockavail" >&5
echo "${ECHO_T}$rwlockavail" >&6; } echo "${ECHO_T}$rwlockavail" >&6; }
if test "$rwlockavail" = "yes" ; then if test "$rwlockavail" = "yes" ; then
@ -8883,52 +8747,39 @@ if test "$check_gcc_dash_e" = "yes" ; then
msg="whether linker accepts -Wl,-E" msg="whether linker accepts -Wl,-E"
{ echo "$as_me:$LINENO: checking $msg" >&5 { echo "$as_me:$LINENO: checking $msg" >&5
echo $ECHO_N "checking $msg... $ECHO_C" >&6; } echo $ECHO_N "checking $msg... $ECHO_C" >&6; }
if test "$cross_compiling" = yes; then
linker_dash_e=no
else
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
int main() { int main() {
return 0; return 0;
} }
_ACEOF _ACEOF
rm -f conftest$ac_exeext rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link" if { (ac_try="$ac_link"
case "(($ac_try" in case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;; *) ac_try_echo=$ac_try;;
esac esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>&5 (eval "$ac_link") 2>conftest.er1
ac_status=$? ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext' (exit $ac_status); } && {
{ (case "(($ac_try" in test -z "$ac_c_werror_flag" ||
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; test ! -s conftest.err
*) ac_try_echo=$ac_try;; } && test -s conftest$ac_exeext &&
esac $as_test_x conftest$ac_exeext; then
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
linker_dash_e=yes linker_dash_e=yes
else else
echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5 sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status ) linker_dash_e=no
linker_dash_e=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
if test "$linker_dash_e" = "no" ; then if test "$linker_dash_e" = "no" ; then
LDFLAGS="${orig_ldflags}" LDFLAGS="${orig_ldflags}"
fi fi

View File

@ -770,12 +770,12 @@ AC_LANG_C
[ msg="for inline keyword" ] [ msg="for inline keyword" ]
AC_MSG_CHECKING($msg) AC_MSG_CHECKING($msg)
AC_TRY_RUN( AC_COMPILE_IFELSE(
static inline int foo() { return 0; } static inline int foo() { return 0; }
int main() { int main() {
return foo(); return foo();
}, },
inline=yes, inline=no, inline=no) inline=yes, inline=no)
if test "$inline" = "no" ; then if test "$inline" = "no" ; then
MZOPTIONS="$MZOPTIONS -DNO_INLINE_KEYWORD" MZOPTIONS="$MZOPTIONS -DNO_INLINE_KEYWORD"
fi fi
@ -783,27 +783,27 @@ AC_MSG_RESULT($inline)
[ msg="for noinline attribute" ] [ msg="for noinline attribute" ]
AC_MSG_CHECKING($msg) AC_MSG_CHECKING($msg)
AC_TRY_RUN( AC_COMPILE_IFELSE(
static int foo() __attribute__ ((noinline)); static int foo() __attribute__ ((noinline));
static int foo() { return 0; } static int foo() { return 0; }
int main() { int main() {
return foo(); return foo();
}, noinline=yes, noinline=no, noinline=no) }, noinline=yes, noinline=no)
if test "$noinline" = "yes" ; then if test "$noinline" = "yes" ; then
AC_DEFINE(MZ_USE_NOINLINE,1,[Have noinline attribute]) AC_DEFINE(MZ_USE_NOINLINE,1,[Have noinline attribute])
fi fi
AC_MSG_RESULT($inline) AC_MSG_RESULT($noinline)
[ msg="for GNU preprocessor" ] [ msg="for GNU preprocessor" ]
AC_MSG_CHECKING($msg) AC_MSG_CHECKING($msg)
AC_TRY_RUN( AC_COMPILE_IFELSE(
int main () { int main () {
#ifdef __GNUC__ #ifdef __GNUC__
return 0; return 0;
#else #else
return 1; return 1;
#endif #endif
}, using_gnu_cpp=yes, using_gnu_cpp=no, using_gnu_cpp=no) }, using_gnu_cpp=yes, using_gnu_cpp=no)
if test "$using_gnu_cpp" = "yes" ; then if test "$using_gnu_cpp" = "yes" ; then
XFORMFLAGS="$XFORMFLAGS --keep-lines" XFORMFLAGS="$XFORMFLAGS --keep-lines"
case "$build_os" in case "$build_os" in
@ -876,7 +876,7 @@ fi
[ msg="for mbsrtowcs" ] [ msg="for mbsrtowcs" ]
AC_MSG_CHECKING($msg) AC_MSG_CHECKING($msg)
AC_TRY_RUN( AC_LINK_IFELSE(
[ #include <wchar.h> ] [ #include <wchar.h> ]
[ #include <strings.h>] [ #include <strings.h>]
int main() { int main() {
@ -885,7 +885,7 @@ AC_TRY_RUN(
[ bzero(&state, sizeof(mbstate_t));] [ bzero(&state, sizeof(mbstate_t));]
[ mbsrtowcs(0, &src, 0, &state);] [ mbsrtowcs(0, &src, 0, &state);]
return 0; return 0;
}, mbsrtowcs=yes, mbsrtowcs=no, mbsrtowcs=no) }, mbsrtowcs=yes, mbsrtowcs=no)
if test "$mbsrtowcs" = "no" ; then if test "$mbsrtowcs" = "no" ; then
MZOPTIONS="$MZOPTIONS -DNO_MBTOWC_FUNCTIONS" MZOPTIONS="$MZOPTIONS -DNO_MBTOWC_FUNCTIONS"
fi fi
@ -894,7 +894,7 @@ AC_MSG_RESULT($mbsrtowcs)
if test "${try_poll_syscall}" = "yes" ; then if test "${try_poll_syscall}" = "yes" ; then
[ msg="for poll" ] [ msg="for poll" ]
AC_MSG_CHECKING($msg) AC_MSG_CHECKING($msg)
AC_TRY_RUN( AC_LINK_IFELSE(
[ #include <poll.h> ] [ #include <poll.h> ]
int main() { int main() {
struct pollfd pfd; struct pollfd pfd;
@ -903,7 +903,7 @@ if test "${try_poll_syscall}" = "yes" ; then
pfd.events = POLLIN; pfd.events = POLLIN;
r = poll(&pfd, 1, 0); r = poll(&pfd, 1, 0);
return 0; return 0;
}, use_poll=yes, use_poll=no, use_poll=no) }, use_poll=yes, use_poll=no)
AC_MSG_RESULT($use_poll) AC_MSG_RESULT($use_poll)
if test "${use_poll}" = "yes" ; then if test "${use_poll}" = "yes" ; then
AC_DEFINE(HAVE_POLL_SYSCALL,1,[Have poll]) AC_DEFINE(HAVE_POLL_SYSCALL,1,[Have poll])
@ -913,7 +913,7 @@ fi
if test "${try_epoll_syscall}" = "yes" ; then if test "${try_epoll_syscall}" = "yes" ; then
[ msg="for epoll" ] [ msg="for epoll" ]
AC_MSG_CHECKING($msg) AC_MSG_CHECKING($msg)
AC_TRY_RUN( AC_LINK_IFELSE(
[ #include <sys/epoll.h> ] [ #include <sys/epoll.h> ]
int main() { int main() {
int fd; int fd;
@ -922,7 +922,7 @@ if test "${try_epoll_syscall}" = "yes" ; then
ev.events = EPOLLIN | EPOLLONESHOT; ev.events = EPOLLIN | EPOLLONESHOT;
epoll_ctl(fd, EPOLL_CTL_ADD, 0, &ev); epoll_ctl(fd, EPOLL_CTL_ADD, 0, &ev);
return 0; return 0;
}, use_epoll=yes, use_epoll=no, use_epoll=no) }, use_epoll=yes, use_epoll=no)
AC_MSG_RESULT($use_epoll) AC_MSG_RESULT($use_epoll)
if test "${use_epoll}" = "yes" ; then if test "${use_epoll}" = "yes" ; then
AC_DEFINE(HAVE_EPOLL_SYSCALL,1,[Have epoll]) AC_DEFINE(HAVE_EPOLL_SYSCALL,1,[Have epoll])
@ -932,7 +932,7 @@ fi
if test "${try_kqueue_syscall}" = "yes" ; then if test "${try_kqueue_syscall}" = "yes" ; then
[ msg="for kqueue" ] [ msg="for kqueue" ]
AC_MSG_CHECKING($msg) AC_MSG_CHECKING($msg)
AC_TRY_RUN( AC_LINK_IFELSE(
[ #include <sys/types.h> ] [ #include <sys/types.h> ]
[ #include <sys/event.h> ] [ #include <sys/event.h> ]
[ #include <sys/time.h> ] [ #include <sys/time.h> ]
@ -944,7 +944,7 @@ if test "${try_kqueue_syscall}" = "yes" ; then
EV_SET(&kev, 0, EVFILT_READ, EV_ADD, 0, 0, NULL); EV_SET(&kev, 0, EVFILT_READ, EV_ADD, 0, 0, NULL);
kevent(kq, &kev, 1, NULL, 0, &timeout); kevent(kq, &kev, 1, NULL, 0, &timeout);
return 0; return 0;
}, use_kqueue=yes, use_kqueue=no, use_kqueue=no) }, use_kqueue=yes, use_kqueue=no)
AC_MSG_RESULT($use_kqueue) AC_MSG_RESULT($use_kqueue)
if test "${use_kqueue}" = "yes" ; then if test "${use_kqueue}" = "yes" ; then
AC_DEFINE(HAVE_KQUEUE_SYSCALL,1,[Have kqueue]) AC_DEFINE(HAVE_KQUEUE_SYSCALL,1,[Have kqueue])
@ -1016,7 +1016,7 @@ fi
if test "${check_for_mprotect}" = "yes" ; then if test "${check_for_mprotect}" = "yes" ; then
[ msg="for mmap and mprotect" ] [ msg="for mmap and mprotect" ]
AC_MSG_CHECKING($msg) AC_MSG_CHECKING($msg)
AC_TRY_RUN( AC_LINK_IFELSE(
[ #include <sys/mman.h> ] [ #include <sys/mman.h> ]
[ #include <fcntl.h> ] [ #include <fcntl.h> ]
int main() { int main() {
@ -1024,7 +1024,7 @@ if test "${check_for_mprotect}" = "yes" ; then
p = mmap(0, 2 << 16, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, open("/dev/zero", O_RDWR), 0); p = mmap(0, 2 << 16, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE, open("/dev/zero", O_RDWR), 0);
mprotect(p, 2 << 16, PROT_READ | PROT_WRITE | PROT_EXEC); mprotect(p, 2 << 16, PROT_READ | PROT_WRITE | PROT_EXEC);
return 0; return 0;
}, use_mprotect=yes, use_mprotect=no, use_mprotect=no) }, use_mprotect=yes, use_mprotect=no)
AC_MSG_RESULT($use_mprotect) AC_MSG_RESULT($use_mprotect)
if test "${use_mprotect}" = "yes" ; then if test "${use_mprotect}" = "yes" ; then
AC_DEFINE(HAVE_MMAP_MPROTECT,1,[Have mmap and mprotect]) AC_DEFINE(HAVE_MMAP_MPROTECT,1,[Have mmap and mprotect])
@ -1152,7 +1152,7 @@ fi
if test "${enable_mzrt}" = "yes" ; then if test "${enable_mzrt}" = "yes" ; then
[ msg="for compare-and-swap" ] [ msg="for compare-and-swap" ]
AC_MSG_CHECKING($msg) AC_MSG_CHECKING($msg)
AC_TRY_RUN( AC_LINK_IFELSE(
int check1(long *addr, long old, long new_val) { int check1(long *addr, long old, long new_val) {
return __sync_bool_compare_and_swap(addr, old, new_val); return __sync_bool_compare_and_swap(addr, old, new_val);
} }
@ -1162,7 +1162,7 @@ if test "${enable_mzrt}" = "yes" ; then
int main() { int main() {
long l = 2; short s = 3; long l = 2; short s = 3;
return !check1(&l, 2, 4) || !check2(&s, 3, 6); return !check1(&l, 2, 4) || !check2(&s, 3, 6);
}, cas_available=yes, cas_available=no, cas_available=no) }, cas_available=yes, cas_available=no)
AC_MSG_RESULT($cas_available) AC_MSG_RESULT($cas_available)
if test "${cas_available}" = "yes" ; then if test "${cas_available}" = "yes" ; then
AC_DEFINE(MZ_CAS_AVAILABLE,1,[Compare-and-swap available]) AC_DEFINE(MZ_CAS_AVAILABLE,1,[Compare-and-swap available])
@ -1187,12 +1187,12 @@ if test "${enable_pthread}" = "yes" ; then
[ msg="whether pthread_rwlock is available" ] [ msg="whether pthread_rwlock is available" ]
AC_MSG_CHECKING($msg) AC_MSG_CHECKING($msg)
AC_TRY_RUN( AC_LINK_IFELSE(
[ #include <pthread.h>] [ #include <pthread.h>]
pthread_rwlock_t l; pthread_rwlock_t l;
int main() { int main() {
return pthread_rwlock_init(&l, NULL); return pthread_rwlock_init(&l, NULL);
}, rwlockavail=yes, rwlockavail=no, rwlockavail=no) }, rwlockavail=yes, rwlockavail=no)
AC_MSG_RESULT($rwlockavail) AC_MSG_RESULT($rwlockavail)
if test "$rwlockavail" = "yes" ; then if test "$rwlockavail" = "yes" ; then
AC_DEFINE(HAVE_PTHREAD_RWLOCK,1,[Have pthread_rwlock]) AC_DEFINE(HAVE_PTHREAD_RWLOCK,1,[Have pthread_rwlock])
@ -1213,10 +1213,10 @@ if test "$check_gcc_dash_e" = "yes" ; then
# Can use -Wl,-E for linking because we're using GNU linker? # Can use -Wl,-E for linking because we're using GNU linker?
[ msg="whether linker accepts -Wl,-E" ] [ msg="whether linker accepts -Wl,-E" ]
AC_MSG_CHECKING($msg) AC_MSG_CHECKING($msg)
AC_TRY_RUN( AC_LINK_IFELSE(
int main() { int main() {
return 0; return 0;
}, linker_dash_e=yes, linker_dash_e=no, linker_dash_e=no) }, linker_dash_e=yes, linker_dash_e=no)
if test "$linker_dash_e" = "no" ; then if test "$linker_dash_e" = "no" ; then
LDFLAGS="${orig_ldflags}" LDFLAGS="${orig_ldflags}"
fi fi