From b746099d04f82ee4470885afc0d80d660af0155b Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Wed, 24 Jun 2015 14:51:30 +0100 Subject: [PATCH 1/7] Locate mingw32 compiler correctly configure can now identify i686-w64-mingw32-gcc. Code included to determine the value for AR from $OCAMLLIB/Makefile.config since OCamlMakefile insists on calling AR directly, rather than using ocamlmklib. --- Makefile.config.in | 7 +- configure | 2759 ++++++++++++++++++++++---------------------- configure.ac | 16 +- 3 files changed, 1407 insertions(+), 1375 deletions(-) diff --git a/Makefile.config.in b/Makefile.config.in index 10e6b7dc879..d19b21ddf31 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -24,7 +24,10 @@ OCAMLYACC = @OCAMLYACC@ OCAMLMKLIB = @OCAMLMKLIB@ OCAMLDOC = @OCAMLDOC@ -WIN32 = @WIN32@ +CC = @CC@ +AR = @AR@ + EXE = @EXE@ +WIN32 = @WIN32@ -export OCAMLVERSION OCAMLFIND OCAML OCAMLC OCAMLOPT OCAMLDEP OCAMLLEX OCAMLYACC OCAMLMKLIB OCAMLDOC EXE +export OCAMLVERSION OCAMLFIND OCAML OCAMLC OCAMLOPT OCAMLDEP OCAMLLEX OCAMLYACC OCAMLMKLIB OCAMLDOC EXE CC AR diff --git a/configure b/configure index 2058ef1a85f..411a8f55546 100755 --- a/configure +++ b/configure @@ -604,10 +604,19 @@ OCAMLFIND OCAMLYACC OCAMLLEXDOTOPT OCAMLLEX +AR EXE WIN32 +CYGPATH ocaml_4_03 ocaml_4_02 +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC AWK OCAMLBUILD OCAMLDOCDOTOPT @@ -624,13 +633,6 @@ OCAMLOPT OCAMLLIB OCAMLVERSION OCAMLC -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC target_alias host_alias build_alias @@ -1797,21 +1799,18 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 + + # checking for ocamlc + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if ${ac_cv_prog_OCAMLC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$OCAMLC"; then + ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -1820,7 +1819,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" + ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -1830,10 +1829,10 @@ IFS=$as_save_IFS fi fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +OCAMLC=$ac_cv_prog_OCAMLC +if test -n "$OCAMLC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5 +$as_echo "$OCAMLC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -1841,17 +1840,17 @@ fi fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 +if test -z "$ac_cv_prog_OCAMLC"; then + ac_ct_OCAMLC=$OCAMLC + # Extract the first word of "ocamlc", so it can be a program name with args. +set dummy ocamlc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. + if test -n "$ac_ct_OCAMLC"; then + ac_cv_prog_ac_ct_OCAMLC="$ac_ct_OCAMLC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -1860,7 +1859,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" + ac_cv_prog_ac_ct_OCAMLC="ocamlc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -1870,17 +1869,17 @@ IFS=$as_save_IFS fi fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } +ac_ct_OCAMLC=$ac_cv_prog_ac_ct_OCAMLC +if test -n "$ac_ct_OCAMLC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLC" >&5 +$as_echo "$ac_ct_OCAMLC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_CC" = x; then - CC="" + if test "x$ac_ct_OCAMLC" = x; then + OCAMLC="no" else case $cross_compiling:$ac_tool_warned in yes:) @@ -1888,23 +1887,41 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - CC=$ac_ct_CC + OCAMLC=$ac_ct_OCAMLC fi else - CC="$ac_cv_prog_CC" + OCAMLC="$ac_cv_prog_OCAMLC" fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 + + if test "$OCAMLC" != "no"; then + OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5 +$as_echo "OCaml version is $OCAMLVERSION" >&6; } + # If OCAMLLIB is set, use it + if test "$OCAMLLIB" = ""; then + OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4` + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCAMLLIB previously set; preserving it." >&5 +$as_echo "OCAMLLIB previously set; preserving it." >&6; } + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5 +$as_echo "OCaml library path is $OCAMLLIB" >&6; } + + + + + # checking for ocamlopt + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlopt", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if ${ac_cv_prog_OCAMLOPT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$OCAMLOPT"; then + ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -1913,7 +1930,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" + ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -1923,30 +1940,29 @@ IFS=$as_save_IFS fi fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +OCAMLOPT=$ac_cv_prog_OCAMLOPT +if test -n "$OCAMLOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5 +$as_echo "$OCAMLOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - fi fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 +if test -z "$ac_cv_prog_OCAMLOPT"; then + ac_ct_OCAMLOPT=$OCAMLOPT + # Extract the first word of "ocamlopt", so it can be a program name with args. +set dummy ocamlopt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$ac_ct_OCAMLOPT"; then + ac_cv_prog_ac_ct_OCAMLOPT="$ac_ct_OCAMLOPT" # Let the user override the test. else - ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do @@ -1954,11 +1970,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" + ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -1966,44 +1978,60 @@ done done IFS=$as_save_IFS -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi fi fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +ac_ct_OCAMLOPT=$ac_cv_prog_ac_ct_OCAMLOPT +if test -n "$ac_ct_OCAMLOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPT" >&5 +$as_echo "$ac_ct_OCAMLOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - + if test "x$ac_ct_OCAMLOPT" = x; then + OCAMLOPT="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLOPT=$ac_ct_OCAMLOPT + fi +else + OCAMLOPT="$ac_cv_prog_OCAMLOPT" fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 + + OCAMLBEST=byte + if test "$OCAMLOPT" = "no"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5 +$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;} + else + TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` + if test "$TMPVERSION" != "$OCAMLVERSION" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlopt discarded." >&5 +$as_echo "versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlopt discarded." >&6; } + OCAMLOPT=no + else + OCAMLBEST=opt + fi + fi + + + + # checking for ocamlc.opt + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlc.opt", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : +if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. + if test -n "$OCAMLCDOTOPT"; then + ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2012,7 +2040,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2022,32 +2050,28 @@ IFS=$as_save_IFS fi fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } +OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT +if test -n "$OCAMLCDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5 +$as_echo "$OCAMLCDOTOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$CC" && break - done fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then + ac_ct_OCAMLCDOTOPT=$OCAMLCDOTOPT + # Extract the first word of "ocamlc.opt", so it can be a program name with args. +set dummy ocamlc.opt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : +if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. + if test -n "$ac_ct_OCAMLCDOTOPT"; then + ac_cv_prog_ac_ct_OCAMLCDOTOPT="$ac_ct_OCAMLCDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2056,7 +2080,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" + ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2066,21 +2090,17 @@ IFS=$as_save_IFS fi fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } +ac_ct_OCAMLCDOTOPT=$ac_cv_prog_ac_ct_OCAMLCDOTOPT +if test -n "$ac_ct_OCAMLCDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLCDOTOPT" >&5 +$as_echo "$ac_ct_OCAMLCDOTOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" + if test "x$ac_ct_OCAMLCDOTOPT" = x; then + OCAMLCDOTOPT="no" else case $cross_compiling:$ac_tool_warned in yes:) @@ -2088,516 +2108,436 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - CC=$ac_ct_CC + OCAMLCDOTOPT=$ac_ct_OCAMLCDOTOPT fi +else + OCAMLCDOTOPT="$ac_cv_prog_OCAMLCDOTOPT" fi -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } + if test "$OCAMLCDOTOPT" != "no"; then + TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` + if test "$TMPVERSION" != "$OCAMLVERSION" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlc.opt discarded." >&5 +$as_echo "versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlc.opt discarded." >&6; } + else + OCAMLC=$OCAMLCDOTOPT + fi + fi -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 + # checking for ocamlopt.opt + if test "$OCAMLOPT" != "no" ; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLOPTDOTOPT"; then + ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } done + done +IFS=$as_save_IFS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" +fi +fi +OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT +if test -n "$OCAMLOPTDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5 +$as_echo "$OCAMLOPTDOTOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' +fi +if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then + ac_ct_OCAMLOPTDOTOPT=$OCAMLOPTDOTOPT + # Extract the first word of "ocamlopt.opt", so it can be a program name with args. +set dummy ocamlopt.opt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLOPTDOTOPT"; then + ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="$ac_ct_OCAMLOPTDOTOPT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done -test "$ac_cv_exeext" = no && ac_cv_exeext= + done +IFS=$as_save_IFS -else - ac_file='' fi -if test -z "$ac_file"; then : +fi +ac_ct_OCAMLOPTDOTOPT=$ac_cv_prog_ac_ct_OCAMLOPTDOTOPT +if test -n "$ac_ct_OCAMLOPTDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPTDOTOPT" >&5 +$as_echo "$ac_ct_OCAMLOPTDOTOPT" >&6; } +else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; + if test "x$ac_ct_OCAMLOPTDOTOPT" = x; then + OCAMLOPTDOTOPT="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done + OCAMLOPTDOTOPT=$ac_ct_OCAMLOPTDOTOPT + fi else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } + OCAMLOPTDOTOPT="$ac_cv_prog_OCAMLOPTDOTOPT" fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; + if test "$OCAMLOPTDOTOPT" != "no"; then + TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` + if test "$TMPVERSION" != "$OCAMLVERSION" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlopt.opt discarded." >&5 +$as_echo "versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlopt.opt discarded." >&6; } + else + OCAMLOPT=$OCAMLOPTDOTOPT + fi + fi + fi + - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : + # checking for ocaml toplevel + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocaml", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocaml; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAML+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif + if test -n "$OCAML"; then + ac_cv_prog_OCAML="$OCAML" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAML="${ac_tool_prefix}ocaml" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes +OCAML=$ac_cv_prog_OCAML +if test -n "$OCAML"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAML" >&5 +$as_echo "$OCAML" >&6; } else - GCC= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : + + +fi +if test -z "$ac_cv_prog_OCAML"; then + ac_ct_OCAML=$OCAML + # Extract the first word of "ocaml", so it can be a program name with args. +set dummy ocaml; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAML+:} false; then : $as_echo_n "(cached) " >&6 else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test -n "$ac_ct_OCAML"; then + ac_cv_prog_ac_ct_OCAML="$ac_ct_OCAML" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAML="ocaml" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -int -main () -{ +fi +fi +ac_ct_OCAML=$ac_cv_prog_ac_ct_OCAML +if test -n "$ac_ct_OCAML"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAML" >&5 +$as_echo "$ac_ct_OCAML" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes + if test "x$ac_ct_OCAML" = x; then + OCAML="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAML=$ac_ct_OCAML + fi else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + OCAML="$ac_cv_prog_OCAML" +fi -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : + # checking for ocamldep + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamldep", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamldep; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLDEP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$OCAMLDEP"; then + ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS +fi +fi +OCAMLDEP=$ac_cv_prog_OCAMLDEP +if test -n "$OCAMLDEP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5 +$as_echo "$OCAMLDEP" >&6; } else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test -z "$ac_cv_prog_OCAMLDEP"; then + ac_ct_OCAMLDEP=$OCAMLDEP + # Extract the first word of "ocamldep", so it can be a program name with args. +set dummy ocamldep; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLDEP"; then + ac_cv_prog_ac_ct_OCAMLDEP="$ac_ct_OCAMLDEP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLDEP="ocamldep" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag +ac_ct_OCAMLDEP=$ac_cv_prog_ac_ct_OCAMLDEP +if test -n "$ac_ct_OCAMLDEP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEP" >&5 +$as_echo "$ac_ct_OCAMLDEP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" + + if test "x$ac_ct_OCAMLDEP" = x; then + OCAMLDEP="no" else - CFLAGS="-g" + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLDEP=$ac_ct_OCAMLDEP fi else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi + OCAMLDEP="$ac_cv_prog_OCAMLDEP" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : + + + # checking for ocamldep.opt + if test "$OCAMLDEP" != "no" ; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamldep.opt", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamldep.opt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_OCAMLDEPDOTOPT+:} false; then : $as_echo_n "(cached) " >&6 else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} + if test -n "$OCAMLDEPDOTOPT"; then + ac_cv_prog_OCAMLDEPDOTOPT="$OCAMLDEPDOTOPT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_OCAMLDEPDOTOPT="${ac_tool_prefix}ocamldep.opt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +fi +fi +OCAMLDEPDOTOPT=$ac_cv_prog_OCAMLDEPDOTOPT +if test -n "$OCAMLDEPDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEPDOTOPT" >&5 +$as_echo "$OCAMLDEPDOTOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break +if test -z "$ac_cv_prog_OCAMLDEPDOTOPT"; then + ac_ct_OCAMLDEPDOTOPT=$OCAMLDEPDOTOPT + # Extract the first word of "ocamldep.opt", so it can be a program name with args. +set dummy ocamldep.opt; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_OCAMLDEPDOTOPT+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_OCAMLDEPDOTOPT"; then + ac_cv_prog_ac_ct_OCAMLDEPDOTOPT="$ac_ct_OCAMLDEPDOTOPT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_OCAMLDEPDOTOPT="ocamldep.opt" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done -rm -f conftest.$ac_ext -CC=$ac_save_CC + done +IFS=$as_save_IFS fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - +fi +ac_ct_OCAMLDEPDOTOPT=$ac_cv_prog_ac_ct_OCAMLDEPDOTOPT +if test -n "$ac_ct_OCAMLDEPDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEPDOTOPT" >&5 +$as_echo "$ac_ct_OCAMLDEPDOTOPT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test "x$ac_ct_OCAMLDEPDOTOPT" = x; then + OCAMLDEPDOTOPT="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OCAMLDEPDOTOPT=$ac_ct_OCAMLDEPDOTOPT + fi +else + OCAMLDEPDOTOPT="$ac_cv_prog_OCAMLDEPDOTOPT" +fi + if test "$OCAMLDEPDOTOPT" != "no"; then + TMPVERSION=`$OCAMLDEPDOTOPT -version | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` + if test "$TMPVERSION" != "$OCAMLVERSION" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamldep.opt discarded." >&5 +$as_echo "version differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamldep.opt discarded." >&6; } + else + OCAMLDEP=$OCAMLDEPDOTOPT + fi + fi + fi - # checking for ocamlc + # checking for ocamlmktop if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlc; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}ocamlmktop", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLC+:} false; then : +if ${ac_cv_prog_OCAMLMKTOP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OCAMLC"; then - ac_cv_prog_OCAMLC="$OCAMLC" # Let the user override the test. + if test -n "$OCAMLMKTOP"; then + ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2606,7 +2546,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLC="${ac_tool_prefix}ocamlc" + ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2616,10 +2556,10 @@ IFS=$as_save_IFS fi fi -OCAMLC=$ac_cv_prog_OCAMLC -if test -n "$OCAMLC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLC" >&5 -$as_echo "$OCAMLC" >&6; } +OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP +if test -n "$OCAMLMKTOP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5 +$as_echo "$OCAMLMKTOP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -2627,17 +2567,17 @@ fi fi -if test -z "$ac_cv_prog_OCAMLC"; then - ac_ct_OCAMLC=$OCAMLC - # Extract the first word of "ocamlc", so it can be a program name with args. -set dummy ocamlc; ac_word=$2 +if test -z "$ac_cv_prog_OCAMLMKTOP"; then + ac_ct_OCAMLMKTOP=$OCAMLMKTOP + # Extract the first word of "ocamlmktop", so it can be a program name with args. +set dummy ocamlmktop; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then : +if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OCAMLC"; then - ac_cv_prog_ac_ct_OCAMLC="$ac_ct_OCAMLC" # Let the user override the test. + if test -n "$ac_ct_OCAMLMKTOP"; then + ac_cv_prog_ac_ct_OCAMLMKTOP="$ac_ct_OCAMLMKTOP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2646,7 +2586,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLC="ocamlc" + ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2656,17 +2596,17 @@ IFS=$as_save_IFS fi fi -ac_ct_OCAMLC=$ac_cv_prog_ac_ct_OCAMLC -if test -n "$ac_ct_OCAMLC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLC" >&5 -$as_echo "$ac_ct_OCAMLC" >&6; } +ac_ct_OCAMLMKTOP=$ac_cv_prog_ac_ct_OCAMLMKTOP +if test -n "$ac_ct_OCAMLMKTOP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKTOP" >&5 +$as_echo "$ac_ct_OCAMLMKTOP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OCAMLC" = x; then - OCAMLC="no" + if test "x$ac_ct_OCAMLMKTOP" = x; then + OCAMLMKTOP="no" else case $cross_compiling:$ac_tool_warned in yes:) @@ -2674,41 +2614,24 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OCAMLC=$ac_ct_OCAMLC + OCAMLMKTOP=$ac_ct_OCAMLMKTOP fi else - OCAMLC="$ac_cv_prog_OCAMLC" + OCAMLMKTOP="$ac_cv_prog_OCAMLMKTOP" fi - if test "$OCAMLC" != "no"; then - OCAMLVERSION=`$OCAMLC -v | sed -n -e 's|.*version* *\(.*\)$|\1|p'` - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml version is $OCAMLVERSION" >&5 -$as_echo "OCaml version is $OCAMLVERSION" >&6; } - # If OCAMLLIB is set, use it - if test "$OCAMLLIB" = ""; then - OCAMLLIB=`$OCAMLC -where 2>/dev/null || $OCAMLC -v|tail -1|cut -d ' ' -f 4` - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCAMLLIB previously set; preserving it." >&5 -$as_echo "OCAMLLIB previously set; preserving it." >&6; } - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: OCaml library path is $OCAMLLIB" >&5 -$as_echo "OCaml library path is $OCAMLLIB" >&6; } - - - - - # checking for ocamlopt - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlopt", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2 + # checking for ocamlmklib + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamlmklib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLOPT+:} false; then : +if ${ac_cv_prog_OCAMLMKLIB+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OCAMLOPT"; then - ac_cv_prog_OCAMLOPT="$OCAMLOPT" # Let the user override the test. + if test -n "$OCAMLMKLIB"; then + ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2717,7 +2640,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLOPT="${ac_tool_prefix}ocamlopt" + ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2727,10 +2650,10 @@ IFS=$as_save_IFS fi fi -OCAMLOPT=$ac_cv_prog_OCAMLOPT -if test -n "$OCAMLOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPT" >&5 -$as_echo "$OCAMLOPT" >&6; } +OCAMLMKLIB=$ac_cv_prog_OCAMLMKLIB +if test -n "$OCAMLMKLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5 +$as_echo "$OCAMLMKLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -2738,17 +2661,17 @@ fi fi -if test -z "$ac_cv_prog_OCAMLOPT"; then - ac_ct_OCAMLOPT=$OCAMLOPT - # Extract the first word of "ocamlopt", so it can be a program name with args. -set dummy ocamlopt; ac_word=$2 +if test -z "$ac_cv_prog_OCAMLMKLIB"; then + ac_ct_OCAMLMKLIB=$OCAMLMKLIB + # Extract the first word of "ocamlmklib", so it can be a program name with args. +set dummy ocamlmklib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then : +if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OCAMLOPT"; then - ac_cv_prog_ac_ct_OCAMLOPT="$ac_ct_OCAMLOPT" # Let the user override the test. + if test -n "$ac_ct_OCAMLMKLIB"; then + ac_cv_prog_ac_ct_OCAMLMKLIB="$ac_ct_OCAMLMKLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2757,7 +2680,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLOPT="ocamlopt" + ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2767,17 +2690,17 @@ IFS=$as_save_IFS fi fi -ac_ct_OCAMLOPT=$ac_cv_prog_ac_ct_OCAMLOPT -if test -n "$ac_ct_OCAMLOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPT" >&5 -$as_echo "$ac_ct_OCAMLOPT" >&6; } +ac_ct_OCAMLMKLIB=$ac_cv_prog_ac_ct_OCAMLMKLIB +if test -n "$ac_ct_OCAMLMKLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKLIB" >&5 +$as_echo "$ac_ct_OCAMLMKLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OCAMLOPT" = x; then - OCAMLOPT="no" + if test "x$ac_ct_OCAMLMKLIB" = x; then + OCAMLMKLIB="no" else case $cross_compiling:$ac_tool_warned in yes:) @@ -2785,40 +2708,24 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OCAMLOPT=$ac_ct_OCAMLOPT + OCAMLMKLIB=$ac_ct_OCAMLMKLIB fi else - OCAMLOPT="$ac_cv_prog_OCAMLOPT" + OCAMLMKLIB="$ac_cv_prog_OCAMLMKLIB" fi - OCAMLBEST=byte - if test "$OCAMLOPT" = "no"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot find ocamlopt; bytecode compilation only." >&5 -$as_echo "$as_me: WARNING: Cannot find ocamlopt; bytecode compilation only." >&2;} - else - TMPVERSION=`$OCAMLOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` - if test "$TMPVERSION" != "$OCAMLVERSION" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlopt discarded." >&5 -$as_echo "versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlopt discarded." >&6; } - OCAMLOPT=no - else - OCAMLBEST=opt - fi - fi - - - # checking for ocamlc.opt - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlc.opt", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2 + # checking for ocamldoc + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamldoc", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then : +if ${ac_cv_prog_OCAMLDOC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OCAMLCDOTOPT"; then - ac_cv_prog_OCAMLCDOTOPT="$OCAMLCDOTOPT" # Let the user override the test. + if test -n "$OCAMLDOC"; then + ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2827,7 +2734,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLCDOTOPT="${ac_tool_prefix}ocamlc.opt" + ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2837,10 +2744,10 @@ IFS=$as_save_IFS fi fi -OCAMLCDOTOPT=$ac_cv_prog_OCAMLCDOTOPT -if test -n "$OCAMLCDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLCDOTOPT" >&5 -$as_echo "$OCAMLCDOTOPT" >&6; } +OCAMLDOC=$ac_cv_prog_OCAMLDOC +if test -n "$OCAMLDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5 +$as_echo "$OCAMLDOC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -2848,17 +2755,17 @@ fi fi -if test -z "$ac_cv_prog_OCAMLCDOTOPT"; then - ac_ct_OCAMLCDOTOPT=$OCAMLCDOTOPT - # Extract the first word of "ocamlc.opt", so it can be a program name with args. -set dummy ocamlc.opt; ac_word=$2 +if test -z "$ac_cv_prog_OCAMLDOC"; then + ac_ct_OCAMLDOC=$OCAMLDOC + # Extract the first word of "ocamldoc", so it can be a program name with args. +set dummy ocamldoc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then : +if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OCAMLCDOTOPT"; then - ac_cv_prog_ac_ct_OCAMLCDOTOPT="$ac_ct_OCAMLCDOTOPT" # Let the user override the test. + if test -n "$ac_ct_OCAMLDOC"; then + ac_cv_prog_ac_ct_OCAMLDOC="$ac_ct_OCAMLDOC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2867,7 +2774,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLCDOTOPT="ocamlc.opt" + ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2877,17 +2784,17 @@ IFS=$as_save_IFS fi fi -ac_ct_OCAMLCDOTOPT=$ac_cv_prog_ac_ct_OCAMLCDOTOPT -if test -n "$ac_ct_OCAMLCDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLCDOTOPT" >&5 -$as_echo "$ac_ct_OCAMLCDOTOPT" >&6; } +ac_ct_OCAMLDOC=$ac_cv_prog_ac_ct_OCAMLDOC +if test -n "$ac_ct_OCAMLDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOC" >&5 +$as_echo "$ac_ct_OCAMLDOC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OCAMLCDOTOPT" = x; then - OCAMLCDOTOPT="no" + if test "x$ac_ct_OCAMLDOC" = x; then + OCAMLDOC="no" else case $cross_compiling:$ac_tool_warned in yes:) @@ -2895,34 +2802,25 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OCAMLCDOTOPT=$ac_ct_OCAMLCDOTOPT + OCAMLDOC=$ac_ct_OCAMLDOC fi else - OCAMLCDOTOPT="$ac_cv_prog_OCAMLCDOTOPT" + OCAMLDOC="$ac_cv_prog_OCAMLDOC" fi - if test "$OCAMLCDOTOPT" != "no"; then - TMPVERSION=`$OCAMLCDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` - if test "$TMPVERSION" != "$OCAMLVERSION" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlc.opt discarded." >&5 -$as_echo "versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlc.opt discarded." >&6; } - else - OCAMLC=$OCAMLCDOTOPT - fi - fi - # checking for ocamlopt.opt - if test "$OCAMLOPT" != "no" ; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlopt.opt", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2 + # checking for ocamldoc.opt + if test "$OCAMLDOC" != "no" ; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ocamldoc.opt", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamldoc.opt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then : +if ${ac_cv_prog_OCAMLDOCDOTOPT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OCAMLOPTDOTOPT"; then - ac_cv_prog_OCAMLOPTDOTOPT="$OCAMLOPTDOTOPT" # Let the user override the test. + if test -n "$OCAMLDOCDOTOPT"; then + ac_cv_prog_OCAMLDOCDOTOPT="$OCAMLDOCDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2931,7 +2829,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLOPTDOTOPT="${ac_tool_prefix}ocamlopt.opt" + ac_cv_prog_OCAMLDOCDOTOPT="${ac_tool_prefix}ocamldoc.opt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2941,10 +2839,10 @@ IFS=$as_save_IFS fi fi -OCAMLOPTDOTOPT=$ac_cv_prog_OCAMLOPTDOTOPT -if test -n "$OCAMLOPTDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLOPTDOTOPT" >&5 -$as_echo "$OCAMLOPTDOTOPT" >&6; } +OCAMLDOCDOTOPT=$ac_cv_prog_OCAMLDOCDOTOPT +if test -n "$OCAMLDOCDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOCDOTOPT" >&5 +$as_echo "$OCAMLDOCDOTOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -2952,17 +2850,17 @@ fi fi -if test -z "$ac_cv_prog_OCAMLOPTDOTOPT"; then - ac_ct_OCAMLOPTDOTOPT=$OCAMLOPTDOTOPT - # Extract the first word of "ocamlopt.opt", so it can be a program name with args. -set dummy ocamlopt.opt; ac_word=$2 +if test -z "$ac_cv_prog_OCAMLDOCDOTOPT"; then + ac_ct_OCAMLDOCDOTOPT=$OCAMLDOCDOTOPT + # Extract the first word of "ocamldoc.opt", so it can be a program name with args. +set dummy ocamldoc.opt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then : +if ${ac_cv_prog_ac_ct_OCAMLDOCDOTOPT+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OCAMLOPTDOTOPT"; then - ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="$ac_ct_OCAMLOPTDOTOPT" # Let the user override the test. + if test -n "$ac_ct_OCAMLDOCDOTOPT"; then + ac_cv_prog_ac_ct_OCAMLDOCDOTOPT="$ac_ct_OCAMLDOCDOTOPT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2971,7 +2869,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLOPTDOTOPT="ocamlopt.opt" + ac_cv_prog_ac_ct_OCAMLDOCDOTOPT="ocamldoc.opt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -2981,17 +2879,17 @@ IFS=$as_save_IFS fi fi -ac_ct_OCAMLOPTDOTOPT=$ac_cv_prog_ac_ct_OCAMLOPTDOTOPT -if test -n "$ac_ct_OCAMLOPTDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLOPTDOTOPT" >&5 -$as_echo "$ac_ct_OCAMLOPTDOTOPT" >&6; } +ac_ct_OCAMLDOCDOTOPT=$ac_cv_prog_ac_ct_OCAMLDOCDOTOPT +if test -n "$ac_ct_OCAMLDOCDOTOPT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOCDOTOPT" >&5 +$as_echo "$ac_ct_OCAMLDOCDOTOPT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OCAMLOPTDOTOPT" = x; then - OCAMLOPTDOTOPT="no" + if test "x$ac_ct_OCAMLDOCDOTOPT" = x; then + OCAMLDOCDOTOPT="no" else case $cross_compiling:$ac_tool_warned in yes:) @@ -2999,39 +2897,34 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OCAMLOPTDOTOPT=$ac_ct_OCAMLOPTDOTOPT + OCAMLDOCDOTOPT=$ac_ct_OCAMLDOCDOTOPT fi else - OCAMLOPTDOTOPT="$ac_cv_prog_OCAMLOPTDOTOPT" + OCAMLDOCDOTOPT="$ac_cv_prog_OCAMLDOCDOTOPT" fi - if test "$OCAMLOPTDOTOPT" != "no"; then - TMPVERSION=`$OCAMLOPTDOTOPT -v | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` - if test "$TMPVERSION" != "$OCAMLVERSION" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlopt.opt discarded." >&5 -$as_echo "versions differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamlopt.opt discarded." >&6; } - else - OCAMLOPT=$OCAMLOPTDOTOPT - fi - fi - fi - - + if test "$OCAMLDOCDOTOPT" != "no"; then + TMPVERSION=`$OCAMLDOCDOTOPT -version | tr -d '\015'` + if test "$TMPVERSION" != "$OCAMLVERSION" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamldoc.opt discarded." >&5 +$as_echo "version differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamldoc.opt discarded." >&6; } + else + OCAMLDOC=$OCAMLDOCDOTOPT + fi + fi fi - - - # checking for ocaml toplevel + # checking for ocamlbuild if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocaml", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocaml; ac_word=$2 + # Extract the first word of "${ac_tool_prefix}ocamlbuild", so it can be a program name with args. +set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAML+:} false; then : +if ${ac_cv_prog_OCAMLBUILD+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OCAML"; then - ac_cv_prog_OCAML="$OCAML" # Let the user override the test. + if test -n "$OCAMLBUILD"; then + ac_cv_prog_OCAMLBUILD="$OCAMLBUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -3040,7 +2933,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAML="${ac_tool_prefix}ocaml" + ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3050,10 +2943,10 @@ IFS=$as_save_IFS fi fi -OCAML=$ac_cv_prog_OCAML -if test -n "$OCAML"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAML" >&5 -$as_echo "$OCAML" >&6; } +OCAMLBUILD=$ac_cv_prog_OCAMLBUILD +if test -n "$OCAMLBUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLBUILD" >&5 +$as_echo "$OCAMLBUILD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -3061,17 +2954,17 @@ fi fi -if test -z "$ac_cv_prog_OCAML"; then - ac_ct_OCAML=$OCAML - # Extract the first word of "ocaml", so it can be a program name with args. -set dummy ocaml; ac_word=$2 +if test -z "$ac_cv_prog_OCAMLBUILD"; then + ac_ct_OCAMLBUILD=$OCAMLBUILD + # Extract the first word of "ocamlbuild", so it can be a program name with args. +set dummy ocamlbuild; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAML+:} false; then : +if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OCAML"; then - ac_cv_prog_ac_ct_OCAML="$ac_ct_OCAML" # Let the user override the test. + if test -n "$ac_ct_OCAMLBUILD"; then + ac_cv_prog_ac_ct_OCAMLBUILD="$ac_ct_OCAMLBUILD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -3080,7 +2973,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAML="ocaml" + ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3090,17 +2983,17 @@ IFS=$as_save_IFS fi fi -ac_ct_OCAML=$ac_cv_prog_ac_ct_OCAML -if test -n "$ac_ct_OCAML"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAML" >&5 -$as_echo "$ac_ct_OCAML" >&6; } +ac_ct_OCAMLBUILD=$ac_cv_prog_ac_ct_OCAMLBUILD +if test -n "$ac_ct_OCAMLBUILD"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLBUILD" >&5 +$as_echo "$ac_ct_OCAMLBUILD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OCAML" = x; then - OCAML="no" + if test "x$ac_ct_OCAMLBUILD" = x; then + OCAMLBUILD="no" else case $cross_compiling:$ac_tool_warned in yes:) @@ -3108,25 +3001,42 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OCAML=$ac_ct_OCAML + OCAMLBUILD=$ac_ct_OCAMLBUILD fi else - OCAML="$ac_cv_prog_OCAML" + OCAMLBUILD="$ac_cv_prog_OCAMLBUILD" fi - # checking for ocamldep - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamldep", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamldep; ac_word=$2 +if test "x$OCAMLC" = "xno"; then + as_fn_error $? "You must install the OCaml compiler" "$LINENO" 5 +fi + +# Check whether --enable-version_check was given. +if test "${enable_version_check+set}" = set; then : + enableval=$enable_version_check; +fi + + +# Check whether --enable-checks was given. +if test "${enable_checks+set}" = set; then : + enableval=$enable_checks; +fi + + +# Check that OCaml version is greater or equal to 4.01.0 +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLDEP+:} false; then : +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OCAMLDEP"; then - ac_cv_prog_OCAMLDEP="$OCAMLDEP" # Let the user override the test. -else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do @@ -3134,7 +3044,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLDEP="${ac_tool_prefix}ocamldep" + ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3144,28 +3054,93 @@ IFS=$as_save_IFS fi fi -OCAMLDEP=$ac_cv_prog_OCAMLDEP -if test -n "$OCAMLDEP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEP" >&5 -$as_echo "$OCAMLDEP" >&6; } +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + test -n "$AWK" && break +done + +if test "x${enable_version_check}" != "xno"; then : + + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$OCAMLVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=`echo "4.01.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` + + + + if test "$ax_compare_version" = "true" ; then + as_fn_error $? "Your version of OCaml: $OCAMLVERSION is not supported" "$LINENO" 5 + fi + + fi -if test -z "$ac_cv_prog_OCAMLDEP"; then - ac_ct_OCAMLDEP=$OCAMLDEP - # Extract the first word of "ocamldep", so it can be a program name with args. -set dummy ocamldep; ac_word=$2 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler os_type" >&5 +$as_echo_n "checking for compiler os_type... " >&6; } +OS_TYPE=`$OCAML shell/print_config.ml os_type 2>/dev/null | fgrep -v "Cannot find" || $OCAMLC -config | fgrep os_type | sed -e "s/.*: //"` +if test "$?" -eq 0 ; then : + +else + as_fn_error $? "failed" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OS_TYPE" >&5 +$as_echo "$OS_TYPE" >&6; } + +# Need the C compiler used for OCaml (important on Windows, as both x86 and x64 are used) +if test "$OCAMLBEST" = "opt"; then : + OCAMLBESTCC=$OCAMLOPT +else + OCAMLBESTCC=$OCAMLC +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $($OCAMLBESTCC -config | sed -n -e "s/native_c_compiler: \(.*\) .*/\1/p") gcc cl cc + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OCAMLDEP"; then - ac_cv_prog_ac_ct_OCAMLDEP="$ac_ct_OCAMLDEP" # Let the user override the test. + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -3174,7 +3149,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLDEP="ocamldep" + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3184,43 +3159,32 @@ IFS=$as_save_IFS fi fi -ac_ct_OCAMLDEP=$ac_cv_prog_ac_ct_OCAMLDEP -if test -n "$ac_ct_OCAMLDEP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEP" >&5 -$as_echo "$ac_ct_OCAMLDEP" >&6; } +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OCAMLDEP" = x; then - OCAMLDEP="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OCAMLDEP=$ac_ct_OCAMLDEP - fi -else - OCAMLDEP="$ac_cv_prog_OCAMLDEP" -fi - - # checking for ocamldep.opt - if test "$OCAMLDEP" != "no" ; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamldep.opt", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamldep.opt; ac_word=$2 + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in $($OCAMLBESTCC -config | sed -n -e "s/native_c_compiler: \(.*\) .*/\1/p") gcc cl cc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLDEPDOTOPT+:} false; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OCAMLDEPDOTOPT"; then - ac_cv_prog_OCAMLDEPDOTOPT="$OCAMLDEPDOTOPT" # Let the user override the test. + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -3229,7 +3193,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLDEPDOTOPT="${ac_tool_prefix}ocamldep.opt" + ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3239,479 +3203,610 @@ IFS=$as_save_IFS fi fi -OCAMLDEPDOTOPT=$ac_cv_prog_OCAMLDEPDOTOPT -if test -n "$OCAMLDEPDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEPDOTOPT" >&5 -$as_echo "$OCAMLDEPDOTOPT" >&6; } +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi -if test -z "$ac_cv_prog_OCAMLDEPDOTOPT"; then - ac_ct_OCAMLDEPDOTOPT=$OCAMLDEPDOTOPT - # Extract the first word of "ocamldep.opt", so it can be a program name with args. -set dummy ocamldep.opt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLDEPDOTOPT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLDEPDOTOPT"; then - ac_cv_prog_ac_ct_OCAMLDEPDOTOPT="$ac_ct_OCAMLDEPDOTOPT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLDEPDOTOPT="ocamldep.opt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac done - done -IFS=$as_save_IFS +test "$ac_cv_exeext" = no && ac_cv_exeext= -fi -fi -ac_ct_OCAMLDEPDOTOPT=$ac_cv_prog_ac_ct_OCAMLDEPDOTOPT -if test -n "$ac_ct_OCAMLDEPDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDEPDOTOPT" >&5 -$as_echo "$ac_ct_OCAMLDEPDOTOPT" >&6; } else + ac_file='' +fi +if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext - if test "x$ac_ct_OCAMLDEPDOTOPT" = x; then - OCAMLDEPDOTOPT="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac - OCAMLDEPDOTOPT=$ac_ct_OCAMLDEPDOTOPT - fi +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done else - OCAMLDEPDOTOPT="$ac_cv_prog_OCAMLDEPDOTOPT" + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } - if test "$OCAMLDEPDOTOPT" != "no"; then - TMPVERSION=`$OCAMLDEPDOTOPT -version | sed -n -e 's|.*version* *\(.*\)$|\1|p' ` - if test "$TMPVERSION" != "$OCAMLVERSION" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamldep.opt discarded." >&5 -$as_echo "version differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamldep.opt discarded." >&6; } - else - OCAMLDEP=$OCAMLDEPDOTOPT - fi +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } fi fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } - # checking for ocamlmktop - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlmktop", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLMKTOP+:} false; then : +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OCAMLMKTOP"; then - ac_cv_prog_OCAMLMKTOP="$OCAMLMKTOP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLMKTOP="${ac_tool_prefix}ocamlmktop" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac done - done -IFS=$as_save_IFS +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if ${ac_cv_c_compiler_gnu+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + fi -OCAMLMKTOP=$ac_cv_prog_OCAMLMKTOP -if test -n "$OCAMLMKTOP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKTOP" >&5 -$as_echo "$OCAMLMKTOP" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + GCC= fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if ${ac_cv_prog_cc_g+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ -fi -if test -z "$ac_cv_prog_OCAMLMKTOP"; then - ac_ct_OCAMLMKTOP=$OCAMLMKTOP - # Extract the first word of "ocamlmktop", so it can be a program name with args. -set dummy ocamlmktop; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then : - $as_echo_n "(cached) " >&6 + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes else - if test -n "$ac_ct_OCAMLMKTOP"; then - ac_cv_prog_ac_ct_OCAMLMKTOP="$ac_ct_OCAMLMKTOP" # Let the user override the test. + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLMKTOP="ocamlmktop" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_ct_OCAMLMKTOP=$ac_cv_prog_ac_ct_OCAMLMKTOP -if test -n "$ac_ct_OCAMLMKTOP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKTOP" >&5 -$as_echo "$ac_ct_OCAMLMKTOP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi - - if test "x$ac_ct_OCAMLMKTOP" = x; then - OCAMLMKTOP="no" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OCAMLMKTOP=$ac_ct_OCAMLMKTOP + CFLAGS="-g" fi else - OCAMLMKTOP="$ac_cv_prog_OCAMLMKTOP" + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi fi - - - # checking for ocamlmklib - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlmklib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLMKLIB+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OCAMLMKLIB"; then - ac_cv_prog_OCAMLMKLIB="$OCAMLMKLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLMKLIB="${ac_tool_prefix}ocamlmklib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done - done -IFS=$as_save_IFS +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + # Used to indicate true or false condition + ax_compare_version=false + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=`echo "$OCAMLVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` -fi -fi -OCAMLMKLIB=$ac_cv_prog_OCAMLMKLIB -if test -n "$OCAMLMKLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLMKLIB" >&5 -$as_echo "$OCAMLMKLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + ax_compare_version_B=`echo "4.02.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` -fi -if test -z "$ac_cv_prog_OCAMLMKLIB"; then - ac_ct_OCAMLMKLIB=$OCAMLMKLIB - # Extract the first word of "ocamlmklib", so it can be a program name with args. -set dummy ocamlmklib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLMKLIB"; then - ac_cv_prog_ac_ct_OCAMLMKLIB="$ac_ct_OCAMLMKLIB" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLMKLIB="ocamlmklib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_OCAMLMKLIB=$ac_cv_prog_ac_ct_OCAMLMKLIB -if test -n "$ac_ct_OCAMLMKLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLMKLIB" >&5 -$as_echo "$ac_ct_OCAMLMKLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` - if test "x$ac_ct_OCAMLMKLIB" = x; then - OCAMLMKLIB="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OCAMLMKLIB=$ac_ct_OCAMLMKLIB - fi -else - OCAMLMKLIB="$ac_cv_prog_OCAMLMKLIB" -fi - # checking for ocamldoc - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamldoc", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLDOC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLDOC"; then - ac_cv_prog_OCAMLDOC="$OCAMLDOC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLDOC="${ac_tool_prefix}ocamldoc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + if test "$ax_compare_version" = "true" ; then + : + fi -fi -fi -OCAMLDOC=$ac_cv_prog_OCAMLDOC -if test -n "$OCAMLDOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOC" >&5 -$as_echo "$OCAMLDOC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +ocaml_4_02="$ax_compare_version" -fi -if test -z "$ac_cv_prog_OCAMLDOC"; then - ac_ct_OCAMLDOC=$OCAMLDOC - # Extract the first word of "ocamldoc", so it can be a program name with args. -set dummy ocamldoc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLDOC"; then - ac_cv_prog_ac_ct_OCAMLDOC="$ac_ct_OCAMLDOC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLDOC="ocamldoc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_OCAMLDOC=$ac_cv_prog_ac_ct_OCAMLDOC -if test -n "$ac_ct_OCAMLDOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOC" >&5 -$as_echo "$ac_ct_OCAMLDOC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_OCAMLDOC" = x; then - OCAMLDOC="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OCAMLDOC=$ac_ct_OCAMLDOC - fi -else - OCAMLDOC="$ac_cv_prog_OCAMLDOC" -fi + # Used to indicate true or false condition + ax_compare_version=false + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. - # checking for ocamldoc.opt - if test "$OCAMLDOC" != "no" ; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamldoc.opt", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamldoc.opt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLDOCDOTOPT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OCAMLDOCDOTOPT"; then - ac_cv_prog_OCAMLDOCDOTOPT="$OCAMLDOCDOTOPT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLDOCDOTOPT="${ac_tool_prefix}ocamldoc.opt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + ax_compare_version_A=`echo "$OCAMLVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` -fi -fi -OCAMLDOCDOTOPT=$ac_cv_prog_OCAMLDOCDOTOPT -if test -n "$OCAMLDOCDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDOCDOTOPT" >&5 -$as_echo "$OCAMLDOCDOTOPT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + ax_compare_version_B=`echo "4.03.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` -fi -if test -z "$ac_cv_prog_OCAMLDOCDOTOPT"; then - ac_ct_OCAMLDOCDOTOPT=$OCAMLDOCDOTOPT - # Extract the first word of "ocamldoc.opt", so it can be a program name with args. -set dummy ocamldoc.opt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLDOCDOTOPT+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OCAMLDOCDOTOPT"; then - ac_cv_prog_ac_ct_OCAMLDOCDOTOPT="$ac_ct_OCAMLDOCDOTOPT" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLDOCDOTOPT="ocamldoc.opt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_OCAMLDOCDOTOPT=$ac_cv_prog_ac_ct_OCAMLDOCDOTOPT -if test -n "$ac_ct_OCAMLDOCDOTOPT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLDOCDOTOPT" >&5 -$as_echo "$ac_ct_OCAMLDOCDOTOPT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + ax_compare_version=`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` - if test "x$ac_ct_OCAMLDOCDOTOPT" = x; then - OCAMLDOCDOTOPT="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OCAMLDOCDOTOPT=$ac_ct_OCAMLDOCDOTOPT - fi -else - OCAMLDOCDOTOPT="$ac_cv_prog_OCAMLDOCDOTOPT" -fi - if test "$OCAMLDOCDOTOPT" != "no"; then - TMPVERSION=`$OCAMLDOCDOTOPT -version | tr -d '\015'` - if test "$TMPVERSION" != "$OCAMLVERSION" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: version differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamldoc.opt discarded." >&5 -$as_echo "version differs from ocamlc $TMPVERSION != $OCAMLVERSION; ocamldoc.opt discarded." >&6; } - else - OCAMLDOC=$OCAMLDOCDOTOPT + + if test "$ax_compare_version" = "true" ; then + : fi - fi - fi - # checking for ocamlbuild - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ocamlbuild", so it can be a program name with args. -set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2 +ocaml_4_03="$ax_compare_version" + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cygpath", so it can be a program name with args. +set dummy ${ac_tool_prefix}cygpath; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OCAMLBUILD+:} false; then : +if ${ac_cv_prog_CYGPATH+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$OCAMLBUILD"; then - ac_cv_prog_OCAMLBUILD="$OCAMLBUILD" # Let the user override the test. + if test -n "$CYGPATH"; then + ac_cv_prog_CYGPATH="$CYGPATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -3720,7 +3815,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OCAMLBUILD="${ac_tool_prefix}ocamlbuild" + ac_cv_prog_CYGPATH="${ac_tool_prefix}cygpath" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3730,10 +3825,10 @@ IFS=$as_save_IFS fi fi -OCAMLBUILD=$ac_cv_prog_OCAMLBUILD -if test -n "$OCAMLBUILD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLBUILD" >&5 -$as_echo "$OCAMLBUILD" >&6; } +CYGPATH=$ac_cv_prog_CYGPATH +if test -n "$CYGPATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGPATH" >&5 +$as_echo "$CYGPATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } @@ -3741,17 +3836,17 @@ fi fi -if test -z "$ac_cv_prog_OCAMLBUILD"; then - ac_ct_OCAMLBUILD=$OCAMLBUILD - # Extract the first word of "ocamlbuild", so it can be a program name with args. -set dummy ocamlbuild; ac_word=$2 +if test -z "$ac_cv_prog_CYGPATH"; then + ac_ct_CYGPATH=$CYGPATH + # Extract the first word of "cygpath", so it can be a program name with args. +set dummy cygpath; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then : +if ${ac_cv_prog_ac_ct_CYGPATH+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$ac_ct_OCAMLBUILD"; then - ac_cv_prog_ac_ct_OCAMLBUILD="$ac_ct_OCAMLBUILD" # Let the user override the test. + if test -n "$ac_ct_CYGPATH"; then + ac_cv_prog_ac_ct_CYGPATH="$ac_ct_CYGPATH" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -3760,7 +3855,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OCAMLBUILD="ocamlbuild" + ac_cv_prog_ac_ct_CYGPATH="cygpath" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3770,17 +3865,17 @@ IFS=$as_save_IFS fi fi -ac_ct_OCAMLBUILD=$ac_cv_prog_ac_ct_OCAMLBUILD -if test -n "$ac_ct_OCAMLBUILD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OCAMLBUILD" >&5 -$as_echo "$ac_ct_OCAMLBUILD" >&6; } +ac_ct_CYGPATH=$ac_cv_prog_ac_ct_CYGPATH +if test -n "$ac_ct_CYGPATH"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CYGPATH" >&5 +$as_echo "$ac_ct_CYGPATH" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - if test "x$ac_ct_OCAMLBUILD" = x; then - OCAMLBUILD="no" + if test "x$ac_ct_CYGPATH" = x; then + CYGPATH="no" else case $cross_compiling:$ac_tool_warned in yes:) @@ -3788,41 +3883,46 @@ yes:) $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac - OCAMLBUILD=$ac_ct_OCAMLBUILD + CYGPATH=$ac_ct_CYGPATH fi else - OCAMLBUILD="$ac_cv_prog_OCAMLBUILD" + CYGPATH="$ac_cv_prog_CYGPATH" fi -if test "x$OCAMLC" = "xno"; then - as_fn_error $? "You must install the OCaml compiler" "$LINENO" 5 +if test x"$CYGPATH" = x"no" ; then + AR=ar +else + printf "include %s/Makefile.config\nall:\n\t@echo \$(ARCMD)" `$OCAMLC -where | cygpath -f -` > conftestMakefile + AR=`make --no-print-directory -f conftestMakefile` fi -# Check whether --enable-version_check was given. -if test "${enable_version_check+set}" = set; then : - enableval=$enable_version_check; -fi +if test "${OS_TYPE}" = "Win32"; then : + WIN32=1 + EXE=.exe + +else + + EXE= + WIN32=0 -# Check whether --enable-checks was given. -if test "${enable_checks+set}" = set; then : - enableval=$enable_checks; fi -# Check that OCaml version is greater or equal to 4.01.0 -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + + +if test "x$AR" != "x" ; then : + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}$AR", so it can be a program name with args. +set dummy ${ac_tool_prefix}$AR; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -3831,7 +3931,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AWK="$ac_prog" + ac_cv_prog_AR="${ac_tool_prefix}$AR" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -3841,159 +3941,74 @@ IFS=$as_save_IFS fi fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi - test -n "$AWK" && break +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "$AR", so it can be a program name with args. +set dummy $AR; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_AR+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_AR="$AR" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done - -if test "x${enable_version_check}" != "xno"; then : - - - - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - - ax_compare_version_A=`echo "$OCAMLVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version_B=`echo "4.01.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version=`echo "x$ax_compare_version_A -x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` - - - - if test "$ax_compare_version" = "true" ; then - as_fn_error $? "Your version of OCaml: $OCAMLVERSION is not supported" "$LINENO" 5 - fi - + done +IFS=$as_save_IFS fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler os_type" >&5 -$as_echo_n "checking for compiler os_type... " >&6; } -OS_TYPE=`$OCAML shell/print_config.ml os_type 2>/dev/null | fgrep -v "Cannot find" || $OCAMLC -config | fgrep os_type | sed -e "s/.*: //"` -if test "$?" -eq 0 ; then : - +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } else - as_fn_error $? "failed" "$LINENO" 5 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $OS_TYPE" >&5 -$as_echo "$OS_TYPE" >&6; } - - - - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - - ax_compare_version_A=`echo "$OCAMLVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version_B=`echo "4.02.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version=`echo "x$ax_compare_version_A -x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` - - - - if test "$ax_compare_version" = "true" ; then - : - fi - -ocaml_4_02="$ax_compare_version" - - - - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - - ax_compare_version_A=`echo "$OCAMLVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version_B=`echo "4.03.0" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version=`echo "x$ax_compare_version_A -x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` - - - - if test "$ax_compare_version" = "true" ; then - : - fi - -ocaml_4_03="$ax_compare_version" - - -if test "${OS_TYPE}" = "Win32"; then : - - WIN32=1 - EXE=.exe + if test "x$ac_ct_AR" = x; then + AR="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi else - - EXE= - WIN32=0 - + AR="$ac_cv_prog_AR" fi +else + AR="no" - +fi # checking for ocamllex if test -n "$ac_tool_prefix"; then diff --git a/configure.ac b/configure.ac index 01ffcba7ef2..5b5af7c0fbe 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,6 @@ AC_INIT(opam,2.0.0~beta3) AC_COPYRIGHT(Copyright 2012-2017 OcamlPro SAS) AC_CONFIG_MACRO_DIR([m4]) -AC_PROG_CC AC_PROG_OCAML if test "x$OCAMLC" = "xno"; then @@ -31,11 +30,24 @@ OS_TYPE=`$OCAML shell/print_config.ml os_type 2>/dev/null | fgrep -v "Cannot fin AS_IF([ test "$?" -eq 0 ],,[AC_MSG_ERROR([failed])] ) AC_MSG_RESULT([$OS_TYPE]) +# Need the C compiler used for OCaml (important on Windows, as both x86 and x64 are used) +AS_IF([test "$OCAMLBEST" = "opt"],[OCAMLBESTCC=$OCAMLOPT],[OCAMLBESTCC=$OCAMLC]) +AC_PROG_CC([$($OCAMLBESTCC -config | sed -n -e "s/native_c_compiler: \(.*\) .*/\1/p") gcc cl cc]) + AX_COMPARE_VERSION([$OCAMLVERSION], [ge], [4.02.0]) AC_SUBST(ocaml_4_02,"$ax_compare_version") AX_COMPARE_VERSION([$OCAMLVERSION], [ge], [4.03.0]) AC_SUBST(ocaml_4_03,"$ax_compare_version") +AC_CHECK_TOOL([CYGPATH],[cygpath],[no]) + +if test x"$CYGPATH" = x"no" ; then + AR=ar +else + printf "include %s/Makefile.config\nall:\n\t@echo \$(ARCMD)" `$OCAMLC -where | cygpath -f -` > conftestMakefile + AR=`make --no-print-directory -f conftestMakefile` +fi + AS_IF([ test "${OS_TYPE}" = "Win32"],[ WIN32=1 EXE=.exe @@ -47,6 +59,8 @@ AS_IF([ test "${OS_TYPE}" = "Win32"],[ AC_SUBST(WIN32) AC_SUBST(EXE) +AS_IF([ test "x$AR" != "x" ],[AC_CHECK_TOOL(AR,$AR)],[AC_SUBST(AR,"no")]) + AC_PROG_OCAMLLEX AC_PROG_OCAMLYACC AC_PROG_FINDLIB From 5faa6f2ead1cecb939081decd4fd88c40c9e4ce2 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Wed, 24 Jun 2015 14:52:41 +0100 Subject: [PATCH 2/7] Remove out-of-date Win32 tests from OCamlMakefile --- OCamlMakefile | 51 +++------------------------------------------------ 1 file changed, 3 insertions(+), 48 deletions(-) diff --git a/OCamlMakefile b/OCamlMakefile index 303b2f554ed..93733e48457 100644 --- a/OCamlMakefile +++ b/OCamlMakefile @@ -124,27 +124,13 @@ SYSTEM := $(shell ocamlc -config 2>/dev/null | grep system | sed 's/system: //') ifeq ($(SYSTEM),$(filter $(SYSTEM),mingw mingw64)) MINGW=1 endif -ifeq ($(SYSTEM),win32) +ifeq ($(SYSTEM),$(filter $(SYSTEM),win32 win64)) MSVC=1 endif ifdef MINGW export MINGW WIN32 := 1 - # The default value 'cc' makes 'ocamlc -cc "cc"' raises the error 'The - # NTVDM CPU has encountered an illegal instruction'. - ifndef CC - MNO_CYGWIN := $(shell gcc -Wextra -v --help 2>/dev/null | grep -q '\-mno-cygwin'; echo $$?) - CC := gcc - else - MNO_CYGWIN := $(shell $$CC -Wextra -v --help 2>/dev/null | grep -q '\-mno-cygwin'; echo $$?) - endif - # We are compiling with cygwin tools: - ifeq ($(MNO_CYGWIN),0) - CFLAGS_WIN32 := -mno-cygwin - endif - # The OCaml C header files use this flag: - CFLAGS += -D__MINGW32__ endif ifdef MSVC export MSVC @@ -206,15 +192,6 @@ ifndef RPATH_FLAG endif export RPATH_FLAG -ifndef MSVC -ifndef PIC_CFLAGS - PIC_CFLAGS := -fPIC -endif -ifndef PIC_CPPFLAGS - PIC_CPPFLAGS := -DPIC -endif -endif - export PIC_CFLAGS export PIC_CPPFLAGS @@ -973,32 +950,11 @@ endif .rep .zog .glade ifndef STATIC -ifdef MINGW -# From OCaml 3.11.0, ocamlmklib is available on windows -OCAMLMLIB_EXISTS = $(shell which $(OCAMLMKLIB)) -ifeq ($(strip $(OCAMLMLIB_EXISTS)),) -$(DLLSONAME): $(OBJ_LINK) - $(CC) $(CFLAGS) $(CFLAGS_WIN32) $(OBJ_LINK) -shared -o $@ \ - $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/lib%.a))) \ - '$(OCAMLLIBPATH)/ocamlrun.a' \ - -Wl,--whole-archive \ - -Wl,--export-all-symbols \ - -Wl,--allow-multiple-definition \ - -Wl,--enable-auto-import -else +ifdef MSVC $(DLLSONAME): $(OBJ_LINK) $(OCAMLMKLIB) $(INCFLAGS) $(CLIBFLAGS) \ - -o $(CLIB_BASE) $(OBJ_LINK) $(CLIBS:%=-l%) \ - $(CFRAMEWORKS:%=-framework %) \ + -o $(CLIB_BASE) $(OBJ_LINK) $(CLIBS:%=%.lib) $(CFRAMEWORKS:%=-framework %) \ $(OCAMLMKLIB_FLAGS) -endif -else -ifdef MSVC -$(DLLSONAME): $(OBJ_LINK) - link /NOLOGO /DLL /OUT:$@ $(OBJ_LINK) \ - $(wildcard $(foreach dir,$(LIBDIRS),$(CLIBS:%=$(dir)/%.lib))) \ - '$(OCAMLLIBPATH)/ocamlrun.lib' - else $(DLLSONAME): $(OBJ_LINK) $(OCAMLMKLIB) $(INCFLAGS) $(CLIBFLAGS) \ @@ -1006,7 +962,6 @@ $(DLLSONAME): $(OBJ_LINK) $(OCAMLMKLIB_FLAGS) endif endif -endif ifndef LIB_PACK_NAME $(RESULT).cma: $(REAL_IMPL_INTF) $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS) From 3a96c973f32abb76d411e65b897155042ce62a2d Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Tue, 3 Nov 2015 16:43:23 +0000 Subject: [PATCH 3/7] Fix broken test in OCamlMakefile Test for ocamlc -config fails if your OCaml installation path includes "system"! --- OCamlMakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OCamlMakefile b/OCamlMakefile index 93733e48457..35a2f8ab2ca 100644 --- a/OCamlMakefile +++ b/OCamlMakefile @@ -112,7 +112,7 @@ endif #################### variables depending on your OCaml-installation -SYSTEM := $(shell ocamlc -config 2>/dev/null | grep system | sed 's/system: //') +SYSTEM := $(shell ocamlc -config 2>/dev/null | sed -n -e 's/^system: //p ') # This may be # - mingw # - mingw64 From 22e35cde75d8656bf5c54c4fc27d6de570ed5e3d Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Sun, 12 Jul 2015 09:01:57 +0100 Subject: [PATCH 4/7] Invoke ocamldep correctly on Windows ocamldep needs to have the -slash option passed on Windows. --- Makefile.config.in | 2 ++ configure | 20 ++++++++++++++++++++ configure.ac | 11 +++++++++++ src/Makefile | 2 +- 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/Makefile.config.in b/Makefile.config.in index d19b21ddf31..2a8f91bd743 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -14,6 +14,8 @@ LIBEXT := $(if $(USE_BYTE),.cma,.cmxa) PACKS = @OCAML_PKG_unix@ @OCAML_PKG_bigarray@ @OCAML_PKG_extlib@ @OCAML_PKG_re@ @OCAML_PKG_re_glob@ @OCAML_PKG_cmdliner@ @OCAML_PKG_ocamlgraph@ @OCAML_PKG_cudf@ @OCAML_PKG_dose3_common@ @OCAML_PKG_dose3_algo@ @OCAML_PKG_jsonm@ @OCAML_PKG_opam_file_format@ +OCAMLDEPARGS = @OCAMLDEPARGS@ + OCAMLFIND = @OCAMLFIND@ OCAML = @OCAML@ OCAMLC = @OCAMLC@ diff --git a/configure b/configure index 411a8f55546..730b0e0a29d 100755 --- a/configure +++ b/configure @@ -605,6 +605,7 @@ OCAMLYACC OCAMLLEXDOTOPT OCAMLLEX AR +OCAMLDEPARGS EXE WIN32 CYGPATH @@ -3912,6 +3913,25 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for invocation options for $OCAMLDEP" >&5 +$as_echo_n "checking for invocation options for $OCAMLDEP... " >&6; } +if test ${WIN32} -eq 1 ; then : + + OCAMLDEPARGS=-slash + OCAMLDEP="$OCAMLDEP -slash" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCAMLDEPARGS" >&5 +$as_echo "$OCAMLDEPARGS" >&6; } + +else + + OCAMLDEPARGS= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none required" >&5 +$as_echo "none required" >&6; } + +fi + + if test "x$AR" != "x" ; then : if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}$AR", so it can be a program name with args. diff --git a/configure.ac b/configure.ac index 5b5af7c0fbe..4374c69c10c 100644 --- a/configure.ac +++ b/configure.ac @@ -59,6 +59,17 @@ AS_IF([ test "${OS_TYPE}" = "Win32"],[ AC_SUBST(WIN32) AC_SUBST(EXE) +AC_MSG_CHECKING([for invocation options for $OCAMLDEP]) +AS_IF([ test ${WIN32} -eq 1 ],[ + OCAMLDEPARGS=-slash + AC_SUBST(OCAMLDEP,"$OCAMLDEP -slash") + AC_MSG_RESULT([$OCAMLDEPARGS]) +],[ + OCAMLDEPARGS= + AC_MSG_RESULT([none required]) +]) +AC_SUBST(OCAMLDEPARGS) + AS_IF([ test "x$AR" != "x" ],[AC_CHECK_TOOL(AR,$AR)],[AC_SUBST(AR,"no")]) AC_PROG_OCAMLLEX diff --git a/src/Makefile b/src/Makefile index 0e28a048eef..17c60286ee1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -44,7 +44,7 @@ else # Reset command name for ocamlfind OCAMLC = ocamlc OCAMLOPT = ocamlopt - OCAMLDEP = ocamldep + OCAMLDEP = ocamldep $(OCAMLDEPARGS) OCAMLLEX = ocamllex OCAMLYACC = ocamlyacc OCAMLMKLIB = ocamlmklib From 848c702fd939df3dbdeaf1bae616d5231dd52e95 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Wed, 15 Jul 2015 18:32:50 +0100 Subject: [PATCH 5/7] Workaround conflict over link command The Microsoft Linker is called link which has the potential to conflict with coreutils link, depending on the order of directories in PATH. By default, coreutils link will win, and compilation is broken on MSVC OCaml. Simply altering /etc/profile to put the Cygwin directories later isn't an option as commands like find and sort then get overridden by Microsoft's "alternative" implementations in system32. Introduce detection in configure so that if multiple link commands are found in PATH, identify the first one which is a Microsoft Linker and alter PATH in Makefile to include its directory first. --- .gitattributes | 1 + Makefile.config.in | 4 +++- configure | 17 +++++++++++++++++ configure.ac | 8 ++++++++ shell/check_linker | 17 +++++++++++++++++ 5 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 shell/check_linker diff --git a/.gitattributes b/.gitattributes index 2e2f7c8168c..027bee07d2f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -5,6 +5,7 @@ *.sh text eol=lf configure text eol=lf configure.ac text eol=lf +check_linker text eol=lf *.m4 text eol=lf # Treat patches as binary for safety diff --git a/Makefile.config.in b/Makefile.config.in index 2a8f91bd743..dc76e72aa55 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -32,4 +32,6 @@ AR = @AR@ EXE = @EXE@ WIN32 = @WIN32@ -export OCAMLVERSION OCAMLFIND OCAML OCAMLC OCAMLOPT OCAMLDEP OCAMLLEX OCAMLYACC OCAMLMKLIB OCAMLDOC EXE CC AR +PATH:=@PATH_PREPEND@$(PATH) + +export OCAMLVERSION OCAMLFIND OCAML OCAMLC OCAMLOPT OCAMLDEP OCAMLLEX OCAMLYACC OCAMLMKLIB OCAMLDOC EXE CC AR PATH diff --git a/configure b/configure index 730b0e0a29d..1bf984953a2 100755 --- a/configure +++ b/configure @@ -605,6 +605,7 @@ OCAMLYACC OCAMLLEXDOTOPT OCAMLLEX AR +PATH_PREPEND OCAMLDEPARGS EXE WIN32 @@ -3932,6 +3933,22 @@ $as_echo "none required" >&6; } fi +if test ${WIN32} -eq 1 -a "$GCC" != "yes" ; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Microsoft Linker needs a PATH shim" >&5 +$as_echo_n "checking whether Microsoft Linker needs a PATH shim... " >&6; } + PATH_PREPEND=$(bash ./shell/check_linker) + if test "x${PATH_PREPEND}" = "x" ; then : + PATH_PREPEND_RESULT=no +else + PATH_PREPEND_RESULT=yes +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PATH_PREPEND_RESULT" >&5 +$as_echo "$PATH_PREPEND_RESULT" >&6; } + +fi + if test "x$AR" != "x" ; then : if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}$AR", so it can be a program name with args. diff --git a/configure.ac b/configure.ac index 4374c69c10c..84444cad96b 100644 --- a/configure.ac +++ b/configure.ac @@ -70,6 +70,14 @@ AS_IF([ test ${WIN32} -eq 1 ],[ ]) AC_SUBST(OCAMLDEPARGS) +AS_IF([ test ${WIN32} -eq 1 -a "$GCC" != "yes" ],[ + AC_MSG_CHECKING([whether Microsoft Linker needs a PATH shim]) + PATH_PREPEND=$(bash ./shell/check_linker) + AS_IF([test "x${PATH_PREPEND}" = "x" ],[PATH_PREPEND_RESULT=no],[PATH_PREPEND_RESULT=yes]) + AC_SUBST(PATH_PREPEND) + AC_MSG_RESULT([$PATH_PREPEND_RESULT]) +]) + AS_IF([ test "x$AR" != "x" ],[AC_CHECK_TOOL(AR,$AR)],[AC_SUBST(AR,"no")]) AC_PROG_OCAMLLEX diff --git a/shell/check_linker b/shell/check_linker new file mode 100644 index 00000000000..173899080a5 --- /dev/null +++ b/shell/check_linker @@ -0,0 +1,17 @@ +#!/bin/bash + +# Ensure that the Microsoft Linker isn't being messed up by /usr/bin/link +FIRST=1 +FAULT=0 +PREPEND= +while IFS= read -r line; do + OUTPUT=$("$line" --version | head -1 | fgrep "Microsoft (R) Incremental Linker") + if [ "x$OUTPUT" = "x" -a $FIRST -eq 1 ] ; then + FAULT=1 + elif [ $FAULT -eq 1 ] ; then + PREPEND=$(dirname "$line"): + FAULT=0 + fi +done < <(which --all link) + +echo $PATH_PREPEND$PREPEND From 2770220ea76196bea8ae9d259244c01a82d03a6f Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Sat, 29 Aug 2015 10:43:16 +0100 Subject: [PATCH 6/7] Improve default --prefix for Windows Autoconf's default prefix of /usr/local is inappropriate for Windows as it results in C:\usr\local being created by the opam-installer. When Windows is detected, the default is changed to C:/OPAM instead. --- configure | 3 +++ configure.ac | 2 ++ 2 files changed, 5 insertions(+) diff --git a/configure b/configure index 1bf984953a2..e9730533028 100755 --- a/configure +++ b/configure @@ -583,6 +583,7 @@ PACKAGE_STRING='opam 2.0.0~beta3' PACKAGE_BUGREPORT='' PACKAGE_URL='' +ac_default_prefix=`ocamlc -config 2>/dev/null | tr -d '\r' | sed -n -e "s;^os_type: Win32;C:/OPAM;p" -e "s;^os_type:.*;/usr/local;p"` ac_subst_vars='LTLIBOBJS LIBOBJS hasalldeps @@ -1802,6 +1803,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + # checking for ocamlc if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ocamlc", so it can be a program name with args. diff --git a/configure.ac b/configure.ac index 84444cad96b..5ebc289efa2 100644 --- a/configure.ac +++ b/configure.ac @@ -3,6 +3,8 @@ AC_COPYRIGHT(Copyright 2012-2017 OcamlPro SAS) AC_CONFIG_MACRO_DIR([m4]) +AC_PREFIX_DEFAULT([`ocamlc -config 2>/dev/null | tr -d '\r' | sed -n -e "s;^os_type: Win32;C:/OPAM;p" -e "s;^os_type:.*;/usr/local;p"`]) + AC_PROG_OCAML if test "x$OCAMLC" = "xno"; then AC_MSG_ERROR([You must install the OCaml compiler]) From 4e0f024f49faed79ddd1952a484f73ec84d07444 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Mon, 29 May 2017 15:20:43 +0200 Subject: [PATCH 7/7] Fix untidy pipe in configure script --- configure | 2 +- configure.ac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index e9730533028..a29ac994525 100755 --- a/configure +++ b/configure @@ -3114,7 +3114,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compiler os_type" >&5 $as_echo_n "checking for compiler os_type... " >&6; } -OS_TYPE=`$OCAML shell/print_config.ml os_type 2>/dev/null | fgrep -v "Cannot find" || $OCAMLC -config | fgrep os_type | sed -e "s/.*: //"` +OS_TYPE=`$OCAML shell/print_config.ml os_type 2>/dev/null | fgrep -v "Cannot find" || $OCAMLC -config | sed -n -e "s/^os_type: //p"` if test "$?" -eq 0 ; then : else diff --git a/configure.ac b/configure.ac index 5ebc289efa2..70782a91788 100644 --- a/configure.ac +++ b/configure.ac @@ -28,7 +28,7 @@ AS_IF([test "x${enable_version_check}" != "xno"], [ ]) AC_MSG_CHECKING([for compiler os_type]) -OS_TYPE=`$OCAML shell/print_config.ml os_type 2>/dev/null | fgrep -v "Cannot find" || $OCAMLC -config | fgrep os_type | sed -e "s/.*: //"` +OS_TYPE=`$OCAML shell/print_config.ml os_type 2>/dev/null | fgrep -v "Cannot find" || $OCAMLC -config | sed -n -e "s/^os_type: //p"` AS_IF([ test "$?" -eq 0 ],,[AC_MSG_ERROR([failed])] ) AC_MSG_RESULT([$OS_TYPE])