If you want to do this rigorously you need to phrase the question more carefully. Assuming we can neglect friction it's possible to move the bookcase with an arbitrarily small amount of work because you can apply a small force for a short time to accelerate the bookcase then wait for it to move into place. So if you're prepared to wait a long enough time you can move the bookcase with as small a force as you want.
I'd guess you're really asking something like: if I want to move the bookcase in a set time $t$ by first pushing to accelerate it then pushing to slow it down again, is the force bigger if I slide it or if I rotate it?

Start by sliding the bookcase. You need to apply a force F until the bookcase has moved a distance $w/2$ then apply the same force in the other direction to slow it again, and you want to do this in some set time $\tau$. The equation you need is:
$$ s = \frac{1}{2}at^2 $$
$a$ is the acceleration, which is $F/m$, $s$ is the distance moved and $t$ is the time taken. If you just consider the first half of the move, i.e. moving the bookcase a distance $w/2$ in a time $\tau/2$ then we can put these values in the above equation to get:
$$ \frac{w}{2} = \frac{1}{2} \frac{F}{m} \frac{\tau^2}{4} $$
and a quick rearrangement tells us that the force $F$ is given by:
$$ F_{slide} = 4 \frac{mw}{\tau^2} $$
Working out the force involved in rotation is pretty similar, except that the equation we need is now:
$$ \theta = \frac{1}{2}\frac{T}{I}t^2 $$
where $\theta$ is the angle moved, $T$ is the torque and $I$ is the moment of inertia. As above we take the first half of the rotation i.e. rotate the bookcase an angle $\pi/2$ in a time $\tau/2$. You also need to know that torque is force times distance from the hinge i.e. $T = Fw$, and the moment of inertia of slab of width $w$ hinged about the edge is $I = mw^2/3$. So substitute all of this in our equation and we get:
$$ \frac{\pi}{2} = \frac{1}{2} \frac{Fw}{mw^2/3} \frac{\tau^2}{4} $$
and rearranging this gives:
$$ F_{rot} = \frac{4\pi}{3}\frac{mw}{\tau^2} $$
Lets take the ratio $F_{rot}/F_{slide}$:
$$ F_{rot}/F_{slide} = \frac{\pi}{3} $$
So the answer is that the force needed to rotate the bookcase is higher than the force needed to slide it by a factor of $\pi/3$.
BUT
All this is dependant on a specific model of how you move the bookcase, I've ignored friction, and in any case the factor of $\pi/3$ is pretty close to unity. I think all we can really say is that it probably doesn't make much difference whether you slide or rotate the bookcase.