2 # Contains some unsorted druntime utility macros.
8 # Check to see if -Werror is enabled.
9 AC_DEFUN([DRUNTIME_WERROR],
11 AC_ARG_ENABLE(werror, [AS_HELP_STRING([--enable-werror],
12 [turns on -Werror @<:@default=no@:>@])])
14 if test "x$enable_werror" = "xyes"; then
22 # Substitute absolute paths for srcdir and builddir.
23 AC_DEFUN([DRUNTIME_CONFIGURE],
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}`
30 [\\/$]* | ?:[\\/]*) libphobos_srcdir=${srcdir} ;;
31 *) libphobos_srcdir=`cd "$srcdir" && ${PWDCMD-pwd} || echo "$srcdir"` ;;
33 AC_SUBST(libphobos_builddir)
34 AC_SUBST(libphobos_srcdir)
39 # Prepare the multilib_arg variable
40 AC_DEFUN([DRUNTIME_MULTILIB],
42 if test ${multilib} = yes; then
43 multilib_arg="--enable-multilib"
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.
55 AC_DEFUN([DRUNTIME_INSTALL_DIRECTORIES],
57 AC_REQUIRE([AC_PROG_GDC])
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)
64 AC_ARG_WITH([cross-host],
65 AC_HELP_STRING([--with-cross-host=HOST],
66 [configuring with a cross compiler]))
68 libphobos_toolexecdir=no
69 libphobos_toolexeclibdir=no
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]),
76 yes) version_specific_libs=yes ;;
77 no) version_specific_libs=no ;;
78 *) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
80 [version_specific_libs=no])
81 AC_MSG_RESULT($version_specific_libs)
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)'
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'
94 libphobos_toolexecdir='${libdir}/gcc/${host_alias}'
95 libphobos_toolexeclibdir='${libdir}'
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} ;;
103 AC_SUBST(libphobos_toolexecdir)
104 AC_SUBST(libphobos_toolexeclibdir)
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)
114 # Add the --enable-druntime-gc option and create the
115 # DRUNTIME_GC_ENABLE conditional
116 AC_DEFUN([DRUNTIME_GC],
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])
124 AM_CONDITIONAL([DRUNTIME_GC_ENABLE], [test "$enable_druntime_gc" = "yes"])