Turnpike theorems deal with the optimality of trajectories reaching asingular solution, in calculus of variations oroptimal control problems.For scalar calculus of variations problems in infinite horizon, linear withrespect to the derivative, we use the theory of viscosity solutions ofHamilton-Jacobi equations to obtain a unique characterization of the valuefunction.With this approach, we extend for the scalar case the classical result based onGreen theorem, when there is uniqueness of the singular solution.We provide a new necessary and sufficient condition for turnpikeoptimality, even in the presence of multiple singular solutions.