  The paper treats the problem of optimal distributed control of a
Cahn-Hilliard-Oono system in $\mathbb{R}^d$, $1\leq d\leq 3$, with the control
located in the mass term and admitting general potentials that include both the
case of a regular potential and the case of some singular potential. The first
part of the paper is concerned with the dependence of the phase variable on the
control variable. In the case of a logarithmic potential, we need to prove an
ad hoc strict separation property, and for this reason we have to restrict
ourselves to the case $d = 2$. In the rest of the work, we study the necessary
first-order optimality conditions, which are proved under suitable
compatibility conditions on the initial datum of the phase variable and the
time derivative of the control, at least in case of potentials having unbounded
domain.
  PLEASE NOTE: A revised version of this paper has been published in Discrete
Contin. Dyn. Syst. Ser. S 15 (2022), 2135-2172: the authors point out that both
the published version and the arXiv preprint contain a trivial mistake in
formula (2.21), which leads to suitable changes in the assumption (2.10) and in
some occurrences of it. Namely, (2.21) and (2.10) become $ \bar \varphi(t) =
\bar \varphi_0 e^{-t} + \int_0^t e^{-(t-s)} \bar u(s) \, ds$ for every
$t\in[0,T]$, and $-M - (\bar\varphi_0)^- , M + (\bar\varphi_0)^+$ belong to the
interior of $D(\beta)$, respectively. The formula just after (2.21) becomes $-M
- (\bar\varphi_0)^- \leq \bar \varphi(t) \leq M + (\bar\varphi_0)^+$ and a
similar change must be done in (4.20). The first line of (2.24) is now implied
by the new (2.21). Next, (2.39) becomes $-(M+ R) - (\bar\varphi_0)^- , (M+ R) +
(\bar\varphi_0)^+$ belong to the interior of $D(\beta)$. Similar changes must
be done in the interval written just two lines before (4.18) and in (4.18)
itself.
