It is impossible to base the progress bar on the needed time (since a source file of 2x the size doesn't necessarily need 2x the time to compile), but you can base it on the number of source files already compiled. Just compile a certain file and advance the bar by one.
However, _do not_ do this! Unix users want to have a standardized process when building and installing a software package (i.e. doing a 'configure; make; make install'), it's more important than knowing when it will have finished (it will have finished, when it will have finished
, a progress bar doesn't make it faster). A real Unix user wouldn't even see the progress bar since they do something else in this time.
This is probably one of the main differences between Windows and Unix users: Windows users want a colored surface with everything moving every second, while Unix users want standardized and working programs.