Only use "-fPIC" for compiling objects that will be part of dynamic libs. Make SConscripts inherit the compile flags from the top level instead of overriding them.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@329 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Maarten ter Huurne 2008-08-26 22:28:42 +00:00
parent 0ebba1bde0
commit 59974dfb5b
11 changed files with 154 additions and 98 deletions

View file

@ -1,11 +1,12 @@
Import('env')
files = ["dis_decode.cpp",
"dis_groups.cpp",
"resolve.cpp",
"syntax.cpp",
"PowerPCDisasm.cpp",
]
files = [
"dis_decode.cpp",
"dis_groups.cpp",
"resolve.cpp",
"syntax.cpp",
"PowerPCDisasm.cpp",
]
env_bochs = env.Copy(CXXFLAGS = " -fPIC ")
env_bochs = env.Copy()
env_bochs.StaticLibrary("bdisasm", files)

View file

@ -19,7 +19,6 @@ compileFlags = [
'-g',
'-O3',
'-fno-strict-aliasing',
'-fPIC',
'-msse2',
'-D_FILE_OFFSET_BITS=64',
'-D_LARGEFILE_SOURCE',
@ -72,8 +71,8 @@ lib_paths = include_paths
env = Environment(
CC = "gcc",
CXX = "g++",
CCFLAGS = compileFlags,
CXXFLAGS = compileFlags,
CCFLAGS = ' '.join(compileFlags),
CXXFLAGS = ' '.join(compileFlags),
CPPPATH = include_paths,
LIBPATH = lib_paths,
ENV = {

View file

@ -1,30 +1,31 @@
Import('env')
files = ["ABI.cpp",
"Common.cpp",
"ChunkFile.cpp",
"CPUDetect.cpp",
"DynamicLibrary.cpp",
"Hash.cpp",
"HTTP.cpp",
"IniFile.cpp",
"Logging.cpp",
"FileUtil.cpp",
"MappedFile.cpp",
"MathUtil.cpp",
"MemArena.cpp",
"MemoryUtil.cpp",
"Plugin.cpp",
"PortableSockets.cpp",
"StringUtil.cpp",
"TestFramework.cpp",
"Thunk.cpp",
"Timer.cpp",
"Thread.cpp",
"x64Emitter.cpp",
"x64Analyzer.cpp",
]
files = [
"ABI.cpp",
"Common.cpp",
"ChunkFile.cpp",
"CPUDetect.cpp",
"DynamicLibrary.cpp",
"Hash.cpp",
"HTTP.cpp",
"IniFile.cpp",
"Logging.cpp",
"FileUtil.cpp",
"MappedFile.cpp",
"MathUtil.cpp",
"MemArena.cpp",
"MemoryUtil.cpp",
"Plugin.cpp",
"PortableSockets.cpp",
"StringUtil.cpp",
"TestFramework.cpp",
"Thunk.cpp",
"Timer.cpp",
"Thread.cpp",
"x64Emitter.cpp",
"x64Analyzer.cpp",
]
env_common = env.Copy()
env_common.Append(CXXFLAGS = [ '-fPIC' ])
env_common.Append(CXXFLAGS = ' ' + ' '.join([ '-fPIC' ]))
env_common.StaticLibrary("common", files)

View file

@ -15,7 +15,17 @@ files = ["LogWindow.cpp",
"RegisterView.cpp",
"JitWindow.cpp",
]
wxenv = env.Copy(CXXFLAGS = "`wx-config --cppflags` -DUSE_XPM_BITMAPS -DwxNEEDS_CHARPP",
LINKFLAGS = "-L/usr/local/lib -pthread `wx-config --libs --debug`")
wxenv.StaticLibrary("debwx", files, LIBS = ["common"])
wxenv = env.Copy()
wxenv.Append(
CXXFLAGS = ' ' + ' '.join([
'`wx-config --cppflags`',
'-DUSE_XPM_BITMAPS',
'-DwxNEEDS_CHARPP'
]),
LINKFLAGS = ' ' + ' '.join([
'-L/usr/local/lib',
'-pthread',
'`wx-config --libs --debug`'
])
)
wxenv.StaticLibrary("debwx", files, LIBS = [ "common" ])

View file

@ -17,14 +17,26 @@ files = ["BootManager.cpp",
"stdafx.cpp",
]
wxenv = env.Copy(CXXFLAGS = "`wx-config --cppflags` -DUSE_XPM_BITMAPS -DwxNEEDS_CHARPP `sdl-config --cflags`",
LINKFLAGS = "-L/usr/local/lib -pthread `wx-config --libs` `sdl-config --libs`")
wxenv = env.Copy()
wxenv.Append(
CXXFLAGS = ' ' + ' '.join([
'`wx-config --cppflags`',
'-DUSE_XPM_BITMAPS',
'-DwxNEEDS_CHARPP',
'`sdl-config --cflags`',
]),
LINKFLAGS = ' ' + ' '.join([
'-L/usr/local/lib',
'-pthread',
'`wx-config --libs`',
'`sdl-config --libs`'
])
)
if sys.platform == 'darwin':
icon = 'Dolphin'
version = "svn"
wxenv.Program("../../../../Binary/mac/Dolphin.app/Contents/MacOS/Dolphin", files, LIBS = ["debwx", "discio", "core", "bdisasm", "videocommon", "common" , "z"])
version = 'svn'
wxenv.Program('../../../../Binary/mac/Dolphin.app/Contents/MacOS/Dolphin', files, LIBS = ["debwx", "discio", "core", "bdisasm", "videocommon", "common" , "z"])
wxenv.Plist("../../../../Binary/mac/Dolphin.app/Contents/Info.plist", Value(dict(
CFAppleHelpAnchor = 'index',
CFBundleExecutable = 'Dolphin',

View file

@ -1,13 +1,15 @@
Import('env')
files = ["BPMemory.cpp",
"CPMemory.cpp",
"LookUpTables.cpp",
"TextureDecoder.cpp",
"XFMemory.cpp",
"XFBConvert.cpp",
"Fifo.cpp",
]
files = [
"BPMemory.cpp",
"CPMemory.cpp",
"LookUpTables.cpp",
"TextureDecoder.cpp",
"XFMemory.cpp",
"XFBConvert.cpp",
"Fifo.cpp",
]
env_common = env.Copy(CXXFLAGS = " -fPIC ")
env_common = env.Copy()
env_common.Append(CXXFLAGS = ' ' + ' '.join([ '-fPIC' ]))
env_common.StaticLibrary("videocommon", files)

View file

@ -1,22 +1,28 @@
Import('env')
import sys
files = ["DSPHandler.cpp",
"MailHandler.cpp",
"main.cpp",
"Config.cpp",
"Globals.cpp",
"PCHW/AOSoundStream.cpp",
"PCHW/Mixer.cpp",
"UCodes/UCode_AX.cpp",
"UCodes/UCode_CARD.cpp",
"UCodes/UCode_InitAudioSystem.cpp",
"UCodes/UCode_Jac.cpp",
"UCodes/UCode_ROM.cpp",
"UCodes/UCodes.cpp",
"UCodes/UCode_Zelda.cpp",
]
dspenv=env.Copy(LINKFLAGS = "`pkg-config --libs ao` ")
files = [
"DSPHandler.cpp",
"MailHandler.cpp",
"main.cpp",
"Config.cpp",
"Globals.cpp",
"PCHW/AOSoundStream.cpp",
"PCHW/Mixer.cpp",
"UCodes/UCode_AX.cpp",
"UCodes/UCode_CARD.cpp",
"UCodes/UCode_InitAudioSystem.cpp",
"UCodes/UCode_Jac.cpp",
"UCodes/UCode_ROM.cpp",
"UCodes/UCodes.cpp",
"UCodes/UCode_Zelda.cpp",
]
dspenv = env.Copy()
dspenv.Append(
CXXFLAGS = ' ' + ' '.join([ '-fPIC', '`pkg-config --cflags ao`' ]),
LINKFLAGS = ' ' + ' '.join([ '`pkg-config --libs ao`' ])
)
if sys.platform == 'darwin':
dspenv.SharedLibrary("../../../../Binary/mac/Plugins/dsphle.so", files, LIBS = ["common"])

View file

@ -1,18 +1,25 @@
Import('env')
output = "../../../../Binary/linux/Plugins/dsplle.so"
files = ["AOSoundStream.cpp",
"disassemble.cpp",
"gdsp_aram.cpp",
"gdsp_ext_op.cpp",
"gdsp_interface.cpp",
"gdsp_interpreter.cpp",
"gdsp_memory.cpp",
"gdsp_opcodes.cpp",
"gdsp_registers.cpp",
"Globals.cpp",
"opcodes.cpp",
"Tools.cpp",
"main.cpp",
]
env.Append(LINKFLAGS = " `pkg-config --libs ao`")
env.SharedLibrary(output, files, LIBS = ["common"])
files = [
"AOSoundStream.cpp",
"disassemble.cpp",
"gdsp_aram.cpp",
"gdsp_ext_op.cpp",
"gdsp_interface.cpp",
"gdsp_interpreter.cpp",
"gdsp_memory.cpp",
"gdsp_opcodes.cpp",
"gdsp_registers.cpp",
"Globals.cpp",
"opcodes.cpp",
"Tools.cpp",
"main.cpp",
]
dspenv = env.Copy()
dspenv.Append(
CXXFLAGS = ' ' + ' '.join([ '-fPIC', '`pkg-config --cflags ao`' ]),
LINKFLAGS = ' ' + ' '.join([ '`pkg-config --libs ao`' ])
)
dspenv.SharedLibrary(output, files, LIBS = ["common"])

View file

@ -6,7 +6,13 @@ if sys.platform == 'darwin':
else:
output = "../../../../Binary/linux/Plugins/padsimple.so"
files = ["main.cpp",
]
padenv=env.Copy(CXXFLAGS = " `pkg-config --cflags sdl`", LINKFLAGS = " `pkg-config --libs sdl`")
files = [
"main.cpp",
]
padenv = env.Copy()
padenv.Append(
CXXFLAGS = ' ' + ' '.join([ '-fPIC', '`pkg-config --cflags sdl`' ]),
LINKFLAGS = ' ' + ' '.join([ '`pkg-config --libs sdl`' ])
)
padenv.SharedLibrary(output, files, LIBS=["common"])

View file

@ -23,6 +23,7 @@ files = [
'GUI/ConfigDlg.cpp',
]
compileFlags = [
'-fPIC',
'`wx-config --cppflags`',
]
linkFlags = [
@ -58,9 +59,10 @@ if useSDL:
compileFlags += [ '`sdl-config --cflags`', '-DUSE_SDL=1' ]
linkFlags += [ '`sdl-config --libs`' ]
gfxenv = env.Copy(
CXXFLAGS = ' '.join(compileFlags),
LINKFLAGS = ' '.join(linkFlags),
gfxenv = env.Copy()
gfxenv.Append(
CXXFLAGS = ' ' + ' '.join(compileFlags),
LINKFLAGS = ' ' + ' '.join(linkFlags)
)
gfxenv.SharedLibrary(
'../../../../Binary/%s/Plugins/zeroogl.so' % platform,

View file

@ -6,9 +6,19 @@ if sys.platform == 'darwin':
else:
output = "../../../../Binary/linux/Plugins/Plugin_nJoy_SDL.so"
files = [ "nJoy.cpp",
"GUI/AboutBox.cpp",
"GUI/ConfigBox.cpp",
]
padenv=env.Copy(CXXFLAGS = " `wx-config --cppflags` `pkg-config --cflags sdl`", LINKFLAGS = "`wx-config --libs` `pkg-config --libs sdl` ")
padenv.SharedLibrary(output, files, LIBS=["common"])
files = [
"nJoy.cpp",
"GUI/AboutBox.cpp",
"GUI/ConfigBox.cpp",
]
padenv = env.Copy()
padenv.Append(
CXXFLAGS = ' ' + ' '.join([
'-fPIC', '`wx-config --cppflags`', '`pkg-config --cflags sdl`'
]),
LINKFLAGS = ' ' + ' '.join([
'`wx-config --libs`', '`pkg-config --libs sdl`'
])
)
padenv.SharedLibrary(output, files, LIBS = [ "common" ])