mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-01 12:06:16 +08:00
config: Add tests for modules-desired features
this adds configure tests for features that modules can take advantage of -- and if they are not present has reduced or fallback functionality. gcc/ * configure.ac: Add tests for fstatat, sighandler_t, O_CLOEXEC, unix-domain and ipv6 sockets. * config.in: Rebuilt. * configure: Rebuilt.
This commit is contained in:
parent
255483e5b7
commit
e1f07131e2
@ -302,6 +302,18 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if AF_INET6 supported. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_AF_INET6
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if AF_UNIX supported. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_AF_UNIX
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if your assembler supports architecture modifiers. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_AS_ARCHITECTURE_MODIFIERS
|
||||
@ -564,12 +576,24 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if the assembler understands -march=rv*_zifencei. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_AS_MARCH_ZIFENCEI
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if your assembler supports mfcr field. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_AS_MFCRF
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if the assembler understands -misa-spec=. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_AS_MISA_SPEC
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if your Mac OS X assembler supports the -mmacos-version-min option.
|
||||
*/
|
||||
#ifndef USED_FOR_TARGET
|
||||
@ -643,18 +667,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if your assembler supports -misa-spec=. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_AS_MISA_SPEC
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if your assembler supports -march=rv*_zifencei. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_AS_MARCH_ZIFENCEI
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if your assembler supports relocs needed by -fpic. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_AS_SMALL_PIC_RELOCS
|
||||
@ -1265,6 +1277,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* Define to 1 if you have the `fstatat' function. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_FSTATAT
|
||||
#endif
|
||||
|
||||
|
||||
/* Define to 1 if you have the <ftw.h> header file. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_FTW_H
|
||||
@ -1770,6 +1788,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* Define to 1 if you have the `posix_fallocate' function. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_POSIX_FALLOCATE
|
||||
#endif
|
||||
|
||||
|
||||
/* Define to 1 if you have the `putchar_unlocked' function. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_PUTCHAR_UNLOCKED
|
||||
@ -1794,6 +1818,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if <sys/signal.h> defines sighandler_t */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_SIGHANDLER_T
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if the system-provided CRTs are present on Solaris. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HAVE_SOLARIS_CRTS
|
||||
@ -2033,6 +2063,12 @@
|
||||
#endif
|
||||
|
||||
|
||||
/* Define if O_CLOEXEC supported by fcntl. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef HOST_HAS_O_CLOEXEC
|
||||
#endif
|
||||
|
||||
|
||||
/* Define as const if the declaration of iconv() needs const. */
|
||||
#ifndef USED_FOR_TARGET
|
||||
#undef ICONV_CONST
|
||||
|
152
gcc/configure
vendored
152
gcc/configure
vendored
@ -10142,8 +10142,8 @@ fi
|
||||
|
||||
for ac_func in times clock kill getrlimit setrlimit atoq \
|
||||
popen sysconf strsignal getrusage nl_langinfo \
|
||||
gettimeofday mbstowcs wcswidth mmap setlocale \
|
||||
clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked madvise mallinfo mallinfo2
|
||||
gettimeofday mbstowcs wcswidth mmap posix_fallocate setlocale \
|
||||
clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked madvise mallinfo mallinfo2 fstatat
|
||||
do :
|
||||
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var"
|
||||
@ -10215,6 +10215,14 @@ _ACEOF
|
||||
|
||||
fi
|
||||
|
||||
ac_fn_cxx_check_type "$LINENO" "sighander_t" "ac_cv_type_sighander_t" "signal.h
|
||||
"
|
||||
if test "x$ac_cv_type_sighander_t" = xyes; then :
|
||||
|
||||
$as_echo "#define HAVE_SIGHANDLER_T 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
|
||||
ac_fn_cxx_check_header_preproc "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h"
|
||||
@ -11938,6 +11946,142 @@ $as_echo "#define HOST_HAS_F_SETLKW 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
# Check if O_CLOEXEC is defined by fcntl
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
|
||||
$as_echo_n "checking for O_CLOEXEC... " >&6; }
|
||||
if ${ac_cv_o_cloexec+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <fcntl.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
return open ("/dev/null", O_RDONLY | O_CLOEXEC);
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_cxx_try_compile "$LINENO"; then :
|
||||
ac_cv_o_cloexec=yes
|
||||
else
|
||||
ac_cv_o_cloexec=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_o_cloexec" >&5
|
||||
$as_echo "$ac_cv_o_cloexec" >&6; }
|
||||
if test $ac_cv_o_cloexec = yes; then
|
||||
|
||||
$as_echo "#define HOST_HAS_O_CLOEXEC 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
# C++ Modules would like some networking features to provide the mapping
|
||||
# server. You can still use modules without them though.
|
||||
# The following network-related checks could probably do with some
|
||||
# Windows and other non-linux defenses and checking.
|
||||
|
||||
# Local socket connectivity wants AF_UNIX networking
|
||||
# Check for AF_UNIX networking
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AF_UNIX" >&5
|
||||
$as_echo_n "checking for AF_UNIX... " >&6; }
|
||||
if ${ac_cv_af_unix+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <netinet/in.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
sockaddr_un un;
|
||||
un.sun_family = AF_UNSPEC;
|
||||
int fd = socket (AF_UNIX, SOCK_STREAM, 0);
|
||||
connect (fd, (sockaddr *)&un, sizeof (un));
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_cxx_try_compile "$LINENO"; then :
|
||||
ac_cv_af_unix=yes
|
||||
else
|
||||
ac_cv_af_unix=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_af_unix" >&5
|
||||
$as_echo "$ac_cv_af_unix" >&6; }
|
||||
if test $ac_cv_af_unix = yes; then
|
||||
|
||||
$as_echo "#define HAVE_AF_UNIX 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
# Remote socket connectivity wants AF_INET6 networking
|
||||
# Check for AF_INET6 networking
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for AF_INET6" >&5
|
||||
$as_echo_n "checking for AF_INET6... " >&6; }
|
||||
if ${ac_cv_af_inet6+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
|
||||
sockaddr_in6 in6;
|
||||
in6.sin6_family = AF_UNSPEC;
|
||||
struct addrinfo *addrs = 0;
|
||||
struct addrinfo hints;
|
||||
hints.ai_flags = 0;
|
||||
hints.ai_family = AF_INET6;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_protocol = 0;
|
||||
hints.ai_canonname = 0;
|
||||
hints.ai_addr = 0;
|
||||
hints.ai_next = 0;
|
||||
int e = getaddrinfo ("localhost", 0, &hints, &addrs);
|
||||
const char *str = gai_strerror (e);
|
||||
freeaddrinfo (addrs);
|
||||
int fd = socket (AF_INET6, SOCK_STREAM, 0);
|
||||
connect (fd, (sockaddr *)&in6, sizeof (in6));
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_cxx_try_compile "$LINENO"; then :
|
||||
ac_cv_af_inet6=yes
|
||||
else
|
||||
ac_cv_af_inet6=no
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_af_inet6" >&5
|
||||
$as_echo "$ac_cv_af_inet6" >&6; }
|
||||
if test $ac_cv_af_inet6 = yes; then
|
||||
|
||||
$as_echo "#define HAVE_AF_INET6 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
# Restore CFLAGS, CXXFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
|
||||
CFLAGS="$saved_CFLAGS"
|
||||
CXXFLAGS="$saved_CXXFLAGS"
|
||||
@ -19036,7 +19180,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 19039 "configure"
|
||||
#line 19183 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
@ -19142,7 +19286,7 @@ else
|
||||
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
|
||||
lt_status=$lt_dlunknown
|
||||
cat > conftest.$ac_ext <<_LT_EOF
|
||||
#line 19145 "configure"
|
||||
#line 19289 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
#if HAVE_DLFCN_H
|
||||
|
@ -1417,8 +1417,8 @@ define(gcc_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
|
||||
putchar_unlocked putc_unlocked)
|
||||
AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoq \
|
||||
popen sysconf strsignal getrusage nl_langinfo \
|
||||
gettimeofday mbstowcs wcswidth mmap setlocale \
|
||||
gcc_UNLOCKED_FUNCS madvise mallinfo mallinfo2)
|
||||
gettimeofday mbstowcs wcswidth mmap posix_fallocate setlocale \
|
||||
gcc_UNLOCKED_FUNCS madvise mallinfo mallinfo2 fstatat)
|
||||
|
||||
if test x$ac_cv_func_mbstowcs = xyes; then
|
||||
AC_CACHE_CHECK(whether mbstowcs works, gcc_cv_func_mbstowcs_works,
|
||||
@ -1440,6 +1440,10 @@ fi
|
||||
|
||||
AC_CHECK_TYPE(ssize_t, int)
|
||||
AC_CHECK_TYPE(caddr_t, char *)
|
||||
AC_CHECK_TYPE(sighander_t,
|
||||
AC_DEFINE(HAVE_SIGHANDLER_T, 1,
|
||||
[Define if <sys/signal.h> defines sighandler_t]),
|
||||
,signal.h)
|
||||
|
||||
GCC_AC_FUNC_MMAP_BLACKLIST
|
||||
|
||||
@ -1585,6 +1589,72 @@ if test $ac_cv_f_setlkw = yes; then
|
||||
[Define if F_SETLKW supported by fcntl.])
|
||||
fi
|
||||
|
||||
# Check if O_CLOEXEC is defined by fcntl
|
||||
AC_CACHE_CHECK(for O_CLOEXEC, ac_cv_o_cloexec, [
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <fcntl.h>]], [[
|
||||
return open ("/dev/null", O_RDONLY | O_CLOEXEC);]])],
|
||||
[ac_cv_o_cloexec=yes],[ac_cv_o_cloexec=no])])
|
||||
if test $ac_cv_o_cloexec = yes; then
|
||||
AC_DEFINE(HOST_HAS_O_CLOEXEC, 1,
|
||||
[Define if O_CLOEXEC supported by fcntl.])
|
||||
fi
|
||||
|
||||
# C++ Modules would like some networking features to provide the mapping
|
||||
# server. You can still use modules without them though.
|
||||
# The following network-related checks could probably do with some
|
||||
# Windows and other non-linux defenses and checking.
|
||||
|
||||
# Local socket connectivity wants AF_UNIX networking
|
||||
# Check for AF_UNIX networking
|
||||
AC_CACHE_CHECK(for AF_UNIX, ac_cv_af_unix, [
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <netinet/in.h>]],[[
|
||||
sockaddr_un un;
|
||||
un.sun_family = AF_UNSPEC;
|
||||
int fd = socket (AF_UNIX, SOCK_STREAM, 0);
|
||||
connect (fd, (sockaddr *)&un, sizeof (un));]])],
|
||||
[ac_cv_af_unix=yes],
|
||||
[ac_cv_af_unix=no])])
|
||||
if test $ac_cv_af_unix = yes; then
|
||||
AC_DEFINE(HAVE_AF_UNIX, 1,
|
||||
[Define if AF_UNIX supported.])
|
||||
fi
|
||||
|
||||
# Remote socket connectivity wants AF_INET6 networking
|
||||
# Check for AF_INET6 networking
|
||||
AC_CACHE_CHECK(for AF_INET6, ac_cv_af_inet6, [
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>]],[[
|
||||
sockaddr_in6 in6;
|
||||
in6.sin6_family = AF_UNSPEC;
|
||||
struct addrinfo *addrs = 0;
|
||||
struct addrinfo hints;
|
||||
hints.ai_flags = 0;
|
||||
hints.ai_family = AF_INET6;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
hints.ai_protocol = 0;
|
||||
hints.ai_canonname = 0;
|
||||
hints.ai_addr = 0;
|
||||
hints.ai_next = 0;
|
||||
int e = getaddrinfo ("localhost", 0, &hints, &addrs);
|
||||
const char *str = gai_strerror (e);
|
||||
freeaddrinfo (addrs);
|
||||
int fd = socket (AF_INET6, SOCK_STREAM, 0);
|
||||
connect (fd, (sockaddr *)&in6, sizeof (in6));]])],
|
||||
[ac_cv_af_inet6=yes],
|
||||
[ac_cv_af_inet6=no])])
|
||||
if test $ac_cv_af_inet6 = yes; then
|
||||
AC_DEFINE(HAVE_AF_INET6, 1,
|
||||
[Define if AF_INET6 supported.])
|
||||
fi
|
||||
|
||||
# Restore CFLAGS, CXXFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
|
||||
CFLAGS="$saved_CFLAGS"
|
||||
CXXFLAGS="$saved_CXXFLAGS"
|
||||
|
Loading…
Reference in New Issue
Block a user