Mail Archives: djgpp-workers/2000/12/29/12:41:44
> Well, I don't know in what cases you're going to use your DJGPP tests,
> but sometimes it might be a good idea to check for specific features instead,
> for example, you don't have to explicitly check for DJGPP if you test fork()
> or drive letters availability. But again, I didn't see your code.
The test is only used where needed to adjust the behaviour of autoconf and the
configure script it generates; it is NOT used to change the behaviour of the
package being configured.
I use it in the following situations:
* at the start of configure to default prefix to /dev/env/DJDIR. This allows configure
to pick up the config.site file from $DJDIR/share (and a config.site file is
REQUIRED to make configure behave correctly under DJGPP (it needs to override
some variables (pathsep, ln -s, test to find executables))).
* in AC_PATH_PROG to only return the filename, not the path. This allows a
configured tree to be distributed. This is the most disruptive change I made, as
it does not correspond to the normal behaviour of configure; I believe that for
DJGPP, this is what we want. I've yet to see many configure.in's that rely
on the path returned by AC_PATH_PROG, and those that do usually do so to
catch known broken versions (and as we all know, no DJGPP program is
broken ;-) ). Anyway, please refrain from bashing me over this until I have
sent my patches to the autoconf team for scrutiny.
* in config.status, I use this to detect DJGPP, and if found, I turn a leading
drivespec x:/ in an output file into /dev/x/, so the colon will not cause trouble
when config.status separates output file and template. A more elegant way
of handling this could be found, but this is an easy workaround.
A similar transformation is done on ac_given_srcdir to avoid getting caught
in an endless loop because of the colon.
* at the end of configure, so I can run dtou on config.status
* in autoupdate, so I can run dtou on the updated configure.in
* in autoheader, so I can run dtou on the output file
* in autoconf, so I can close the output file (exec 4>/dev/null) and run dtou on it
As for Martin's suggestion to use $DJGPP, that would probably be more robust
indeed, as users are free to rename djgpp.env provided $DJGPP points to the
right file.
So, this will likely be better:
if test -d /dev/env/DJDIR -a -n "$DJGPP" -a -f "$DJGPP"; then
# Hooray! DJGPP!
fi
Since config.guess uses it, I suppose I could indeed also use 'uname', testing for
'pc' as machine and 'MS-DOS' as OS. But they seem slightly to generic (it is
feasible some other (future) environment would use the same return values, but
it's much less likely that som other environment uses both DJDIR, DJGPP and
the /dev/env/ system).
Any further suggestions are more than welcome.
- Raw text -