From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1ca5e4a3e79e64cb,start X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!news.highwinds-media.com!colt.net!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Including C source in GNAT project for building library Date: Thu, 24 Jan 2008 05:27:26 +0000 Organization: Pushface Message-ID: NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1201152447 29089 62.49.19.209 (24 Jan 2008 05:27:27 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Thu, 24 Jan 2008 05:27:27 +0000 (UTC) Cancel-Lock: sha1:g5N6afxi6uT8BrPBeR2hP9YJr0s= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (darwin) Xref: g2news1.google.com comp.lang.ada:19571 Date: 2008-01-24T05:27:26+00:00 List-Id: This relates to building TASH as a library (static, libtash.a) using GNAT Project, as in GNAT-GPL-2007. As well as Ada source, this library needs two C-sourced units to act as wrappers for macros in the Tcl/Tk header files. I can do this by hand (obviously only for a static library) by doing this after gnatmake has done its part: gcc -c -g -O2 -I/usr/include tclmacro.c gcc -c -g -O2 -I/usr/include tkmacro.c ar -r lib/libtash.a tclmacro.o tkmacro.o ranlib lib/libtash.a but can't help feeling there should be a way to tell gnatmake to do this! So far I have with "../tash_options"; project Build_Tash_Library is for Library_Name use "tash"; for Languages use ("Ada","C"); for Library_Interface use ( "cargv", "chelper", "tash.arrays", "tash.file", "tash.file_io", "tash.float_arrays", "tash.float_lists", "tash.floats", "tash.integer_arrays", "tash.integer_lists", "tash.integers", "tash.lists", "tash.platform", "tash.regexp", "tash.strings", "tash.system", "tash", "tcl.ada", "tcl.tk.ada", "tcl.tk", "tcl" ); for Source_Files use ( "tclmacro.c", "tkmacro.c", "cargv.adb", "cargv.ads", "chelper.adb", "chelper.ads", "tash-arrays.adb", "tash-arrays.ads", "tash-file.adb", "tash-file.ads", "tash-file_io.adb", "tash-file_io.ads", "tash-float_arrays.ads", "tash-float_lists.ads", "tash-floats.adb", "tash-floats.ads", "tash-integer_arrays.ads", "tash-integer_lists.ads", "tash-integers.adb", "tash-integers.ads", "tash-lists.adb", "tash-lists.ads", "tash-platform.adb", "tash-platform.ads", "tash-regexp.adb", "tash-regexp.ads", "tash-strings.adb", "tash-strings.ads", "tash-system.adb", "tash-system.ads", "tash.adb", "tash.ads", "tcl-ada.adb", "tcl-ada.ads", "tcl-tk-ada.adb", "tcl-tk-ada.ads", "tcl-tk.adb", "tcl-tk.ads", "tcl.adb", "tcl.ads" ); for Object_Dir use ".build_lib"; for Library_Kind use "static"; for Library_Src_Dir use "lib"; for Library_Dir use "lib"; package IDE is for Compiler_Command ("ada") use "gnatmake"; for Gnatlist use "gnatls"; for VCS_Kind use "CVS"; end IDE; package Builder is for Default_Switches ("ada") use ("-m", "-g"); end Builder; package Compiler is for Default_Switches ("ada") use Tash_Options.Compiler_Options; for Default_Switches ("C") use ("-c", "-g", "-O2", "-I/usr/include"); end Compiler; end Build_Tash_Library;