[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] r4186 - in trunk/pingus: . src/editor src/engine/display sr
From: |
grumbel |
Subject: |
[Pingus-CVS] r4186 - in trunk/pingus: . src/editor src/engine/display src/engine/system src/pingus src/pingus/screens |
Date: |
Sat, 27 Aug 2011 19:17:52 +0200 |
Author: grumbel
Date: 2011-08-27 19:17:52 +0200 (Sat, 27 Aug 2011)
New Revision: 4186
Modified:
trunk/pingus/INSTALL.unix
trunk/pingus/SConscript
trunk/pingus/src/editor/editor_level.cpp
trunk/pingus/src/engine/display/display.cpp
trunk/pingus/src/engine/display/screenshot.cpp
trunk/pingus/src/engine/system/sdl_system.cpp
trunk/pingus/src/pingus/pingus_main.cpp
trunk/pingus/src/pingus/screens/pingus_menu.cpp
Log:
Further simplified the SConscript, removed need for config.h
Modified: trunk/pingus/INSTALL.unix
===================================================================
--- trunk/pingus/INSTALL.unix 2011-08-27 17:16:20 UTC (rev 4185)
+++ trunk/pingus/INSTALL.unix 2011-08-27 17:17:52 UTC (rev 4186)
@@ -60,15 +60,7 @@
% scons -h
-If the configuration step fails for any reason and you want to simply
-skip it, use:
- % scons configure ignore_errors=True
- % scons
-
-The build might however fail if you do that.
-
-
Running:
--------
Once the compilation is successful you can run Pingus directly from
Modified: trunk/pingus/SConscript
===================================================================
--- trunk/pingus/SConscript 2011-08-27 17:16:20 UTC (rev 4185)
+++ trunk/pingus/SConscript 2011-08-27 17:17:52 UTC (rev 4186)
@@ -68,14 +68,9 @@
return False
class Project:
- def __init__(self):
- self.configure()
- self.build()
-
def configure(self):
self.configure_begin()
self.configure_opengl()
- self.configure_linuxusbmouse()
self.configure_linuxevdev()
self.configure_wiimote()
self.configure_xinput()
@@ -86,12 +81,32 @@
self.configure_end()
def configure_begin(self):
- self.define_options("custom.py", ARGUMENTS)
+ self.opts = Variables("custom.py", ARGUMENTS)
+ self.opts.Add('CC', 'C Compiler', 'gcc')
+ self.opts.Add('CXX', 'C++ Compiler', 'g++')
+ # self.opts.Add('debug', 'Build with debugging options', 0)
+ # self.opts.Add('profile', 'Build with profiling support', 0)
+
+ self.opts.Add('CPPPATH', 'Additional preprocessor paths', [])
+ self.opts.Add('LIBPATH', 'Additional library paths', [])
+ self.opts.Add('CPPFLAGS', 'Additional preprocessor flags', [])
+ self.opts.Add('CPPDEFINES', 'defined constants', [])
+ self.opts.Add('LIBS', 'Additional libraries', [])
+ self.opts.Add('CCFLAGS', 'C Compiler flags', [])
+ self.opts.Add('CXXFLAGS', 'C++ Compiler flags', [])
+ self.opts.Add('LINKFLAGS', 'Linker Compiler flags', [])
+
+ self.opts.Add(BoolVariable('with_opengl', 'Build with OpenGL
support', True))
+ self.opts.Add(BoolVariable('with_xinput', 'Build with Xinput
support', False))
+ self.opts.Add(BoolVariable('with_linuxevdev', 'Build with Linux
evdev support', True))
+ self.opts.Add(BoolVariable('with_wiimote', 'Build with Wiimote
support', False))
+ self.opts.Add(BoolVariable('ignore_errors', 'Ignore any fatal
configuration errors', False))
+ self.opts.Add('optional_sources', 'Additional source files', [])
+
self.env = Environment(options = self.opts)
+ self.env.Append(CPPDEFINES = [('VERSION', '"\\"0.8.0\\""')])
Help(self.opts.GenerateHelpText(self.env))
- self.opts.Update(self.env)
-
if os.environ.has_key('PATH'):
self.env['ENV']['PATH'] = os.environ['PATH']
if os.environ.has_key('HOME'):
@@ -100,11 +115,9 @@
if os.environ.has_key('PKG_CONFIG_PATH'):
self.env['ENV']['PKG_CONFIG_PATH'] = os.environ['PKG_CONFIG_PATH']
- self.env['CPPPATH'] += ['.', 'src/', 'external/']
+ self.env.Append(CPPPATH = ['.', 'src/', 'external/'])
- self.config_h_defines = []
-
- self.config = self.env.Configure(custom_tests = {
+ self.conf = self.env.Configure(custom_tests = {
'CheckMyProgram' : CheckMyProgram,
'CheckSDLLib': CheckSDLLib,
'CheckIconv': CheckIconv,
@@ -113,8 +126,7 @@
self.reports = ""
def configure_end(self):
- self.env = self.config.Finish()
- self.opts.Save("config.py", self.env)
+ self.env = self.conf.Finish()
print "Reports:"
print self.reports
@@ -122,28 +134,8 @@
if not self.fatal_error == "":
print "Fatal Errors:"
print self.fatal_error
- if not self.env['ignore_errors']:
- Exit(1)
- else:
- print "\nError are being ignored, the build continues"
+ Exit(1)
- config_h = open('config.h', 'w')
- config_h.write('#define VERSION "0.7.3"\n')
- config_h.write('#define ICONV_CONST %s\n' % self.iconv_const)
- for (v,k) in self.config_h_defines:
- config_h.write('#define %s %s\n' % (v, k))
- config_h.close()
-
- if ('configure' in COMMAND_LINE_TARGETS):
- print "Configuration written to config.h and config.py, run:"
- print ""
- print " scons"
- print ""
- print "To start the compile"
- else:
- print "Configuration written to config.h and config.py"
- ARGUMENTS = {}
-
def configure_gxx(self):
# FIXME: Seems to require a rather new version of SCons
ret = config.CheckBuilder(context, None, "C++")
@@ -155,37 +147,29 @@
self.reports += " * OpenGL support: disabled\n"
else:
self.reports += " * OpenGL support: enabled\n"
- self.config_h_defines += [('HAVE_OPENGL', 1)]
- self.env['LIBS'] += ['GL']
- self.env['optional_sources'] +=
['src/engine/display/opengl/opengl_framebuffer_surface_impl.cpp',
-
'src/engine/display/opengl/opengl_framebuffer.cpp' ]
+ self.conf.env.Append(CPPDEFINES = [('HAVE_OPENGL', 1)])
+ self.conf.env.Append(LIBS = ['GL'])
+ self.conf.env.Append(optional_sources =
['src/engine/display/opengl/opengl_framebuffer_surface_impl.cpp',
+
'src/engine/display/opengl/opengl_framebuffer.cpp' ])
- def configure_linuxusbmouse(self):
- if not self.env['with_linuxusbmouse']:
- self.reports += " * Linux USB mouse support: disabled\n"
- else:
- self.reports += " * Linux USB mouse support: enabled\n"
- self.config_h_defines += [('HAVE_LINUXUSBMOUSE', 1)]
- self.env['optional_sources'] +=
['src/engine/input/usbmouse/usbmouse_driver.cpp']
-
def configure_linuxevdev(self):
if not self.env['with_linuxevdev']:
reports += " * Linux evdev support: disabled\n"
else:
self.reports += " * Linux evdev support: ok\n"
- self.config_h_defines += [('HAVE_LINUXEVDEV', 1)]
- self.env['optional_sources'] +=
['src/engine/input/evdev/evdev_driver.cpp',
-
'src/engine/input/evdev/evdev_device.cpp']
+ self.conf.env.Append(CPPDEFINES = [('HAVE_LINUXEVDEV', 1)])
+ self.conf.env.Append(optional_sources =
['src/engine/input/evdev/evdev_driver.cpp',
+
'src/engine/input/evdev/evdev_device.cpp'])
def configure_wiimote(self):
if not self.env['with_wiimote']:
self.reports += " * Wiimote support: disabled\n"
elif config.CheckLibWithHeader('cwiid', 'cwiid.h', 'c++'):
self.reports += " * Wiimote support: yes\n"
- self.config_h_defines += [('HAVE_CWIID', 1)]
- self.env['LIBS'] += ['cwiid']
- self.env['optional_sources'] +=
['src/engine/input/wiimote/wiimote_driver.cpp',
-
'src/engine/input/wiimote/wiimote.cpp']
+ self.conf.env.Append(CPPDEFINES = [('HAVE_CWIID', 1)])
+ self.conf.env.Append(LIBS = ['cwiid'])
+ self.conf.env.Append(optional_sources =
['src/engine/input/wiimote/wiimote_driver.cpp',
+
'src/engine/input/wiimote/wiimote.cpp'])
else:
self.reports += " * Wiimote support: no (libcwiid or cwiid.h not
found)\n"
@@ -196,68 +180,39 @@
self.reports += " * XInput support: no (library Xi not found)\n"
## FIXME: Need to set a define
else:
self.reports += " * XInput support: yes\n"
- self.config_h_defines += [('HAVE_XINPUT', 1)]
- self.env['LIBS'] += ['Xi']
- self.env['optional_sources'] +=
['src/engine/input/xinput/xinput_driver.cpp',
-
'src/engine/input/xinput/xinput_device.cpp']
-
+ self.conf.env.Append(CPPDEFINES = [('HAVE_XINPUT', 1)])
+ self.conf.env.Append(LIBS = ['Xi'])
+ self.conf.env.Append(optional_sources =
['src/engine/input/xinput/xinput_driver.cpp',
+
'src/engine/input/xinput/xinput_device.cpp'])
+
def configure_boost(self):
- if not self.config.CheckLibWithHeader('boost_signals',
'boost/signals.hpp', 'c++'):
- if not self.config.CheckLibWithHeader('boost_signals-mt',
'boost/signals.hpp', 'c++'):
+ if not self.conf.CheckLibWithHeader('boost_signals',
'boost/signals.hpp', 'c++'):
+ if not self.conf.CheckLibWithHeader('boost_signals-mt',
'boost/signals.hpp', 'c++'):
self.fatal_error += " * library 'boost_signals' not found\n"
def configure_png(self):
- if not self.config.CheckLibWithHeader('png', 'png.h', 'c++'):
+ if not self.conf.CheckLibWithHeader('png', 'png.h', 'c++'):
self.fatal_error += " * library 'png' not found\n"
def configure_sdl(self):
- if self.config.CheckMyProgram('sdl-config'):
- self.env.ParseConfig('sdl-config --cflags --libs')
+ if self.conf.CheckMyProgram('sdl-config'):
+ self.conf.env.ParseConfig('sdl-config --cflags --libs')
for sdllib in ['image', 'mixer']:
- if not self.config.CheckSDLLib(sdllib):
+ if not self.conf.CheckSDLLib(sdllib):
self.fatal_error += " * SDL library '%s' not found\n" %
sdllib
else:
fatal_error += " * couldn't find sdl-config, SDL missing\n"
def configure_iconv(self):
- self.iconv_const = self.config.CheckIconv()
- if self.iconv_const == False:
+ iconv_const = self.conf.CheckIconv()
+ if iconv_const == False:
self.fatal_error += " * can't call iconv\n"
+ else:
+ self.conf.env.Append(CPPDEFINES = [('ICONV_CONST', iconv_const)])
- def define_options(self, filename, args):
- self.opts = Variables(filename, args)
- self.opts.Add('CC', 'C Compiler', 'gcc')
- self.opts.Add('CXX', 'C++ Compiler', 'g++')
- # self.opts.Add('debug', 'Build with debugging options', 0)
- # self.opts.Add('profile', 'Build with profiling support', 0)
-
- self.opts.Add('CPPPATH', 'Additional preprocessor paths', [])
- self.opts.Add('LIBPATH', 'Additional library paths', [])
- self.opts.Add('CPPFLAGS', 'Additional preprocessor flags', [])
- self.opts.Add('CPPDEFINES', 'defined constants', [])
- self.opts.Add('LIBS', 'Additional libraries', [])
- self.opts.Add('CCFLAGS', 'C Compiler flags', [])
- self.opts.Add('CXXFLAGS', 'C++ Compiler flags', [])
- self.opts.Add('LINKFLAGS', 'Linker Compiler flags', [])
-
- self.opts.Add(BoolVariable('with_opengl', 'Build with OpenGL
support', True))
- self.opts.Add(BoolVariable('with_xinput', 'Build with Xinput
support', False))
- self.opts.Add(BoolVariable('with_linuxusbmouse', 'Build with Linux USB
mouse support', True))
- self.opts.Add(BoolVariable('with_linuxevdev', 'Build with Linux
evdev support', True))
- self.opts.Add(BoolVariable('with_wiimote', 'Build with Wiimote
support', False))
- self.opts.Add(BoolVariable('ignore_errors', 'Ignore any fatal
configuration errors', False))
- self.opts.Add('optional_sources', 'Additional source files', [])
-
def build(self):
- self.define_options("config.py", {})
- self.env = Environment(options = self.opts)
- Help(self.opts.GenerateHelpText(self.env))
+ self.env.Append(CPPPATH = ['.', 'src/'])
- self.opts.Update(self.env)
- self.env['CPPPATH'] += ['.', 'src/']
-
- Clean('pingus', ['config.py', 'config.h'])
-
libpingus = self.env.StaticLibrary('pingus',
Glob('external/tinygettext/*.cpp')
+ \
Glob('src/editor/*.cpp') + \
@@ -280,11 +235,14 @@
Glob('src/pingus/worldobjs/*.cpp')
+ \
Glob('src/util/*.cpp') + \
self.env['optional_sources'])
+
self.env.Program('pingus', ['src/main.cpp', libpingus])
for filename in Glob("test/*_test.cpp", strings=True):
self.env.Program(filename[:-4], [filename, libpingus])
project = Project()
+project.configure()
+project.build()
## EOF ##
Modified: trunk/pingus/src/editor/editor_level.cpp
===================================================================
--- trunk/pingus/src/editor/editor_level.cpp 2011-08-27 17:16:20 UTC (rev
4185)
+++ trunk/pingus/src/editor/editor_level.cpp 2011-08-27 17:17:52 UTC (rev
4186)
@@ -20,8 +20,6 @@
#include <fstream>
#include <iostream>
-#include "config.h"
-
#include "pingus/pingus_level.hpp"
#include "util/sexpr_file_writer.hpp"
Modified: trunk/pingus/src/engine/display/display.cpp
===================================================================
--- trunk/pingus/src/engine/display/display.cpp 2011-08-27 17:16:20 UTC (rev
4185)
+++ trunk/pingus/src/engine/display/display.cpp 2011-08-27 17:17:52 UTC (rev
4186)
@@ -17,7 +17,6 @@
#include "engine/display/display.hpp"
#include <stdexcept>
-#include <config.h>
#include "engine/display/sdl_framebuffer.hpp"
#include "engine/screen/screen_manager.hpp"
Modified: trunk/pingus/src/engine/display/screenshot.cpp
===================================================================
--- trunk/pingus/src/engine/display/screenshot.cpp 2011-08-27 17:16:20 UTC
(rev 4185)
+++ trunk/pingus/src/engine/display/screenshot.cpp 2011-08-27 17:17:52 UTC
(rev 4186)
@@ -17,7 +17,6 @@
#include "engine/display/screenshot.hpp"
#include <assert.h>
-#include <config.h>
#include <iostream>
#include <png.h>
Modified: trunk/pingus/src/engine/system/sdl_system.cpp
===================================================================
--- trunk/pingus/src/engine/system/sdl_system.cpp 2011-08-27 17:16:20 UTC
(rev 4185)
+++ trunk/pingus/src/engine/system/sdl_system.cpp 2011-08-27 17:17:52 UTC
(rev 4186)
@@ -18,7 +18,6 @@
#include <iostream>
-#include "config.h"
#include "engine/display/display.hpp"
#include "math/size.hpp"
Modified: trunk/pingus/src/pingus/pingus_main.cpp
===================================================================
--- trunk/pingus/src/pingus/pingus_main.cpp 2011-08-27 17:16:20 UTC (rev
4185)
+++ trunk/pingus/src/pingus/pingus_main.cpp 2011-08-27 17:17:52 UTC (rev
4186)
@@ -16,7 +16,6 @@
#include "pingus/pingus_main.hpp"
-#include <config.h>
#include <signal.h>
#include "editor/editor_level.hpp"
Modified: trunk/pingus/src/pingus/screens/pingus_menu.cpp
===================================================================
--- trunk/pingus/src/pingus/screens/pingus_menu.cpp 2011-08-27 17:16:20 UTC
(rev 4185)
+++ trunk/pingus/src/pingus/screens/pingus_menu.cpp 2011-08-27 17:17:52 UTC
(rev 4186)
@@ -16,8 +16,6 @@
#include "pingus/screens/pingus_menu.hpp"
-#include <config.h>
-
#include "editor/editor_screen.hpp"
#include "engine/screen/screen_manager.hpp"
#include "engine/sound/sound.hpp"
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] r4186 - in trunk/pingus: . src/editor src/engine/display src/engine/system src/pingus src/pingus/screens,
grumbel <=