#!/bin/sh

test_dir=$(mktemp -d)

cleanup() {
    rm -rf $test_dir ;
}
trap cleanup 1 2 3 13 15

cd "$test_dir"

cat > proj.gpr <<EOF
with "plplotada";
project Proj is
  for Source_Dirs use (".");
  for Main use ("proc.adb");
end Proj;
EOF

cat > proc.adb <<EOF
with Ada.Text_IO;
with PLplot_Standard; 
procedure Proc is
begin
   Ada.Text_IO.Put_Line (Integer'Image (PLplot_Standard.Max_Lines_For_Multiplot));
end Proc;
EOF

gprbuild -v proj.gpr
./proc

cleanup
