autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unexpected behaviour/bug whilst using AC_CHECK_PROG


From: Akim Demaille
Subject: Re: Unexpected behaviour/bug whilst using AC_CHECK_PROG
Date: 20 Apr 2001 15:48:25 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley)

> (verified this for version 2.13 and a version claiming to be 2.14.1,
> version 2.49-d from alpha.gnu.org seems to behave similarly when I
> look at the code in acgeneral.m4).
> 
>         Hi,
> 
> whilst configuring ratpoison (a very nice window manager), I ran into
> problems with the following piece from configure.in
> 
> AC_ARG_WITH(xterm, [ --with-xterm=PROG        set the x terminal emulator 
> used by ratpoison ],
> term_prog=$withval, term_prog="xterm")
> AC_DEFINE_UNQUOTED(TERM_PROG,"$term_prog")
> 
> dnl check for an x terminal emulator
> AC_CHECK_PROG(TERM_PROG,$term_prog,yes,no)
> if test x$TERM_PROG = xno; then
>    AC_MSG_WARN([*** Can't find x terminal emulator \`$term_prog'])
> fi
> 
> I can do ./configure --with-xterm=rxvt. However, when I try
> ./configure --with-xterm=/dis/sw/X11/bin/rxvt (where the one I want to
> use is), it tells me "not found". 
> 
> Looking at how it works, that seems only natural (with AC_CHECK_PROG
> checks for $term_prog in every directory in $PATH, but as my PATH
> doesn't include /, it doesn't find $PATH/dis/sw/X11/bin/rxvt. Changing
> the AC_CHECK_PROG line to
> 
> AC_CHECK_PROG(TERM_PROG,$term_prog,yes,no,/:$PATH)
> 
> let's me do what I think should be allowed by default (when the path
> is unspecified) - I feel I should be allowed to specify the full path
> to the program, at least unless someone has given an explicit PATH.
> 
> AC_PATH_PROG behaves similarly.

This is a misunderstanding on how things should be done in Autoconf.
The code should not introduce AC_ARG_WITH(xterm), rather, use
$TERM_PROG directly.  Or, if they want to use AC_ARG_WITH anyway, then
if the value is absolute they should set TERM_PROG, otherwise set
$term_prog so that AC_PATH_PROG looks for it.

As far as you are concerned, running

        ./configure TERM_PROG=/foo/bar

should do what you want.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]