[m-rev.] for review: configure.in improvements

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Nov 16 18:08:14 AEDT 2002


On 16-Nov-2002, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > Several points:
> > 	- Could you please add a newline to the error message?
> 
> I can change it to something like:
> 
> checking whether to enable the GCC back-end interface... configure: error:
> --enable-gcc-back-end requires an already installed Mercury compiler.
> 
> The "configure: error:" part is generated by AC_MSG_ERROR.

Hmm.  I guess that is OK.
But it would IMHO be nicer to call AC_MSG_RESULT(...) before AC_MSG_ERROR(...),
e.g.

	AC_MSG_RESULT(yes)
	AC_MSG_ERROR(--enable-gcc-back-end requires an already
		installed Mercury compiler.)

so that the output comes out as

	checking whether to enable the GCC back-end interface... yes
	configure: error: --enable-gcc-back-end requires an already
		installed Mercury compiler.

Technically this is required by the specification of autoconf, which says

	Macro: AC_MSG_CHECKING (FEATURE-DESCRIPTION)
	...
	This macro ... must be followed by a call to `AC_MSG_RESULT'

Another alternative would be to use AC_MSG_RESULT() with an empty argument.

> configure.in:
> @@ -242,7 +245,8 @@
>  case $enable_aditi_back_end in
>  	no)
>  		if test "$BOOTSTRAP_MC" = ""; then
> -			AC_MSG_WARN(--disable-aditi-back-end requires an already installed Mercury compiler.)
> +			AC_MSG_WARN([
> +--disable-aditi-back-end requires an already installed Mercury compiler])
>  			enable_aditi_back_end=yes
>  		else
>  			# This will regenerate compiler/rl_out.m and

Here the output still isn't going to look good:
	
	checking for whether to enable the Aditi back-end...
	configure: warning: --disable-aditi-back-end requires an already installed Mercury compiler
	no

It would be better to move the call to AC_MSG_WARN earlier,
and add a newline (and a tab) so that it comes out as

	checking for whether to enable the Aditi back-end... no
	configure: warning: --disable-aditi-back-end requires an already
		installed Mercury compiler

> @@ -304,7 +308,8 @@

>  fi
>  if test "$MKFIFO" = ""; then
> -	AC_MSG_WARN(cannot find a working \`mkfifo' or \`mknod')
> +	AC_MSG_WARN([
> +cannot find a working \`mkfifo' or \`mknod'])

Why is a newline needed there?

> @@ -328,7 +333,8 @@
>  	esac
>  fi
>  if test "$MKTEMP" = ""; then
> -	AC_MSG_WARN(cannot find a working \`mktemp', using \`mkdir || exit'')
> +	AC_MSG_WARN([
> +cannot find a working \`mktemp', using \`mkdir || exit''])

Likewise here?

> @@ -1869,7 +1875,8 @@
>  
>  		if test $mercury_cv_can_enable_deep_profiler = no; then
>  			echo
> -			AC_MSG_ERROR(--enable-deep-profiler specified but system does not support it)
> +			AC_MSG_ERROR([
> +--enable-deep-profiler specified but system does not support it])
>  			exit 1
>  		fi

The "echo" there should be AC_MSG_RESULT(), I think.
Then you wouldn't need a newline in the AC_MSG_ERROR(...) call.

> @@ -1882,7 +1889,8 @@
>  		true
>  	else
>  		echo
> -		AC_MSG_ERROR(CGI script directory $mercury_cv_cgi_dir does not exist)
> +		AC_MSG_ERROR([
> +CGI script directory $mercury_cv_cgi_dir does not exist])
>  		exit 1

Likewise here.

> @@ -3047,8 +3055,8 @@
>  		AC_DEFINE(MR_USE_EXTERNAL_DEBUGGER)
>  	else
>  		AC_MSG_RESULT(no)
> -		AC_MSG_ERROR(Cannot enable external debugger)
> -		AC_MSG_ERROR(because sockets do not work)
> +		AC_MSG_ERROR([
> +Cannot enable external debugger because sockets do not work])
>  	fi		

I don't think you need a newline there, because AC_MSG_RESULT should
output a newline.

This is all cosmetic, of course.  If you want to commit your change as is
I'd be happy to tweak these details.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list