From b03c1c78c789efd470228cc37a184941fca87df7 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 16 Jan 2020 16:50:27 +0000 Subject: [PATCH 1/2] Add --disable-ocamltest --- Changes | 3 +++ Makefile | 9 ++++++--- Makefile.config.in | 1 + configure | 16 ++++++++++++++++ configure.ac | 9 +++++++++ 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 60dfdedfbb43..00983268b219 100644 --- a/Changes +++ b/Changes @@ -194,6 +194,9 @@ Working version ### Build system: +- #9250: Add --disable-ocamltest to configure + (David Allsopp, review by Sébastien Hinderer) + ### Bug fixes: - #7683, #1499: Fixes one case where the evaluation order in native-code diff --git a/Makefile b/Makefile index 7b9f726a7cb8..8bd0600c99d6 100644 --- a/Makefile +++ b/Makefile @@ -68,6 +68,7 @@ DEPFLAGS=-slash DEPINCLUDES=$(INCLUDES) OCAMLDOC_OPT=$(WITH_OCAMLDOC:=.opt) +OCAMLTEST_OPT=$(WITH_OCAMLTEST:=.opt) BYTESTART=driver/main.cmo @@ -210,11 +211,12 @@ opt.opt: checknative $(MAKE) ocaml $(MAKE) opt-core $(MAKE) ocamlc.opt - $(MAKE) otherlibraries $(WITH_DEBUGGER) $(WITH_OCAMLDOC) ocamltest + $(MAKE) otherlibraries $(WITH_DEBUGGER) $(WITH_OCAMLDOC) \ + $(WITH_OCAMLTEST) $(MAKE) ocamlopt.opt $(MAKE) otherlibrariesopt $(MAKE) ocamllex.opt ocamltoolsopt ocamltoolsopt.opt $(OCAMLDOC_OPT) \ - ocamltest.opt + $(OCAMLTEST_OPT) ifneq "$(WITH_OCAMLDOC)" "" $(MAKE) manpages endif @@ -244,7 +246,8 @@ coreboot: .PHONY: all all: coreall $(MAKE) ocaml - $(MAKE) otherlibraries $(WITH_DEBUGGER) $(WITH_OCAMLDOC) ocamltest + $(MAKE) otherlibraries $(WITH_DEBUGGER) $(WITH_OCAMLDOC) \ + $(WITH_OCAMLTEST) ifneq "$(WITH_OCAMLDOC)" "" $(MAKE) manpages endif diff --git a/Makefile.config.in b/Makefile.config.in index 6d37323920ed..bd67520aa6bb 100644 --- a/Makefile.config.in +++ b/Makefile.config.in @@ -215,6 +215,7 @@ RUNTIMEI=@instrumented_runtime@ WITH_DEBUGGER=@with_debugger@ WITH_CAMLTEX=@with_camltex@ WITH_OCAMLDOC=@ocamldoc@ +WITH_OCAMLTEST=@ocamltest@ ASM_CFI_SUPPORTED=@asm_cfi_supported@ WITH_FRAME_POINTERS=@frame_pointers@ WITH_SPACETIME=@spacetime@ diff --git a/configure b/configure index bb907f5c3b84..67284fdb7a5e 100755 --- a/configure +++ b/configure @@ -784,6 +784,7 @@ bfd_cppflags x_libraries x_includes pthread_link +ocamltest ocamldoc with_camltex with_debugger @@ -894,6 +895,7 @@ enable_str_lib enable_unix_lib enable_bigarray_lib enable_ocamldoc +enable_ocamltest enable_frame_pointers enable_naked_pointers enable_spacetime @@ -1564,6 +1566,7 @@ Optional Features: --disable-unix-lib do not build the unix library --disable-bigarray-lib do not build the legacy separate bigarray library --disable-ocamldoc do not build the ocamldoc documentation system + --disable-ocamltest do not build the ocamltest driver --enable-frame-pointers use frame pointers in runtime and generated code --disable-naked-pointers do not allow naked pointers @@ -2892,6 +2895,7 @@ VERSION=4.11.0+dev0-2019-10-18 + ## Generated files @@ -3137,6 +3141,12 @@ else fi +# Check whether --enable-ocamltest was given. +if test "${enable_ocamltest+set}" = set; then : + enableval=$enable_ocamltest; +fi + + # Check whether --enable-frame-pointers was given. if test "${enable_frame_pointers+set}" = set; then : enableval=$enable_frame_pointers; @@ -16651,6 +16661,12 @@ else ocamldoc=ocamldoc fi +if test x"$enable_ocamltest" = "xno"; then : + ocamltest="" +else + ocamltest=ocamltest +fi + if test x"$enable_flambda" = "xyes"; then : flambda=true if test x"$enable_flambda_invariants" = "xyes"; then : diff --git a/configure.ac b/configure.ac index cda2710906ad..1cc6cb022867 100644 --- a/configure.ac +++ b/configure.ac @@ -129,6 +129,7 @@ AC_SUBST([as_has_debug_prefix_map]) AC_SUBST([with_debugger]) # TODO: rename this variable AC_SUBST([with_camltex]) AC_SUBST([ocamldoc]) +AC_SUBST([ocamltest]) AC_SUBST([pthread_link]) AC_SUBST([x_includes]) AC_SUBST([x_libraries]) @@ -276,6 +277,10 @@ AC_ARG_ENABLE([ocamldoc], [], [ocamldoc=auto]) +AC_ARG_ENABLE([ocamltest], + [AS_HELP_STRING([--disable-ocamltest], + [do not build the ocamltest driver])]) + AC_ARG_ENABLE([frame-pointers], [AS_HELP_STRING([--enable-frame-pointers], [use frame pointers in runtime and generated code])]) @@ -1675,6 +1680,10 @@ AS_IF([test x"$enable_ocamldoc" = "xno"], [ocamldoc=""], [ocamldoc=ocamldoc]) +AS_IF([test x"$enable_ocamltest" = "xno"], + [ocamltest=""], + [ocamltest=ocamltest]) + AS_IF([test x"$enable_flambda" = "xyes"], [flambda=true AS_IF([test x"$enable_flambda_invariants" = "xyes"], From fd6c0e3a03f50c485e800df9d04f63fe54e8ac87 Mon Sep 17 00:00:00 2001 From: David Allsopp Date: Thu, 13 Feb 2020 16:53:07 +0000 Subject: [PATCH 2/2] Don't built ocamltest on release builds --enable-ocamltest is paranoidly included in the CI scripts, although the trees are never pushed with a release VERSION at the tip. --- Changes | 3 ++- configure | 11 ++++++----- configure.ac | 6 +++--- tools/ci/appveyor/appveyor_build.sh | 2 +- tools/ci/inria/bootstrap | 2 +- tools/ci/inria/main | 2 +- tools/ci/travis/travis-ci.sh | 2 ++ 7 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Changes b/Changes index 00983268b219..1937421a7ffe 100644 --- a/Changes +++ b/Changes @@ -194,7 +194,8 @@ Working version ### Build system: -- #9250: Add --disable-ocamltest to configure +- #9250: Add --disable-ocamltest to configure and disable building for + non-development builds. (David Allsopp, review by Sébastien Hinderer) ### Bug fixes: diff --git a/configure b/configure index 67284fdb7a5e..62e49b7993e4 100755 --- a/configure +++ b/configure @@ -16661,11 +16661,12 @@ else ocamldoc=ocamldoc fi -if test x"$enable_ocamltest" = "xno"; then : - ocamltest="" -else - ocamltest=ocamltest -fi +case $enable_ocamltest,4.11.0+dev0-2019-10-18 in #( + yes,*|,*+dev*) : + ocamltest='ocamltest' ;; #( + *) : + ocamltest='' ;; +esac if test x"$enable_flambda" = "xyes"; then : flambda=true diff --git a/configure.ac b/configure.ac index 1cc6cb022867..4fd6346173f9 100644 --- a/configure.ac +++ b/configure.ac @@ -1680,9 +1680,9 @@ AS_IF([test x"$enable_ocamldoc" = "xno"], [ocamldoc=""], [ocamldoc=ocamldoc]) -AS_IF([test x"$enable_ocamltest" = "xno"], - [ocamltest=""], - [ocamltest=ocamltest]) +AS_CASE([$enable_ocamltest,AC_PACKAGE_VERSION], + [yes,*|,*+dev*],[ocamltest='ocamltest'], + [ocamltest='']) AS_IF([test x"$enable_flambda" = "xyes"], [flambda=true diff --git a/tools/ci/appveyor/appveyor_build.sh b/tools/ci/appveyor/appveyor_build.sh index 16f00ac4d8ee..5f5bdbf8654a 100644 --- a/tools/ci/appveyor/appveyor_build.sh +++ b/tools/ci/appveyor/appveyor_build.sh @@ -56,7 +56,7 @@ function set_configuration { ;; esac - ./configure $build $host --prefix="$2" + ./configure $build $host --prefix="$2" --enable-ocamltest FILE=$(pwd | cygpath -f - -m)/Makefile.config echo "Edit $FILE to turn C compiler warnings into errors" diff --git a/tools/ci/inria/bootstrap b/tools/ci/inria/bootstrap index a33b6b3a7fcb..6e993a1453e0 100755 --- a/tools/ci/inria/bootstrap +++ b/tools/ci/inria/bootstrap @@ -125,7 +125,7 @@ set -ex # default values make=make instdir="$HOME/ocaml-tmp-install" -confoptions="${OCAML_CONFIGURE_OPTIONS}" +confoptions="--enable-ocamltest ${OCAML_CONFIGURE_OPTIONS}" make_native=true cleanup=false check_make_alldepend=false diff --git a/tools/ci/inria/main b/tools/ci/inria/main index ca190321ba68..99fb466761bb 100755 --- a/tools/ci/inria/main +++ b/tools/ci/inria/main @@ -125,7 +125,7 @@ host='' conffile=Makefile.config make=make instdir="$HOME/ocaml-tmp-install" -confoptions="${OCAML_CONFIGURE_OPTIONS}" +confoptions="--enable-ocamltest ${OCAML_CONFIGURE_OPTIONS}" make_native=true cleanup=false check_make_alldepend=false diff --git a/tools/ci/travis/travis-ci.sh b/tools/ci/travis/travis-ci.sh index a22c3dc7fe25..0d51ff95ea36 100755 --- a/tools/ci/travis/travis-ci.sh +++ b/tools/ci/travis/travis-ci.sh @@ -102,11 +102,13 @@ EOF --disable-bigarray-lib \ --disable-ocamldoc \ --disable-native-compiler \ + --enable-ocamltest \ $CONFIG_ARG" else configure_flags="\ --prefix=$PREFIX \ --enable-flambda-invariants \ + --enable-ocamltest \ $CONFIG_ARG" fi case $XARCH in