X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Doug Kaufman Newsgroups: comp.os.msdos.djgpp Subject: Re: Autoconf tutorial Date: Mon, 26 Dec 2005 19:09:14 +0000 (UTC) Organization: "a2i network" Lines: 72 Message-ID: References: NNTP-Posting-Host: green.rahul.net X-Trace: blue.rahul.net 1135624154 14679 192.160.13.49 (26 Dec 2005 19:09:14 GMT) X-Complaints-To: support AT rahul DOT net NNTP-Posting-Date: Mon, 26 Dec 2005 19:09:14 +0000 (UTC) User-Agent: nn/6.6.4 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Radical NetSurfer writes: >What would also be nice is if someone would please take the >time to sit down and write out a nice little tutorial, step by step, >of how to use Autoconf/autom4te. Theres documentation that >comes with it sure, but it would be nice to have a "how to" or >"introduction to" with details such as what djgpp-packages are >needed to properly implement autoconf, which versions are >highly recommended, and downloaded from specifically which >ftp site, etc. Then everybody will be "on the same page" as it >were. And we can all discover how these new tools are supposed >to work. I am not sure that this would help, since the main time that you use the tools when they might fail is in porting a program that is not officially part of the DJGPP suite. Each of the official DJGPP programs has generally been tweaked to compile nicely. That said, you generally need a matching pair of autoconf and automake. You always need perl and frequently need libtool. You should have recent versions of most of the other tools. I usually start out by saving the "aclocal.m4" file that comes with the distribution, since some package maintainers put macro definitions there instead of in "acinclude.m4". The first step is to read the "install" or "installation" file to see if there are specific instructions or problems noted. Next read a file called "problems" if it exists. See if there is a file "install.djgpp" or "install.dos". Look for a subdirectory that might have specific instruction. If there are no specific installation instructions for DJGPP, generally follow the instructions for unix. You are less likely to have trouble if you are in an environment that supports long file names and if you use paths in the form of /dev/c/... or /dev/env/DJDIR/... rather than in the form of "c:/...". If there are no specific instructions, I would start by going to the root of the source files and running "aclocal". You may need to addd the "-I" option to specify directories that have macro definitions. If the distribution uses libtool, next run "libtoolize". Many programs use a "config.h" file. If so, you need to run "autoheader", which creates "config.h.in". The next step is to run automake to create all your "Makefile.in" files. You may want to run it with options "-a --foreign". If there have been no errors, the next step is to run "autoconf", which creates your "configure" file. Once that is created, you can run "./configure --help" to see the specific options available in that package. To get the program to build properly in DJGPP, you might need to specify certain options, or set values in the environment for "CFLAGS" and/or "CPPFLAGS". When porting a new program, I find it helpful to keep logs of all the screen messages, so that warnings and errors can be addressed. After building a program that hasn't previously been ported to DJGPP, test it looking for problems. See if there is a test suite that might be invoked by "make check" or "make test". Once you have a working program, you may want to go back and tweak the distribution so that it still works in a 8+3 filename environment and accepts filenames in "c:/..." or even in "c:\..." style. As far as other program prerequisites, autoconf just runs a series of perl scripts. Each program may have its own specific scripts (that is what aclocal.m4 is about). I don't know that you can predict what each author has put into those. If something doesn't work, you need to read the source and see what it is trying to do, then decide why it isn't working and how to fix it. The above may not be elegant, but it has worked for me in porting lots of programs to DJGPP. Doug -- Doug Kaufman Internet: dkaufman AT rahul DOT net