AC_CONFIG_SRCDIR(Makefile.am)
AC_CONFIG_HEADER(config.h)
-libtool_VERSION=14:0:0
+libtool_VERSION=22:0:0
AC_SUBST(libtool_VERSION)
AM_ENABLE_MULTILIB(, ..)
case ${host} in
*-*-aix*)
- # static hash tables crashes on AIX when libgo is built with O2
- CFLAGS="$CFLAGS -fno-section-anchors"
- GOCFLAGS="$GOCFLAGS -fno-section-anchors"
+ # Check default architecture for FAT library creation
+ if test -z "`$CC -x c -E /dev/null -g3 -o - | grep 64BIT`" ; then
+ AIX_EXTRA_ARCH='64'
+ else
+ AIX_EXTRA_ARCH='32'
+ fi
+ AC_SUBST(AIX_EXTRA_ARCH)
;;
esac
WARN_FLAGS='-Wall -Wextra -Wwrite-strings -Wcast-qual'
AC_SUBST(WARN_FLAGS)
-AC_ARG_ENABLE(werror, [AS_HELP_STRING([--enable-werror],
- [turns on -Werror @<:@default=yes@:>@])])
-if test "x$enable_werror" != "xno"; then
- WERROR="-Werror"
-fi
+AC_ARG_ENABLE([werror],
+ [AS_HELP_STRING([--disable-werror], [disable building with -Werror])])
+AS_IF([test "x$enable_werror" != "xno" && test "x$GCC" = "xyes"],
+ [WERROR="-Werror"])
AC_SUBST(WERROR)
glibgo_toolexecdir=no
[version_specific_libs=no])
AC_MSG_RESULT($version_specific_libs)
+GCC_WITH_TOOLEXECLIBDIR
+
# Version-specific runtime libs processing.
if test $version_specific_libs = yes; then
glibgo_toolexecdir='${libdir}/gcc/${host_alias}'
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'
+ case ${with_toolexeclibdir} in
+ no)
+ nover_glibgo_toolexeclibdir='${toolexecdir}/lib'
+ ;;
+ *)
+ nover_glibgo_toolexeclibdir=${with_toolexeclibdir}
+ ;;
+ esac
else
nover_glibgo_toolexecdir='${libdir}/gcc/${host_alias}'
nover_glibgo_toolexeclibdir='${libdir}'
# All known GOOS values. This is the union of all operating systems
# supported by the gofrontend and all operating systems supported by
# the gc toolchain.
-ALLGOOS="aix android darwin dragonfly freebsd hurd irix js linux netbsd openbsd plan9 rtems solaris windows"
+ALLGOOS="aix android darwin dragonfly freebsd hurd illumos ios irix js linux netbsd openbsd plan9 rtems solaris windows zos"
is_darwin=no
is_freebsd=no
aarch64-*-*)
GOARCH=arm64
;;
+ aarch64_be-*-*)
+ GOARCH=arm64be
+ ;;
arm*-*-* | strongarm*-*-* | ep9312*-*-* | xscale-*-*)
GOARCH=arm
case ${host} in
[GOARCH=ppc64le],
[GOARCH=ppc64])])
;;
- riscv64-*-*)
- GOARCH=riscv64
+ riscv*-*-*)
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+#if __riscv_xlen == 64
+#error 64-bit
+#endif
+])],
+[GOARCH=riscv],
+[GOARCH=riscv64])
;;
s390*-*-*)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([
AC_SUBST(ALLGOARCH)
AC_SUBST(ALLGOARCHFAMILY)
+AM_CONDITIONAL(LIBGO_IS_X86, test "$GOARCH" = "386" -o "$GOARCH" = "amd64" -o "$GOARCH" = "amd64p32")
+
FUNCTION_DESCRIPTORS=false
case ${host} in
rs6000*-*-* | powerpc*-*-*)
AC_CHECK_LIB([pthread], [pthread_create], PTHREAD_LIBS=-lpthread)
AC_SUBST(PTHREAD_LIBS)
+dnl Test if -lucontext is required for makecontext.
+AC_SEARCH_LIBS([makecontext], [ucontext])
+
dnl Test if -lrt is required for sched_yield or nanosleep or clock_gettime.
AC_SEARCH_LIBS([sched_yield], [rt])
AC_SEARCH_LIBS([nanosleep], [rt])
GCC_CHECK_UNWIND_GETIPINFO
-AC_CHECK_HEADERS(port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.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/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h)
+AC_CHECK_HEADERS(fcntl.h port.h sched.h semaphore.h sys/file.h sys/mman.h syscall.h sys/epoll.h sys/event.h sys/inotify.h sys/ptrace.h sys/syscall.h sys/sysctl.h sys/user.h sys/utsname.h sys/select.h sys/socket.h net/bpf.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/ptrace.h linux/reboot.h netinet/in_syst.h netinet/ip.h netinet/ip_mroute.h netinet/if_ether.h lwp.h)
AC_CHECK_HEADERS([netinet/icmp6.h], [], [],
[#include <netinet/in.h>
AM_CONDITIONAL(HAVE_STRERROR_R, test "$ac_cv_func_strerror_r" = yes)
AM_CONDITIONAL(HAVE_WAIT4, test "$ac_cv_func_wait4" = yes)
+AC_STRUCT_DIRENT_D_TYPE
+
AC_CHECK_FUNCS(accept4 dup3 epoll_create1 faccessat fallocate fchmodat fchownat futimesat getxattr inotify_add_watch inotify_init inotify_init1 inotify_rm_watch listxattr mkdirat mknodat open64 openat pipe2 removexattr renameat setxattr sync_file_range splice syscall tee unlinkat unshare utimensat)
AC_TYPE_OFF_T
-AC_CHECK_TYPES([loff_t])
+
+CFLAGS_hold="$CFLAGS"
+CFLAGS="$OSCFLAGS $CFLAGS"
+AC_CHECK_TYPES([loff_t], [], [], [[
+#include <sys/types.h>
+#include <fcntl.h>
+]])
+CFLAGS="$CFLAGS_hold"
LIBS_hold="$LIBS"
LIBS="$LIBS -lm"
[Define if your assembler supports AES instructions.])
fi
+dnl Test whether the linker supports the -static option.
+AC_CACHE_CHECK([whether -static is supported],
+[libgo_cv_ld_static],
+[LDFLAGS_hold=$LDFLAGS
+LDFLAGS="$LDFLAGS -static"
+AC_LINK_IFELSE([AC_LANG_PROGRAM(,)],
+[libgo_cv_ld_static=yes],
+[libgo_cv_ld_static=no])
+LDFLAGS=$LDFLAGS_hold])
+AM_CONDITIONAL(HAVE_STATIC_LINK, test "$libgo_cv_ld_static" = yes)
+
AC_CACHE_SAVE
if test ${multilib} = yes; then
multilib_arg=
fi
-AC_CONFIG_FILES(Makefile testsuite/Makefile)
+AC_CONFIG_FILES(Makefile testsuite/Makefile testsuite/libgo-test-support.exp)
AC_CONFIG_COMMANDS([default],
[if test -n "$CONFIG_FILES"; then