[Cbe-oss-dev] [PATCH] libspe2: Add Linker_Options pragma to Ada binding

Sa Liu SALIU at de.ibm.com
Fri Jul 6 23:33:31 EST 2007


This patch adds Linker_Options pragma to Ada binding, so that the GNAT 
linker will link the package file with libspe2 automatically.

Signed-off-by: Sa Liu <saliu at de.ibm.com>

----
Index: libspe2/ada/libspe2.ads
===================================================================
--- libspe2/ada/libspe2.ads     (revision 67)
+++ libspe2/ada/libspe2.ads     (working copy)
@@ -12,6 +12,10 @@ package libspe2 is
   use Interfaces.C;
   use libspe2_types;
 
+--
+-- link with libspe2
+--
+  pragma Linker_Options("-lspe2");
 
 --
 -- spe_context_create
Index: libspe2/ada/Makefile
===================================================================
--- libspe2/ada/Makefile        (revision 67)
+++ libspe2/ada/Makefile        (working copy)
@@ -33,7 +33,7 @@ adabinding : libspe2.ads libspe2_types.a
        $(CC) -c libspe2_types.ads
 
 tests : testsingle.adb 
-       $(CROSS)gnatmake -g $^ -largs -lspe2
+       $(CROSS)gnatmake -g $^
 
 spu_programs:  hello 
 
Index: libspe2/ada/README
===================================================================
--- libspe2/ada/README  (revision 67)
+++ libspe2/ada/README  (working copy)
@@ -20,6 +20,7 @@ Project hello is
 end hello;
 
 When compiling the Ada source program, add a GNAT option -Phello.gpr.
-Finally to link the program with libspe dynamic library, add linker 
option -lspe2.
 e.g.
-ppu-gnatmake helloworld.adb -Phello.gpr -largs -lspe2
+ppu-gnatmake helloworld.adb -Phello.gpr 
+
+The libspe2.ads file is linked with libspe dynamic library automatically 
through Linker_Options pragma. 
-------------------------------------------------------------------

---
EOF

Mit freundlichen Grüßen / Best Regards
Sa Liu, GCC on Cell/B.E. Development, LTC
Phone: (+49) 7031 163104
-----------------------------------------------------------------------------------------------------------------------------------
IBM Deutschland Entwicklung GmbH
Vorsitzender des Aufsichtsrats: Johann Weihen | Geschäftsführung: Herbert 
Kircher
Sitz der Gesellschaft: Böblingen | Registergericht: Amtsgericht Stuttgart, 
HRB 243294




More information about the cbe-oss-dev mailing list