Source

gdc / d / config-lang.in

Full commit
# config-lang.in for D front-end

# GDC -- D front-end for GCC
# Copyright (C) 2004 David Friedman
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

language="d"
compilers="cc1d\$(exeext)"
stagestuff="gdc\$(exeext) gdc-cross\$(exeext) cc1d\$(exeext)"

# This file can be called from one of two places,
# so ensure we account for both.
d_gcc_version=
if [ -e $srcdir/gcc/BASE-VER ]; then
  d_gcc_version=$(cat $srcdir/gcc/BASE-VER)
elif [ -e $srcdir/BASE-VER ]; then
  d_gcc_version=$(cat $srcdir/BASE-VER)
else
  echo "Sorry, cannot find BASE-VER"
  exit 1
fi

d_gcc_version=$(echo $d_gcc_version | sed -e 's/\([0-9]*\)\.\([0-9]*\).*/\1\2/')
if [ ${d_gcc_version} -ge 46 ]; then
  d_langfiles="\$(srcdir)/d/d-lang.h \$(srcdir)/d/d-lang-type.h"
elif [ ${d_gcc_version} -ge 45 ]; then
  d_langfiles="\$(srcdir)/d/d-lang.h \$(srcdir)/d/d-lang-type-45.h"
else
  echo "Sorry, this version of gcc is not supported"
  exit 1
fi

gtfiles="${d_langfiles} \$(srcdir)/d/d-builtins.c"

target_libs="target-libphobos"