URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libgo/] [configure.ac] - Rev 780
Go to most recent revision | Compare with Previous | Blame | View Log
# configure.ac -- Go library configure script.# Copyright 2009 The Go Authors. All rights reserved.# Use of this source code is governed by a BSD-style# license that can be found in the LICENSE file.# Process this file with autoreconf to produce configure.AC_PREREQ(2.64)AC_INIT(package-unused, version-unused,, libgo)AC_CONFIG_SRCDIR(Makefile.am)AC_CONFIG_HEADER(config.h)libtool_VERSION=1:0:0AC_SUBST(libtool_VERSION)AM_ENABLE_MULTILIB(, ..)AC_CANONICAL_SYSTEMtarget_alias=${target_alias-$host_alias}AM_INIT_AUTOMAKE([1.9.3 no-define foreign -Wall])AH_TEMPLATE(PACKAGE, [Name of package])AH_TEMPLATE(VERSION, [Version number of package])m4_rename([_AC_ARG_VAR_PRECIOUS],[glibgo_PRECIOUS])m4_define([_AC_ARG_VAR_PRECIOUS],[])AC_PROG_CCAC_PROG_GOm4_rename_force([glibgo_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])AC_SUBST(CFLAGS)AM_MAINTAINER_MODEAC_PROG_LDAC_PROG_RANLIBAC_CHECK_TOOL(OBJCOPY, objcopy, missing-objcopy)AC_LIBTOOL_DLOPENAM_PROG_LIBTOOLAC_SUBST(enable_shared)AC_SUBST(enable_static)CC_FOR_BUILD=${CC_FOR_BUILD:-gcc}AC_SUBST(CC_FOR_BUILD)AC_PROG_AWKWARN_FLAGS='-Wall -Wextra -Wwrite-strings -Wcast-qual'AC_SUBST(WARN_FLAGS)dnl FIXME: This should be controlled by --enable-maintainer-mode.WERROR="-Werror"AC_SUBST(WERROR)glibgo_toolexecdir=noglibgo_toolexeclibdir=noAC_MSG_CHECKING([for --enable-version-specific-runtime-libs])AC_ARG_ENABLE([version-specific-runtime-libs],AC_HELP_STRING([--enable-version-specific-runtime-libs],[Specify that runtime libraries should be installed in a compiler-specific directory]),[case "$enableval" inyes) version_specific_libs=yes ;;no) version_specific_libs=no ;;*) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;esac],[version_specific_libs=no])AC_MSG_RESULT($version_specific_libs)# Version-specific runtime libs processing.if test $version_specific_libs = yes; thenglibgo_toolexecdir='${libdir}/gcc/${host_alias}'glibgo_toolexeclibdir='${toolexecdir}/${gcc_version}$(MULTISUBDIR)'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"; thennover_glibgo_toolexecdir='${exec_prefix}/${host_alias}'nover_glibgo_toolexeclibdir='${toolexecdir}/lib'elsenover_glibgo_toolexecdir='${libdir}/gcc/${host_alias}'nover_glibgo_toolexeclibdir='${libdir}'fimulti_os_directory=`$CC -print-multi-os-directory`case $multi_os_directory in.) ;; # Avoid trailing /.*) nover_glibgo_toolexeclibdir=${nover_glibgo_toolexeclibdir}/${multi_os_directory} ;;esacif test x"$glibgo_toolexecdir" = x"no"; thenglibgo_toolexecdir="${nover_glibgo_toolexecdir}"glibgo_toolexeclibdir="${nover_glibgo_toolexeclibdir}"fiAC_SUBST(glibgo_toolexecdir)AC_SUBST(glibgo_toolexeclibdir)AC_SUBST(nover_glibgo_toolexeclibdir)# See if the user wants to configure without libffi. Some# architectures don't support it. FIXME: We should set a default# based on the host.AC_ARG_WITH(libffi,AS_HELP_STRING([--without-libffi],[don't use libffi]),[:],[with_libffi=${with_libffi_default-yes}])LIBFFI=LIBFFIINCS=if test "$with_libffi" != no; thenAC_DEFINE(USE_LIBFFI, 1, [Define if we're to use libffi.])LIBFFI=../libffi/libffi_convenience.laLIBFFIINCS='-I$(top_srcdir)/../libffi/include -I../libffi/include'fiAC_SUBST(LIBFFI)AC_SUBST(LIBFFIINCS)# Used to tell GNU make to include a file without telling automake to# include it.go_include="-include"AC_SUBST(go_include)is_darwin=nois_freebsd=nois_irix=nois_linux=nois_netbsd=nois_rtems=nois_solaris=noGOOS=unknowncase ${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 ;;esacAM_CONDITIONAL(LIBGO_IS_DARWIN, test $is_darwin = yes)AM_CONDITIONAL(LIBGO_IS_FREEBSD, test $is_freebsd = yes)AM_CONDITIONAL(LIBGO_IS_IRIX, test $is_irix = yes)AM_CONDITIONAL(LIBGO_IS_LINUX, test $is_linux = yes)AM_CONDITIONAL(LIBGO_IS_NETBSD, test $is_netbsd = yes)AM_CONDITIONAL(LIBGO_IS_RTEMS, test $is_rtems = yes)AM_CONDITIONAL(LIBGO_IS_SOLARIS, test $is_solaris = yes)AC_SUBST(GOOS)dnl N.B. Keep in sync with gcc/testsuite/go.test/go-test.exp (go-set-goarch).is_386=nois_alpha=nois_arm=nois_m68k=nomips_abi=unknownis_ppc=nois_ppc64=nois_sparc=nois_sparc64=nois_x86_64=noGOARCH=unknowncase ${host} inalpha*-*-*)is_alpha=yesGOARCH=alpha;;arm*-*-* | strongarm*-*-* | ep9312*-*-* | xscale-*-*)is_arm=yesGOARCH=arm;;changequote(,)dnli[34567]86-*-* | x86_64-*-*)changequote([,])dnlAC_COMPILE_IFELSE([#ifdef __x86_64__#error 64-bit#endif],[is_386=yes], [is_x86_64=yes])if test "$is_386" = "yes"; thenGOARCH=386elseGOARCH=amd64fi;;m68k*-*-*)is_m68k=yesGOARCH=m68k;;mips*-*-*)AC_COMPILE_IFELSE([#if _MIPS_SIM != _ABIO32#error not o32#endif],[mips_abi="o32"],[AC_COMPILE_IFELSE([#if _MIPS_SIM != _ABIN32#error not n32#endif],[mips_abi="n32"],[AC_COMPILE_IFELSE([#if _MIPS_SIM != _ABI64#error not n64#endif],[mips_abi="n64"],[AC_COMPILE_IFELSE([#if _MIPS_SIM != _ABIO64#error not o64#endif],[mips_abi="o64"],[AC_MSG_ERROR([unknown MIPS ABI])[mips_abi="n32"]])])])])case "$mips_abi" in"o32") GOARCH=mipso32 ;;"n32") GOARCH=mipsn32 ;;"n64") GOARCH=mipsn64 ;;"o64") GOARCH=mipso64 ;;esac;;rs6000*-*-* | powerpc*-*-*)AC_COMPILE_IFELSE([#ifdef _ARCH_PPC64#error 64-bit#endif],[is_ppc=yes], [is_ppc64=yes])if test "$is_ppc" = "yes"; thenGOARCH=ppcelseGOARCH=ppc64fi;;sparc*-*-*)AC_COMPILE_IFELSE([#if defined(__sparcv9) || defined(__arch64__)#error 64-bit#endif],[is_sparc=yes], [is_sparc64=yes])if test "$is_sparc" = "yes"; thenGOARCH=sparcelseGOARCH=sparc64fi;;esacAM_CONDITIONAL(LIBGO_IS_386, test $is_386 = yes)AM_CONDITIONAL(LIBGO_IS_ALPHA, test $is_alpha = yes)AM_CONDITIONAL(LIBGO_IS_ARM, test $is_arm = yes)AM_CONDITIONAL(LIBGO_IS_M68K, test $is_m68k = yes)AM_CONDITIONAL(LIBGO_IS_MIPS, test $mips_abi != unknown)AM_CONDITIONAL(LIBGO_IS_MIPSO32, test $mips_abi = o32)AM_CONDITIONAL(LIBGO_IS_MIPSN32, test $mips_abi = n32)AM_CONDITIONAL(LIBGO_IS_MIPSN64, test $mips_abi = n64)AM_CONDITIONAL(LIBGO_IS_MIPSO64, test $mips_abi = o64)AM_CONDITIONAL(LIBGO_IS_PPC, test $is_ppc = yes)AM_CONDITIONAL(LIBGO_IS_PPC64, test $is_ppc64 = yes)AM_CONDITIONAL(LIBGO_IS_SPARC, test $is_sparc = yes)AM_CONDITIONAL(LIBGO_IS_SPARC64, test $is_sparc64 = yes)AM_CONDITIONAL(LIBGO_IS_X86_64, test $is_x86_64 = yes)AC_SUBST(GOARCH)dnl Some files are only present when needed for specific architectures.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; thenGO_LIBCALL_OS_FILE=go/syscall/libcall_${GOOS}.gofiif test -f ${srcdir}/go/syscall/libcall_${GOOS}_${GOARCH}.go; thenGO_LIBCALL_OS_ARCH_FILE=go/syscall/libcall_${GOOS}_${GOARCH}.gofiif test -f ${srcdir}/go/syscall/syscall_${GOOS}.go; thenGO_SYSCALL_OS_FILE=go/syscall/syscall_${GOOS}.gofiif test -f ${srcdir}/go/syscall/syscall_${GOOS}_${GOARCH}.go; thenGO_SYSCALL_OS_ARCH_FILE=go/syscall/syscall_${GOOS}_${GOARCH}.gofiAC_SUBST(GO_LIBCALL_OS_FILE)AC_SUBST(GO_LIBCALL_OS_ARCH_FILE)AC_SUBST(GO_SYSCALL_OS_FILE)AC_SUBST(GO_SYSCALL_OS_ARCH_FILE)dnl Special flags used to generate sysinfo.go.OSCFLAGS="-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"case "$target" inmips-sgi-irix6.5*)# IRIX 6 needs _XOPEN_SOURCE=500 for the XPG5 version of struct# msghdr in <sys/socket.h>.OSCFLAGS="$OSCFLAGS -D_XOPEN_SOURCE=500";;*-*-solaris2.[[89]])# Solaris 8/9 need this so struct msghdr gets the msg_control# etc. fields in <sys/socket.h> (_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 <sys/socket.h> (_XPG4_2). _XOPEN_SOURCE=600 as# above doesn't work with C99.OSCFLAGS="$OSCFLAGS -std=gnu99 -D_XOPEN_SOURCE=600 -D__EXTENSIONS__";;esacAC_SUBST(OSCFLAGS)dnl Use -fsplit-stack when compiling C code if available.AC_CACHE_CHECK([whether -fsplit-stack is supported],[libgo_cv_c_split_stack_supported],[CFLAGS_hold=$CFLAGSCFLAGS="$CFLAGS -fsplit-stack"AC_COMPILE_IFELSE([[int i;]],[libgo_cv_c_split_stack_supported=yes],[libgo_cv_c_split_stack_supported=no])CFLAGS=$CFLAGS_hold])if test "$libgo_cv_c_split_stack_supported" = yes; thenSPLIT_STACK=-fsplit-stackAC_DEFINE(USING_SPLIT_STACK, 1,[Define if the compiler supports -fsplit-stack])elseSPLIT_STACK=fiAC_SUBST(SPLIT_STACK)AM_CONDITIONAL(USING_SPLIT_STACK,test "$libgo_cv_c_split_stack_supported" = yes)dnl Check whether the linker does stack munging when calling fromdnl split-stack into non-split-stack code. We check this by lookingdnl at the --help output. FIXME: This is only half right: it'sdnl possible for the linker to support this for some targets but notdnl others.AC_CACHE_CHECK([whether linker supports split stack],[libgo_cv_c_linker_supports_split_stack],libgo_cv_c_linker_supports_split_stack=noif $LD --help 2>/dev/null | grep split-stack-adjust-size >/dev/null 2>&1; thenlibgo_cv_c_linker_supports_split_stack=yesfi)if test "$libgo_cv_c_linker_supports_split_stack" = yes; thenAC_DEFINE(LINKER_SUPPORTS_SPLIT_STACK, 1,[Define if the linker support split stack adjustments])fidnl Test for the -lm library.MATH_LIBS=AC_CHECK_LIB([m], [sqrt], MATH_LIBS=-lm)AC_SUBST(MATH_LIBS)dnl Test for -lsocket and -lnsl. Copied from libjava/configure.ac.AC_CACHE_CHECK([for socket libraries], libgo_cv_lib_sockets,[libgo_cv_lib_sockets=libgo_check_both=noAC_CHECK_FUNC(connect, libgo_check_socket=no, libgo_check_socket=yes)if test "$libgo_check_socket" = "yes"; thenunset ac_cv_func_connectAC_CHECK_LIB(socket, main, libgo_cv_lib_sockets="-lsocket",libgo_check_both=yes)fiif test "$libgo_check_both" = "yes"; thenlibgo_old_libs=$LIBSLIBS="$LIBS -lsocket -lnsl"unset ac_cv_func_acceptAC_CHECK_FUNC(accept,[libgo_check_nsl=nolibgo_cv_lib_sockets="-lsocket -lnsl"])unset ac_cv_func_acceptLIBS=$libgo_old_libsfiunset ac_cv_func_gethostbynamelibgo_old_libs="$LIBS"AC_CHECK_FUNC(gethostbyname, ,[AC_CHECK_LIB(nsl, main,[libgo_cv_lib_sockets="$libgo_cv_lib_sockets -lnsl"])])unset ac_cv_func_gethostbynameLIBS=$libgo_old_libs])NET_LIBS="$libgo_cv_lib_sockets"AC_SUBST(NET_LIBS)dnl Test whether the compiler supports the -pthread option.AC_CACHE_CHECK([whether -pthread is supported],[libgo_cv_lib_pthread],[CFLAGS_hold=$CFLAGSCFLAGS="$CFLAGS -pthread"AC_COMPILE_IFELSE([[int i;]],[libgo_cv_lib_pthread=yes],[libgo_cv_lib_pthread=no])CFLAGS=$CFLAGS_hold])PTHREAD_CFLAGS=if test "$libgo_cv_lib_pthread" = yes; thenPTHREAD_CFLAGS=-pthreadfiAC_SUBST(PTHREAD_CFLAGS)dnl Test for the -lpthread library.PTHREAD_LIBS=AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS=-lpthread)AC_SUBST(PTHREAD_LIBS)dnl Test if -lrt is required for sched_yield.AC_SEARCH_LIBS([sched_yield], [rt])AC_C_BIGENDIANGCC_CHECK_UNWIND_GETIPINFOAC_ARG_ENABLE(sjlj-exceptions,AC_HELP_STRING([--enable-sjlj-exceptions],[force use of builtin_setjmp for exceptions]),[case "$enableval" inyes|no|auto) ;;*) AC_MSG_ERROR([unknown argument to --enable-sjlj-exceptions]) ;;esac],[enable_sjlj_exceptions=auto])AC_CACHE_CHECK([whether to use setjmp/longjmp exceptions],[libgo_cv_lib_sjlj_exceptions],[AC_LANG_CONFTEST([AC_LANG_SOURCE([void bar ();void clean (int *);void foo (){int i __attribute__ ((cleanup (clean)));bar();}])])CFLAGS_hold=$CFLAGSCFLAGS="--save-temps -fexceptions"libgo_cv_lib_sjlj_exceptions=unknownAS_IF([ac_fn_c_try_compile],[if grep _Unwind_SjLj_Resume conftest.s >/dev/null 2>&1; thenlibgo_cv_lib_sjlj_exceptions=yeselif grep _Unwind_Resume conftest.s >/dev/null 2>&1; thenlibgo_cv_lib_sjlj_exceptions=nofi])CFLAGS=$CFLAGS_holdrm -f conftest*])if test "$enable_sjlj_exceptions" = "auto"; thenenable_sjlj_exceptions=$libgo_cv_lib_sjlj_exceptionsficase $enable_sjlj_exceptions inyes)AC_DEFINE(LIBGO_SJLJ_EXCEPTIONS, 1,[Define if the C++ compiler is configured for setjmp/longjmp exceptions.]);;no);;*)AC_MSG_ERROR([unable to detect exception model]);;esacAC_CHECK_HEADERS(sys/mman.h syscall.h sys/epoll.h sys/ptrace.h sys/syscall.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/if.h sys/prctl.h sys/mount.h sys/vfs.h sys/statfs.h)AC_CHECK_HEADERS([linux/filter.h linux/netlink.h linux/rtnetlink.h], [], [],[#ifdef HAVE_SYS_SOCKET_H#include <sys/socket.h>#endif])AM_CONDITIONAL(HAVE_SYS_MMAN_H, test "$ac_cv_header_sys_mman_h" = yes)AC_CHECK_FUNCS(strerror_r strsignal wait4 mincore setenv)AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)AM_CONDITIONAL(HAVE_WAIT4, test "$ac_cv_func_wait4" = yes)AC_CHECK_FUNCS(epoll_create1 faccessat fallocate fchmodat fchownat futimesat inotify_add_watch inotify_init inotify_rm_watch mkdirat mknodat openat renameat splice tee unlinkat unshare)AC_TYPE_OFF_TAC_CHECK_TYPES([loff_t])CFLAGS_hold="$CFLAGS"CFLAGS="$CFLAGS $PTHREAD_CFLAGS"LIBS_hold="$LIBS"LIBS="$LIBS $PTHREAD_LIBS"AC_CHECK_FUNCS(sem_timedwait)CFLAGS="$CFLAGS_hold"LIBS="$LIBS_hold"LIBS_hold="$LIBS"LIBS="$LIBS $MATH_LIBS"AC_CHECK_FUNCS(matherr)LIBS="$LIBS_hold"AC_CACHE_CHECK([for __sync_bool_compare_and_swap_4],[libgo_cv_func___sync_bool_compare_and_swap_4],[AC_LINK_IFELSE([typedef unsigned int uint32 __attribute__ ((mode (SI)));uint32 i;int main() { return __sync_bool_compare_and_swap (&i, 0, 1); }],[libgo_cv_func___sync_bool_compare_and_swap_4=yes],[libgo_cv_func___sync_bool_compare_and_swap_4=no])])if test "$libgo_cv_func___sync_bool_compare_and_swap_4" = "yes"; thenAC_DEFINE(HAVE_SYNC_BOOL_COMPARE_AND_SWAP_4, 1,[Define to 1 if the compiler provides the __sync_bool_compare_and_swap function for uint32])fiAC_CACHE_CHECK([for __sync_bool_compare_and_swap_8],[libgo_cv_func___sync_bool_compare_and_swap_8],[AC_LINK_IFELSE([typedef unsigned int uint64 __attribute__ ((mode (DI)));uint64 i;int main() { return __sync_bool_compare_and_swap (&i, 0, 1); }],[libgo_cv_func___sync_bool_compare_and_swap_8=yes],[libgo_cv_func___sync_bool_compare_and_swap_8=no])])if test "$libgo_cv_func___sync_bool_compare_and_swap_8" = "yes"; thenAC_DEFINE(HAVE_SYNC_BOOL_COMPARE_AND_SWAP_8, 1,[Define to 1 if the compiler provides the __sync_bool_compare_and_swap function for uint64])fiAC_CACHE_CHECK([for __sync_fetch_and_add_4],[libgo_cv_func___sync_fetch_and_add_4],[AC_LINK_IFELSE([typedef unsigned int uint32 __attribute__ ((mode (SI)));uint32 i;int main() { return __sync_fetch_and_add (&i, 1); }],[libgo_cv_func___sync_fetch_and_add_4=yes],[libgo_cv_func___sync_fetch_and_add_4=no])])if test "$libgo_cv_func___sync_fetch_and_add_4" = "yes"; thenAC_DEFINE(HAVE_SYNC_FETCH_AND_ADD_4, 1,[Define to 1 if the compiler provides the __sync_fetch_and_add function for uint32])fiAC_CACHE_CHECK([for __sync_add_and_fetch_8],[libgo_cv_func___sync_add_and_fetch_8],[AC_LINK_IFELSE([typedef unsigned int uint64 __attribute__ ((mode (DI)));uint64 i;int main() { return __sync_add_and_fetch (&i, 1); }],[libgo_cv_func___sync_add_and_fetch_8=yes],[libgo_cv_func___sync_add_and_fetch_8=no])])if test "$libgo_cv_func___sync_add_and_fetch_8" = "yes"; thenAC_DEFINE(HAVE_SYNC_ADD_AND_FETCH_8, 1,[Define to 1 if the compiler provides the __sync_add_and_fetch function for uint64])fidnl For x86 we want to use the -minline-all-stringops option to avoiddnl forcing a stack split when calling memcpy and friends.AC_CACHE_CHECK([whether compiler supports -minline-all-stringops],[libgo_cv_c_stringops],[CFLAGS_hold=$CFLAGSCFLAGS="$CFLAGS -minline-all-stringops"AC_COMPILE_IFELSE([int i;],[libgo_cv_c_stringops=yes],[libgo_cv_c_stringops=no])CFLAGS=$CFLAGS_hold])STRINGOPS_FLAG=if test "$libgo_cv_c_stringops" = yes; thenSTRINGOPS_FLAG=-minline-all-stringopsfiAC_SUBST(STRINGOPS_FLAG)dnl For x86 we want to compile the math library with -mfancy-math-387dnl -funsafe-math-optimizations so that we can use the builtindnl instructions directly.AC_CACHE_CHECK([whether compiler supports -mfancy-math-387],[libgo_cv_c_fancymath],[CFLAGS_hold=$CFLAGSCFLAGS="$CFLAGS -mfancy-math-387"AC_COMPILE_IFELSE([int i;],[libgo_cv_c_fancymath=yes],[libgo_cv_c_fancymath=no])CFLAGS=$CFLAGS_hold])MATH_FLAG=if test "$libgo_cv_c_fancymath" = yes; thenMATH_FLAG="-mfancy-math-387 -funsafe-math-optimizations"fiAC_SUBST(MATH_FLAG)CFLAGS_hold=$CFLAGSCFLAGS="$CFLAGS -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE"AC_CHECK_TYPES([off64_t])CFLAGS=$CFLAGS_holddnl Work out the size of the epoll_events struct on GNU/Linux.AC_CACHE_CHECK([epoll_event size],[libgo_cv_c_epoll_event_size],[AC_COMPUTE_INT(libgo_cv_c_epoll_event_size,[sizeof (struct epoll_event)],[#include <sys/epoll.h>],[libgo_cv_c_epoll_event_size=0])])SIZEOF_STRUCT_EPOLL_EVENT=${libgo_cv_c_epoll_event_size}AC_SUBST(SIZEOF_STRUCT_EPOLL_EVENT)dnl Work out the offset of the fd field in the epoll_events struct ondnl GNU/Linux.AC_CACHE_CHECK([epoll_event data.fd offset],[libgo_cv_c_epoll_event_fd_offset],[AC_COMPUTE_INT(libgo_cv_c_epoll_event_fd_offset,[offsetof (struct epoll_event, data.fd)],[#include <stddef.h>#include <sys/epoll.h>],[libgo_cv_c_epoll_event_fd_offset=0])])STRUCT_EPOLL_EVENT_FD_OFFSET=${libgo_cv_c_epoll_event_fd_offset}AC_SUBST(STRUCT_EPOLL_EVENT_FD_OFFSET)dnl See if struct exception is defined in <math.h>.AC_CHECK_TYPE([struct exception],[libgo_has_struct_exception=yes],[libgo_has_struct_exception=no],[#include <math.h>])if test "$libgo_has_struct_exception" = "yes"; thenAC_DEFINE(HAVE_STRUCT_EXCEPTION, 1,[Define to 1 if <math.h> defines struct exception])fidnl Check if makecontext expects the uc_stack member of ucontext to pointdnl to the top of the stack.case "$target" insparc*-*-solaris2.[[89]]*)libgo_cv_lib_makecontext_stack_top=yes;;*)libgo_cv_lib_makecontext_stack_top=no;;esacif test "$libgo_cv_lib_makecontext_stack_top" = "yes"; thenAC_DEFINE(MAKECONTEXT_STACK_TOP, 1,[Define if makecontext expects top of stack in uc_stack.])fidnl See whether setcontext changes the value of TLS variables.AC_CACHE_CHECK([whether setcontext clobbers TLS variables],[libgo_cv_lib_setcontext_clobbers_tls],[CFLAGS_hold="$CFLAGS"CFLAGS="$PTHREAD_CFLAGS"LIBS_hold="$LIBS"LIBS="$LIBS $PTHREAD_LIBS"AC_CHECK_SIZEOF([void *])AS_VAR_ARITH([ptr_type_size], [$ac_cv_sizeof_void_p \* 8])AC_RUN_IFELSE([AC_LANG_SOURCE([#include <pthread.h>#include <stdlib.h>#include <ucontext.h>#include <unistd.h>__thread int tls;static char stack[[10 * 1024 * 1024]];static ucontext_t c;/* Called via makecontext/setcontext. */static voidcfn (void){exit (tls);}/* Called via pthread_create. */static void *tfn (void *dummy){/* The thread should still see this value after callingsetcontext. */tls = 0;setcontext (&c);/* The call to setcontext should not return. */abort ();}intmain (){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_TOPc.uc_stack.ss_sp += sizeof stack;#endifc.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 ();}])],[libgo_cv_lib_setcontext_clobbers_tls=no],[libgo_cv_lib_setcontext_clobbers_tls=yes],[case "$target:$ptr_type_size" ini?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])CFLAGS="$CFLAGS_hold"LIBS="$LIBS_hold"])if test "$libgo_cv_lib_setcontext_clobbers_tls" = "yes"; thenAC_DEFINE(SETCONTEXT_CLOBBERS_TLS, 1,[Define if setcontext clobbers TLS variables])fiAC_CACHE_SAVEif test ${multilib} = yes; thenmultilib_arg="--enable-multilib"elsemultilib_arg=fiAC_CONFIG_FILES(Makefile testsuite/Makefile)AC_CONFIG_COMMANDS([default],[if test -n "$CONFIG_FILES"; then# Multilibs need MULTISUBDIR defined correctly in certain makefiles so# that multilib installs will end up installed in the correct place.# The testsuite needs it for multilib-aware ABI baseline files.# To work around this not being passed down from config-ml.in -># srcdir/Makefile.am -> srcdir/{src,libsupc++,...}/Makefile.am, manually# append it here. Only modify Makefiles that have just been created.## Also, get rid of this simulated-VPATH thing that automake does.cat > vpsed << \_EOFs!`test -f '$<' || echo '$(srcdir)/'`!!_EOFfor i in $SUBDIRS; docase $CONFIG_FILES in*${i}/Makefile*)#echo "Adding MULTISUBDIR to $i/Makefile"sed -f vpsed $i/Makefile > tmpgrep '^MULTISUBDIR =' Makefile >> tmpmv tmp $i/Makefile;;esacdonerm vpsedfi],[# Variables needed in config.status (file generation) which aren't already# passed by autoconf.SUBDIRS="$SUBDIRS"])AC_OUTPUT
Go to most recent revision | Compare with Previous | Blame | View Log
