1#
2# Contains macros to allow building libphobos as part of GCC.
3# This includes macros to locate directories and do configure checks
4# without an installed libdruntime.
5#
6
7
8# PHOBOS_ABS_SRCDIR
9# -----------------
10# Find absolute top level source directory and set phobos_cv_abs_srcdir
11AC_DEFUN([PHOBOS_ABS_SRCDIR], [
12  dnl Not sure if 100% portable, but we need the absolute dir as the _LT_COMPILER_C_O
13  dnl test changes the directory
14  AC_CACHE_CHECK([[for absolute libphobos source path]],
15    [[phobos_cv_abs_srcdir]],
16    [[phobos_cv_abs_srcdir=`cd $srcdir && pwd`]])
17    AS_IF([[test -d "$phobos_cv_abs_srcdir"]],
18      [],
19      [AC_MSG_ERROR([[can't find absolute libphobos source path]])])
20])
21
22
23# WITH_LOCAL_DRUNTIME(CALL, EXTRAFLAGS)
24# -------------------------------------
25# Execute CALL with GDCFLAGS adjusted to use the local druntime includes.
26# Flags contains extra arguments to append to GDCFLAGS (e.g. -nophoboslib).
27AC_DEFUN([WITH_LOCAL_DRUNTIME], [
28  AC_REQUIRE([PHOBOS_ABS_SRCDIR])
29  gdc_save_DFLAGS=$GDCFLAGS
30  GDCFLAGS="-fno-druntime -nostdinc -I $phobos_cv_abs_srcdir/libdruntime $2 $GDCFLAGS"
31  $1
32  GDCFLAGS=$gdc_save_DFLAGS
33])
34