Fix hash-table violation in trans-decl.c.
[official-gcc.git] / libphobos / m4 / druntime.m4
blobee9b8ed7a055b15d3774d870422524ef859d04b5
2 # Contains some unsorted druntime utility macros.
6 # DRUNTIME_WERROR
7 # ---------------
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@:>@])])
13   WERROR_FLAG=""
14   if test "x$enable_werror" = "xyes"; then
15       WERROR_FLAG="-Werror"
16   fi
20 # DRUNTIME_CONFIGURE
21 # ------------------
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}`
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)
37 # DRUNTIME_MULTILIB
38 # -----------------
39 # Prepare the multilib_arg variable
40 AC_DEFUN([DRUNTIME_MULTILIB],
42   if test ${multilib} = yes; then
43     multilib_arg="--enable-multilib"
44   else
45     multilib_arg=
46   fi
50 # DRUNTIME_INSTALL_DIRECTORIES
51 # ----------------------------
52 # Setup various install directories for headers.
53 # Add the cross-host option and substitute the toolexecdir
54 # 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)
62   AC_SUBST(gcc_version)
64   AC_ARG_WITH([cross-host],
65     AC_HELP_STRING([--with-cross-host=HOST],
66                    [configuring with a cross compiler]))
68   toolexecdir=no
69   toolexeclibdir=no
71   version_specific_libs=no
73   # Version-specific runtime libs processing.
74   if test $version_specific_libs = yes; then
75       toolexecdir='${libdir}/gcc/${host_alias}'
76       toolexeclibdir='${toolexecdir}/${gcc_version}$(MULTISUBDIR)'
77   else
78       # Calculate toolexecdir, toolexeclibdir
79       # Install a library built with a cross compiler in tooldir, not libdir.
80       if test -n "$with_cross_host" && test x"$with_cross_host" != x"no"; then
81           toolexecdir='${exec_prefix}/${host_alias}'
82           toolexeclibdir='${toolexecdir}/lib'
83       else
84           toolexecdir='${libdir}/gcc/${host_alias}'
85           toolexeclibdir='${libdir}'
86       fi
87       multi_os_directory=`$GDC -print-multi-os-directory`
88       case $multi_os_directory in
89           .) ;; # Avoid trailing /.
90           *) toolexeclibdir=${toolexeclibdir}/${multi_os_directory} ;;
91       esac
92   fi
93   AC_SUBST(toolexecdir)
94   AC_SUBST(toolexeclibdir)
96   # Default case for install directory for D sources files.
97   gdc_include_dir='$(libdir)/gcc/${target_alias}/${gcc_version}/include/d'
98   AC_SUBST(gdc_include_dir)
102 # DRUNTIME_GC
103 # -----------
104 # Add the --enable-druntime-gc option and create the
105 # DRUNTIME_GC_ENABLE conditional
106 AC_DEFUN([DRUNTIME_GC],
108   dnl switch between gc and gcstub
109   AC_ARG_ENABLE(druntime-gc,
110     AC_HELP_STRING([--enable-druntime-gc],
111                    [enable D runtime garbage collector (default: yes)]),
112     [enable_druntime_gc=no],[enable_druntime_gc=yes])
114   AM_CONDITIONAL([DRUNTIME_GC_ENABLE], [test "$enable_druntime_gc" = "yes"])