From 633e40b6f925556e94347c348a2804cdc1068d88 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Wed, 8 Mar 2017 14:26:00 +0100 Subject: [camlpX] Enrico's changes to camlp4 removal. This removes some remaining support for camlp4 in the infrastructure and documents the change. --- CHANGES | 4 ++++ INSTALL | 12 +++++------- Makefile.build | 44 +++++--------------------------------------- Makefile.dev | 21 --------------------- configure.ml | 14 +++----------- tools/coq_makefile.ml | 6 +----- tools/coqmktop.ml | 13 ++----------- 7 files changed, 20 insertions(+), 94 deletions(-) diff --git a/CHANGES b/CHANGES index 240d71ec04..3b4d265988 100644 --- a/CHANGES +++ b/CHANGES @@ -26,6 +26,10 @@ Plugins - The mathematical proof language (also known as declarative mode) was removed. +Dependencies + +- Support for camlp4 has been removed. + Changes from V8.6beta1 to V8.6 ============================== diff --git a/INSTALL b/INSTALL index 9454bba4ab..6b49738b83 100644 --- a/INSTALL +++ b/INSTALL @@ -39,8 +39,7 @@ WHAT DO YOU NEED ? probably available in your distribution and for sure at http://projects.camlcity.org/projects/findlib.html) - - Camlp5 (version >= 6.02) (Coq compiles with Camlp4 but might be - less well supported) + - Camlp5 (version >= 6.02) - GNU Make version 3.81 or later @@ -74,11 +73,10 @@ INSTALLATION PROCEDURE IN DETAILS (NORMAL USERS). bigger), you will also need the "ocamlopt" (or its native code version "ocamlopt.opt") command. -2- Check that you have Camlp5 (or a supported Camlp4) installed on your - computer and that the command "camlp5" lies in a directory which - is present in your $PATH environment variable path. - (You need Camlp5/4 in both bytecode and native versions if - your platform supports it). +2- Check that you have Camlp5 installed on your computer and that the + command "camlp5" lies in a directory which is present in your $PATH + environment variable path. (You need Camlp5 in both bytecode and + native versions if your platform supports it). 3- The uncompression and un-tarring of the distribution file gave birth to a directory named "coq-8.xx". You can rename this directory and put diff --git a/Makefile.build b/Makefile.build index eeb648ba1e..56f1fb8b49 100644 --- a/Makefile.build +++ b/Makefile.build @@ -146,14 +146,10 @@ $(OCAMLOPT) $(MLINCLUDES) $(OPTFLAGS) $(LINKMETADATA) -o $@ $(1) $(addsuffix .cm $(OCAMLC) $(MLINCLUDES) $(BYTEFLAGS) $(CUSTOM) -o $@ $(1) $(addsuffix .cma,$(2)) $^) endef -# Camlp4 / Camlp5 settings +# Camlp5 settings CAMLP4DEPS:=grammar/compat5.cmo grammar/grammar.cma -ifeq ($(CAMLP4),camlp5) CAMLP4USE=pa_extend.cmo q_MLast.cmo pa_macro.cmo -D$(CAMLVERSION) -else -CAMLP4USE=-D$(CAMLVERSION) -endif PR_O := $(if $(READABLE_ML4),pr_o.cmo,pr_dump.cmo) @@ -162,11 +158,7 @@ SYSCMA:=$(addsuffix .cma,$(SYSMOD)) SYSCMXA:=$(addsuffix .cmxa,$(SYSMOD)) # We do not repeat the dependencies already in SYSMOD here -ifeq ($(CAMLP4),camlp5) P4CMA:=gramlib.cma -else -P4CMA:=camlp4lib.cma -endif ########################################################################### # Infrastructure for the rest of the Makefile @@ -242,26 +234,6 @@ kernel/copcodes.ml: kernel/byterun/coq_instruct.h $(SHOW)'CCDEP $<' $(HIDE)$(OCAMLC) -ccopt "-MM -MQ $@ -MQ $(<:.c=.o) -isystem $(CAMLHLIB)" $< $(TOTARGET) -########################################################################### -### Special rules (Camlp5 / Camlp4) -########################################################################### - -# Special rule for the compatibility-with-camlp5 extension for camlp4 -# -# - grammar/compat5.cmo changes 'GEXTEND' into 'EXTEND'. Safe, always loaded -# - grammar/compat5b.cmo changes 'EXTEND' into 'EXTEND Gram'. Interact badly with -# syntax such that 'VERNAC EXTEND', we only load it in grammar/ - -ifeq ($(CAMLP4),camlp4) -grammar/compat5.cmo: grammar/compat5.mlp - $(OCAMLC) -c -I $(MYCAMLP4LIB) -pp '$(CAMLP4O) -I $(MYCAMLP4LIB) -impl' -impl $< -grammar/compat5b.cmo: grammar/compat5b.mlp - $(OCAMLC) -c -I $(MYCAMLP4LIB) -pp '$(CAMLP4O) -I $(MYCAMLP4LIB) -impl' -impl $< -else -grammar/compat5.cmo: grammar/compat5.ml - $(OCAMLC) -c $< -endif - ########################################################################### # grammar/grammar.cma ########################################################################### @@ -299,15 +271,9 @@ grammar/grammar.cma : $(GRAMCMO) ## Support of Camlp5 and Camlp5 -ifeq ($(CAMLP4),camlp4) - COMPATCMO:=grammar/compat5.cmo grammar/compat5b.cmo - GRAMP4USE:=$(COMPATCMO) -D$(CAMLVERSION) - GRAMPP:=$(CAMLP4O) -I $(MYCAMLP4LIB) $(GRAMP4USE) $(CAMLP4COMPAT) -impl -else - COMPATCMO:= - GRAMP4USE:=$(COMPATCMO) pa_extend.cmo q_MLast.cmo pa_macro.cmo -D$(CAMLVERSION) - GRAMPP:=$(CAMLP4O) -I $(MYCAMLP4LIB) $(GRAMP4USE) $(CAMLP4COMPAT) -impl -endif +COMPATCMO:= +GRAMP4USE:=$(COMPATCMO) pa_extend.cmo q_MLast.cmo pa_macro.cmo -D$(CAMLVERSION) +GRAMPP:=$(CAMLP4O) -I $(MYCAMLP4LIB) $(GRAMP4USE) $(CAMLP4COMPAT) -impl ## Rules for standard .mlp and .mli files in grammar/ @@ -597,7 +563,7 @@ plugins/%.cmx: plugins/%.ml $(HIDE)$(OCAMLLEX) -o $@ "$*.mll" %.ml: %.ml4 $(CAMLP4DEPS) - $(SHOW)'CAMLP4O $<' + $(SHOW)'CAMLP5O $<' $(HIDE)$(CAMLP4O) -I $(MYCAMLP4LIB) $(PR_O) \ $(CAMLP4DEPS) $(CAMLP4USE) $(CAMLP4COMPAT) -impl $< -o $@ diff --git a/Makefile.dev b/Makefile.dev index ea6b8b9194..5931e46dd0 100644 --- a/Makefile.dev +++ b/Makefile.dev @@ -20,13 +20,8 @@ DEBUGPRINTERS:=dev/top_printers.cmo dev/vm_printers.cmo devel: printers printers: $(CORECMA) $(DEBUGPRINTERS) dev/camlp4.dbg -ifeq ($(CAMLP4),camlp5) dev/camlp4.dbg: echo "load_printer gramlib.cma" > $@ -else -dev/camlp4.dbg: - echo "load_printer camlp4lib.cma" > $@ -endif ############ # revision @@ -199,22 +194,6 @@ ltac: $(LTACVO) $(LTACCMO) .PHONY: omega micromega setoid_ring nsatz extraction .PHONY: fourier funind cc rtauto btauto ltac -################################# -### Misc other development rules -################################# - -# NOTA : otags only accepts camlp4 as preprocessor, so the following rule -# won't build tags of .ml4 when compiling with camlp5 - -otags: - otags $(MLIFILES) $(filter-out configure.ml, $(MLSTATICFILES)) \ - $(if $(filter camlp5,$(CAMLP4)), , \ - -pa op -pa g -pa m -pa rq $(addprefix -pa , $(CAMLP4DEPS)) \ - $(addprefix -impl , $(ML4FILES))) - -.PHONY: otags - - # For emacs: # Local Variables: # mode: makefile diff --git a/configure.ml b/configure.ml index cc63fde702..befd67262c 100644 --- a/configure.ml +++ b/configure.ml @@ -251,7 +251,6 @@ module Prefs = struct let coqdocdir = ref (None : string option) let ocamlfindcmd = ref (None : string option) let lablgtkdir = ref (None : string option) - let usecamlp5 = ref true let camlp5dir = ref (None : string option) let arch = ref (None : string option) let natdynlink = ref true @@ -311,9 +310,9 @@ let args_options = Arg.align [ "-lablgtkdir", arg_string_option Prefs.lablgtkdir, "