Cache the results of all runtime checks.
This will be helpful to people who want to compile Python with a cross-compiler. Now you can upload the configure script on your host machine, run it with caching enabled, and download the cached results on your build machine.
This commit is contained in:
parent
0805b4ac54
commit
7b0c1c76cd
108
configure.in
108
configure.in
|
@ -873,10 +873,11 @@ yes)
|
||||||
AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
|
AC_MSG_CHECKING(whether $CC accepts -fno-strict-aliasing)
|
||||||
ac_save_cc="$CC"
|
ac_save_cc="$CC"
|
||||||
CC="$CC -fno-strict-aliasing"
|
CC="$CC -fno-strict-aliasing"
|
||||||
|
AC_CACHE_VAL(ac_cv_no_strict_aliasing_ok,
|
||||||
AC_TRY_RUN([int main() { return 0; }],
|
AC_TRY_RUN([int main() { return 0; }],
|
||||||
ac_cv_no_strict_aliasing_ok=yes,
|
ac_cv_no_strict_aliasing_ok=yes,
|
||||||
ac_cv_no_strict_aliasing_ok=no,
|
ac_cv_no_strict_aliasing_ok=no,
|
||||||
ac_cv_no_strict_aliasing_ok=no)
|
ac_cv_no_strict_aliasing_ok=no))
|
||||||
CC="$ac_save_cc"
|
CC="$ac_save_cc"
|
||||||
AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
|
AC_MSG_RESULT($ac_cv_no_strict_aliasing_ok)
|
||||||
if test $ac_cv_no_strict_aliasing_ok = yes
|
if test $ac_cv_no_strict_aliasing_ok = yes
|
||||||
|
@ -2496,7 +2497,8 @@ AC_CHECK_LIB(c, inet_aton, [$ac_cv_prog_TRUE],
|
||||||
# On Tru64, chflags seems to be present, but calling it will
|
# On Tru64, chflags seems to be present, but calling it will
|
||||||
# exit Python
|
# exit Python
|
||||||
AC_MSG_CHECKING(for chflags)
|
AC_MSG_CHECKING(for chflags)
|
||||||
AC_TRY_RUN([
|
AC_CACHE_VAL(ac_cv_have_chflags,
|
||||||
|
AC_TRY_RUN([[
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
int main(int argc, char*argv[])
|
int main(int argc, char*argv[])
|
||||||
|
@ -2505,13 +2507,19 @@ int main(int argc, char*argv[])
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
],AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
|
]], ac_cv_have_chflags=yes,
|
||||||
AC_MSG_RESULT(yes),
|
ac_cv_have_chflags=no,
|
||||||
AC_MSG_RESULT(no)
|
ac_cv_have_chflags=no)
|
||||||
)
|
)
|
||||||
|
AC_MSG_RESULT($ac_cv_have_chflags)
|
||||||
|
if test $ac_cv_have_chflags = yes
|
||||||
|
then
|
||||||
|
AC_DEFINE(HAVE_CHFLAGS, 1, Define to 1 if you have the `chflags' function.)
|
||||||
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING(for lchflags)
|
AC_MSG_CHECKING(for lchflags)
|
||||||
AC_TRY_RUN([
|
AC_CACHE_VAL(ac_cv_have_lchflags,
|
||||||
|
AC_TRY_RUN([[
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
int main(int argc, char*argv[])
|
int main(int argc, char*argv[])
|
||||||
|
@ -2520,10 +2528,15 @@ int main(int argc, char*argv[])
|
||||||
return 1;
|
return 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
],AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
|
]], ac_cv_have_lchflags=yes,
|
||||||
AC_MSG_RESULT(yes),
|
ac_cv_have_lchflags=no,
|
||||||
AC_MSG_RESULT(no)
|
ac_cv_have_lchflags=no)
|
||||||
)
|
)
|
||||||
|
AC_MSG_RESULT($ac_cv_have_lchflags)
|
||||||
|
if test $ac_cv_have_lchflags = yes
|
||||||
|
then
|
||||||
|
AC_DEFINE(HAVE_LCHFLAGS, 1, Define to 1 if you have the `lchflags' function.)
|
||||||
|
fi
|
||||||
|
|
||||||
dnl Check if system zlib has *Copy() functions
|
dnl Check if system zlib has *Copy() functions
|
||||||
dnl
|
dnl
|
||||||
|
@ -2677,19 +2690,22 @@ AC_TRY_LINK([
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
],[
|
], [getaddrinfo(NULL, NULL, NULL, NULL);],
|
||||||
getaddrinfo(NULL, NULL, NULL, NULL);
|
have_getaddrinfo=yes,
|
||||||
], [
|
have_getaddrinfo=no)
|
||||||
AC_MSG_RESULT(yes)
|
AC_MSG_RESULT($have_getaddrinfo)
|
||||||
AC_MSG_CHECKING(getaddrinfo bug)
|
if test $have_getaddrinfo = yes
|
||||||
AC_TRY_RUN([
|
then
|
||||||
|
AC_MSG_CHECKING(getaddrinfo bug)
|
||||||
|
AC_CACHE_VAL(ac_cv_buggy_getaddrinfo,
|
||||||
|
AC_TRY_RUN([[
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
main()
|
int main()
|
||||||
{
|
{
|
||||||
int passive, gaierr, inet4 = 0, inet6 = 0;
|
int passive, gaierr, inet4 = 0, inet6 = 0;
|
||||||
struct addrinfo hints, *ai, *aitop;
|
struct addrinfo hints, *ai, *aitop;
|
||||||
|
@ -2761,26 +2777,22 @@ main()
|
||||||
|
|
||||||
if (aitop)
|
if (aitop)
|
||||||
freeaddrinfo(aitop);
|
freeaddrinfo(aitop);
|
||||||
exit(0);
|
return 0;
|
||||||
|
|
||||||
bad:
|
bad:
|
||||||
if (aitop)
|
if (aitop)
|
||||||
freeaddrinfo(aitop);
|
freeaddrinfo(aitop);
|
||||||
exit(1);
|
return 1;
|
||||||
}
|
}
|
||||||
],
|
]], ac_cv_buggy_getaddrinfo=no,
|
||||||
AC_MSG_RESULT(good)
|
ac_cv_buggy_getaddrinfo=yes,
|
||||||
buggygetaddrinfo=no,
|
ac_cv_buggy_getaddrinfo=yes))
|
||||||
AC_MSG_RESULT(buggy)
|
fi
|
||||||
buggygetaddrinfo=yes,
|
|
||||||
AC_MSG_RESULT(buggy)
|
|
||||||
buggygetaddrinfo=yes)], [
|
|
||||||
AC_MSG_RESULT(no)
|
|
||||||
buggygetaddrinfo=yes
|
|
||||||
])
|
|
||||||
|
|
||||||
if test "$buggygetaddrinfo" = "yes"; then
|
if test $have_getaddrinfo = no -o $ac_cv_buggy_getaddrinfo = yes
|
||||||
if test "$ipv6" = "yes"; then
|
then
|
||||||
|
if test $ipv6 = yes
|
||||||
|
then
|
||||||
echo 'Fatal: You must get working getaddrinfo() function.'
|
echo 'Fatal: You must get working getaddrinfo() function.'
|
||||||
echo ' or you can specify "--disable-ipv6"'.
|
echo ' or you can specify "--disable-ipv6"'.
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -3247,6 +3259,7 @@ LIBS=$LIBS_SAVE
|
||||||
|
|
||||||
# Multiprocessing check for broken sem_getvalue
|
# Multiprocessing check for broken sem_getvalue
|
||||||
AC_MSG_CHECKING(for broken sem_getvalue)
|
AC_MSG_CHECKING(for broken sem_getvalue)
|
||||||
|
AC_CACHE_VAL(ac_cv_broken_sem_getvalue,
|
||||||
AC_TRY_RUN([
|
AC_TRY_RUN([
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -3267,11 +3280,16 @@ int main(void){
|
||||||
sem_close(a);
|
sem_close(a);
|
||||||
return res==-1 ? 1 : 0;
|
return res==-1 ? 1 : 0;
|
||||||
}
|
}
|
||||||
]
|
], ac_cv_broken_sem_getvalue=no,
|
||||||
,AC_MSG_RESULT(no),
|
ac_cv_broken_sem_getvalue=yes,
|
||||||
AC_MSG_RESULT(yes)
|
ac_cv_broken_sem_getvalue=yes)
|
||||||
AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1, define to 1 if your sem_getvalue is broken.)
|
|
||||||
)
|
)
|
||||||
|
AC_MSG_RESULT($ac_cv_broken_sem_getvalue)
|
||||||
|
if test $ac_cv_broken_sem_getvalue = yes
|
||||||
|
then
|
||||||
|
AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1,
|
||||||
|
[define to 1 if your sem_getvalue is broken.])
|
||||||
|
fi
|
||||||
|
|
||||||
# determine what size digit to use for Python's longs
|
# determine what size digit to use for Python's longs
|
||||||
AC_MSG_CHECKING([digit size for Python's longs])
|
AC_MSG_CHECKING([digit size for Python's longs])
|
||||||
|
@ -3528,6 +3546,7 @@ then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING(for broken poll())
|
AC_MSG_CHECKING(for broken poll())
|
||||||
|
AC_CACHE_VAL(ac_cv_broken_poll,
|
||||||
AC_TRY_RUN([
|
AC_TRY_RUN([
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
|
||||||
|
@ -3555,7 +3574,7 @@ int main (void)
|
||||||
],
|
],
|
||||||
ac_cv_broken_poll=yes,
|
ac_cv_broken_poll=yes,
|
||||||
ac_cv_broken_poll=no,
|
ac_cv_broken_poll=no,
|
||||||
ac_cv_broken_poll=no)
|
ac_cv_broken_poll=no))
|
||||||
AC_MSG_RESULT($ac_cv_broken_poll)
|
AC_MSG_RESULT($ac_cv_broken_poll)
|
||||||
if test "$ac_cv_broken_poll" = yes
|
if test "$ac_cv_broken_poll" = yes
|
||||||
then
|
then
|
||||||
|
@ -3757,6 +3776,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING(for %zd printf() format support)
|
AC_MSG_CHECKING(for %zd printf() format support)
|
||||||
|
AC_CACHE_VAL(ac_cv_have_size_t_format,
|
||||||
AC_TRY_RUN([#include <stdio.h>
|
AC_TRY_RUN([#include <stdio.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -3790,10 +3810,17 @@ int main()
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}],
|
}
|
||||||
[AC_MSG_RESULT(yes)
|
], ac_cv_have_size_t_format=yes,
|
||||||
AC_DEFINE(PY_FORMAT_SIZE_T, "z", [Define to printf format modifier for Py_ssize_t])],
|
ac_cv_have_size_t_format=no,
|
||||||
AC_MSG_RESULT(no))
|
ac_cv_have_size_t_format=no)
|
||||||
|
)
|
||||||
|
AC_MSG_RESULT($ac_cv_have_size_t_format)
|
||||||
|
if test $ac_cv_have_size_t_format = yes
|
||||||
|
then
|
||||||
|
AC_DEFINE(PY_FORMAT_SIZE_T, "z",
|
||||||
|
[Define to printf format modifier for Py_ssize_t])
|
||||||
|
fi
|
||||||
|
|
||||||
AC_CHECK_TYPE(socklen_t,,
|
AC_CHECK_TYPE(socklen_t,,
|
||||||
AC_DEFINE(socklen_t,int,
|
AC_DEFINE(socklen_t,int,
|
||||||
|
@ -3807,6 +3834,7 @@ AC_CHECK_TYPE(socklen_t,,
|
||||||
])
|
])
|
||||||
|
|
||||||
AC_MSG_CHECKING(for broken mbstowcs)
|
AC_MSG_CHECKING(for broken mbstowcs)
|
||||||
|
AC_CACHE_VAL(ac_cv_broken_mbstowcs,
|
||||||
AC_TRY_RUN([
|
AC_TRY_RUN([
|
||||||
#include<stdlib.h>
|
#include<stdlib.h>
|
||||||
int main() {
|
int main() {
|
||||||
|
@ -3818,7 +3846,7 @@ int main() {
|
||||||
],
|
],
|
||||||
ac_cv_broken_mbstowcs=no,
|
ac_cv_broken_mbstowcs=no,
|
||||||
ac_cv_broken_mbstowcs=yes,
|
ac_cv_broken_mbstowcs=yes,
|
||||||
ac_cv_broken_mbstowcs=no)
|
ac_cv_broken_mbstowcs=no))
|
||||||
AC_MSG_RESULT($ac_cv_broken_mbstowcs)
|
AC_MSG_RESULT($ac_cv_broken_mbstowcs)
|
||||||
if test "$ac_cv_broken_mbstowcs" = yes
|
if test "$ac_cv_broken_mbstowcs" = yes
|
||||||
then
|
then
|
||||||
|
|
Loading…
Reference in New Issue