X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=libgo%2Fconfigure;h=dc85ccfa9db7be3de4775de2fe4876ece657992c;hb=fbfd788b3485f46af2d12fd867a2f440735a1890;hp=6fe02592306f9591d9f59a7b91db8d08fddbc587;hpb=ccd3f476fe018616f62e4d79fe2d202ad58611f7;p=pf3gnuchains%2Fgcc-fork.git diff --git a/libgo/configure b/libgo/configure old mode 100644 new mode 100755 index 6fe02592306..dc85ccfa9db --- a/libgo/configure +++ b/libgo/configure @@ -602,7 +602,12 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +STRUCT_EPOLL_EVENT_FD_OFFSET +SIZEOF_STRUCT_EPOLL_EVENT +MATH_FLAG STRINGOPS_FLAG +HAVE_WAIT4_FALSE +HAVE_WAIT4_TRUE HAVE_STRERROR_R_FALSE HAVE_STRERROR_R_TRUE HAVE_SYS_MMAN_H_FALSE @@ -614,8 +619,11 @@ MATH_LIBS USING_SPLIT_STACK_FALSE USING_SPLIT_STACK_TRUE SPLIT_STACK -GO_DEBUG_PROC_REGS_OS_ARCH_FILE -GO_SYSCALLS_SYSCALL_OS_ARCH_FILE +OSCFLAGS +GO_SYSCALL_OS_ARCH_FILE +GO_SYSCALL_OS_FILE +GO_LIBCALL_OS_ARCH_FILE +GO_LIBCALL_OS_FILE GOARCH LIBGO_IS_X86_64_FALSE LIBGO_IS_X86_64_TRUE @@ -627,14 +635,22 @@ LIBGO_IS_PPC64_FALSE LIBGO_IS_PPC64_TRUE LIBGO_IS_PPC_FALSE LIBGO_IS_PPC_TRUE -LIBGO_IS_MIPS64_FALSE -LIBGO_IS_MIPS64_TRUE +LIBGO_IS_MIPSO64_FALSE +LIBGO_IS_MIPSO64_TRUE +LIBGO_IS_MIPSN64_FALSE +LIBGO_IS_MIPSN64_TRUE +LIBGO_IS_MIPSN32_FALSE +LIBGO_IS_MIPSN32_TRUE +LIBGO_IS_MIPSO32_FALSE +LIBGO_IS_MIPSO32_TRUE LIBGO_IS_MIPS_FALSE LIBGO_IS_MIPS_TRUE LIBGO_IS_M68K_FALSE LIBGO_IS_M68K_TRUE LIBGO_IS_ARM_FALSE LIBGO_IS_ARM_TRUE +LIBGO_IS_ALPHA_FALSE +LIBGO_IS_ALPHA_TRUE LIBGO_IS_386_FALSE LIBGO_IS_386_TRUE GOOS @@ -642,19 +658,25 @@ LIBGO_IS_SOLARIS_FALSE LIBGO_IS_SOLARIS_TRUE LIBGO_IS_RTEMS_FALSE LIBGO_IS_RTEMS_TRUE +LIBGO_IS_NETBSD_FALSE +LIBGO_IS_NETBSD_TRUE LIBGO_IS_LINUX_FALSE LIBGO_IS_LINUX_TRUE +LIBGO_IS_IRIX_FALSE +LIBGO_IS_IRIX_TRUE LIBGO_IS_FREEBSD_FALSE LIBGO_IS_FREEBSD_TRUE LIBGO_IS_DARWIN_FALSE LIBGO_IS_DARWIN_TRUE +go_include LIBFFIINCS LIBFFI +nover_glibgo_toolexeclibdir glibgo_toolexeclibdir glibgo_toolexecdir -glibgo_prefixdir WERROR WARN_FLAGS +CC_FOR_BUILD enable_static enable_shared CPP @@ -1933,6 +1955,184 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_type + +# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES +# -------------------------------------------- +# Tries to find the compile-time value of EXPR in a program that includes +# INCLUDES, setting VAR accordingly. Returns whether the value could be +# computed +ac_fn_c_compute_int () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if test "$cross_compiling" = yes; then + # Depending upon the size, compute the lo and hi bounds. +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=0 ac_mid=0 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid; break +else + as_fn_arith $ac_mid + 1 && ac_lo=$as_val + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) < 0)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=-1 ac_mid=-1 + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) >= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_lo=$ac_mid; break +else + as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + done +else + ac_lo= ac_hi= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# Binary search between lo and hi bounds. +while test "x$ac_lo" != "x$ac_hi"; do + as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +static int test_array [1 - 2 * !(($2) <= $ac_mid)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_hi=$ac_mid +else + as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +done +case $ac_lo in #(( +?*) eval "$3=\$ac_lo"; ac_retval=0 ;; +'') ac_retval=1 ;; +esac + else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +static long int longval () { return $2; } +static unsigned long int ulongval () { return $2; } +#include +#include +int +main () +{ + + FILE *f = fopen ("conftest.val", "w"); + if (! f) + return 1; + if (($2) < 0) + { + long int i = longval (); + if (i != ($2)) + return 1; + fprintf (f, "%ld", i); + } + else + { + unsigned long int i = ulongval (); + if (i != ($2)) + return 1; + fprintf (f, "%lu", i); + } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + echo >>conftest.val; read $3 config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -6409,7 +6609,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; } case $lt_cv_prog_gnu_ld in yes*) case $host in - i?86-*-solaris*) + i?86-*-solaris* | x86_64-*-solaris2.1[0-9]*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) @@ -10900,7 +11100,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10903 "configure" +#line 11103 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11006,7 +11206,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11009 "configure" +#line 11209 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -13135,6 +13335,52 @@ CC="$lt_save_CC" +CC_FOR_BUILD=${CC_FOR_BUILD:-gcc} + + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + + WARN_FLAGS='-Wall -Wextra -Wwrite-strings -Wcast-qual' @@ -13143,7 +13389,6 @@ WERROR="-Werror" glibgo_toolexecdir=no glibgo_toolexeclibdir=no -glibgo_prefixdir=$prefix { $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-version-specific-runtime-libs" >&5 $as_echo_n "checking for --enable-version-specific-runtime-libs... " >&6; } @@ -13169,20 +13414,23 @@ fi # Calculate glibgo_toolexecdir, glibgo_toolexeclibdir # Install a library built with a cross compiler in tooldir, not libdir. +if test -n "$with_cross_host" && + test x"$with_cross_host" != x"no"; then + nover_glibgo_toolexecdir='${exec_prefix}/${host_alias}' + nover_glibgo_toolexeclibdir='${toolexecdir}/lib' +else + nover_glibgo_toolexecdir='${libdir}/gcc/${host_alias}' + nover_glibgo_toolexeclibdir='${libdir}' +fi +multi_os_directory=`$CC -print-multi-os-directory` +case $multi_os_directory in + .) ;; # Avoid trailing /. + *) nover_glibgo_toolexeclibdir=${nover_glibgo_toolexeclibdir}/${multi_os_directory} ;; +esac + if test x"$glibgo_toolexecdir" = x"no"; then - if test -n "$with_cross_host" && - test x"$with_cross_host" != x"no"; then - glibgo_toolexecdir='${exec_prefix}/${host_alias}' - glibgo_toolexeclibdir='${toolexecdir}/lib' - else - glibgo_toolexecdir='${libdir}/gcc/${host_alias}' - glibgo_toolexeclibdir='${libdir}' - fi - multi_os_directory=`$CC -print-multi-os-directory` - case $multi_os_directory in - .) ;; # Avoid trailing /. - *) glibgo_toolexeclibdir=$glibgo_toolexeclibdir/$multi_os_directory ;; - esac + glibgo_toolexecdir="${nover_glibgo_toolexecdir}" + glibgo_toolexeclibdir="${nover_glibgo_toolexeclibdir}" fi @@ -13213,16 +13461,25 @@ fi +# Used to tell GNU make to include a file without telling automake to +# include it. +go_include="-include" + + is_darwin=no is_freebsd=no +is_irix=no is_linux=no +is_netbsd=no is_rtems=no is_solaris=no GOOS=unknown case ${host} in *-*-darwin*) is_darwin=yes; GOOS=darwin ;; *-*-freebsd*) is_freebsd=yes; GOOS=freebsd ;; + *-*-irix6*) is_irix=yes; GOOS=irix ;; *-*-linux*) is_linux=yes; GOOS=linux ;; + *-*-netbsd*) is_netbsd=yes; GOOS=netbsd ;; *-*-rtems*) is_rtems=yes; GOOS=rtems ;; *-*-solaris2*) is_solaris=yes; GOOS=solaris ;; esac @@ -13242,6 +13499,14 @@ else LIBGO_IS_FREEBSD_FALSE= fi + if test $is_irix = yes; then + LIBGO_IS_IRIX_TRUE= + LIBGO_IS_IRIX_FALSE='#' +else + LIBGO_IS_IRIX_TRUE='#' + LIBGO_IS_IRIX_FALSE= +fi + if test $is_linux = yes; then LIBGO_IS_LINUX_TRUE= LIBGO_IS_LINUX_FALSE='#' @@ -13250,6 +13515,14 @@ else LIBGO_IS_LINUX_FALSE= fi + if test $is_netbsd = yes; then + LIBGO_IS_NETBSD_TRUE= + LIBGO_IS_NETBSD_FALSE='#' +else + LIBGO_IS_NETBSD_TRUE='#' + LIBGO_IS_NETBSD_FALSE= +fi + if test $is_rtems = yes; then LIBGO_IS_RTEMS_TRUE= LIBGO_IS_RTEMS_FALSE='#' @@ -13269,10 +13542,10 @@ fi is_386=no +is_alpha=no is_arm=no is_m68k=no -is_mips=no -is_mips64=no +mips_abi=unknown is_ppc=no is_ppc64=no is_sparc=no @@ -13280,6 +13553,10 @@ is_sparc64=no is_x86_64=no GOARCH=unknown case ${host} in + alpha*-*-*) + is_alpha=yes + GOARCH=alpha + ;; arm*-*-* | strongarm*-*-* | ep9312*-*-* | xscale-*-*) is_arm=yes GOARCH=arm @@ -13312,21 +13589,59 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __mips64 -#error 64-bit +#if _MIPS_SIM != _ABIO32 +#error not o32 +#endif +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + mips_abi="o32" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if _MIPS_SIM != _ABIN32 +#error not n32 +#endif +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + mips_abi="n32" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if _MIPS_SIM != _ABI64 +#error not n64 +#endif +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + mips_abi="n64" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#if _MIPS_SIM != _ABIO64 +#error not o64 #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - is_mips=yes + mips_abi="o64" else - is_mips64=yes + as_fn_error "unknown MIPS ABI" "$LINENO" 5 +mips_abi="n32" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test "$is_mips" = "yes"; then - GOARCH=mips - else - GOARCH=mips64 - fi +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + case "$mips_abi" in + "o32") GOARCH=mipso32 ;; + "n32") GOARCH=mipsn32 ;; + "n64") GOARCH=mipsn64 ;; + "o64") GOARCH=mipso64 ;; + esac ;; rs6000*-*-* | powerpc*-*-*) cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -13377,6 +13692,14 @@ else LIBGO_IS_386_FALSE= fi + if test $is_alpha = yes; then + LIBGO_IS_ALPHA_TRUE= + LIBGO_IS_ALPHA_FALSE='#' +else + LIBGO_IS_ALPHA_TRUE='#' + LIBGO_IS_ALPHA_FALSE= +fi + if test $is_arm = yes; then LIBGO_IS_ARM_TRUE= LIBGO_IS_ARM_FALSE='#' @@ -13393,7 +13716,7 @@ else LIBGO_IS_M68K_FALSE= fi - if test $is_mips = yes; then + if test $mips_abi != unknown; then LIBGO_IS_MIPS_TRUE= LIBGO_IS_MIPS_FALSE='#' else @@ -13401,12 +13724,36 @@ else LIBGO_IS_MIPS_FALSE= fi - if test $is_mips64 = yes; then - LIBGO_IS_MIPS64_TRUE= - LIBGO_IS_MIPS64_FALSE='#' + if test $mips_abi = o32; then + LIBGO_IS_MIPSO32_TRUE= + LIBGO_IS_MIPSO32_FALSE='#' +else + LIBGO_IS_MIPSO32_TRUE='#' + LIBGO_IS_MIPSO32_FALSE= +fi + + if test $mips_abi = n32; then + LIBGO_IS_MIPSN32_TRUE= + LIBGO_IS_MIPSN32_FALSE='#' else - LIBGO_IS_MIPS64_TRUE='#' - LIBGO_IS_MIPS64_FALSE= + LIBGO_IS_MIPSN32_TRUE='#' + LIBGO_IS_MIPSN32_FALSE= +fi + + if test $mips_abi = n64; then + LIBGO_IS_MIPSN64_TRUE= + LIBGO_IS_MIPSN64_FALSE='#' +else + LIBGO_IS_MIPSN64_TRUE='#' + LIBGO_IS_MIPSN64_FALSE= +fi + + if test $mips_abi = o64; then + LIBGO_IS_MIPSO64_TRUE= + LIBGO_IS_MIPSO64_FALSE='#' +else + LIBGO_IS_MIPSO64_TRUE='#' + LIBGO_IS_MIPSO64_FALSE= fi if test $is_ppc = yes; then @@ -13451,16 +13798,46 @@ fi -GO_SYSCALLS_SYSCALL_OS_ARCH_FILE= -if test -f ${srcdir}/syscalls/syscall_${GOOS}_${GOARCH}.go; then - GO_SYSCALLS_SYSCALL_OS_ARCH_FILE=syscalls/syscall_${GOOS}_${GOARCH}.go +GO_LIBCALL_OS_FILE= +GO_LIBCALL_OS_ARCH_FILE= +GO_SYSCALL_OS_FILE= +GO_SYSCALL_OS_ARCH_FILE= +if test -f ${srcdir}/go/syscall/libcall_${GOOS}.go; then + GO_LIBCALL_OS_FILE=go/syscall/libcall_${GOOS}.go +fi +if test -f ${srcdir}/go/syscall/libcall_${GOOS}_${GOARCH}.go; then + GO_LIBCALL_OS_ARCH_FILE=go/syscall/libcall_${GOOS}_${GOARCH}.go +fi +if test -f ${srcdir}/go/syscall/syscall_${GOOS}.go; then + GO_SYSCALL_OS_FILE=go/syscall/syscall_${GOOS}.go +fi +if test -f ${srcdir}/go/syscall/syscall_${GOOS}_${GOARCH}.go; then + GO_SYSCALL_OS_ARCH_FILE=go/syscall/syscall_${GOOS}_${GOARCH}.go fi -GO_DEBUG_PROC_REGS_OS_ARCH_FILE= -if test -f ${srcdir}/go/debug/proc/regs_${GOOS}_${GOARCH}.go; then - GO_DEBUG_PROC_REGS_OS_ARCH_FILE=go/debug/proc/regs_${GOOS}_${GOARCH}.go -fi + + + +OSCFLAGS="-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" +case "$target" in + mips-sgi-irix6.5*) + # IRIX 6 needs _XOPEN_SOURCE=500 for the XPG5 version of struct + # msghdr in . + OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=500" + ;; + *-*-solaris2.[89]) + # Solaris 8/9 need this so struct msghdr gets the msg_control + # etc. fields in (_XPG4_2). + OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=500 -D_XOPEN_SOURCE_EXTENDED -D__EXTENSIONS__" + ;; + *-*-solaris2.1[01]) + # Solaris 10+ needs this so struct msghdr gets the msg_control + # etc. fields in (_XPG4_2). _XOPEN_SOURCE=600 as + # above doesn't work with C99. + OSCFLAGS="$OSCFLAGS -std=gnu99 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__" + ;; +esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -fsplit-stack is supported" >&5 @@ -14131,7 +14508,7 @@ no) ;; esac -for ac_header in sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h +for ac_header in sys/file.h sys/mman.h syscall.h sys/epoll.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h net/if_arp.h net/route.h netpacket/packet.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h sys/timex.h sys/sysinfo.h utime.h linux/ether.h linux/fs.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -14145,6 +14522,59 @@ fi done + +for ac_header in linux/filter.h linux/if_addr.h linux/if_ether.h linux/if_tun.h linux/netlink.h linux/rtnetlink.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether can be used" >&5 +$as_echo_n "checking whether can be used... " >&6; } +if test "${libgo_cv_c_ustat_h+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + CFLAGS_hold=$CFLAGS +CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE $OSCFLAGS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_LINUX_FILTER_H +#include +#endif +#include + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libgo_cv_c_ustat_h=yes +else + libgo_cv_c_ustat_h=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS=$CFLAGS_hold +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_c_ustat_h" >&5 +$as_echo "$libgo_cv_c_ustat_h" >&6; } +if test $libgo_cv_c_ustat_h = yes; then + +$as_echo "#define HAVE_USTAT_H 1" >>confdefs.h + +fi + if test "$ac_cv_header_sys_mman_h" = yes; then HAVE_SYS_MMAN_H_TRUE= HAVE_SYS_MMAN_H_FALSE='#' @@ -14154,7 +14584,7 @@ else fi -for ac_func in srandom random strerror_r strsignal +for ac_func in strerror_r strsignal wait4 mincore setenv dl_iterate_phdr do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -14175,6 +14605,99 @@ else HAVE_STRERROR_R_FALSE= fi + if test "$ac_cv_func_wait4" = yes; then + HAVE_WAIT4_TRUE= + HAVE_WAIT4_FALSE='#' +else + HAVE_WAIT4_TRUE='#' + HAVE_WAIT4_FALSE= +fi + + +for ac_func in epoll_create1 faccessat fallocate fchmodat fchownat futimesat inotify_add_watch inotify_init inotify_init1 inotify_rm_watch mkdirat mknodat openat renameat sync_file_range splice tee unlinkat unshare +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "loff_t" "ac_cv_type_loff_t" "$ac_includes_default" +if test "x$ac_cv_type_loff_t" = x""yes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_LOFF_T 1 +_ACEOF + + +fi + + +LIBS_hold="$LIBS" +LIBS="$LIBS -lm" +for ac_func in cosl expl logl sinl tanl acosl asinl atanl atan2l expm1l ldexpl log10l log1pl +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +LIBS="$LIBS_hold" + +CFLAGS_hold="$CFLAGS" +CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +LIBS_hold="$LIBS" +LIBS="$LIBS $PTHREAD_LIBS" +for ac_func in sem_timedwait +do : + ac_fn_c_check_func "$LINENO" "sem_timedwait" "ac_cv_func_sem_timedwait" +if test "x$ac_cv_func_sem_timedwait" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SEM_TIMEDWAIT 1 +_ACEOF + +fi +done + +CFLAGS="$CFLAGS_hold" +LIBS="$LIBS_hold" + +LIBS_hold="$LIBS" +LIBS="$LIBS $MATH_LIBS" +for ac_func in matherr +do : + ac_fn_c_check_func "$LINENO" "matherr" "ac_cv_func_matherr" +if test "x$ac_cv_func_matherr" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_MATHERR 1 +_ACEOF + +fi +done + +LIBS="$LIBS_hold" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __sync_bool_compare_and_swap_4" >&5 $as_echo_n "checking for __sync_bool_compare_and_swap_4... " >&6; } @@ -14205,6 +14728,35 @@ $as_echo "#define HAVE_SYNC_BOOL_COMPARE_AND_SWAP_4 1" >>confdefs.h fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __sync_bool_compare_and_swap_8" >&5 +$as_echo_n "checking for __sync_bool_compare_and_swap_8... " >&6; } +if test "${libgo_cv_func___sync_bool_compare_and_swap_8+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +typedef unsigned int uint64 __attribute__ ((mode (DI))); +uint64 i; +int main() { return __sync_bool_compare_and_swap (&i, 0, 1); } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + libgo_cv_func___sync_bool_compare_and_swap_8=yes +else + libgo_cv_func___sync_bool_compare_and_swap_8=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_func___sync_bool_compare_and_swap_8" >&5 +$as_echo "$libgo_cv_func___sync_bool_compare_and_swap_8" >&6; } +if test "$libgo_cv_func___sync_bool_compare_and_swap_8" = "yes"; then + +$as_echo "#define HAVE_SYNC_BOOL_COMPARE_AND_SWAP_8 1" >>confdefs.h + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __sync_fetch_and_add_4" >&5 $as_echo_n "checking for __sync_fetch_and_add_4... " >&6; } if test "${libgo_cv_func___sync_fetch_and_add_4+set}" = set; then : @@ -14234,6 +14786,35 @@ $as_echo "#define HAVE_SYNC_FETCH_AND_ADD_4 1" >>confdefs.h fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __sync_add_and_fetch_8" >&5 +$as_echo_n "checking for __sync_add_and_fetch_8... " >&6; } +if test "${libgo_cv_func___sync_add_and_fetch_8+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +typedef unsigned int uint64 __attribute__ ((mode (DI))); +uint64 i; +int main() { return __sync_add_and_fetch (&i, 1); } + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + libgo_cv_func___sync_add_and_fetch_8=yes +else + libgo_cv_func___sync_add_and_fetch_8=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_func___sync_add_and_fetch_8" >&5 +$as_echo "$libgo_cv_func___sync_add_and_fetch_8" >&6; } +if test "$libgo_cv_func___sync_add_and_fetch_8" = "yes"; then + +$as_echo "#define HAVE_SYNC_ADD_AND_FETCH_8 1" >>confdefs.h + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -minline-all-stringops" >&5 $as_echo_n "checking whether compiler supports -minline-all-stringops... " >&6; } if test "${libgo_cv_c_stringops+set}" = set; then : @@ -14261,6 +14842,33 @@ if test "$libgo_cv_c_stringops" = yes; then fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -mfancy-math-387" >&5 +$as_echo_n "checking whether compiler supports -mfancy-math-387... " >&6; } +if test "${libgo_cv_c_fancymath+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + CFLAGS_hold=$CFLAGS +CFLAGS="$CFLAGS -mfancy-math-387" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + libgo_cv_c_fancymath=yes +else + libgo_cv_c_fancymath=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS=$CFLAGS_hold +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_c_fancymath" >&5 +$as_echo "$libgo_cv_c_fancymath" >&6; } +MATH_FLAG= +if test "$libgo_cv_c_fancymath" = yes; then + MATH_FLAG="-mfancy-math-387 -funsafe-math-optimizations" +fi + + CFLAGS_hold=$CFLAGS CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE" ac_fn_c_check_type "$LINENO" "off64_t" "ac_cv_type_off64_t" "$ac_includes_default" @@ -14275,6 +14883,210 @@ fi CFLAGS=$CFLAGS_hold +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking epoll_event size" >&5 +$as_echo_n "checking epoll_event size... " >&6; } +if test "${libgo_cv_c_epoll_event_size+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "sizeof (struct epoll_event)" "libgo_cv_c_epoll_event_size" "#include "; then : + +else + libgo_cv_c_epoll_event_size=0 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_c_epoll_event_size" >&5 +$as_echo "$libgo_cv_c_epoll_event_size" >&6; } +SIZEOF_STRUCT_EPOLL_EVENT=${libgo_cv_c_epoll_event_size} + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking epoll_event data.fd offset" >&5 +$as_echo_n "checking epoll_event data.fd offset... " >&6; } +if test "${libgo_cv_c_epoll_event_fd_offset+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "offsetof (struct epoll_event, data.fd)" "libgo_cv_c_epoll_event_fd_offset" "#include +#include "; then : + +else + libgo_cv_c_epoll_event_fd_offset=0 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_c_epoll_event_fd_offset" >&5 +$as_echo "$libgo_cv_c_epoll_event_fd_offset" >&6; } +STRUCT_EPOLL_EVENT_FD_OFFSET=${libgo_cv_c_epoll_event_fd_offset} + + +ac_fn_c_check_type "$LINENO" "struct exception" "ac_cv_type_struct_exception" "#include +" +if test "x$ac_cv_type_struct_exception" = x""yes; then : + libgo_has_struct_exception=yes +else + libgo_has_struct_exception=no +fi + +if test "$libgo_has_struct_exception" = "yes"; then + +$as_echo "#define HAVE_STRUCT_EXCEPTION 1" >>confdefs.h + +fi + +case "$target" in + sparc*-*-solaris2.[89]*) + libgo_cv_lib_makecontext_stack_top=yes + ;; + *) + libgo_cv_lib_makecontext_stack_top=no + ;; +esac +if test "$libgo_cv_lib_makecontext_stack_top" = "yes"; then + +$as_echo "#define MAKECONTEXT_STACK_TOP 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setcontext clobbers TLS variables" >&5 +$as_echo_n "checking whether setcontext clobbers TLS variables... " >&6; } +if test "${libgo_cv_lib_setcontext_clobbers_tls+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + CFLAGS_hold="$CFLAGS" +CFLAGS="$PTHREAD_CFLAGS" +LIBS_hold="$LIBS" +LIBS="$LIBS $PTHREAD_LIBS" +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } +if test "${ac_cv_sizeof_void_p+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_void_p" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "cannot compute sizeof (void *) +See \`config.log' for more details." "$LINENO" 5; }; } + else + ac_cv_sizeof_void_p=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_VOID_P $ac_cv_sizeof_void_p +_ACEOF + + +as_fn_arith $ac_cv_sizeof_void_p \* 8 && ptr_type_size=$as_val +if test "$cross_compiling" = yes; then : + case "$target:$ptr_type_size" in + i?86-*-solaris2.1[01]:64 | x86_64*-*-solaris2.1[01]:64) + libgo_cv_lib_setcontext_clobbers_tls=yes ;; + *) + libgo_cv_lib_setcontext_clobbers_tls=no ;; + esac + +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include +#include + +__thread int tls; + +static char stack[10 * 1024 * 1024]; +static ucontext_t c; + +/* Called via makecontext/setcontext. */ + +static void +cfn (void) +{ + exit (tls); +} + +/* Called via pthread_create. */ + +static void * +tfn (void *dummy) +{ + /* The thread should still see this value after calling + setcontext. */ + tls = 0; + + setcontext (&c); + + /* The call to setcontext should not return. */ + abort (); +} + +int +main () +{ + pthread_t tid; + + /* The thread should not see this value. */ + tls = 1; + + if (getcontext (&c) < 0) + abort (); + + c.uc_stack.ss_sp = stack; +#ifdef MAKECONTEXT_STACK_TOP + c.uc_stack.ss_sp += sizeof stack; +#endif + c.uc_stack.ss_flags = 0; + c.uc_stack.ss_size = sizeof stack; + c.uc_link = NULL; + makecontext (&c, cfn, 0); + + if (pthread_create (&tid, NULL, tfn, NULL) != 0) + abort (); + + if (pthread_join (tid, NULL) != 0) + abort (); + + /* The thread should have called exit. */ + abort (); +} + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + libgo_cv_lib_setcontext_clobbers_tls=no +else + libgo_cv_lib_setcontext_clobbers_tls=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +CFLAGS="$CFLAGS_hold" +LIBS="$LIBS_hold" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_lib_setcontext_clobbers_tls" >&5 +$as_echo "$libgo_cv_lib_setcontext_clobbers_tls" >&6; } +if test "$libgo_cv_lib_setcontext_clobbers_tls" = "yes"; then + +$as_echo "#define SETCONTEXT_CLOBBERS_TLS 1" >>confdefs.h + +fi + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -14487,10 +15299,18 @@ if test -z "${LIBGO_IS_FREEBSD_TRUE}" && test -z "${LIBGO_IS_FREEBSD_FALSE}"; th as_fn_error "conditional \"LIBGO_IS_FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${LIBGO_IS_IRIX_TRUE}" && test -z "${LIBGO_IS_IRIX_FALSE}"; then + as_fn_error "conditional \"LIBGO_IS_IRIX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${LIBGO_IS_LINUX_TRUE}" && test -z "${LIBGO_IS_LINUX_FALSE}"; then as_fn_error "conditional \"LIBGO_IS_LINUX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${LIBGO_IS_NETBSD_TRUE}" && test -z "${LIBGO_IS_NETBSD_FALSE}"; then + as_fn_error "conditional \"LIBGO_IS_NETBSD\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${LIBGO_IS_RTEMS_TRUE}" && test -z "${LIBGO_IS_RTEMS_FALSE}"; then as_fn_error "conditional \"LIBGO_IS_RTEMS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -14503,6 +15323,10 @@ if test -z "${LIBGO_IS_386_TRUE}" && test -z "${LIBGO_IS_386_FALSE}"; then as_fn_error "conditional \"LIBGO_IS_386\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${LIBGO_IS_ALPHA_TRUE}" && test -z "${LIBGO_IS_ALPHA_FALSE}"; then + as_fn_error "conditional \"LIBGO_IS_ALPHA\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${LIBGO_IS_ARM_TRUE}" && test -z "${LIBGO_IS_ARM_FALSE}"; then as_fn_error "conditional \"LIBGO_IS_ARM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -14515,8 +15339,20 @@ if test -z "${LIBGO_IS_MIPS_TRUE}" && test -z "${LIBGO_IS_MIPS_FALSE}"; then as_fn_error "conditional \"LIBGO_IS_MIPS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${LIBGO_IS_MIPS64_TRUE}" && test -z "${LIBGO_IS_MIPS64_FALSE}"; then - as_fn_error "conditional \"LIBGO_IS_MIPS64\" was never defined. +if test -z "${LIBGO_IS_MIPSO32_TRUE}" && test -z "${LIBGO_IS_MIPSO32_FALSE}"; then + as_fn_error "conditional \"LIBGO_IS_MIPSO32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBGO_IS_MIPSN32_TRUE}" && test -z "${LIBGO_IS_MIPSN32_FALSE}"; then + as_fn_error "conditional \"LIBGO_IS_MIPSN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBGO_IS_MIPSN64_TRUE}" && test -z "${LIBGO_IS_MIPSN64_FALSE}"; then + as_fn_error "conditional \"LIBGO_IS_MIPSN64\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${LIBGO_IS_MIPSO64_TRUE}" && test -z "${LIBGO_IS_MIPSO64_FALSE}"; then + as_fn_error "conditional \"LIBGO_IS_MIPSO64\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${LIBGO_IS_PPC_TRUE}" && test -z "${LIBGO_IS_PPC_FALSE}"; then @@ -14552,6 +15388,10 @@ if test -z "${HAVE_STRERROR_R_TRUE}" && test -z "${HAVE_STRERROR_R_FALSE}"; then as_fn_error "conditional \"HAVE_STRERROR_R\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${HAVE_WAIT4_TRUE}" && test -z "${HAVE_WAIT4_FALSE}"; then + as_fn_error "conditional \"HAVE_WAIT4\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0