[LLVMdev] [PATCH] Prefer to use *.opt ocaml executables as they are more efficient.

Gordon Henriksen gordonhenriksen at mac.com
Tue Mar 4 06:11:11 PST 2008


Hi Erick,

On Mar 4, 2008, at 03:19, Erick Tryzelaar wrote:

> I noticed that the ocaml compilation isn't using the .opt
> executables if they're available. We might gain a slight
> optimization in ocaml compile time by optionally using them
> with this patch.

This looks like a good improvement.

> ---
> autoconf/configure.ac |   18 +++++
> configure             |  195 ++++++++++++++++++++++++++++++++++++++++ 
> ++------
> 2 files changed, 188 insertions(+), 25 deletions(-)diff --git  
> autoconf/configure.ac autoconf/configure.ac
> index 97e0305..56a25ca 100644
> --- autoconf/configure.ac
> +++ autoconf/configure.ac
> @@ -592,6 +592,9 @@ AC_PATH_PROG(ZIP,[zip],[echo "Skipped: zip not  
> found"])
> AC_PATH_PROG(OCAMLC,[ocamlc],[echo "Skipped: ocamlc not found"])
> AC_PATH_PROG(OCAMLOPT,[ocamlopt],[echo "Skipped: ocamlopt not found"])
> AC_PATH_PROG(OCAMLDEP,[ocamldep],[echo "Skipped: ocamldep not found"])
> +AC_PATH_PROG(OCAMLC_OPT,[ocamlc.opt],[echo "Skipped: ocamlc.opt not  
> found"])
> +AC_PATH_PROG(OCAMLOPT_OPT,[ocamlopt.opt],[echo "Skipped:  
> ocamlopt.opt not found"])
> +AC_PATH_PROG(OCAMLDEP_OPT,[ocamldep.opt],[echo "Skipped:  
> ocamldep.opt not found"])
>
> dnl Determine if the linker supports the -R option.
> AC_LINK_USE_R
> @@ -911,6 +914,21 @@ AC_DEFINE_UNQUOTED(LLVM_CONFIGTIME,  
> "$LLVM_CONFIGTIME",
> AC_DEFINE_UNQUOTED(LLVM_HOSTTRIPLE, "$host",
> 	 	   [Host triple we were built on])
>
> +# prefer ocamlc.opt to ocamlc
> +if test "x$OCAMLC" != x -a "x$OCAMLC_OPT" != x ; then
> +	OCAMLC=$OCAMLC_OPT
> +fi
> +
> +# prefer ocamlopt.opt to ocamlopt
> +if test "x$OCAMLOPT" != x -a "x$OCAMLOPT_OPT" != x ; then
> +	OCAMLOPT=$OCAMLOPT_OPT
> +fi
> +
> +# prefer ocamldep.opt to ocamldep
> +if test "x$OCAMLDEP" != x -a "x$OCAMLDEP_OPT" != x ; then
> +	OCAMLDEP=$OCAMLDEP_OPT
> +fi
> +
> # Determine which bindings to build.
> if test "$BINDINGS_TO_BUILD" = auto ; then
>   BINDINGS_TO_BUILD=""

I think it would be simpler to use AC_PATH_PROGS instead. See how $GV  
is set up for instance. Can you please see whether that approach is  
workable?

— Gordon





More information about the llvm-dev mailing list