Article View: comp.unix.programmer
Article #3741Re: GNU Autoconf & MS-Windows
From: Glynn Clements
Date: Wed, 10 Dec 2003 00:35
Date: Wed, 10 Dec 2003 00:35
61 lines
4348 bytes
4348 bytes
Tristan Miller <psychonaut@nothingisreal.com> writes: > SHORT STORY: In addition to the standard Unix configure script, I want > Autoconf/Automake to produce separate ready-to-use Makefiles and > config.h files for use with popular Windows compilers, and then include > these alternatives in my distribution. Is this possible, and if so, > how should I do it? > > LONG STORY: I've written some software packages for which I am now > producing distributions with GNU Autoconf and Automake. The packages > are console applications written in more or less standard C and C++, > and before I moved to Autotools there had been reports of successful > compiles on Windows with Microsoft's Visual C++ compiler. If possible, > I'd like to ensure that the autoconfiscated distribution continues to > compile under Windows without requiring the user to install additional > software, such as Cygwin. However, now that I am using Autotools, I > have rewritten some of my code to use some basic preprocessor macros > #defined by configure (PACKAGE, VERSION, PACKAGE_STRING, etc.). > > Is it possible to use Autoconf and Automake to produce a config.h and > Makefile for use with MSVC++ and its NMAKE utility? How about for > other popular Windows C and C++ compilers, like Borland? That way > maybe I can include in the distribution a default config.h for use with > Windows (which I presume will be overwritten by Unix users running > configure) and an alternative Makefile, (say, Makefile.w32). Then I > could revise the installation instructions so that they essentially > say, "Unix users, do the standard ./configure;make;make install. > Windows users, import the Makefile.w32 file using whatever mechanism > your IDE provides." > > Is this dream realizable? If so, how do I go about doing it, and are > there any gotchas I should be aware of? This doesn't make much sense. The configure script "fills in the blanks" in config.h.in and Makefile.in with values which are appropriate for the system on which the script is run. If the user isn't going to be running a configure script, they will be using fixed versions of config.h and Makefile. So just create versions of config.h and Makefile which are appropriate for a typical Windows system. IOW, autoconf doesn't help at all. This isn't a Windows issue; it wouldn't help if you were trying to do this for Unix. OTOH, this is an area where automake could be useful, but isn't (because it only generates GNU Makefiles, not NMAKE Makefiles). At least, not directly; you could use it to generate config.h.in and Makefile.in, and then just edit these by hand to produce the appropriate files. This assumes that you have the requisite knowledge; e.g. whether all of the various HAVE_xxx are true or false for Windows. After all, that information has to come from somewhere, and it can't come from the configure script (as it does on Unix) if you aren't running it. -- Glynn Clements <glynn.clements@virgin.net>
Technical Details
Message-ID:
<m3vfopfr0w.fsf@cerise.nosuchdomain.co.uk>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!news2.telebyte.nl!news.cambrium.nl!news.cambrium.nl!news.cambrium.nl!news2.euro.net!newspeer1-gui.server.ntli.net!ntli.net!newsfep2-win.server.ntli.net.POSTED!53ab2750!not-for-mailReferences:
<1123221.qYdsJqJpgY@ID-187157.news.dfncis.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109f73,4ddc229e2cd08f77 X-Google-Attributes: gid109f73,public X-Google-Thread: fc89c,4ddc229e2cd08f77 X-Google-Attributes: gidfc89c,public X-Google-ArrivalTime: 2003-12-09 16:36:48 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!news2.telebyte.nl!news.cambrium.nl!news.cambrium.nl!news.cambrium.nl!news2.euro.net!newspeer1-gui.server.ntli.net!ntli.net!newsfep2-win.server.ntli.net.POSTED!53ab2750!not-for-mail Followup-To: gnu.utils.help Sender: glynn@cerise.nosuchdomain.co.uk Newsgroups: comp.unix.programmer,gnu.utils.help Subject: Re: GNU Autoconf & MS-Windows References: <1123221.qYdsJqJpgY@ID-187157.news.dfncis.de> From: Glynn Clements <glynn.clements@virgin.net> Message-ID: <m3vfopfr0w.fsf@cerise.nosuchdomain.co.uk> Lines: 61 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Reasonable Discussion) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: 10 Dec 2003 00:35:59 +0000 NNTP-Posting-Host: 62.252.4.34 X-Complaints-To: abuse@virgin.net X-Trace: newsfep2-win.server.ntli.net 1071016607 62.252.4.34 (Wed, 10 Dec 2003 00:36:47 GMT) NNTP-Posting-Date: Wed, 10 Dec 2003 00:36:47 GMT Organization: Virgin Net Usenet Service