1# 2# Contains some unsorted druntime utility macros. 3# 4 5 6# DRUNTIME_WERROR 7# --------------- 8# Check to see if -Werror is enabled. 9AC_DEFUN([DRUNTIME_WERROR], 10[ 11 AC_ARG_ENABLE(werror, [AS_HELP_STRING([--enable-werror], 12 [turns on -Werror @<:@default=no@:>@])]) 13 WERROR_FLAG="" 14 if test "x$enable_werror" = "xyes"; then 15 WERROR_FLAG="-Werror" 16 fi 17]) 18 19 20# DRUNTIME_CONFIGURE 21# ------------------ 22# Substitute absolute paths for srcdir and builddir. 23AC_DEFUN([DRUNTIME_CONFIGURE], 24[ 25 # These need to be absolute paths, yet at the same time need to 26 # canonicalize only relative paths, because then amd will not unmount 27 # drives. Thus the use of PWDCMD: set it to 'pawd' or 'amq -w' if using amd. 28 libphobos_builddir=`${PWDCMD-pwd}` 29 case $srcdir in 30 [\\/$]* | ?:[\\/]*) libphobos_srcdir=${srcdir} ;; 31 *) libphobos_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;; 32 esac 33 AC_SUBST(libphobos_builddir) 34 AC_SUBST(libphobos_srcdir) 35]) 36 37# DRUNTIME_MULTILIB 38# ----------------- 39# Prepare the multilib_arg variable 40AC_DEFUN([DRUNTIME_MULTILIB], 41[ 42 if test ${multilib} = yes; then 43 multilib_arg="--enable-multilib" 44 else 45 multilib_arg= 46 fi 47]) 48 49 50# DRUNTIME_INSTALL_DIRECTORIES 51# ---------------------------- 52# Setup various install directories for headers. 53# Add the cross-host option and substitute the libphobos_toolexecdir 54# libphobos_toolexeclibdir and gdc_include_dir variables. 55AC_DEFUN([DRUNTIME_INSTALL_DIRECTORIES], 56[ 57 AC_REQUIRE([AC_PROG_GDC]) 58 59 AC_MSG_CHECKING([D GCC version]) 60 gcc_version=`eval $get_gcc_base_ver $srcdir/../gcc/BASE-VER` 61 AC_MSG_RESULT($gcc_version) 62 AC_SUBST(gcc_version) 63 64 AC_ARG_WITH([cross-host], 65 AC_HELP_STRING([--with-cross-host=HOST], 66 [configuring with a cross compiler])) 67 68 libphobos_toolexecdir=no 69 libphobos_toolexeclibdir=no 70 71 AC_MSG_CHECKING([for --enable-version-specific-runtime-libs]) 72 AC_ARG_ENABLE([version-specific-runtime-libs], 73 AC_HELP_STRING([--enable-version-specific-runtime-libs], 74 [Specify that runtime libraries should be installed in a compiler-specific directory]), 75 [case "$enableval" in 76 yes) version_specific_libs=yes ;; 77 no) version_specific_libs=no ;; 78 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);; 79 esac], 80 [version_specific_libs=no]) 81 AC_MSG_RESULT($version_specific_libs) 82 83 # Version-specific runtime libs processing. 84 if test $version_specific_libs = yes; then 85 libphobos_toolexecdir='${libdir}/gcc/${host_alias}' 86 libphobos_toolexeclibdir='${toolexecdir}/${gcc_version}$(MULTISUBDIR)' 87 else 88 # Calculate libphobos_toolexecdir, libphobos_toolexeclibdir 89 # Install a library built with a cross compiler in tooldir, not libdir. 90 if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then 91 libphobos_toolexecdir='${exec_prefix}/${host_alias}' 92 libphobos_toolexeclibdir='${toolexecdir}/lib' 93 else 94 libphobos_toolexecdir='${libdir}/gcc/${host_alias}' 95 libphobos_toolexeclibdir='${libdir}' 96 fi 97 multi_os_directory=`$GDC -print-multi-os-directory` 98 case $multi_os_directory in 99 .) ;; # Avoid trailing /. 100 *) libphobos_toolexeclibdir=${libphobos_toolexeclibdir}/${multi_os_directory} ;; 101 esac 102 fi 103 AC_SUBST(libphobos_toolexecdir) 104 AC_SUBST(libphobos_toolexeclibdir) 105 106 # Default case for install directory for D sources files. 107 gdc_include_dir='$(libdir)/gcc/${target_alias}/${gcc_version}/include/d' 108 AC_SUBST(gdc_include_dir) 109]) 110 111 112# DRUNTIME_GC 113# ----------- 114# Add the --enable-druntime-gc option and create the 115# DRUNTIME_GC_ENABLE conditional 116AC_DEFUN([DRUNTIME_GC], 117[ 118 dnl switch between gc and gcstub 119 AC_ARG_ENABLE(druntime-gc, 120 AC_HELP_STRING([--enable-druntime-gc], 121 [enable D runtime garbage collector (default: yes)]), 122 [enable_druntime_gc=no],[enable_druntime_gc=yes]) 123 124 AM_CONDITIONAL([DRUNTIME_GC_ENABLE], [test "$enable_druntime_gc" = "yes"]) 125]) 126