<?xml version="1.0" ?>
<gprconfig>
  <!--  Languages that require no compiler, but can be selected through
        -config -->
  <compiler_description>
    <name>SIMULINK</name>
    <languages>Simulink</languages>
  </compiler_description>

  <compiler_description>
    <name>MATLAB</name>
    <languages>Matlab</languages>
  </compiler_description>

  <compiler_description>
    <name>PRJFILE</name>
    <languages>Project File</languages>
  </compiler_description>

  <!--    GCC 3.x & 4.x (not for GNAT Pro)-->
  <compiler_description>
    <name>GCC</name>
    <executable prefix="1">(.*-wrs-.*|.*-sysgo.*|.*-elf-.*|.*-eabi-.*|.*-eabispe-.*|avr-.*|.*-elinos-linux.*|.*-linux-gnu-|.*mingw32.*|.*-xcoff-.*|.*linux-android.*|arm-linux-gnueabi-|arm-linux-gnueabihf-|e500v2-gnu-linux-|powerpc-.*-linux.*-|.*-darwin.*-|.*-freebsd.*)?gcc(-\d+)?</executable>
    <version>
      <external>$EXEC -v</external>
      <nogrep regexp="for GNAT Pro"></nogrep>
      <grep regexp="^gcc \S+ (\S+)" group="1"></grep>
    </version>
    <languages>C</languages>
    <target>
      <external>$EXEC -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!--    GCC for GNAT Pro 3.x & 4.x -->
  <compiler_description>
    <name>GCC_Pro</name>
    <executable prefix="1">(.*-wrs-.*|.*-sysgo.*|.*-elf-.*|.*-eabi-.*|.*-eabispe-.*|avr-.*|.*-elinos-linux.*|.*-linux-gnu-|.*mingw32.*|.*-xcoff-.*|.*linux-android.*|arm-linux-gnueabi-|arm-linux-gnueabihf-|e500v2-gnu-linux-|powerpc-.*-linux.*-|.*-darwin.*-|.*-fastos.*|.*-freebsd.*|.*-qnx.*|.*-rtems.*)?gcc</executable>
    <version>
      <external>${PREFIX}gcc -v</external>

      <!--  'gcc version 4.7.4 20131104 for GNAT Pro ...' -->
      <grep regexp="^gcc \S+ (\S+) \d+ (\(prerelease\) )?\(?for GNAT Pro" group="1"></grep>
    </version>
    <languages>C</languages>
    <target>
      <external>${PREFIX}gcc -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!-- PikeOS -->

  <compiler_description>
    <name>GCC-SYSGO-ARM</name>
    <executable prefix="1">(arm_v7hf-)gcc</executable>
    <version>
      <getenv name="PIKEOS_VERSION" />
    </version>
    <languages>C</languages>
    <target>arm-sysgo-pikeos</target>
  </compiler_description>

  <compiler_description>
    <name>GCC-SYSGO-X86</name>
    <executable prefix="1">(x86_i586-)gcc</executable>
    <version>
      <getenv name="PIKEOS_VERSION" />
    </version>
    <languages>C</languages>
    <target>i586-sysgo-pikeos</target>
  </compiler_description>

  <compiler_description>
    <name>GCC-SYSGO-PPC</name>
    <executable prefix="1">(ppc_oea-)gcc</executable>
    <version>
      <getenv name="PIKEOS_VERSION" />
    </version>
    <languages>C</languages>
    <target>powerpc-sysgo-pikeos</target>
  </compiler_description>

  <!--     GCC 2.8.1
    There is no switch, in such versions, to find out the list of languages,
    so we just assume there is only C.
    C++ could be found by looking for the "g++" executable
  -->
  <compiler_description>
    <name>GCC-28</name>
    <executable>gcc</executable>
    <version>
      <external>gcc -v</external>
      <grep regexp="^gcc \S+ (\S+)" group="1"></grep>
      <must_match>2\.8\.</must_match>
    </version>
    <languages>C</languages>
    <target>
      <external>gcc -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!--  G++ compilers (not for GNAT Pro)  -->
  <compiler_description>
    <name>G++</name>
    <executable>g\+\+(-\d+)?</executable>
    <version>
      <external>$EXEC -v</external>
      <nogrep regexp="for GNAT Pro"></nogrep>
      <grep regexp="^gcc \S+ (\S+)" group="1"></grep>
    </version>
    <languages>C++</languages>
    <target>
      <external>$EXEC -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!--  G++ compilers for GNAT Pro  -->
  <compiler_description>
    <name>G++_Pro</name>
    <executable prefix="1">(.*-elf-.*|.*-eabi-.*|.*-wrs-.*|.*-fastos.*|.*-freebsd.*|.*-linux-gnu.*-|.*-linux-android.*|.*-rtems.*)?g\+\+</executable>
    <version>
      <external>${PREFIX}g++ -v</external>

      <!--  'gcc version 4.7.4 20131104 for GNAT Pro ...' -->
      <grep regexp="^gcc \S+ (\S+) \d+ \(?for GNAT Pro" group="1"></grep>
    </version>
    <languages>C++</languages>
    <target>
      <external>${PREFIX}g++ -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!--  Assembler (not for GNAT Pro) -->
  <compiler_description>
    <name>GCC-ASM</name>
    <executable prefix="1">(.*-wrs-.*|.*-sysgo.*|.*-elf-.*|.*-eabi-.*|.*-eabispe-.*|avr-.*|.*-elinos-linux.*|.*-linux-gnu-|.*mingw32.*|.*-xcoff-.*|.*linux-android.*|arm-linux-gnueabi-|arm-linux-gnueabihf-|e500v2-gnu-linux-|powerpc-.*-linux.*-|.*-darwin.*-|.*-fastos.*|.*-freebsd.*|.*-qnx.*|.*-rtems.*)?gcc(-\d+)?</executable>
    <version>
      <external>$EXEC -v</external>
      <nogrep regexp="for GNAT Pro"></nogrep>
      <grep regexp="^gcc \S+ (\S+)" group="1"></grep>
    </version>
    <languages>Asm,Asm_Cpp,Asm2</languages>
    <target>
      <external>$EXEC -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!--  Assembler (for GNAT Pro) -->
  <compiler_description>
    <name>GCC-ASM_Pro</name>
    <executable prefix="1">(.*-wrs-.*|.*-sysgo.*|.*-elf-.*|.*-eabi-.*|.*-eabispe-.*|avr-.*|.*-elinos-linux.*|.*-linux-gnu-|.*mingw32.*|.*-xcoff-.*|.*linux-android.*|arm-linux-gnueabi-|arm-linux-gnueabihf-|e500v2-gnu-linux-|powerpc-.*-linux.*-|.*-darwin.*-|.*-.*fastos.*|.*-freebsd.*|.*-qnx.*|.*-rtems.*)?gcc</executable>
    <version>
      <external>${PREFIX}gcc -v</external>
      <grep regexp="^gcc \S+ (\S+) \d+ (\(prerelease\) )?\(?for GNAT Pro" group="1"></grep>
    </version>
    <languages>Asm,Asm_Cpp,Asm2</languages>
    <target>
      <external>${PREFIX}gcc -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!--  Binary image -->
  <compiler_description>
    <name>LD</name>
    <executable prefix="1">(.*-wrs.*-|.*-sysgo.*-|.*-elf.*-|.*-eabi.*-|.*-eabispe.*-|avr.*-|.*-elinos-linux.*-|.*-linux-gnu-|.*mingw32.*-|.*-xcoff.*-|.*linux-android.*|arm-linux-gnueabi-|arm-linux-gnueabihf-|e500v2-gnu-linux-|powerpc-.*-linux.*-|.*-darwin.*-|.*-fastos.*|.*-freebsd.*|.*-qnx.*-|.*-rtems.*-)?ld</executable>
    <version>
      <external>${PREFIX}ld -v</external>
      <grep regexp="^(GNU ld.*|LLD) (\S+)" group="2"></grep>
    </version>
    <languages>Bin_Img</languages>
    <target>
      <external>${PREFIX}gcc -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

   <!--   GNAT
    To find the list of supported runtimes, we check the contents of
    the directory. To be compatible with older versions of GNAT (3.16
    for instance), we also accept lib/gcc-lib as the directory that
    contains the runtime files.
   -->
  <compiler_description>
    <name>GNAT</name>
    <executable prefix="1">(.*-wrs-.*|.*-sysgo.*|.*-elf-.*|.*-eabi-.*|.*-eabispe-.*|avr-.*|.*-elinos-linux.*|.*-linux-gnu-|.*mingw32.*|.*-xcoff-.*|.*linux-android.*|arm-linux-gnueabi-|arm-linux-gnueabihf-|e500v2-gnu-linux-|powerpc-.*-linux.*-|.*-darwin.*-|.*-fastos.*|.*-freebsd.*|.*-qnx.*|.*-rtems.*)?gnatls</executable>
    <version>
      <external>${PREFIX}gnatls -v --version</external>
      <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
    </version>
    <languages>Ada</languages>
    <variable name="gcc_version">
      <external>${PREFIX}gcc -v</external>
      <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
    </variable>
    <variable name="gcc_version_major">
      <external>${PREFIX}gcc -v</external>
      <grep regexp="^[-\w]*gcc \S+ (\d+)\.\d+\.\d+" group="1"></grep>
    </variable>
    <runtimes default="default,kernel,native">
       <directory group="default" >\.\./lib(32|64)?/gcc(-lib)?/$TARGET/($gcc_version|$gcc_version_major)/adalib/</directory>
       <directory group="default" contents="^rts-">\.\./lib(32|64)?/gcc(-lib)?/$TARGET/($gcc_version|$gcc_version_major)/ada_object_path</directory>
       <directory group="4" >\.\./lib(32|64)?/gcc(-lib)?/$TARGET/($gcc_version|$gcc_version_major)/rts-(.*)/adalib/</directory>
       <directory group="2" >\.\./$TARGET/lib(32|64)?/gnat/(.*)/adalib/</directory>
    </runtimes>
    <target>
      <external>${PREFIX}gcc -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!--  CodePeer -->

  <compiler_description>
    <name>GNAT_CODEPEER</name>
    <executable prefix="1">(.*gnatsas-|.*gnsa-|.*codepeer-)gnatls</executable>
    <version>
      <external>${PREFIX}gnatls -v</external>
      <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
    </version>
    <languages>Ada,C,C++</languages>
    <variable name="gcc_version">
      <external>${PREFIX}gcc -v</external>
      <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
    </variable>
    <runtimes default="default,native">
       <directory group="default" >\.\./libexec/codepeer/lib/gcc/.*/$gcc_version/adalib/</directory>
       <directory group="1" >\.\./libexec/codepeer/lib/gnat/(.*)/adalib/</directory>
       <directory group="1" >\.\./libexec/codepeer/lib/gcc/.*/$gcc_version/rts-(.*)/adalib/</directory>
    </runtimes>
    <target>codepeer</target>
  </compiler_description>

  <!--  Generic GNAT LLVM Target -->

  <compiler_description>
    <name>GNAT_LLVM_NATIVE</name>
    <executable prefix="1">(llvm-)gnatls</executable>
    <version>
      <external>${PREFIX}gnatls -v</external>
      <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
    </version>
    <languages>Ada</languages>
    <variable name="gcc_version">
      <external>${PREFIX}gcc -v</external>
      <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
    </variable>
    <runtimes default="default,native">
       <directory group="default" >\.\./lib/rts-native/adalib/</directory>
       <directory group="1" >\.\./lib/rts-(.*)/adalib/</directory>
    </runtimes>
    <target>llvm</target>
  </compiler_description>

  <!--  Architecture-specific GNAT-LLVM Ada compiler  -->

  <compiler_description>
    <name>GNAT_LLVM</name>
    <executable prefix="1">((.*-elf-|.*-linux-gnu-)?llvm-)gnatls</executable>
    <version>
      <external>${PREFIX}gnatls -v</external>
      <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
    </version>
    <languages>Ada</languages>
    <variable name="gcc_version">
      <external>${PREFIX}gcc -v</external>
      <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
    </variable>
    <runtimes default="default,native">
       <directory group="default" >\.\./lib/rts-native/adalib/</directory>
       <directory group="1" >\.\./lib/rts-(.*)/adalib/</directory>
       <directory group="2" >\.\./$TARGET/lib(32|64)?/gnat-llvm/(.*)/adalib/</directory>
    </runtimes>
    <target>
      <external>${PREFIX}gcc -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!--  Architecture-specific GNAT-LLVM assembler  -->

  <compiler_description>
    <name>GNAT_LLVM_ASM</name>
    <executable prefix="1">((.*-elf-|.*-linux-gnu-)?llvm-)gcc</executable>
    <version>
      <external>$EXEC -v</external>
      <grep regexp="^llvm-.*gcc.+GNAT Pro (\S+)" group="1"></grep>
    </version>
    <languages>Asm,Asm_Cpp,Asm2</languages>
    <target>
      <external>$EXEC -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!--  Generic C compiler for LLVM  -->
  <compiler_description>
    <name>C_LLVM</name>
    <executable>clang</executable>
    <version>
      <external>clang --version</external>

      <!--  '...clang version 6.0.0...'  -->
      <grep regexp="clang version (\S+)" group="1"></grep>
    </version>
    <languages>C</languages>
    <target>llvm</target>
  </compiler_description>

  <!--  Generic C++ compiler for LLVM  -->
  <compiler_description>
    <name>C++_LLVM</name>
    <executable>clang\+\+</executable>
    <version>
      <external>clang++ --version</external>

      <!--  '...clang version 6.0.0...'  -->
      <grep regexp="clang version (\S+)" group="1"></grep>
    </version>
    <languages>C++</languages>
    <target>llvm</target>
  </compiler_description>

  <!--  C Target -->

  <compiler_description>
    <name>GNAT_C</name>
    <executable prefix="1">(c-)gnatls</executable>
    <version>
      <external>${PREFIX}gnatls -v</external>
      <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
    </version>
    <languages>Ada</languages>
    <variable name="gcc_version">
      <external>${PREFIX}gcc -v</external>
      <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
    </variable>
    <runtimes default="default,ccg">
       <directory group="default" >\.\./libexec/gnat_ccg/lib/gcc/.*/$gcc_version/adalib/</directory>
       <directory group="1" >\.\./libexec/gnat_ccg/lib/gcc/.*/$gcc_version/rts-(.*)/adalib/</directory>
       <directory group="1" >\.\./lib/gnat/(.*)/adalib/</directory>
    </runtimes>
    <target>c</target>
  </compiler_description>

  <!--  CCG Target (C generation via LLVM) -->

  <compiler_description>
    <name>GNAT_CCG</name>
    <executable prefix="1">(c-|llvm-)gnatls</executable>
    <version>
      <external>${PREFIX}gnatls -v</external>
      <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
    </version>
    <languages>Ada</languages>
    <variable name="gcc_version">
      <external>${PREFIX}gcc -v</external>
      <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
    </variable>
    <runtimes default="default,ccg">
       <directory group="default" >\.\./lib/rts-ccg/adalib/</directory>
       <directory group="1" >\.\./lib/rts-(.*)/adalib/</directory>
    </runtimes>
    <target>c</target>
  </compiler_description>

  <!--  GNAT CUDA Target -->

  <compiler_description>
    <name>GNAT_CUDA</name>
    <executable prefix="1">llvm-gnatls</executable>
    <version>
      <external>llvm-gnatls -v</external>
      <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
    </version>
    <languages>Ada</languages>
    <variable name="gcc_version">
      <external>cuda-gcc -v</external>
      <grep regexp="^[-\w]*gcc \S+ (\S+)" group="1"></grep>
    </variable>
    <runtimes default="default,device-cuda">
       <directory group="default" >\.\./lib/rts-device-cuda/adalib/</directory>
       <directory group="1" >\.\./lib/rts-(.*)/adalib/</directory>
    </runtimes>
    <target>cuda</target>
  </compiler_description>


  <!--  GNAT_DOTNET -->

  <compiler_description>
    <name>GNAT_DOTNET</name>
    <executable prefix="1">(.*dotnet-)gnatls</executable>
    <version>
      <external>${PREFIX}gnatls -v</external>
      <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
    </version>
    <languages>Ada</languages>
    <runtimes default="default,kernel">
       <directory group="default" >\.\./lib/dotgnat/adalib/</directory>
       <directory group="1" >\.\./lib/dotgnat/rts-(.*)/adalib/</directory>
    </runtimes>
    <target>dotnet</target>
  </compiler_description>

  <!--  JGNAT -->

  <compiler_description>
    <name>JGNAT</name>
    <executable prefix="1">(.*jvm-)gnatls</executable>
    <version>
      <external>${PREFIX}gnatls -v</external>
      <grep regexp="^GNATLS.+?(\d+(\.\d+)?)" group="1"></grep>
    </version>
    <languages>Ada</languages>
    <runtimes default="default">
       <directory group="default" >\.\./lib/jgnat/adalib/</directory>
       <directory group="1" >\.\./lib/jgnat/rts-(.*)/adalib/</directory>
    </runtimes>
    <target>jvm</target>
  </compiler_description>

  <!--    G77  -->
  <compiler_description>
    <name>G77</name>
    <executable>g77</executable>
    <version>
      <external>g77 --version</external>
      <grep regexp="\(GCC.*\) (\S+)" group="1"></grep>
    </version>
    <languages>Fortran</languages>
    <target>
      <external>g77 -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!--    GFortran  -->
  <compiler_description>
    <name>GFORTRAN</name>
    <executable>gfortran(-\d+)?</executable>
    <version>
      <external>$EXEC -v</external>
      <grep regexp="^gcc \S+ (\S+)" group="1"></grep>
    </version>
    <languages>Fortran</languages>
    <target>
      <external>$EXEC -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!--    mingw-cygwin compiler  -->
  <compiler_description>
    <name>GCC-CYGMING</name>
    <executable>gcc</executable>
    <version>
      <external>gcc --version</external>
      <grep regexp="\(GCC\) (\S+).*\(cygming special\)" group="1"></grep>
    </version>
    <languages>C,C++,Fortran</languages>
    <target>
      <external>gcc -mno-cygwin -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <compiler_description>
    <name>GCC-MINGW32</name>
    <executable prefix="1">gcc(-sjlj|)</executable>
    <version>
      <external>gcc${PREFIX} --version</external>
      <grep regexp="\(GCC\) (\S+).*\(mingw32.*\)" group="1"></grep>
    </version>
    <languages>C,C++,Fortran</languages>
    <target>
      <external>gcc${PREFIX} -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!-- Diab C Compiler -->
  <compiler_description>
    <name>DIABC-PPC</name>
    <executable>dcc</executable>
    <version>
      <external>dcc -V</external>
      <grep regexp=".*dcc(.exe)? Rel ([0-9.]*)" group="2"></grep>
    </version>
    <languages>C</languages>
    <target>powerpc-elf</target>
  </compiler_description>

  <!-- LynxWorks C compiler for LynxOS-178 -->
  <compiler_description>
    <name>LYNXWORKS-C</name>
    <executable>gcc</executable>
    <version>
      <external>gcc -v</external>
      <grep regexp="^gcc version (\S+)" group="1"></grep>
    </version>
    <languages>C</languages>
    <target>
      <external>gcc -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
      <must_match>.*xcoff-lynxos.*</must_match>
    </target>
  </compiler_description>

  <!-- LynxWorks C++ compiler for LynxOS-178 -->
  <compiler_description>
    <name>LYNXWORKS-C++</name>
    <executable>c\+\+</executable>
    <version>
      <external>c++ -v</external>
      <grep regexp="^gcc version (\S+)" group="1"></grep>
    </version>
    <languages>C++</languages>
    <target>
      <external>c++ -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
      <must_match>.*xcoff-lynxos.*</must_match>
    </target>
  </compiler_description>

  <!-- Clang C compiler -->
  <compiler_description>
    <name>CLANG-C</name>
    <executable prefix="1">((.*-elf-|.*-linux-gnu-)?)clang</executable>
    <version>
      <external>$EXEC -v</external>
      <grep regexp=".*(LLVM|clang) version ([0-9.]*)" group="2"></grep>
    </version>
    <languages>C</languages>
    <target>
      <external>$EXEC -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!-- Clang++ C++ compiler -->
  <compiler_description>
    <name>CLANG-C++</name>
    <executable prefix="1">((.*-elf-|.*-linux-gnu-)?)clang\+\+</executable>
    <version>
      <external>$EXEC -v</external>
      <grep regexp=".*(LLVM|clang) version ([0-9.]*)" group="2"></grep>
    </version>
    <languages>C++</languages>
    <target>
      <external>$EXEC -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!-- Clang assembler -->
  <compiler_description>
    <name>CLANG-ASM</name>
    <executable prefix="1">((.*-elf-|.*-linux-gnu-)?)clang</executable>
    <version>
      <external>$EXEC -v</external>
      <grep regexp=".*(LLVM|clang) version ([0-9.]*)" group="2"></grep>
    </version>
    <languages>Asm,Asm_Cpp,Asm2</languages>
    <target>
      <external>$EXEC -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

  <!--  Windres compiler -->
  <compiler_description>
    <name>WINDRES</name>
    <executable prefix="1">(i686-.*-mingw32-|x86_64-.*-mingw32-)?windres</executable>
    <version>
      <external>${PREFIX}windres --version</external>
      <grep regexp="^GNU windres \(GNU Binutils\) (\S+)" group="1"></grep>
    </version>
    <languages>WinRes</languages>
    <target>
      <external>${PREFIX}gcc -dumpmachine</external>
      <grep regexp="[^\r\n]+"></grep>
    </target>
  </compiler_description>

</gprconfig>
