The problem is we can’t check any generated files into Mercurial.
So, if we check SDL_config.h in with your proposed change, then every time it’s generated it’ll be listed as changed and will undoubtedly be accidentally checked in with generated changes.
If we don’t generate SDL_config.h, then we need some way to tell that a file generated by configure should be included instead of the default options.
I’m open to suggestions…
I’m not sure I understand the precise circumstances, but you can certainly check generated
files into a repository.
The “conventional” way to build things is wrong. The correct way to build things
mandates that the repository and all files and directories therein are read only.
If you’re doing an “in-place” build, then the only correct way to make it happen
requires copying the repository as a first step.
In that case clobbering file in the repository with a generated one during the build
has no effect.
All major systems follow read-only repository model. It is also the only way
to build separate models simultaneously, for example a debug version
and a release version.
Ideally your build procedure is set up to avoid copying, for example by ensuring
complete separation of temporary files and outputs from inputs on the command lines
of all commands. eg you must use
gcc -c $REPO/src/xx.c -o $BUILDDIR/lib/x.o
etc etc. The proper way to build has a golden rule: the current directly must NEVER
be used for anything explicitly. (Recursive make is evil stupidity and should not be used
This model also supports cross compilation, for example building windows executables on
Linux. Or in the gaming environment building for multiple game devices from a large
development machine with cross compilers.
Anyhow the easiest fix for an evil “in place” build model is to copy the whole repository
(excluding .svn files etc) to a nominated or defaulted location, cd into that, and then
proceed to build “as normal”. It’s easy to modify the config script to accept an option
which allows to specify the directory, or to calculate the build directory name from
parameters (such as platform name, debug options, etc). Or both.
If you actually WANT to then commit a generated file back to the repository you can
copy it back from the build to the repo image and then commit. It can’t happen by default,
which is what you want.
This is also vital for documentation where you have, say, doc.tex source and want
to also include doc.pdf and doc.html in the repo, which are generated, because not
all developers have the tools to generate these files.On 16/02/2011, at 2:17 PM, Sam Lantinga wrote:
–
john skaller
@john_skaller