Author: Ludovic Brenta <ludovic@ludovic-brenta.org>
Forwarded: not-needed
Description: make a tarball from testgtk examples
Upstream examples, in directory testgtk, are intended to be built
inside the source tree. This patch adds a project and a make file,
so that the tarball provided by the doc package demonstrates how
every user may build a program depending on gtkada.

Index: b/testgtk/testgtk.gpr
===================================================================
--- a/testgtk/testgtk.gpr	2011-09-04 00:53:42.000000000 +0200
+++ b/testgtk/testgtk.gpr	2011-09-04 01:27:43.000000000 +0200
@@ -1,25 +1,18 @@
-with "../src/gtkada_src";
-with "../shared";
-with "opengl/testgtk_opengl";
-
+with "gtkada";
+with "gtkglada";
 project TestGtk is
-
-   for Languages use ("Ada");
    for Main use ("testgtk.adb", "testcairo.adb");
-   for Source_Dirs use ("./");
-   for Object_Dir use "obj/";
+   for Source_Dirs use (".", "opengl");
+   for Object_Dir use "obj";
    for Exec_Dir use ".";
 
-   package Builder is
-      for Default_Switches ("Ada") use Shared.Builder'Default_Switches ("Ada");
-   end Builder;
-
    package Compiler is
-      for Default_Switches ("Ada") use
-         ("-gnatQ", "-gnatwa", "-gnatay3abcefhiklmnprt", "-g", "-O1");
+      for Default_Switches ("Ada") use ("-g", "-O1", "-gnatafo");
    end Compiler;
-
-   package Binder   renames Shared.Binder;
-   package IDE      renames Shared.IDE;
-
+   package Binder is
+      for Default_Switches ("Ada") use ("-E");
+   end Binder;
+   package Linker is
+      for Default_Switches ("Ada") use ("-lgtkglada", "-lGLU", "obj/lw.o");
+   end Linker;
 end TestGtk;
Index: b/testgtk/testgtk.mak
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ b/testgtk/testgtk.mak	2011-09-04 01:17:38.000000000 +0200
@@ -0,0 +1,47 @@
+# -*- Makefile -*- to build testgtk
+# Copyright (c) 2004 Ludovic Brenta <ludovic.brenta@insalien.org>
+
+# 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
+
+
+
+# On Debian GNU/Linux, the preferred way to build Ada software is to
+# use GNAT project files.  This simple Makefile compiles the C portion
+# of testgtk and delegates the rest of processing to such a project
+# file.
+
+# The Makefile in this directory is unchanged from the upstream
+# sources; however, it will not work because it assumes that it
+# resides in the GtkAda source directory.  Use this file instead.
+
+.SUFFIXES:
+
+C_OBJECTS=$(patsubst opengl/%.c,obj/%.o,$(wildcard opengl/*.c))
+CFLAGS=-g -O2
+
+all: obj $(C_OBJECTS) opengl/view_gl.adb force
+	gnatmake -Ptestgtk.gpr
+
+obj:
+	-mkdir -p obj
+
+obj/%.o: opengl/%.c
+	gcc -c $(CFLAGS) -o $@ $< `pkg-config --cflags glib-2.0`
+
+opengl/%.adb: opengl/%.gpb
+	gnatprep -r -c -DHAVE_GL=True -DWIN32=False $< $@
+
+.PHONY: force
