Mercurial > hg > aimc
comparison trunk/SConstruct @ 298:35a8fbf4ff82
-Added a bit of junk to try and build a bianry for OS X 10.4 in SConstruct
-Fixes to the FileList to build on linux - hopefully
author | tomwalters |
---|---|
date | Tue, 23 Feb 2010 21:51:11 +0000 |
parents | 09f6050303f8 |
children | 57e6c567461c |
comparison
equal
deleted
inserted
replaced
297:09f6050303f8 | 298:35a8fbf4ff82 |
---|---|
71 build_platform = env['PLATFORM'] | 71 build_platform = env['PLATFORM'] |
72 target_platform = build_platform | 72 target_platform = build_platform |
73 | 73 |
74 # Build products location and executable name | 74 # Build products location and executable name |
75 build_dir = os.path.join('build', target_platform + '-release') | 75 build_dir = os.path.join('build', target_platform + '-release') |
76 target_executable = 'aimc' | 76 target_executable = 'AIMCopy' |
77 test_executable = 'aimc_tests' | 77 test_executable = 'aimc_tests' |
78 | 78 |
79 # Create build products directory if necessary | 79 # Create build products directory if necessary |
80 if not os.path.exists(build_dir): | 80 if not os.path.exists(build_dir): |
81 os.makedirs(build_dir) | 81 os.makedirs(build_dir) |
115 print('Cross-compilation for Windows is not supported') | 115 print('Cross-compilation for Windows is not supported') |
116 Exit(1) | 116 Exit(1) |
117 else: | 117 else: |
118 print('Unsupported compiler: ' + compiler) | 118 print('Unsupported compiler: ' + compiler) |
119 Exit(1) | 119 Exit(1) |
120 | 120 |
121 if build_platform == 'darwin': | 121 # To make a statically-linked version for os 10.4 and up... |
122 env.AppendUnique(CPPFLAGS = ['-arch', 'i386']) | 122 #if build_platform == 'darwin': |
123 env.AppendUnique(LINKFLAGS = ['-arch', 'i386']) | 123 # env.AppendUnique(CPPFLAGS = ['-arch', 'i386']) |
124 # env.AppendUnique(LINKFLAGS = ['-arch', 'i386']) | |
125 # env.AppendUnique(LINKFLAGS = ['-Wl']) | |
126 # env.AppendUnique(LINKFLAGS = ['-search_paths_first']) | |
127 # env.AppendUnique(MACOSX_DEPLOYMENT_TARGET = ['10.4']) | |
128 # env.AppendUnique(GCC_VERSION = ['4.0']) | |
129 # env.Replace(CC = ['gcc-4.0']) | |
130 # env.Replace(CXX = ['gcc-4.0']) | |
131 # env.AppendUnique(CPPFLAGS = ['-fno-stack-protector','-isysroot', '/Developer/SDKs/MacOSX10.5.sdk', '-mmacosx-version-min=10.4']) | |
124 | 132 |
125 if not target_platform == 'win32': | 133 if not target_platform == 'win32': |
126 # On windows, utf support is builtin for SimpleIni | 134 # On windows, utf support is builtin for SimpleIni |
127 # but not on other platforms | 135 # but not on other platforms |
128 sources += ['Support/ConvertUTF.c'] | 136 sources += ['Support/ConvertUTF.c'] |
132 | 140 |
133 # Look for the sources in the correct place | 141 # Look for the sources in the correct place |
134 env.Append(CPPPATH = ['#src']) | 142 env.Append(CPPPATH = ['#src']) |
135 | 143 |
136 # Dependencies | 144 # Dependencies |
137 deplibs = ['sndfile'] | 145 deplibs = ['sndfile', 'flac', 'vorbis', 'vorbisenc', 'ogg'] |
138 | 146 |
139 for depname in deplibs: | 147 for depname in deplibs: |
140 env.ParseConfig('pkg-config --cflags --libs ' + depname) | 148 env.ParseConfig('pkg-config --cflags --libs ' + depname) |
141 | 149 |
142 env.AppendUnique(LIBS = deplibs) | 150 env.AppendUnique(LIBS = deplibs) |
149 env.Alias(target_executable, os.path.join(build_dir, target_executable)) | 157 env.Alias(target_executable, os.path.join(build_dir, target_executable)) |
150 env.Default(program) | 158 env.Default(program) |
151 | 159 |
152 #test_env = env.Clone() | 160 #test_env = env.Clone() |
153 #test_libs = ['gtest', 'gtest_main'] | 161 #test_libs = ['gtest', 'gtest_main'] |
154 #for depname in test_libs: | 162 ##for depname in test_libs: |
155 # test_env.ParseConfig('pkg-config --cflags --libs ' + depname) | 163 ## test_env.ParseConfig('pkg-config --cflags --libs ' + depname) |
156 #test_env.AppendUnique(LIBPATH = ['/usr/local/lib'], | 164 #test_env.AppendUnique(LIBPATH = ['/usr/local/lib'], |
157 # CPPPATH = ['/usr/local/lib'], | 165 # CPPPATH = ['/usr/local/lib'], |
158 # LIBS = test_libs) | 166 # LIBS = test_libs) |
159 | 167 # |
160 #test = test_env.Program(target = os.path.join(build_dir, test_executable), | 168 #test = test_env.Program(target = os.path.join(build_dir, test_executable), |
161 # source = map(lambda x: '#' + build_dir + '/src/' + x, | 169 # source = map(lambda x: '#' + build_dir + '/src/' + x, |
162 # test_sources)) | 170 # test_sources)) |
163 #env.Alias('test', os.path.join(build_dir, test_executable)) | 171 #env.Alias('test', os.path.join(build_dir, test_executable)) |