WTF SDL_revision.h?

Just used tortoisesvn to down load the SDL source code and when I
compile I find that SDL_revision.h is not there? It isn’t in svn at
all. I searched on the web and found that this is a common problem on
windowsand has been for a while. OTOH, when I checked in my linux
sources it was there, but it had a very old value.

I get the feeling this is an automagically created file. Anyone want
to clue me in on the official way it is supposed to be created?

Bob Pendleton±----------------------------------------------------------

Hello !

Just used tortoisesvn to down load the SDL source code and when I
compile I find that SDL_revision.h is not there? It isn’t in svn at
all. I searched on the web and found that this is a common problem on
windowsand has been for a while. OTOH, when I checked in my linux
sources it was there, but it had a very old value.

I get the feeling this is an automagically created file. Anyone want
to clue me in on the official way it is supposed to be created?

Please look at :

http://www.libsdl.org/cgi/viewvc.cgi/trunk/SDL/build-scripts/updaterev.sh?revision=4338&view=markup

This is called in the Makefile.

CU

Hello !

Just used tortoisesvn to down load the SDL source code and when I
compile I find that SDL_revision.h is not there? It isn’t in svn at
all. I searched on the web and found that this is a common problem on
windowsand has been for a while. OTOH, when I checked in my linux
sources it was there, but it had a very old value.

I get the feeling this is an automagically created file. Anyone want
to clue me in on the official way it is supposed to be created?

Please look at :

http://www.libsdl.org/cgi/viewvc.cgi/trunk/SDL/build-scripts/updaterev.sh?revision=4338&view=markup

This is called in the Makefile.

Which never gets used if you are using VC. How is this supposed to get
happen under windows?

Bob PendletonOn Thu, Sep 17, 2009 at 6:08 PM, Torsten Giebl wrote:

CU


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------

2009/9/17 Bob Pendleton :

Just used tortoisesvn to down load the SDL source code and when I
compile I find that SDL_revision.h is not there? It isn’t in svn at
all. I searched on the web and found that this is a common problem on
windowsand has been for a while. OTOH, when I checked in my linux
sources it was there, but it had a very old value.

I get the feeling this is an automagically created file. Anyone want
to clue me in on the official way it is supposed to be created?

Bob Pendleton

If you don’t want to use autogen, you can make it yourself.

All it contains is
#define SDL_REVISION 4707
where 4707 is the SVN revision.

You may also need to create a SDL_config.h file. If compiling on windows, I use
#include “SDL_config_win32.h”

No “generate_sdl_revision_h.bat”? It seems that this is a common
enough complaint that we should fix it.

Jonny DOn Thu, Sep 17, 2009 at 7:38 PM, Kenneth Bull wrote:

2009/9/17 Bob Pendleton :

Just used tortoisesvn to down load the SDL source code and when I
compile I find that SDL_revision.h is not there? It isn’t in svn at
all. I searched on the web and found that this is a common problem on
windowsand has been for a while. OTOH, when I checked in my linux
sources it was there, but it had a very old value.

I get the feeling this is an automagically created file. Anyone want
to clue me in on the official way it is supposed to be created?

Bob Pendleton

If you don’t want to use autogen, you can make it yourself.

All it contains is
#define SDL_REVISION 4707
where 4707 is the SVN revision.

You may also need to create a SDL_config.h file. ?If compiling on windows, I use
#include “SDL_config_win32.h”


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Agreed. I’ve seen this one pop up on here enough times that I was
really surprised to see that Bob didn’t already know about it.

But… can you actually generate a new file from a .bat? If there’s
a way to do that, I’d like to add it to my bag of tricks.>----- Original Message ----

From: Jonathan Dearborn
Subject: Re: [SDL] WTF SDL_revision.h?

No “generate_sdl_revision_h.bat”? It seems that this is a common
enough complaint that we should fix it.

Jonny D

But… can you actually generate a new file from a .bat? If there’s
a way to do that, I’d like to add it to my bag of tricks.

Uh. What’s wrong with this?

echo #define SDL_REVISION 4707 > SDL_revision.h

It’s been a long time since I’ve done any batch programming, but ISTR
that we did things like that all the time.

(The really painful thing to do in batch files was creating files
without a trailing newline. Pulling that off required some real
ugliness.)

b

Agreed. ?I’ve seen this one pop up on here enough times that I was
really surprised to see that Bob didn’t already know about it.

Up until today I haven’t done anything with SDL on Windows. Linux I do
for fun, Windows I do for pay. No body pays me to do SDL work on
Windows.

Bob PendletonOn Thu, Sep 17, 2009 at 6:46 PM, Mason Wheeler wrote:

But… can you actually generate a new file from a .bat? ?If there’s
a way to do that, I’d like to add it to my bag of tricks.

----- Original Message ----
From: Jonathan Dearborn
Subject: Re: [SDL] WTF SDL_revision.h?

No “generate_sdl_revision_h.bat”? ?It seems that this is a common
enough complaint that we should fix it.

Jonny D


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


±----------------------------------------------------------

If SVN can recognize magic variables in files and automatically update
your working copy of a file to reflect proper variable substitution
(like $Id:$ in CVS) then there can simply be an SDL_revision.h file
and no need to generate it as part of the build process.

If not, a command-line solution must exist, but on Windows there is no
standard “svn” command invocation, it varies widely between Subversion
clients. At the very least, maybe a batch file could take a few stabs,
and failing the automated road, prompt the user for a value.On Thu, Sep 17, 2009 at 8:16 PM, Brian Raiter wrote:

But… can you actually generate a new file from a .bat? ?If there’s
a way to do that, I’d like to add it to my bag of tricks.

Uh. What’s wrong with this?

?echo #define SDL_REVISION 4707 > SDL_revision.h

It’s been a long time since I’ve done any batch programming, but ISTR
that we did things like that all the time.

(The really painful thing to do in batch files was creating files
without a trailing newline. Pulling that off required some real
ugliness.)

b


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


http://codebad.com/

If SVN can recognize magic variables in files and automatically update
your working copy of a file to reflect proper variable substitution
(like $Id:$ in CVS) then there can simply be an SDL_revision.h file
and no need to generate it as part of the build process.

Subversion doesn’t have this. You have to use “svnversion” from the
command line to get the global revision number.

http://subversion.tigris.org/faq.html#version-value-in-source

–ryan.