[m-dev.] How does one set the default compilation grade?

Peter Moulder Peter.Moulder at infotech.monash.edu.au
Fri Jul 2 14:52:39 AEST 2004


On Fri, Jul 02, 2004 at 12:10:43PM +1000, Ralph Becket wrote:
> Fergus Henderson, Friday,  2 July 2004:
> > 
> > If you want to set the default grade at configure time, you can set
> > DEFAULT_GRADE=whatever in the environment before running configure.
> > [... mmc/mmake ...]
> 
> Many thanks.  I've just spent twenty minutes hunting through
> configure.ac and aclocal.m4 and the info files for autoconf and I'm
> still none the wiser as to how I might add a `--default-grade' option to
> configure.  Can someone who groks autoconf help me out?

Not sure if you're asking how to add an option, or what action that
option should do other than setting DEFAULT_GRADE.  I'll assume the
former, and hope that setting DEFAULT_GRADE suffices.

Not knowing how to do what you've actually asked for, I'd use
AC_ARG_WITH, which will give you a --with-default-grade=BLAH option.
E.g.

  AC_ARG_WITH(default-grade,
	AS_HELP_STRING([--with-default-grade=GRADE],
		       [Have the built compiler default to using GRADE instead of the default asm_fast.gc]),
	[case "$withval" in 
	  # Handle `--with-default-grade' (no `=GRADE') and
	  # `--without-default-grade' flags.
	  yes|no)
	    AC_MSG_ERROR([Must supply a valid grade if using --with-default-grade.])
	    ;;
	  *)
	    # Perhaps do better checking on the supplied value here.
	    DEFAULT_GRADE="$withval"
	    export DEFAULT_GRADE
	    ;;
	 esac], [])

However, I haven't looked at the existing configure.ac to know how
DEFAULT_GRADE gets used (e.g. whether the export is necessary, or
whether something else is necessary).

pjrm.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list