The trick is that if you're using configure and you don't want to have SDL_config.h and SDL_revision.h to show up as modified, you need to configure and build from a separate directory. You also need to include SDL_revision.h directly if you want to use the SDL_REVISION constant, as a side effect of these changes. --HG-- rename : include/SDL_config.h.default => include/SDL_config.h
18 lines
405 B
Bash
Executable file
18 lines
405 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# Generate a header file with the current source revision
|
|
|
|
outdir=`pwd`
|
|
cd `dirname $0`
|
|
srcdir=..
|
|
header=$outdir/include/SDL_revision.h
|
|
|
|
rev=`sh showrev.sh`
|
|
if [ "$rev" != "" -a "$rev" != "hg-0:baadf00d" ]; then
|
|
echo "#define SDL_REVISION \"$rev\"" >$header.new
|
|
if diff $header $header.new >/dev/null 2>&1; then
|
|
rm $header.new
|
|
else
|
|
mv $header.new $header
|
|
fi
|
|
fi
|