From 72c136c9007e37b76426b847e8b239c0708b8da7 Mon Sep 17 00:00:00 2001 From: Iain Buclaw Date: Wed, 8 Apr 2020 22:52:05 +0200 Subject: [PATCH] libphobos: Remove --enable-unix configure option. This option is not useful on its own as all posix modules require the compiler to predefine version(Posix) anyway. So the option has been removed, and logic moved into DRUNTIME_OS_SOURCES, where the conditional DRUNTIME_OS_POSIX is set instead. libphobos/ChangeLog: * configure: Regenerate. * configure.ac: Remove DRUNTIME_OS_UNIX. * libdruntime/Makefile.am: Add DRUNTIME_DSOURCES_POSIX if DRUNTIME_OS_POSIX is true. * libdruntime/Makefile.in: Regenerate. * m4/druntime/os.m4 (DRUNTIME_OS_UNIX): Remove, move AM_CONDITIONAL logic to... (DRUNTIME_OS_SOURCES): ...here. Rename conditional to DRUNTIME_OS_POSIX. --- libphobos/ChangeLog | 12 +++++++ libphobos/configure | 59 ++++++++++++------------------- libphobos/configure.ac | 1 - libphobos/libdruntime/Makefile.am | 2 +- libphobos/libdruntime/Makefile.in | 4 +-- libphobos/m4/druntime/os.m4 | 31 +++++----------- 6 files changed, 47 insertions(+), 62 deletions(-) diff --git a/libphobos/ChangeLog b/libphobos/ChangeLog index a67f2283533..216cd61baf1 100644 --- a/libphobos/ChangeLog +++ b/libphobos/ChangeLog @@ -1,3 +1,15 @@ +2020-04-08 Iain Buclaw + + * configure: Regenerate. + * configure.ac: Remove DRUNTIME_OS_UNIX. + * libdruntime/Makefile.am: Add DRUNTIME_DSOURCES_POSIX if + DRUNTIME_OS_POSIX is true. + * libdruntime/Makefile.in: Regenerate. + * m4/druntime/os.m4 (DRUNTIME_OS_UNIX): Remove, move AM_CONDITIONAL + logic to... + (DRUNTIME_OS_SOURCES): ...here. Rename conditional to + DRUNTIME_OS_POSIX. + 2020-04-08 Iain Buclaw * Makefile.in: Regenerate. diff --git a/libphobos/configure b/libphobos/configure index 65e32d88f45..108518d86aa 100755 --- a/libphobos/configure +++ b/libphobos/configure @@ -662,6 +662,8 @@ DRUNTIME_OS_ARM_EABI_UNWINDER_FALSE DRUNTIME_OS_ARM_EABI_UNWINDER_TRUE DCFG_ARM_EABI_UNWINDER DCFG_THREAD_MODEL +DRUNTIME_OS_POSIX_FALSE +DRUNTIME_OS_POSIX_TRUE DRUNTIME_OS_SOLARIS_FALSE DRUNTIME_OS_SOLARIS_TRUE DRUNTIME_OS_MINGW_FALSE @@ -682,8 +684,6 @@ DRUNTIME_OS_ANDROID_FALSE DRUNTIME_OS_ANDROID_TRUE DRUNTIME_OS_AIX_FALSE DRUNTIME_OS_AIX_TRUE -DRUNTIME_OS_UNIX_FALSE -DRUNTIME_OS_UNIX_TRUE DRUNTIME_CPU_S390_FALSE DRUNTIME_CPU_S390_TRUE DRUNTIME_CPU_SYSTEMZ_FALSE @@ -835,7 +835,6 @@ enable_libtool_lock with_gcc_major_version_only enable_werror enable_druntime_gc -enable_unix enable_thread_lib with_libatomic with_libbacktrace @@ -1486,8 +1485,6 @@ Optional Features: --disable-libtool-lock avoid locking (might break parallel builds) --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 - targets) --enable-thread-lib= specify linker option for the system thread library (default: autodetect) @@ -11649,7 +11646,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11652 "configure" +#line 11649 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11755,7 +11752,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11758 "configure" +#line 11755 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -14105,31 +14102,6 @@ fi - # Check whether --enable-unix was given. -if test "${enable_unix+set}" = set; then : - enableval=$enable_unix; : -else - enable_unix=auto -fi - - - case "$druntime_cv_target_os" in - aix*|*bsd*|cygwin*|darwin*|gnu*|linux*|skyos*|*solaris*|sysv*) d_have_unix=1 ;; - esac - if test -n "$d_have_unix" && test "$enable_unix" = auto ; then - enable_unix=yes - fi - if test "$enable_unix" = "yes"; then - DRUNTIME_OS_UNIX_TRUE= - DRUNTIME_OS_UNIX_FALSE='#' -else - DRUNTIME_OS_UNIX_TRUE='#' - DRUNTIME_OS_UNIX_FALSE= -fi - - - - druntime_target_os_parsed="" case "$druntime_cv_target_os" in @@ -14239,6 +14211,21 @@ else fi + druntime_target_posix="no" + case "$druntime_cv_target_os" in + aix*|*bsd*|cygwin*|darwin*|gnu*|linux*|skyos*|*solaris*|sysv*) + druntime_target_posix="yes" + ;; + esac + if test "$druntime_target_posix" = "yes"; then + DRUNTIME_OS_POSIX_TRUE= + DRUNTIME_OS_POSIX_FALSE='#' +else + DRUNTIME_OS_POSIX_TRUE='#' + DRUNTIME_OS_POSIX_FALSE= +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread model used by GDC" >&5 @@ -15599,10 +15586,6 @@ if test -z "${DRUNTIME_CPU_S390_TRUE}" && test -z "${DRUNTIME_CPU_S390_FALSE}"; as_fn_error $? "conditional \"DRUNTIME_CPU_S390\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${DRUNTIME_OS_UNIX_TRUE}" && test -z "${DRUNTIME_OS_UNIX_FALSE}"; then - as_fn_error $? "conditional \"DRUNTIME_OS_UNIX\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${DRUNTIME_OS_AIX_TRUE}" && test -z "${DRUNTIME_OS_AIX_FALSE}"; then as_fn_error $? "conditional \"DRUNTIME_OS_AIX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -15643,6 +15626,10 @@ if test -z "${DRUNTIME_OS_SOLARIS_TRUE}" && test -z "${DRUNTIME_OS_SOLARIS_FALSE as_fn_error $? "conditional \"DRUNTIME_OS_SOLARIS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${DRUNTIME_OS_POSIX_TRUE}" && test -z "${DRUNTIME_OS_POSIX_FALSE}"; then + as_fn_error $? "conditional \"DRUNTIME_OS_POSIX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${DRUNTIME_OS_ARM_EABI_UNWINDER_TRUE}" && test -z "${DRUNTIME_OS_ARM_EABI_UNWINDER_FALSE}"; then as_fn_error $? "conditional \"DRUNTIME_OS_ARM_EABI_UNWINDER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 diff --git a/libphobos/configure.ac b/libphobos/configure.ac index 09e334d2045..594d2001b06 100644 --- a/libphobos/configure.ac +++ b/libphobos/configure.ac @@ -122,7 +122,6 @@ DRUNTIME_MULTILIB DRUNTIME_WERROR DRUNTIME_GC DRUNTIME_CPU_SOURCES -DRUNTIME_OS_UNIX DRUNTIME_OS_SOURCES DRUNTIME_OS_THREAD_MODEL DRUNTIME_OS_ARM_EABI_UNWINDER diff --git a/libphobos/libdruntime/Makefile.am b/libphobos/libdruntime/Makefile.am index b7e4575e0f1..41ccfaa339c 100644 --- a/libphobos/libdruntime/Makefile.am +++ b/libphobos/libdruntime/Makefile.am @@ -47,7 +47,7 @@ else DRUNTIME_SOURCES_CONFIGURED += $(DRUNTIME_DSOURCES_GCSTUB) endif # OS specific sources -if DRUNTIME_OS_UNIX +if DRUNTIME_OS_POSIX DRUNTIME_SOURCES_CONFIGURED += $(DRUNTIME_DSOURCES_POSIX) endif if DRUNTIME_OS_DARWIN diff --git a/libphobos/libdruntime/Makefile.in b/libphobos/libdruntime/Makefile.in index 61dd0d496e3..9277e0a1665 100644 --- a/libphobos/libdruntime/Makefile.in +++ b/libphobos/libdruntime/Makefile.in @@ -112,7 +112,7 @@ target_triplet = @target@ @DRUNTIME_GC_ENABLE_TRUE@am__append_1 = $(DRUNTIME_DSOURCES_GC) @DRUNTIME_GC_ENABLE_FALSE@am__append_2 = $(DRUNTIME_DSOURCES_GCSTUB) # OS specific sources -@DRUNTIME_OS_UNIX_TRUE@am__append_3 = $(DRUNTIME_DSOURCES_POSIX) +@DRUNTIME_OS_POSIX_TRUE@am__append_3 = $(DRUNTIME_DSOURCES_POSIX) @DRUNTIME_OS_DARWIN_TRUE@am__append_4 = $(DRUNTIME_DSOURCES_DARWIN) @DRUNTIME_OS_DRAGONFLYBSD_TRUE@am__append_5 = $(DRUNTIME_DSOURCES_DRAGONFLYBSD) @DRUNTIME_OS_ANDROID_TRUE@am__append_6 = $(DRUNTIME_DSOURCES_BIONIC) @@ -272,7 +272,7 @@ am__objects_7 = core/sys/posix/aio.lo core/sys/posix/arpa/inet.lo \ core/sys/posix/syslog.lo core/sys/posix/termios.lo \ core/sys/posix/time.lo core/sys/posix/ucontext.lo \ core/sys/posix/unistd.lo core/sys/posix/utime.lo -@DRUNTIME_OS_UNIX_TRUE@am__objects_8 = $(am__objects_7) +@DRUNTIME_OS_POSIX_TRUE@am__objects_8 = $(am__objects_7) am__objects_9 = core/sys/darwin/crt_externs.lo \ core/sys/darwin/dlfcn.lo core/sys/darwin/execinfo.lo \ core/sys/darwin/mach/dyld.lo core/sys/darwin/mach/getsect.lo \ diff --git a/libphobos/m4/druntime/os.m4 b/libphobos/m4/druntime/os.m4 index 74167aa2cde..47d4c6a6c80 100644 --- a/libphobos/m4/druntime/os.m4 +++ b/libphobos/m4/druntime/os.m4 @@ -52,33 +52,12 @@ AC_DEFUN([DRUNTIME_OS_DETECT], ]) -# DRUNTIME_OS_UNIX -# ---------------- -# Add --enable-unix option or autodetects if system is unix -# and create the DRUNTIME_OS_UNIX conditional. -AC_DEFUN([DRUNTIME_OS_UNIX], -[ - AC_REQUIRE([DRUNTIME_OS_DETECT]) - AC_ARG_ENABLE(unix, - AC_HELP_STRING([--enable-unix], - [enables Unix runtime (default: yes, for Unix targets)]), - :,[enable_unix=auto]) - - case "$druntime_cv_target_os" in - aix*|*bsd*|cygwin*|darwin*|gnu*|linux*|skyos*|*solaris*|sysv*) d_have_unix=1 ;; - esac - if test -n "$d_have_unix" && test "$enable_unix" = auto ; then - enable_unix=yes - fi - AM_CONDITIONAL([DRUNTIME_OS_UNIX], [test "$enable_unix" = "yes"]) -]) - - # DRUNTIME_OS_SOURCES # ------------------- # Detect target OS and add DRUNTIME_OS_AIX DRUNTIME_OS_DARWIN # DRUNTIME_OS_FREEBSD DRUNTIME_OS_LINUX DRUNTIME_OS_MINGW # DRUNTIME_OS_SOLARIS DRUNTIME_OS_OPENBSD conditionals. +# If the system is posix, add DRUNTIME_OS_POSIX conditional. AC_DEFUN([DRUNTIME_OS_SOURCES], [ AC_REQUIRE([DRUNTIME_OS_DETECT]) @@ -130,6 +109,14 @@ AC_DEFUN([DRUNTIME_OS_SOURCES], [test "$druntime_target_os_parsed" = "mingw"]) AM_CONDITIONAL([DRUNTIME_OS_SOLARIS], [test "$druntime_target_os_parsed" = "solaris"]) + + druntime_target_posix="no" + case "$druntime_cv_target_os" in + aix*|*bsd*|cygwin*|darwin*|gnu*|linux*|skyos*|*solaris*|sysv*) + druntime_target_posix="yes" + ;; + esac + AM_CONDITIONAL([DRUNTIME_OS_POSIX], [test "$druntime_target_posix" = "yes"]) ]) -- 2.30.2