+dnl CF_GNAT_PROJECTS version: 4 updated: 2013/09/07 14:05:46
+dnl ----------------
+dnl GNAT projects are configured with ".gpr" project files.
+dnl GNAT libraries are a further development, using the project feature.
+AC_DEFUN([CF_GNAT_PROJECTS],
+[
+AC_REQUIRE([CF_GNAT_VERSION])
+
+cf_gnat_libraries=no
+cf_gnat_projects=no
+
+AC_MSG_CHECKING(if GNAT supports project files)
+case $cf_gnat_version in #(vi
+3.[[0-9]]*) #(vi
+ ;;
+*)
+ case $cf_cv_system_name in #(vi
+ cygwin*|msys*) #(vi
+ ;;
+ *)
+ mkdir conftest.src conftest.bin conftest.lib
+ cd conftest.src
+ rm -rf conftest* *~conftest*
+ cat >>library.gpr <<CF_EOF
+project Library is
+ Kind := External ("LIB_KIND");
+ for Library_Name use "ConfTest";
+ for Object_Dir use ".";
+ for Library_ALI_Dir use External("LIBRARY_DIR");
+ for Library_Version use External ("SONAME");
+ for Library_Kind use Kind;
+ for Library_Dir use External("BUILD_DIR");
+ Source_Dir := External ("SOURCE_DIR");
+ for Source_Dirs use (Source_Dir);
+ package Compiler is
+ for Default_Switches ("Ada") use
+ ("-g",
+ "-O2",
+ "-gnatafno",
+ "-gnatVa", -- All validity checks
+ "-gnatwa"); -- Activate all optional errors
+ end Compiler;
+end Library;
+CF_EOF
+ cat >>confpackage.ads <<CF_EOF
+package ConfPackage is
+ procedure conftest;
+end ConfPackage;
+CF_EOF
+ cat >>confpackage.adb <<CF_EOF
+with Text_IO;
+package body ConfPackage is
+ procedure conftest is
+ begin
+ Text_IO.Put ("Hello World");
+ Text_IO.New_Line;
+ end conftest;
+end ConfPackage;
+CF_EOF
+ if ( $cf_ada_make $ADAFLAGS \
+ -Plibrary.gpr \
+ -XBUILD_DIR=`cd ../conftest.bin;pwd` \
+ -XLIBRARY_DIR=`cd ../conftest.lib;pwd` \
+ -XSOURCE_DIR=`pwd` \
+ -XSONAME=libConfTest.so.1 \
+ -XLIB_KIND=static 1>&AC_FD_CC 2>&1 ) ; then
+ cf_gnat_projects=yes
+ fi
+ cd ..
+ if test -f conftest.lib/confpackage.ali
+ then
+ cf_gnat_libraries=yes
+ fi
+ rm -rf conftest* *~conftest*
+ ;;
+ esac
+ ;;
+esac
+AC_MSG_RESULT($cf_gnat_projects)
+
+if test $cf_gnat_projects = yes
+then
+ AC_MSG_CHECKING(if GNAT supports libraries)
+ AC_MSG_RESULT($cf_gnat_libraries)
+fi
+
+if test "$cf_gnat_projects" = yes
+then
+ USE_OLD_MAKERULES="#"
+ USE_GNAT_PROJECTS=""
+else
+ USE_OLD_MAKERULES=""
+ USE_GNAT_PROJECTS="#"
+fi
+
+if test "$cf_gnat_libraries" = yes
+then
+ USE_GNAT_LIBRARIES=""
+else
+ USE_GNAT_LIBRARIES="#"
+fi
+
+AC_SUBST(USE_OLD_MAKERULES)
+AC_SUBST(USE_GNAT_PROJECTS)
+AC_SUBST(USE_GNAT_LIBRARIES)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_SIGINT version: 1 updated: 2011/03/27 20:07:59
+dnl --------------
+dnl Check if gnat supports SIGINT, and presumably tasking. For the latter, it
+dnl is noted that gnat may compile a tasking unit even for configurations which
+dnl fail at runtime.
+AC_DEFUN([CF_GNAT_SIGINT],[
+AC_CACHE_CHECK(if GNAT supports SIGINT,cf_cv_gnat_sigint,[
+CF_GNAT_TRY_LINK([with Ada.Interrupts.Names;
+
+package ConfTest is
+
+ pragma Warnings (Off); -- the next pragma exists since 3.11p
+ pragma Unreserve_All_Interrupts;
+ pragma Warnings (On);
+
+ protected Process is
+ procedure Stop;
+ function Continue return Boolean;
+ pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT);
+ private
+ Done : Boolean := False;
+ end Process;
+
+end ConfTest;],
+[package body ConfTest is
+ protected body Process is
+ procedure Stop is
+ begin
+ Done := True;
+ end Stop;
+ function Continue return Boolean is
+ begin
+ return not Done;
+ end Continue;
+ end Process;
+end ConfTest;],
+ [cf_cv_gnat_sigint=yes],
+ [cf_cv_gnat_sigint=no])])
+
+if test $cf_cv_gnat_sigint = yes ; then
+ USE_GNAT_SIGINT=""
+else
+ USE_GNAT_SIGINT="#"
+fi
+AC_SUBST(USE_GNAT_SIGINT)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_GNAT_TRY_LINK version: 3 updated: 2011/03/19 14:47:45