From 01f3428cafc13f5ae765d304494cac750892bb80 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 8 Nov 2011 08:06:25 -0800 Subject: [PATCH] Check for libitm support at top-level. From-SVN: r181168 --- ChangeLog | 5 ++++ configure | 26 +++++++++------------ configure.ac | 23 +++++++------------ libitm/ChangeLog | 7 ++++++ libitm/configure | 4 ++++ libitm/configure.ac | 4 ++++ libitm/configure.tgt | 54 +++++++++++--------------------------------- 7 files changed, 52 insertions(+), 71 deletions(-) diff --git a/ChangeLog b/ChangeLog index d6ae1b1aa8c..6804fe5d0f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-11-08 Richard Henderson + + * configure.ac: Test libitm/configure.tgt to disable libitm. + * configure: Rebuild. + 2011-11-07 Aldy Hernandez Richard Henderson diff --git a/configure b/configure index 03d00483411..b9cf0f1d0ff 100755 --- a/configure +++ b/configure @@ -3057,22 +3057,18 @@ if test x$enable_libgomp = x ; then esac fi -# Disable libitm on non POSIX hosted systems. -if test x$enable_libitm = x ; then - # Enable libitm by default on hosted POSIX systems. - case "${target}" in - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu) - ;; - *-*-netbsd* | *-*-freebsd* | *-*-openbsd*) - ;; - *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*) - ;; - *-*-darwin* | *-*-aix*) - ;; - *) +# Disable libitm on unsupported hosted systems. +if test x$enable_libitm = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libitm support" >&5 +$as_echo_n "checking for libitm support... " >&6; } + if (. ${srcdir}/libitm/configure.tgt; test -n "$UNSUPPORTED"); then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } noconfigdirs="$noconfigdirs target-libitm" - ;; - esac + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi fi # Disable libssp for some systems. diff --git a/configure.ac b/configure.ac index 4bca6d82f46..0a30880ef98 100644 --- a/configure.ac +++ b/configure.ac @@ -493,22 +493,15 @@ if test x$enable_libgomp = x ; then esac fi -# Disable libitm on non POSIX hosted systems. -if test x$enable_libitm = x ; then - # Enable libitm by default on hosted POSIX systems. - case "${target}" in - *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu) - ;; - *-*-netbsd* | *-*-freebsd* | *-*-openbsd*) - ;; - *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11*) - ;; - *-*-darwin* | *-*-aix*) - ;; - *) +# Disable libitm on unsupported hosted systems. +if test x$enable_libitm = x; then + AC_MSG_CHECKING([for libitm support]) + if (. ${srcdir}/libitm/configure.tgt; test -n "$UNSUPPORTED"); then + AC_MSG_RESULT([no]) noconfigdirs="$noconfigdirs target-libitm" - ;; - esac + else + AC_MSG_RESULT([yes]) + fi fi # Disable libssp for some systems. diff --git a/libitm/ChangeLog b/libitm/ChangeLog index 33a45f7fbd3..f9624bb8ca0 100644 --- a/libitm/ChangeLog +++ b/libitm/ChangeLog @@ -1,3 +1,10 @@ +2011-11-08 Richard Henderson + + * configure.ac: Exit if unsupported. + * configure: Rebuild. + * configure.tgt: Delete boilerplate from libgomp for unsupported + targets. Set UNSUPPORTED for unsupported targets. + 2011-11-08 Rainer Orth * configure.tgt: Handle i386 like i[456]86. diff --git a/libitm/configure b/libitm/configure index 08d2993e06e..e6bc1aaa0dc 100644 --- a/libitm/configure +++ b/libitm/configure @@ -17003,6 +17003,10 @@ _ACEOF # Get target configury. . ${srcdir}/configure.tgt +if test -n "$UNSUPPORTED"; then + as_fn_error "Configuration ${target} is unsupported." "$LINENO" 5 +fi + CFLAGS="$save_CFLAGS $XCFLAGS" # Check for __sync_val_compare_and_swap, but only after the target has diff --git a/libitm/configure.ac b/libitm/configure.ac index 7f35b154529..dea70387f0f 100644 --- a/libitm/configure.ac +++ b/libitm/configure.ac @@ -224,6 +224,10 @@ LIBITM_CHECK_SIZE_T_MANGLING # Get target configury. . ${srcdir}/configure.tgt +if test -n "$UNSUPPORTED"; then + AC_MSG_ERROR([Configuration ${target} is unsupported.]) +fi + CFLAGS="$save_CFLAGS $XCFLAGS" # Check for __sync_val_compare_and_swap, but only after the target has diff --git a/libitm/configure.tgt b/libitm/configure.tgt index 7d9b7f6c398..dd7c78bd027 100644 --- a/libitm/configure.tgt +++ b/libitm/configure.tgt @@ -28,7 +28,7 @@ # XLDFLAGS Add extra link flags to use. # Optimize TLS usage by avoiding the overhead of dynamic allocation. -if test $gcc_cv_have_tls = yes ; then +if test "$gcc_cv_have_tls" = yes ; then case "${target}" in # For x86, we use slots in the TCB head for most of our TLS. @@ -47,10 +47,6 @@ fi # work out any special compilation flags as necessary. case "${target_cpu}" in alpha*) ARCH=alpha ;; - ia64*) ARCH=ia64 ;; - mips*) ARCH=mips ;; - powerpc*) ARCH=powerpc ;; - s390*) ARCH=s390 ;; i[3456]86) case " ${CC} ${CFLAGS} " in @@ -75,57 +71,33 @@ case "${target_cpu}" in ARCH=x86 ;; - sparcv9 | sparc64) - # Note that sparcv7 and sparcv8 is not included here. We need cas. - echo "int i;" > conftestx.c - if ${CC} ${CFLAGS} -c -o conftestx.o conftestx.c > /dev/null 2>&1; then - case "`/usr/bin/file conftestx.o`" in - *32-bit*) - case " ${CC} ${CFLAGS}" in - *" -mcpu=ultrasparc"*) - ;; - *) - XCFLAGS="${XCFLAGS} -mcpu=v9" - ;; - esac - ;; - esac - fi - rm -f conftestx.c conftestx.o - ARCH=sparc - ;; - *) ARCH="${target_cpu}" ;; esac - + +# For the benefit of top-level configure, determine if the cpu is supported. +test -d ${srcdir}/$ARCH || UNSUPPORTED=1 + # Since we require POSIX threads, assume a POSIX system by default. config_path="$ARCH posix generic" # Other system configury case "${target}" in *-*-linux*) - if test $enable_linux_futex = yes; then + if test "$enable_linux_futex" = yes; then config_path="linux/$ARCH linux $config_path" fi ;; - *-*-hpux11*) - # HPUX v11.x requires -lrt to resolve sem_init in libgomp.la - XLDFLAGS="${XLDFLAGS} -lrt" + *-*-gnu* | *-*-k*bsd*-gnu \ + | *-*-netbsd* | *-*-freebsd* | *-*-openbsd* \ + | *-*-solaris2* | *-*-sysv4* | *-*-irix6* | *-*-osf* | *-*-hpux11* \ + | *-*-darwin* | *-*-aix*) + # POSIX system. The OS is supported. ;; - *-*-mingw32*) - config_path="$ARCH mingw32 posix generic" - ;; - - *-*-solaris2.[56]*) - config_path="$ARCH posix95 posix generic" - XLDFLAGS="${XLDFLAGS} -lposix4" - ;; - - *-*-darwin*) - config_path="$ARCH bsd posix generic" + *) # Non-POSIX, or embedded system + UNSUPPORTED=1 ;; esac