Enable libphobos on Solaris 11/x86
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Sun, 14 Apr 2019 09:38:01 +0000 (09:38 +0000)
committerRainer Orth <ro@gcc.gnu.org>
Sun, 14 Apr 2019 09:38:01 +0000 (09:38 +0000)
toplevel:
* configure.ac (enable_libphobos): Check LIBPHOBOS_SUPPORTED.
* configure: Regenerate.

libphobos:
* configure.tgt (LIBPHOBOS_SUPPORTED): Default to no.
Set to yes explicitly.
* configure.ac: Handle --enable-libphobos.
(x86_64-*-solaris2.* | i?86-*-solaris2.*): Only mark supported
with gas.
(ENABLE_LIBPHOBOS): New conditional.
* configure: Regenerate.
* Makefile.am (SUBDIRS): Only set if ENABLE_LIBPHOBOS.
* Makefile.in: Regenerate.

From-SVN: r270348

ChangeLog
configure
configure.ac
libphobos/ChangeLog
libphobos/Makefile.am
libphobos/Makefile.in
libphobos/configure
libphobos/configure.ac
libphobos/configure.tgt

index 4622118b252f2590196fdaf49d8eedec48074590..6ad3ad3f18eee1ac4dcbd8970f55c2b579eae10c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2019-04-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * configure.ac (enable_libphobos): Check LIBPHOBOS_SUPPORTED.
+       * configure: Regenerate.
+
 2019-04-12  Iain Buclaw  <ibuclaw@gdcproject.org>
 
        * configure.ac: Add target-zlib to target_libraries.
index 1c5f9b502a8eadfcf92e6d0abb83854178c6912d..1bb0a13198508e55ffd67b4979a934d9666bd4d1 100755 (executable)
--- a/configure
+++ b/configure
@@ -3411,7 +3411,7 @@ if test -d ${srcdir}/libphobos; then
 $as_echo_n "checking for libphobos support... " >&6; }
        if (srcdir=${srcdir}/libphobos; \
                . ${srcdir}/configure.tgt; \
-               test -n "$UNSUPPORTED")
+               test "$LIBPHOBOS_SUPPORTED" != "yes")
        then
            { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
index cffccd378053e8603e27b8e273a13c652df3b289..e3674a338183a794045485eb493e1fb86c75dae0 100644 (file)
@@ -695,7 +695,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"
index 53332089ba17df84a111627c456753ccb4a70ad9..869d96ea77ddf1bff43540b71f3998c77a56deae 100644 (file)
@@ -1,3 +1,16 @@
+2019-04-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * configure.tgt (LIBPHOBOS_SUPPORTED): Default to no.
+       Set to yes explicitly.
+       (x86_64-*-solaris2.11* | i?86-*-solaris2.11*): Mark supported.
+       * configure.ac: Handle --enable-libphobos.
+       (x86_64-*-solaris2.* | i?86-*-solaris2.*): Only mark supported
+       with gas.
+       (ENABLE_LIBPHOBOS): New conditional.
+       * configure: Regenerate.
+       * Makefile.am (SUBDIRS): Only set if ENABLE_LIBPHOBOS.
+       * Makefile.in: Regenerate.
+
 2019-04-14  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
            Iain Buclaw  <ibuclaw@gdcproject.org>
 
index 2afc22a512973fb21e7c0f7cc369d6211fe738f5..dcc77c3809b527f3c1f195089247b07ba58e5258 100644 (file)
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-SUBDIRS = libdruntime src testsuite
+if ENABLE_LIBPHOBOS
+  SUBDIRS = libdruntime src testsuite
+else
+  SUBDIRS =
+endif
 
 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
 
index 47436bdcb11358293de0d7e29712e2bddb313420..58368c92b49209f59a0966b48892342525f5ea33 100644 (file)
@@ -188,7 +188,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
-DIST_SUBDIRS = $(SUBDIRS)
+DIST_SUBDIRS = libdruntime src testsuite
 ACLOCAL = @ACLOCAL@
 AMTAR = @AMTAR@
 AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
@@ -335,7 +335,8 @@ target_vendor = @target_vendor@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = libdruntime src testsuite
+@ENABLE_LIBPHOBOS_FALSE@SUBDIRS = 
+@ENABLE_LIBPHOBOS_TRUE@SUBDIRS = libdruntime src testsuite
 ACLOCAL_AMFLAGS = -I . -I .. -I ../config
 
 # Multilib support.
index 92991813bfd1b3232b63df4373a673cb0fe7988e..87e4e4a7c9b19339bc0d2f30321b75508633ec36 100755 (executable)
@@ -686,6 +686,8 @@ DRUNTIME_GC_ENABLE_TRUE
 libphobos_srcdir
 libphobos_builddir
 get_gcc_base_ver
+ENABLE_LIBPHOBOS_FALSE
+ENABLE_LIBPHOBOS_TRUE
 phobos_compiler_shared_flag
 phobos_compiler_pic_flag
 OTOOL64
@@ -813,6 +815,7 @@ with_pic
 enable_fast_install
 with_gnu_ld
 enable_libtool_lock
+enable_libphobos
 with_gcc_major_version_only
 enable_werror
 enable_druntime_gc
@@ -1463,6 +1466,7 @@ Optional Features:
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-libphobos      Enable libphobos
   --enable-werror         turns on -Werror [default=no]
   --enable-druntime-gc    enable D runtime garbage collector (default: yes)
   --enable-unix           enables Unix runtime (default: yes, for Unix
@@ -11619,7 +11623,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11622 "configure"
+#line 11626 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11725,7 +11729,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11728 "configure"
+#line 11732 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
 lt_prog_compiler_pic_D="$phobos_compiler_shared_flag"
 pic_mode='default'
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --enable-libphobos" >&5
+$as_echo_n "checking for --enable-libphobos... " >&6; }
+# Check whether --enable-libphobos was given.
+if test "${enable_libphobos+set}" = set; then :
+  enableval=$enable_libphobos;
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_libphobos" >&5
+$as_echo "$enable_libphobos" >&6; }
+
+# See if supported.
+unset LIBPHOBOS_SUPPORTED
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for host support for libphobos" >&5
+$as_echo_n "checking for host support for libphobos... " >&6; }
+. ${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
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBPHOBOS_SUPPORTED" >&5
+$as_echo "$LIBPHOBOS_SUPPORTED" >&6; }
+
+# 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
+ if test x$use_libphobos = xyes; then
+  ENABLE_LIBPHOBOS_TRUE=
+  ENABLE_LIBPHOBOS_FALSE='#'
+else
+  ENABLE_LIBPHOBOS_TRUE='#'
+  ENABLE_LIBPHOBOS_FALSE=
+fi
+
+
 # Determine what GCC version number to use in filesystem paths.
 
   get_gcc_base_ver="cat"
@@ -15349,6 +15403,10 @@ if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
   as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${ENABLE_LIBPHOBOS_TRUE}" && test -z "${ENABLE_LIBPHOBOS_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_LIBPHOBOS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${DRUNTIME_GC_ENABLE_TRUE}" && test -z "${DRUNTIME_GC_ENABLE_FALSE}"; then
   as_fn_error $? "conditional \"DRUNTIME_GC_ENABLE\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
index 08e6a9282c4bd708f71ef7953c7fd4f82d4db5c9..d3a7f2709b1c8d499db3d4bd30e09c89738f9645 100644 (file)
@@ -113,6 +113,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
 
index 0471bfd816b151d6164ecbc5dfb64e983a16c2ae..b30f08581080b2c79893936a5887b18125035be1 100644 (file)
 
 # 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
        ;;
   x86_64-*-netbsd* | i?86-*-netbsd*)
+       LIBPHOBOS_SUPPORTED=yes
        ;;
-  *)
-       UNSUPPORTED=1
+  x86_64-*-solaris2.11* | i?86-*-solaris2.11*)
+       LIBPHOBOS_SUPPORTED=yes
        ;;
 esac