From 65908e7ca34031e81f438b5ec595a8fb726dd22f Mon Sep 17 00:00:00 2001 From: Nicolas Berthier Date: Mon, 21 Sep 2015 18:53:52 +0200 Subject: [PATCH] New configure script options to enable/disable byte/native targets --- Makefile | 4 +--- config.in | 2 +- configure | 25 +++++++++++++++++++++++++ configure.in | 12 ++++++++++++ 4 files changed, 39 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index b67fc2e..d25fae0 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ include config -.PHONY: all install +.PHONY: all install uninstall clean all: (cd compiler/; $(MAKE)) @@ -9,12 +9,10 @@ all: install: (cd compiler; $(MAKE) install) (cd lib; $(MAKE) install) - $(INSTALL) tools/$(BZREAX) $(INSTALL_BINDIR) uninstall: (cd compiler; $(MAKE) uninstall) (cd lib; $(MAKE) uninstall) - $(RM) $(INSTALL_BINDIR)/$(BZREAX) clean: (cd compiler; $(MAKE) clean) diff --git a/config.in b/config.in index cb74631..c552fb4 100644 --- a/config.in +++ b/config.in @@ -21,6 +21,6 @@ STDLIB_DIR=@stdlib_dir@ OCAMLBUILD=STDLIB=$(STDLIB_DIR) @OCAMLBUILD@ -use-ocamlfind -TARGET=byte +TARGET=@targets@ ENABLE_SIMULATOR=@enable_simulator@ ENABLE_CTRL2EPT_TRANSLATOR=@enable_ctrl2ept@ diff --git a/configure b/configure index e47b83d..fffa2f2 100755 --- a/configure +++ b/configure @@ -585,6 +585,7 @@ ac_subst_vars='ctrln_pp package_reatk_ctrlNbac LTLIBOBJS LIBOBJS +targets enable_ctrl2ept enable_simulator stdlib_dir @@ -666,6 +667,8 @@ enable_option_checking enable_simulator enable_local_stdlib enable_ctrl2ept +enable_native +enable_byte ' ac_precious_vars='build_alias host_alias @@ -1282,6 +1285,8 @@ Optional Features: --enable-simulator enable the graphical simulator --enable-local-stdlib use the in-sources standard library --enable-ctrl2ept enable the Controllable-Nbac entity translator + --enable-native build native executables + --enable-byte build bytecode executables Report bugs to the package provider. _ACEOF @@ -1891,6 +1896,22 @@ else fi +# Check whether --enable-native was given. +if test "${enable_native+set}" = set; then : + enableval=$enable_native; +else + enable_native=no +fi + + +# Check whether --enable-byte was given. +if test "${enable_byte+set}" = set; then : + enableval=$enable_byte; +else + enable_byte=no +fi + + # 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. @@ -4027,6 +4048,10 @@ else stdlib_dir=$libdir/heptagon fi +if test "$enable_byte" = "yes"; then targets="byte"; fi; +if test "$enable_native" = "yes"; then targets="$targets native"; fi; +if test "x$targets" = "x"; then targets="byte"; fi; + diff --git a/configure.in b/configure.in index 0f458b1..6960eb6 100644 --- a/configure.in +++ b/configure.in @@ -16,6 +16,14 @@ AC_ARG_ENABLE(ctrl2ept, [ --enable-ctrl2ept enable the Controllable-Nbac entity translator],, enable_ctrl2ept=yes) +AC_ARG_ENABLE(native, + [ --enable-native build native executables],, + enable_native=no) + +AC_ARG_ENABLE(byte, + [ --enable-byte build bytecode executables],, + enable_byte=no) + AC_PROG_OCAML if test "$OCAMLC" = "no"; then AC_MSG_ERROR([Please install the OCaml compiler]) @@ -81,6 +89,9 @@ else stdlib_dir=$libdir/heptagon fi +if test "$enable_byte" = "yes"; then targets="byte"; fi; +if test "$enable_native" = "yes"; then targets="$targets native"; fi; +if test "x$targets" = "x"; then targets="byte"; fi; AC_SUBST(INSTALL) AC_SUBST(RM) @@ -88,6 +99,7 @@ AC_SUBST(stdlib_dir) AC_SUBST(enable_simulator) AC_SUBST(enable_ctrl2ept) +AC_SUBST(targets) AC_OUTPUT(config)