[gtkada] Build failure on gtkada 3.8.3

David Lightstone david.lightstone at prodigy.net
Wed Sep 10 15:13:30 CEST 2014


I had a bit of difficulty building gtkada 3.8.2  with open_gl support. Had
to modify several of the makefiles (patchs provided at end of this email)
I thought I would attempt to build based on gtkada 3.8.3 as an alternative.
Building without open_gl support was successful, building with open_gl
support was not successful

I would suspect (possible incorrectly) that both versions are based upon the
same infrastructure libraries gtk 3.8.4  (obtained from
http://libre.adacore.com/download as file gtk+-3.8.4-i686-pc-linux-gnu.tgz)
+ whatever the host provides.
I consequently suspect there to be a problem in the gtkada 3.8.3 build
procedures 
The manifestation is immediately below

gprbind testgtk.bexch
gnatbind testgtk.ali
gcc -c b__testgtk.adb
gprbind test_rtree.bexch
gnatbind test_rtree.ali
gcc -c b__test_rtree.adb
ar cr libtestgtk.a ...
ranlib libtestgtk.a
gcc testgtk.o -lGLU -lGL -Wl,--export-dynamic -pthread
-L/home/dbl/Tools/Ada/bootstrap/lib -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0
-lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo
-lgobject-2.0 -lgmodule-2.0 -lrt -lglib-2.0 -o testgtk
/home/dbl/Tools/Ada/bootstrap/bin/../libexec/gcc/i686-pc-linux-gnu/4.7.4/ld:
libtestgtk.a(lw.o): undefined reference to symbol 'sqrtf@@GLIBC_2.0'
/lib/i386-linux-gnu/libm.so.6: error adding symbols: DSO missing from
command line
collect2: error: ld returned 1 exit status
gprbuild: link of testgtk.adb failed
make: *** [tests] Error 4
dbl at ubuntu:~/Projects/Ada/Bootstrap-Build/14-gtkada-3.8.3$

Based upon the build of 3.8.2 the missing symbol 'sqrtf@@GLIBC_2.0' is
resolved (on my host)  by appending (to the end of the link command) the
library switch -lm

My host computer is an x86 Ubuntu 14.04 LTS VMWare based virtual machine

Dave Lightstone

gtkada 3.8.2 patch immediately follows
source was obtained from http://libre.adacore.com/download as
gtkada-gpl-3.8.2-src.tgz


diff -rupN gtkada-3.8.2-src-original/Makefile.in
gtkada-3.8.2-src-working-for-patch/Makefile.in
--- gtkada-3.8.2-src-original/Makefile.in	2013-05-16
10:48:57.000000000 -0400
+++ gtkada-3.8.2-src-working-for-patch/Makefile.in	2014-09-10
06:04:01.678737000 -0400
@@ -12,7 +12,10 @@ example_dir = examples
 projects_dir = projects
 xml_dir      = xml
 
-all: src tests
+all:  src projects tests
+
+projects: 
+	$(MAKE) -C $(projects_dir)
 
 src:
 	$(MAKE) -C $(src_dir)
diff -rupN gtkada-3.8.2-src-original/projects/Makefile
gtkada-3.8.2-src-working-for-patch/projects/Makefile
--- gtkada-3.8.2-src-original/projects/Makefile	2012-08-01
09:57:19.000000000 -0400
+++ gtkada-3.8.2-src-working-for-patch/projects/Makefile	2014-09-10
07:19:17.534704000 -0400
@@ -11,7 +11,7 @@ SOVER=${MAJOR}.${MINOR}
 PRJDIR=${prefix}/lib/gnat
 
 install: force
-	${MKDIR} "${DESTDIR}${PRJDIR}"
+	${MKDIR} "${DESTDIR}${libdir}"
 	$(MKDIR) "${DESTDIR}$(libdir)/pkgconfig/"
 	${CP} gtkada.pc "${DESTDIR}$(libdir)/pkgconfig/"
 	-${RM} "${DESTDIR}${prefix}"/projects/gtkada*
@@ -21,16 +21,17 @@ install: force
 	@# eventually be installed in ${libdir}.
 	./generate_prj.sh GtkAda ${DEFAULT_LIBRARY_TYPE} ${SOVER} ""
"${libdir}"
 	${CP} gtkada.gpr "${DESTDIR}${PRJDIR}"
-
 ifeq ($(HAVE_OPENGL), True)
 	./generate_prj.sh GtkAda_GL ${DEFAULT_LIBRARY_TYPE} ${SOVER} opengl
"${libdir}"
 	${CP} gtkada_gl.gpr "${DESTDIR}${PRJDIR}"
 endif	
-
 ifeq ($(OS),Windows_NT)
 	${CP} gtkada_install_*.gpr "${DESTDIR}${incdir}"
 endif
 
+all:
+
+
 clean: force
 	${RM} *.gpr 
 
diff -rupN gtkada-3.8.2-src-original/src/Makefile.in
gtkada-3.8.2-src-working-for-patch/src/Makefile.in
--- gtkada-3.8.2-src-original/src/Makefile.in	2013-11-09
06:34:34.000000000 -0500
+++ gtkada-3.8.2-src-working-for-patch/src/Makefile.in	2014-09-10
08:03:24.182684000 -0400
@@ -28,7 +28,8 @@ SONAME        = libgtkada-$(MAJOR).$(MIN
 endif
 ARCHIVENAME   = libgtkada.a
 
-ifeq ($(GL_SUPPORT),yes)
+HAVE_OPENGL=@HAVE_OPENGL@
+ifeq ($(HAVE_OPENGL),True)
 opengl_libs = opengl
 else
 opengl_libs =
Binary files gtkada-3.8.2-src-original/src/opengl/gdkgl.o and
gtkada-3.8.2-src-working-for-patch/src/opengl/gdkgl.o differ
Binary files gtkada-3.8.2-src-original/src/opengl/gtkglarea.o and
gtkada-3.8.2-src-working-for-patch/src/opengl/gtkglarea.o differ
diff -rupN gtkada-3.8.2-src-original/src/opengl/Makefile.in
gtkada-3.8.2-src-working-for-patch/src/opengl/Makefile.in
--- gtkada-3.8.2-src-original/src/opengl/Makefile.in	2012-04-04
03:58:28.000000000 -0400
+++ gtkada-3.8.2-src-working-for-patch/src/opengl/Makefile.in	2014-09-10
06:10:37.862734000 -0400
@@ -44,7 +44,7 @@ install:   module_install force
         fi
 endif
 
-module_ada: ${OPENGL_C_OBJECTS_DIR}
+module_ada: ${OPENGL_C_OBJECTS_DIR} ${OPENGL_C_OBJECTS} ${OPENGL_OBJECTS}
 
 ${OBJ_DIR}/gtkglarea.o: gtkglarea.h gtkglarea.c
 	$(CC) -c $(CFLAGS) -o$@ $(OPENGL_FLAGS) gtkglarea.c
@@ -52,5 +52,13 @@ ${OBJ_DIR}/gtkglarea.o: gtkglarea.h gtkg
 ${OBJ_DIR}/gdkgl.o:  gdkgl.h gdkgl.c
 	$(CC) -c $(CFLAGS) -o$@ $(OPENGL_FLAGS) gdkgl.c
 
+gtk-glarea.o: gtk-glarea.ads gtk-glarea.adb
+
+gdk-gl.o: gdk-gl.ads gdk-gl.adb
+
+glu_h.o:  glu_h.ads
+
+gl_h.o: gl_h.ads gl_h.adb
+
 clean:     module_clean
 distclean: module_distclean
diff -rupN gtkada-3.8.2-src-original/testgtk/create_css_editor.adb
gtkada-3.8.2-src-working-for-patch/testgtk/create_css_editor.adb
--- gtkada-3.8.2-src-original/testgtk/create_css_editor.adb	2014-01-06
05:22:20.000000000 -0500
+++ gtkada-3.8.2-src-working-for-patch/testgtk/create_css_editor.adb
2014-09-10 06:09:05.282735000 -0400
@@ -38,28 +38,28 @@ package body Create_Css_Editor is
 
    CSS : constant String :=
       "/* You can edit the text in this window to change the" & ASCII.LF
-     &" * appearance of this Window." & ASCII.LF
-     &" * Be careful, if you screw it up, nothing might be visible" &
ASCII.LF
-     &" * anymore. :)" & ASCII.LF
-     &" */" & ASCII.LF & ASCII.LF
+     & " * appearance of this Window." & ASCII.LF
+     & " * Be careful, if you screw it up, nothing might be visible" &
ASCII.LF
+     & " * anymore. :)" & ASCII.LF
+     & " */" & ASCII.LF & ASCII.LF
 
-     &"/* This CSS resets all properties to their defaults values" &
ASCII.LF
-     &" * and overrides all user settings and the theme in use */" &
ASCII.LF
+     & "/* This CSS resets all properties to their defaults values" &
ASCII.LF
+     & " * and overrides all user settings and the theme in use */" &
ASCII.LF
      & ASCII.LF
 
-     &"/* Set a very futuristic style by default */" & ASCII.LF & ASCII.LF
+     & "/* Set a very futuristic style by default */" & ASCII.LF & ASCII.LF
 
-     &"* {" & ASCII.LF
-     &"  color: green;" & ASCII.LF
-     &"  font-family: Monospace;" & ASCII.LF
-     &"  border: 1px solid;" & ASCII.LF
-     &"}" & ASCII.LF
-
-     &"/* Make sure selections are visible */" & ASCII.LF
-     &":selected {" & ASCII.LF
-     &"  background-color: darkGreen;" & ASCII.LF
-     &"  color: black;" & ASCII.LF
-     &"}";
+     & "* {" & ASCII.LF
+     & "  color: green;" & ASCII.LF
+     & "  font-family: Monospace;" & ASCII.LF
+     & "  border: 1px solid;" & ASCII.LF
+     & "}" & ASCII.LF
+
+     & "/* Make sure selections are visible */" & ASCII.LF
+     & ":selected {" & ASCII.LF
+     & "  background-color: darkGreen;" & ASCII.LF
+     & "  color: black;" & ASCII.LF
+     & "}";
 
    Last_Working_Css : Unbounded_String := To_Unbounded_String (CSS);
    Error : aliased Glib.Error.GError;
diff -rupN gtkada-3.8.2-src-original/testgtk/create_print.adb
gtkada-3.8.2-src-working-for-patch/testgtk/create_print.adb
--- gtkada-3.8.2-src-original/testgtk/create_print.adb	2014-01-06
05:22:20.000000000 -0500
+++ gtkada-3.8.2-src-working-for-patch/testgtk/create_print.adb	2014-09-10
06:08:30.926735000 -0400
@@ -127,7 +127,7 @@ package body Create_Print is
       Close_Path (Cr);
 
       Set_Source_Rgb (Cr, 0.0, 0.0, 0.0);
-      Set_Line_Width (Cr, 1.0/16.0);
+      Set_Line_Width (Cr, 1.0 / 16.0);
       Set_Line_Cap (Cr, Cairo_Line_Cap_Round);
       Set_Line_Join (Cr, Cairo_Line_Join_Round);
       Cairo.Stroke (Cr);
Binary files gtkada-3.8.2-src-original/testgtk/lw.o and
gtkada-3.8.2-src-working-for-patch/testgtk/lw.o differ
diff -rupN gtkada-3.8.2-src-original/testgtk/Makefile.in
gtkada-3.8.2-src-working-for-patch/testgtk/Makefile.in
--- gtkada-3.8.2-src-original/testgtk/Makefile.in	2013-08-23
06:27:23.000000000 -0400
+++ gtkada-3.8.2-src-working-for-patch/testgtk/Makefile.in	2014-09-10
06:07:22.898736000 -0400
@@ -6,7 +6,7 @@ src_dir = ../src
 opengl_dir = $(src_dir)/opengl
 
 CC = @CC@
-TARGET_LFLAGS = @TARGET_LFLAGS@
+TARGET_LFLAGS = @TARGET_LFLAGS@ @LIBS@
 
 OBJ_DIR=obj
 include ../src/Makefile.common




More information about the gtkada mailing list