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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,807ea75fdd8baa41 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!f31g2000pri.googlegroups.com!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Some questions on packaging Ada code Date: Wed, 9 Mar 2011 03:22:15 -0800 (PST) Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 153.98.68.197 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1299669735 1473 127.0.0.1 (9 Mar 2011 11:22:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 9 Mar 2011 11:22:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: f31g2000pri.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.6) Gecko/2009012111 Red Hat/3.0.6-1.el5 Firefox/3.0.6,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:17983 Date: 2011-03-09T03:22:15-08:00 List-Id: localhost@example.com wrote on comp.lang.ada: > Hello all! Is it possible to generate an executable using gcc-ada and > ncurses that doesn't have any dependencies? I'm thinking about providing an > application to people that don't have ada or maybe even gcc installed and > certainly not ncurses. I have Linux as my development system. If the answer > to this question is yes Yes. For the GNAT run-time library, pass the -static option to gnatbind, like so: gnatmake [other parameters...] -bargs -static or using a package Binder in your GNAT project file. Please read the GNAT User's Guide for your version of GCC[1]. [1] http://gcc.gnu.org/onlinedocs/ For libraries other than the GNAT run-time library (such as ncurses), simply specify the name of all static libraries necessary on the command line or in the package Linker of your project file, like so: gnatmake foo.adb [other options...] \ -bargs -static \ -largs /usr/lib/libncurses_ada.a /usr/lib/libncurses.a or: with "ncurses_ada"; project Foo is package Binder is for Default_Switches ("Ada") use ("-static"); end Binder; package Linker is for Default_Switches ("Ada") use ("/usr/lib/libncurses_ada.a", "/usr/lib/libncurses.a"); end Linker; end Foo; > then my next question would be can I generate a > standalone Windows executable from Linux easily enough or should I take the > source over to Windows somehow and build it there. Thanks for your help. It is possible to cross-compile from a GNU/Linux host to a Windows target but I am not aware of any binary distribution of the necessary cross-compiler. This means you would have to build your own cross- compiler and cross-libraries from source. I think this would be more trouble than it is worth (especially since you seem to be a beginner); you would be better off installing a native compiler and libraries on Windows and recompiling your sources on Windows. Finally, some notes about ncurses: * the library may not work out of the box on Windows as it needs an ANSI-compliant terminal. I'm sure it can be made to work, perhaps with some tweaking. * you will need an Ada binding to ncurses, both on GNU/Linux and on Windows. Do you have one? (see also http://bugs.debian.org/615920). Hope this helps -- Ludovic Brenta.