Permalink
Browse files

some updates to the Linux build system - obtained a core binary and a…

…ll required modules

git-svn-id: https://zerowing.idsoftware.com/svn/radiant/GtkRadiant/branches/ZeroRadiant@180 8a3a26a2-13c4-0310-b231-cf6edde360e5
  • Loading branch information...
timo
timo committed Oct 24, 2007
1 parent c7bd8f2 commit e66458ec9c0b4416b404c56a4cc358c619c0a131
View
@@ -11,7 +11,7 @@ Import( [ 'utils', 'config', 'settings', 'project' ] )
libname = os.path.splitext( libname )[0]
env = Environment()
-settings.SetupEnvironment( env, config )
+settings.SetupEnvironment( env, config['name'] )
proj = utils.vcproj( os.path.join( GetLaunchDir(), project ) )
# some filtering. may need to improve that
@@ -20,9 +20,15 @@ add_sources = []
if ( len( drop ) != 0 ):
add_sources.append( 'l_net_berkeley.c' )
-#env.StaticLibrary( libname, [ os.path.join( libpath, i ) for i in files ] )
+emit_func = env.StaticObject
+try:
+ if ( config['shared'] ):
+ emit_func = env.SharedObject
+except:
+ pass
+
objects = []
for i in files + add_sources:
- objects.append( env.StaticObject( os.path.join( libpath, i ) ) )
+ objects.append( emit_func( os.path.join( libpath, i ) ) )
Return( 'objects' )
View
@@ -0,0 +1,32 @@
+# -*- mode: python -*-
+# ZeroRadiant build scripts
+# TTimo <ttimo@idsoftware.com>
+# http://scons.sourceforge.net
+
+import os
+
+Import( [ 'utils', 'config', 'settings', 'project', 'shlib_objects' ] )
+
+( libpath, libname ) = os.path.split( project )
+libname = os.path.splitext( libname )[0]
+
+env = Environment()
+useJPEG = False
+useGtk = False
+if ( libname == 'image' ):
+ useJPEG = True
+if ( libname == 'surface' ):
+ useGtk = True
+settings.SetupEnvironment( env, config['name'], useGtk = useGtk, useJPEG = useJPEG )
+proj = utils.vcproj( os.path.join( GetLaunchDir(), project ) )
+
+# some filtering. may need to improve that
+add_sources = []
+( drop, files ) = proj.filterSource( r'.*l_net_wins\.c' )
+if ( len( drop ) != 0 ):
+ add_sources.append( 'l_net_berkeley.c' )
+
+module_base = env.SharedLibrary( os.path.join( 'modules', libname ), shlib_objects + [ os.path.join( libpath, i ) for i in files ] )
+module = env.AddPostAction( module_base, utils.CheckUnresolved )
+
+Return( 'module' )
View
@@ -8,8 +8,11 @@ import os
Import( [ 'utils', 'config', 'settings', 'lib_objects' ] )
env = Environment()
-settings.SetupEnvironment( env, config, useGtk = True, useGtkGL = True )
+settings.SetupEnvironment( env, config['name'], useGtk = True, useGtkGL = True )
proj = utils.vcproj( os.path.join( GetLaunchDir(), 'radiant/radiant.vcproj' ) )
-env.Program( 'radiant.bin', lib_objects + [ os.path.join( 'radiant', i ) for i in proj.getSourceFiles() ] )
+radiant = env.Program( 'radiant.bin', lib_objects + [ os.path.join( 'radiant', i ) for i in proj.getSourceFiles() ] )
+
+Return( 'radiant' )
+
View
@@ -51,19 +51,53 @@ def setupParser( self, operators ):
def emit( self ):
settings = self
- for config in self.config_selected:
+ for config_name in self.config_selected:
+ config = {}
+ config['name'] = config_name
+ config['shared'] = False
Export( 'utils', 'settings', 'config' )
- build_dir = os.path.join( 'build', config )
+ build_dir = os.path.join( 'build', config_name )
BuildDir( build_dir, '.', duplicate = 0 )
- # left out jpeg6, splines
+ # left out jpeg6, splines (FIXME: I think jpeg6 is not used at all, can trash?)
lib_objects = []
for project in [ 'libs/synapse/synapse.vcproj', 'libs/cmdlib/cmdlib.vcproj', 'libs/mathlib/mathlib.vcproj', 'libs/l_net/l_net.vcproj', 'libs/ddslib/ddslib.vcproj', 'libs/picomodel/picomodel.vcproj', 'libs/md5lib/md5lib.vcproj' ]:
Export( 'project' )
lib_objects += SConscript( os.path.join( build_dir, 'SConscript.lib' ) )
Export( 'lib_objects' )
- SConscript( os.path.join( build_dir, 'SConscript.radiant' ) )
+ radiant = SConscript( os.path.join( build_dir, 'SConscript.radiant' ) )
+ InstallAs( 'install/radiant.bin', radiant )
- def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False ):
+ # PIC versions of the libs for the modules
+ shlib_objects_extra = {}
+ for project in [ 'libs/synapse/synapse.vcproj', 'libs/mathlib/mathlib.vcproj', 'libs/cmdlib/cmdlib.vcproj' ]:
+ ( libpath, libname ) = os.path.split( project )
+ libname = os.path.splitext( libname )[0]
+ config['shared'] = True
+ Export( 'project', 'config' )
+ build_dir = os.path.join( 'build', config_name, 'shobjs' )
+ BuildDir( build_dir, '.', duplicate = 0 )
+ shlib_objects_extra[libname] = SConscript( os.path.join( build_dir, 'SConscript.lib' ) )
+
+ for project in [ 'plugins/vfspk3/vfspk3.vcproj',
+ 'plugins/image/image.vcproj',
+ 'plugins/entity/entity.vcproj',
+ 'plugins/map/map.vcproj',
+ 'plugins/mapxml/mapxml.vcproj',
+ 'plugins/shaders/shaders.vcproj',
+ 'plugins/surface/surface.vcproj'
+ ]:
+ ( libpath, libname ) = os.path.split( project )
+ libname = os.path.splitext( libname )[0]
+ shlib_objects = shlib_objects_extra['synapse']
+ if ( libname == 'entity' ):
+ shlib_objects += shlib_objects_extra['mathlib']
+ if ( libname == 'map' ):
+ shlib_objects += shlib_objects_extra['cmdlib']
+ Export( 'project', 'shlib_objects' )
+ module = SConscript( os.path.join( build_dir, 'SConscript.module' ) )
+ InstallAs( 'install/modules/%s.so' % libname, module )
+
+ def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False, useJPEG = False ):
env['CC'] = self.cc
env['CXX'] = self.cxx
( ret, xml2 ) = commands.getstatusoutput( 'xml2-config --cflags' )
@@ -72,7 +106,8 @@ def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False ):
assert( False )
xml2libs = commands.getoutput( 'xml2-config --libs' )
env.Append( LINKFLAGS = xml2libs.split( ' ' ) )
- baseflags = [ '-m32', '-pipe', '-Wall', '-fmessage-length=0', '-fvisibility=hidden', xml2.split( ' ' ) ]
+ baseflags = [ '-pipe', '-Wall', '-fmessage-length=0', '-fvisibility=hidden', xml2.split( ' ' ) ]
+# baseflags += [ '-m32' ]
if ( useGtk ):
( ret, gtk2 ) = commands.getstatusoutput( 'pkg-config gtk+-2.0 --cflags' )
if ( ret != 0 ):
@@ -82,11 +117,14 @@ def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False ):
gtk2libs = commands.getoutput( 'pkg-config gtk+-2.0 --libs' )
env.Append( LINKFLAGS = gtk2libs.split( ' ' ) )
else:
+ # always setup at least glib
( ret, glib ) = commands.getstatusoutput( 'pkg-config glib-2.0 --cflags' )
if ( ret != 0 ):
print 'pkg-config glib-2.0 failed'
assert( False )
baseflags += glib.split( ' ' )
+ gliblibs = commands.getoutput( 'pkg-config glib-2.0 --libs' )
+ env.Append( LINKFLAGS = gliblibs.split( ' ' ) )
if ( useGtkGL ):
( ret, gtkgl ) = commands.getstatusoutput( 'pkg-config gtkglext-1.0 --cflags' )
if ( ret != 0 ):
@@ -95,6 +133,8 @@ def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False ):
baseflags += gtkgl.split( ' ' )
gtkgllibs = commands.getoutput( 'pkg-config gtkglext-1.0 --libs' )
env.Append( LINKFLAGS = gtkgllibs.split( ' ' ) )
+ if ( useJPEG ):
+ env.Append( LIBS = 'jpeg' )
env.Append( CFLAGS = baseflags )
env.Append( CXXFLAGS = baseflags + [ '-fpermissive', '-fvisibility-inlines-hidden' ] )
@@ -104,7 +144,10 @@ def SetupEnvironment( self, env, config, useGtk = False, useGtkGL = False ):
env.Append( CFLAGS = [ '-g' ] )
env.Append( CPPDEFINES = [ '_DEBUG' ] )
else:
- env.Append( CFLAGS = [ '-O3', '-march=pentium3', '-Winline', '-ffast-math', '-fno-unsafe-math-optimizations' ] )
+ env.Append( CFLAGS = [ '-O3', '-Winline', '-ffast-math', '-fno-unsafe-math-optimizations' ] )
+ #env.Append( CFLAGS = [ '-march=pentium3' ] )
+
+# env.Append( LINKFLAGS = [ '-m32' ] )
# parse the config statement line to produce/update an existing config list
# the configs expose a list of keywords and accepted values, which the engine parses out
@@ -254,8 +254,13 @@ void DoBkgrndToggleYZ()
CSynapseServer* g_pSynapseServer = NULL;
CSynapseClientBkgrnd2d g_SynapseClient;
-extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer)
-{
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) {
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
if (strcmp(version, SYNAPSE_VERSION))
{
Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version);
@@ -219,8 +219,13 @@ class CSynapseClientBobtoolz : public CSynapseClient
CSynapseServer* g_pSynapseServer = NULL;
CSynapseClientBobtoolz g_SynapseClient;
-extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer)
-{
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) {
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
if (strcmp(version, SYNAPSE_VERSION))
{
Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version);
@@ -184,8 +184,13 @@ class CameraSynapseClient : public CSynapseClient
CSynapseServer* g_pSynapseServer = NULL;
CameraSynapseClient g_SynapseClient;
-extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer)
-{
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) {
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
if (strcmp(version, SYNAPSE_VERSION))
{
Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version);
@@ -181,8 +181,13 @@ class GenSurfSynapseClient : public CSynapseClient
CSynapseServer* g_pSynapseServer = NULL;
GenSurfSynapseClient g_SynapseClient;
-extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer)
-{
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) {
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
if (strcmp(version, SYNAPSE_VERSION))
{
Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version);
@@ -372,8 +372,13 @@ extern "C" void QERPlug_Dispatch(const char* p, vec3_t vMin, vec3_t vMax, bool b
CSynapseServer* g_pSynapseServer = NULL;
CSynapseClientHydraToolz g_SynapseClient;
-extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer)
-{
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) {
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
if (strcmp(version, SYNAPSE_VERSION))
{
Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version);
@@ -496,8 +496,13 @@ class CSynapseClientPrtView : public CSynapseClient
CSynapseServer* g_pSynapseServer = NULL;
CSynapseClientPrtView g_SynapseClient;
-extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer)
-{
+#if __GNUC__ >= 4
+#pragma GCC visibility push(default)
+#endif
+extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces( const char *version, CSynapseServer *pServer ) {
+#if __GNUC__ >= 4
+#pragma GCC visibility pop
+#endif
if (strcmp(version, SYNAPSE_VERSION))
{
Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version);
View
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
+<game
+ name="QuakeZero"
+ enginepath =".."
+ gametools="/home/timo/SVN/ZeroRadiant/install/games"
+ gamename="quakezero"
+/>
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
+<!-- synapse XML configuration -->
+<synapseconfig>
+ <client name="core">
+ <api name="image">
+ tga jpg
+ </api>
+ <api name="VFS">
+ pk3
+ </api>
+ <api name="shaders">
+ quake3
+ </api>
+ <api name="map">
+ mapq3
+ </api>
+ <api name="eclass">
+ def
+ </api>
+ <api name="surfdialog">
+ quake3
+ </api>
+ </client>
+ <client name="image">
+ <api name="VFS">
+ pk3
+ </api>
+ </client>
+ <client name="shaders">
+ <!-- NOTE: this is a SYN_PROVIDE -->
+ <api name="shaders">
+ quake3
+ </api>
+ <api name="VFS">
+ pk3
+ </api>
+ </client>
+ <client name="map">
+ <api name="shaders">
+ quake3
+ </api>
+ </client>
+ <client name="xmap">
+ <api name="shaders">
+ quake3
+ </api>
+ </client>
+ <client name="model">
+ <api name="shaders">
+ quake3
+ </api>
+ <api name="VFS">
+ pk3
+ </api>
+ </client>
+</synapseconfig>
Oops, something went wrong.

0 comments on commit e66458e

Please sign in to comment.