Why not take the suggestion of Gerd Stolpmann and declare
let ( = ) x y = Pervasives.compare
x y = 0
at the beginning of your files ?
Because it fails on functions (if functions are the same, it returns true, otherwise it raises an exception...
# let f x y = x + y;;
val f : int -> int -> int = <fun>
# compare f f;;
- : int = 0
# compare (f 0) (f 0);;
Exception: Invalid_argument "equal: functional value".