9838412 PR#6300: ocamlbuild -use-ocamlfind conflicts with -ocamlc

Authored and Committed by Gabriel Scherer 9 years ago
    PR#6300: ocamlbuild -use-ocamlfind conflicts with -ocamlc
    
    Note: there is a known issue with how -use-ocamlfind work: its
    semantics is to change the compilation commands (ocamlc etc.) during
    the option initialisation phase. This new change make it still take
    into account changes to the command that would have been requested by
    the user at option time (-ocamlc ...) or before (Before_option
    dispatch in a plugin). But if you only activate use_ocamlfind after
    the options (After_option dispatch), the command will not be changed,
    but the "-package ..." ocamlfind-specific flags will still be passed
    at compiler invocation.
    In other words, use-ocamlfind must always be set *strictly* before
    After_options (in a plugin or through the command-line), otherwise
    weird stuff happens.
    
    This glitch would be fixable in this commit (by moving
    ocamlfind-command-initialization after After_options), but doing so
    could have bad backward-compatibility consequences: current users may
    very-well work-around PR#6300 by manually setting the command
    (eg. Options.ocamlc := "ocamlfind ocamlcp") at After_options
    dispatch. If we moved ocamlfind's initialization after After_options,
    plugins using this manual workaround would stop doing what the users
    expect (the ocaml command would become "ocamlfind ocamlfind ocamlcp"
    in this example: not cool).
    
    git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.02@15114 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
    
        
file modified
+2 -0
file modified
+21 -6