09-08-2005, 02:45 AM,
|
|
thelusiv
Administrator
![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png)
|
Posts: 2,346
Threads: 223
Joined: Jun 2005
|
|
Autotools vs SCons configure/build system
I started reading through the docs for autotools and found them rather nasty. It was really tough to figure out where to start with it, so I started asking around for help. Many of my friends recommended dumping autotools in favor of a more straightforward configure/build system, downloads page...Now, once you have SCons and Python, and have checked out the SCons tree, build VDrift thus:<pre>cd vdrift-sconsscons </pre>To see optional components type<pre>scons -h </pre>This will list the only option I've configured so far, fmod. To compile with fmod:<pre>scons fmod=1 </pre>The default is to compile with openal. Sadly, I haven't worked all the bugs out yet, and compiling with openal fails for me. This will be fixed soon (in fact, I'm hoping Joe will take a look at it for me and tell me what I've botched :wink ![Smile Smile](https://www.vdrift.net/Forum/images/smilies/smile.gif) .So far, I really like SCons. It has a lot of things going for it - it seems faster, it doesn't involve cryptic M4 macros or shell scripts, no need even for a separate configure script and Makefile, it wraps it all up into one file ("SConstruct", and in the subdirectories "SConscript") - which drastically reduces clutter in the root directory of the VDrift tree. It has as much flexibility as the Python programming language. In only a few hours I set up what we already have (a configure + build system with an optional library). I even improved on it slightly - now everything under src/vamos/ is compiled as a library that is linked with vdrift when it gets compiled. Best of all it seems easy to work with. I don't think it will be very hard to adapt the build system for other libraries or options in the future, namely setting up install targets.So, if all of you who usually follow the latest in the SVN tree could check this out and try it, and please let me know what you think. This may become VDrift's permanent configure/build system if it works OK for everyone.
|
|
09-08-2005, 10:01 AM,
|
|
FFuser
Member
![*](images/star.png) ![*](images/star.png) ![*](images/star.png)
|
Posts: 147
Threads: 10
Joined: Jul 2005
|
|
Autotools vs SCons configure/build system
joevenzon Wrote:Is there anything we need done that scons can do that autotools can't? Is it worth the extra dependencies? It is not an extra dependency, it replaces another dependency.As thelusiv said it is faster and I think it is more usable to develop
|
|
09-08-2005, 12:17 PM,
|
|
thelusiv
Administrator
![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png)
|
Posts: 2,346
Threads: 223
Joined: Jun 2005
|
|
Autotools vs SCons configure/build system
It's not really an additional dependency, it replaces the dependecy on m4 and shell scripts with a dependency on Python. Nearly every Linux system has Python (I can't think of any who don't). SCons itself can be distributed with the program if we choose to, check their download page, they have a "scons-local" package that is intended just for this. That way users do not necessarily have to have SCons installed to compile.edit: Ulitmately, though, the best way to figure out if it's good or not just try it out. About dependencies - remember, right now we are requiring that users have make and auotmake installed (and the right version! ugh), and if they want to regenerate the build they have to have autoconf and other stuff too.
|
|
09-09-2005, 01:02 PM,
|
|
thelusiv
Administrator
![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png)
|
Posts: 2,346
Threads: 223
Joined: Jun 2005
|
|
Autotools vs SCons configure/build system
joevenzon Wrote:my netplay branch totally isn't breaking anything ,though whose fault is that?!?!? :wink: joevenzon Wrote:anyway, sounds like you've got scons all figured out. does it check for the proper libs? Yeah I think I've got the SCons stuff sorted out. It was satisfyingly painless. Yes it checks for all the necessary libs, as configure did. joevenzon Wrote:note to self: move lists/menus, lists/control_list, lists/fontspacing*, and maybe lists/keys and lists/videomodes to some path inside data I did it for you in the scons-test branch. the files cammode, videoconfig, and controls were moved to runtime/data/settings/ and the rest of the directory was moved to runtime/data/lists/. The contents of the settings directory should be the default settings and these files can be copied to the {user's homedir}/SETTINGS_DIR directory when the game is run for the first time by a user.By the way today I added the SETTINGS_DIR setting to the flags today, so that and DATA_DIR can be handled by the game now. I also added section comments so it's really obvious what's going on in the SCons files now. Also I added /usr/X11R6/lib to the LIBPATH so hopefully we won't have this problem anymore.Next I'm going to work on getting SCons to build a source distribution for us. Other than that, there's not much else I can think of that needs to be done to the SCons files right now. Now mostly those data and settings directory defines need to be handled by the game, because now it compiles well but doesn't run right because I've moved things around...so, do you want to do this Joe? If so, do you want to work on the scons-test branch or do you want me to merge back into the trunk? Or, do you want me to do it? The only reason I would be wary to merge back into the trunk right now, is if for some reason we decide to go back to autotools, I'd rather not junk that whole system in SVN just yet.
|
|
09-12-2005, 12:10 PM,
|
|
thelusiv
Administrator
![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png) ![*](images/star.png)
|
Posts: 2,346
Threads: 223
Joined: Jun 2005
|
|
Autotools vs SCons configure/build system
OK, I have gotten SCons set up to do a lot of cool things, like build source and binary packages automatically. I've also restructured things a little bit, the runtime/ directory is gone now. data/ is moved to the root directory and everything like lists, settings etc. went into data. I also moved some things out of the root, like the project files and the win/ directory - now these reside in tools/anjuta/ and tools/win/ respectively. The .dll files from runtime went into tools/win/dll/.Now I've been trying to code the DATA_DIR variable into the game. It's not possible just to replace every string that needs it with DATA_DIR + ... because in a lot of places this is an attempt to concatenate two string literals, which the compiler doesn't like. So, I thought it would be better to just define a static global variable that would hold it. So now, in main.cpp, there is a line<pre>extern const string data_directory = DATA_DIR;</pre>and in all the files that use data_directory, I've got<pre>extern const string data_directory;</pre>This seems to be working OK now. Is there a better way to do this? I think the only way to make it better would be to have a global configuration class or something, that way this variable could be loaded from a file instead of hard-coded in.Next, I need to set up some way of handling the settings directory. Now, the game will run if executed after an install, it finds some splash graphics, but as soon as it tries to load other stuff (like, anything in lists/) it fails because I've moved that stuff out from under it...Stuff to do:* find the user's homedir (this code will not be portable, I think we'll have to probably start defining something that tells it whether we're compiling on Win32 or Linux if not already)* check to see if there's already a SETTINGS_DIR (defaults to ".vdrift")there* if not, create it and copy defaults from DATA_DIR/settings/* if so, read settings from it* logs should be saved to SETTINGS_DIR/logs* replays should be saved to SETTINGS_DIR/replays* screenshots should be saved to SETTINGS_DIR/shots or something like that
|
|
|