diff options
| author | Gabriel Scherer <gabriel.scherer@gmail.com> | 2017-12-15 10:03:24 +0100 |
|---|---|---|
| committer | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2017-12-15 10:03:24 +0100 |
| commit | dc3086f92c7ca85da27f100c1584dc310f145963 (patch) | |
| tree | 60718578bbd6c545ac51ae09ffa98d4b3b655859 /configure | |
| parent | d323e92d3db5a9f7fafbe05a6501b61d75abe16f (diff) | |
| download | ocaml-dc3086f92c7ca85da27f100c1584dc310f145963.tar.gz | |
configure: build the debug and instrumented runtimes by default (#1526)
This commit builds the debug and instrumented runtimes by default.
For a user that discovers a use for either of those, not having built
by default makes the experience pretty bad: they have to recompile
their own OCaml compiler, possibly from a source checkout if the
option is not available on opam...
With this change the total compilation time only increased by
7 seconds on my machine, from 3m24s to 3m33s -- these are sequential
builds, with parallel builds the difference is lost in the noise.
We wish to make -with-instrumented-runtime the default, but not break
the build on systems that do not support it -- when clock_gettime is
missing. This is done by tracking whether -with-instrumented-runtime
was set explicitly or is the default value; in the latter case,
a missing clock_gettime defaults to no instrumented runtime, without
raising an error at configure-time.
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 34 |
1 files changed, 24 insertions, 10 deletions
@@ -45,8 +45,7 @@ graph_wanted=yes pthread_wanted=yes dl_defs='' verbose=false -debugruntime=false -with_instrumented_runtime=false +debugruntime=true with_sharedlibs=true partialld="ld -r" with_debugger=ocamldebugger @@ -69,6 +68,9 @@ with_cplugins=false with_fpic=false flat_float_array=true +# we distinguish '' (not set) from 'true' (explicitly set by the user) +with_instrumented_runtime='' + # Try to turn internationalization off, can cause config.guess to malfunction! unset LANG unset LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME @@ -171,9 +173,13 @@ while : ; do -verbose|--verbose) verbose=true;; -with-debug-runtime|--with-debug-runtime) - debugruntime=true;; + debugruntime=true;; # default + -no-debug-runtime|--no-debug-runtime) + debugruntime=false;; -with-instrumented-runtime|--with-instrumented-runtime) with_instrumented_runtime=true;; + -no-instrumented-runtime|--no-instrumented-runtime) + with_instrumented_runtime=false;; -no-debugger|--no-debugger) with_debugger="";; -no-ocamldoc|--no-ocamldoc) @@ -1190,20 +1196,28 @@ fi # For instrumented runtime # (clock_gettime needs -lrt for glibc before 2.17) -if $with_instrumented_runtime; then - with_instrumented_runtime=false #enabled it only if found +if test "$with_instrumented_runtime" != "false"; then + instrumented_runtime_support="nonsupported" for libs in "" "-lrt"; do if sh ./hasgot $libs clock_gettime; then inf "clock_gettime functions found (with libraries '$libs')" instrumented_runtime_libs="${libs}" - with_instrumented_runtime=true; + instrumented_runtime_support="supported"; break fi done - if ! $with_instrumented_runtime; then - err "clock_gettime functions not found. " \ - "Instrumented runtime can't be built." - fi + case "$with_instrumented_runtime,$instrumented_runtime_support" in + *,supported) + with_instrumented_runtime=true;; + true,nonsupported) + with_instrumented_runtime=false; + err "clock_gettime functions not found. " \ + "Instrumented runtime can't be built.";; + ,nonsupported) + with_instrumented_runtime=false; + inf "clock_gettime functions not found. " \ + "Instrumented runtime can't be built.";; + esac fi # Configuration for the libraries |
