Hook two computers to one speaker?
A single device outputting to multiple devices seems to work OK. It changes the electrical characteristics (impedence changes, but the tolerance of most devices is actually quite wide) and could theoretically cause damage, but has always worked fine for me.
However, multiple devices outputting to a single device is different. That's a situation where you're most likely to damage something. It might work fine, it might not. It might appear to work fine while slowly damaging components too.
Do you intend on running both sources at the same time? If so, you really should use a mixer. If not, then a simple switch box is the best way to go.
A solution that bypasses this problem (assuming the jacks are free) is to plug Computer A's line out into Computer B's line in, and then Computer B's line out into the speakers; this requires Computer B to be on for either to produce sound, but shouldn't damage any hardware.