# HG changeset patch # Parent 7943668e276d15b949fddd7723cb5213fb465977 Enable libphobos on Solaris 11/x86 diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -694,7 +694,7 @@ if test -d ${srcdir}/libphobos; then AC_MSG_CHECKING([for libphobos support]) if (srcdir=${srcdir}/libphobos; \ . ${srcdir}/configure.tgt; \ - test -n "$UNSUPPORTED") + test "$LIBPHOBOS_SUPPORTED" != "yes") then AC_MSG_RESULT([no]) noconfigdirs="$noconfigdirs target-libphobos" diff --git a/libphobos/Makefile.am b/libphobos/Makefile.am --- a/libphobos/Makefile.am +++ b/libphobos/Makefile.am @@ -15,7 +15,11 @@ # along with GCC; see the file COPYING3. If not see # . -SUBDIRS = libdruntime src testsuite +if ENABLE_LIBPHOBOS + SUBDIRS = libdruntime src testsuite +else + SUBDIRS = +endif ACLOCAL_AMFLAGS = -I . -I .. -I ../config diff --git a/libphobos/configure.ac b/libphobos/configure.ac --- a/libphobos/configure.ac +++ b/libphobos/configure.ac @@ -114,6 +114,42 @@ AC_SUBST(phobos_compiler_shared_flag) lt_prog_compiler_pic_D="$phobos_compiler_shared_flag" pic_mode='default' +AC_MSG_CHECKING([for --enable-libphobos]) +AC_ARG_ENABLE(libphobos, + [AS_HELP_STRING([--enable-libphobos], [Enable libphobos])]) +AC_MSG_RESULT($enable_libphobos) + +# See if supported. +unset LIBPHOBOS_SUPPORTED +AC_MSG_CHECKING([for host support for libphobos]) +. ${srcdir}/configure.tgt +case ${host} in + x86_64-*-solaris2.* | i?86-*-solaris2.*) + # libphobos doesn't compile with the Solaris/x86 assembler due to a + # relatively low linelength limit. + as_prog=`$CC -print-prog-name=as` + if test -n "$as_prog" && $as_prog -v /dev/null 2>&1 | grep GNU > /dev/null 2>&1; then + druntime_cv_use_gas=yes; + else + druntime_cv_use_gas=no; + fi + rm -f a.out + if test x$druntime_cv_use_gas = xno; then + LIBPHOBOS_SUPPORTED=no + fi + ;; +esac +AC_MSG_RESULT($LIBPHOBOS_SUPPORTED) + +# Decide if it's usable. +case $LIBPHOBOS_SUPPORTED:$enable_libphobos in +*:no) use_libphobos=no ;; +*:yes) use_libphobos=yes ;; +yes:*) use_libphobos=yes ;; +*:*) use_libphobos=no ;; +esac +AM_CONDITIONAL(ENABLE_LIBPHOBOS, test x$use_libphobos = xyes) + # Determine what GCC version number to use in filesystem paths. GCC_BASE_VER diff --git a/libphobos/configure.tgt b/libphobos/configure.tgt --- a/libphobos/configure.tgt +++ b/libphobos/configure.tgt @@ -21,16 +21,21 @@ # Disable the libphobos or libdruntime components on untested or known # broken systems. More targets shall be added after testing. +LIBPHOBOS_SUPPORTED=no case "${target}" in arm*-*-linux*) + LIBPHOBOS_SUPPORTED=yes ;; mips*-*-linux*) + LIBPHOBOS_SUPPORTED=yes ;; x86_64-*-kfreebsd*-gnu | i?86-*-kfreebsd*-gnu) + LIBPHOBOS_SUPPORTED=yes ;; x86_64-*-linux* | i?86-*-linux*) + LIBPHOBOS_SUPPORTED=yes ;; - *) - UNSUPPORTED=1 + x86_64-*-solaris2.11* | i?86-*-solaris2.11*) + LIBPHOBOS_SUPPORTED=yes ;; esac