Can't believe this is still going... I cannot recall ever trying to create a square wave by summing sine waves except as a mathematical exercise (but admit I have done that fairly often as it is a nice way to show what comprises a square wave). A switch (between two levels) or clamp (diodes or otherwise, overdriven by a sine wave) is the usual "analog" way, a DAC will generate it directly by switching between two specified levels. The result is not (ever) a "perfect" square wave but can get pretty close. The square wave that results will, when analyzed using Fourier, show tones in the usual odd progression decreasing as 1/N for N = 1, 3, 5, 7,... just like the theory shows. A real "square wave" will have additional even-order components, and the odd components may not be "perfect", since you can't generate an ideal square wave in the real world (the edges are not perfectly sharp). That does not invalidate Fourier analysis. Make a square wave however you like, then use Fourier to analyze the frequencies comprising it. Or a sine wave, triangle wave, or anything else. That is one way of determining the "goodness" of a square (or any) wave, do Fourier and see how many "other" frequencies than the ideal ones you expect are in there.
For example, an ideal triangle wave is discontinuous at the top and bottom, but in the real world those sharp peaks will be rounded off because it does not have infinite bandwidth, and Fourier analysis will show that. (A triangle wave is mathematically the integral of a square wave, and in practice that is one way to create one, others being things like a switch and a current source or two into a capacitor.) Similarly, a real sine wave will not be a single tone but have (hopefully) small other frequencies present, because creating a "perfect" sine wave is impractical (again we can get awfully close!)
As mentioned above, for real-world calculations the Fourier series will be limited, but in practice it rarely matters a you can get "close enough". If sampled, you need a long enough record to capture the "flat-top" behavior (you will get the DC term regardless) and enough time resolution to capture the edges (usual Nyquist criteria for a sampled system, >2x the highest frequency). For a DAC that means twice the bandwidth of the output anti-imaging filter, which suppresses higher frequencies in normal operation, so there is no need for "infinite" bandwidth because the real signal is not that wideband. At the other end (low frequencies), at 44.1 kS/s just 44,100 samples is 1 second's worth of data to capture down to 1 Hz, and FFTs are routinely a million points or so in test systems to capture sub-Hz signals.
Whatever - Don