[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Testing platform
From: |
Ralf Wildenhues |
Subject: |
Re: Testing platform |
Date: |
Fri, 16 Oct 2009 07:14:29 +0200 |
User-agent: |
Mutt/1.5.20 (2009-08-09) |
Hello David,
* Dr. David Kirkby wrote on Thu, Oct 15, 2009 at 11:53:01PM CEST:
> I've got this bit of code, which checks for 'bash'. The user does
> not need to use the bash shell, but many scripts assume the back
> shell and will fail otherwise (no, I did not write them myself!)
The first question that comes up is: what is $foobar used for?
If it is needed for executing the configure script itself, then
this is the wrong approach, and Autoconf should let you integrate
your requirements in its better-shell search (which is currently
possible only using the undocumented _AS_DETECT_REQUIRED macro).
If you need it while building the package, i.e., on the $build system,
then an automatic search seems ok. I'd however use AC_PATH_PROG, and
use its fourth argument to append, say, /opt/OpenSource/bin and
/opt/pware/bin and maybe /opt/freeware/bin or so to the path for
searching.
If you need $foobar on the $host system (i.e., after 'make install'),
then an automatic search only makes sense if you are not building for
another system, be that because you're cross-compiling, or just because
the other system has bash in a different directory.
In any case, you should not use $foobar for both; if you need both, have
two variables, which can default to the same thing. And let your user
know which is what, and how they can be overridden.
> AC_CHECK_PROG(foobar,bash,[yes],[no],[])
> if test x$foobar != xyes
The foobar variable will not be set to "yes" if bash is found anywhere,
but to the command you can use to invoke bash.
> As you can see, it offers suggestions of locations where 'bash' may
> be found. Clearly, if the person is running on AIX, there is not
> much point in telling them where to find bash on HP-UX.
I don't think that is much of a problem. Of course, you could be
smarter, and run either of AC_CANONICAL_{BUILD,HOST} before and refine
your suggestions based on $build or $host; but that's like icing the
cake.
Hope that helps.
Cheers,
Ralf