comparison trunk/SConstruct @ 330:0a8e7d0c70dc

- Hacks to get a basic AIM-C compiling on windows
author tomwalters
date Thu, 22 Jul 2010 04:24:55 +0000
parents 6130fe7f6409
children 4bf6d5bb232e
comparison
equal deleted inserted replaced
329:99b4bbfa286f 330:0a8e7d0c70dc
43 'Modules/BMM/ModulePZFC.cc', 43 'Modules/BMM/ModulePZFC.cc',
44 'Modules/NAP/ModuleHCL.cc', 44 'Modules/NAP/ModuleHCL.cc',
45 'Modules/Strobes/ModuleParabola.cc', 45 'Modules/Strobes/ModuleParabola.cc',
46 'Modules/Strobes/ModuleLocalMax.cc', 46 'Modules/Strobes/ModuleLocalMax.cc',
47 'Modules/SAI/ModuleSAI.cc', 47 'Modules/SAI/ModuleSAI.cc',
48 'Modules/SNR/ModuleNoise.cc',
49 'Modules/SSI/ModuleSSI.cc', 48 'Modules/SSI/ModuleSSI.cc',
50 'Modules/Profile/ModuleSlice.cc', 49 'Modules/Profile/ModuleSlice.cc',
51 'Modules/Profile/ModuleScaler.cc', 50 'Modules/Profile/ModuleScaler.cc',
52 'Modules/Features/ModuleGaussians.cc',
53 'Modules/Output/FileOutputHTK.cc', 51 'Modules/Output/FileOutputHTK.cc',
54 'Modules/Output/FileOutputAIMC.cc'] 52 'Modules/Output/FileOutputAIMC.cc']
55 53
54 # List of currently incative source files which we may want to add back in
55 sources_disabled = ['Modules/SNR/ModuleNoise.cc',
56 'Modules/Features/ModuleGaussians.cc']
57
56 # File which contains main() 58 # File which contains main()
57 #sources = common_sources + ['Main/AIMCopy_SSI_Features_v4_PZFC.cc'] 59 #sources = common_sources + ['Main/AIMCopy_SSI_Features_v4_PZFC.cc']
58 sources = common_sources + ['Main/AIMCopy_SSI_Features_v5_smooth_nap.cc'] 60 #sources = common_sources + ['Main/AIMCopy_SSI_Features_v5_smooth_nap.cc']
61 sources = common_sources + ['Main/aimc.cc']
59 62
60 # Test sources 63 # Test sources
61 test_sources = ['Modules/Profile/ModuleSlice_unittest.cc'] 64 test_sources = ['Modules/Profile/ModuleSlice_unittest.cc']
62 test_sources += common_sources 65 test_sources += common_sources
63 66
80 build_platform = env['PLATFORM'] 83 build_platform = env['PLATFORM']
81 target_platform = build_platform 84 target_platform = build_platform
82 85
83 # Build products location and executable name 86 # Build products location and executable name
84 build_dir = os.path.join('build', target_platform + '-release') 87 build_dir = os.path.join('build', target_platform + '-release')
85 #target_executable = 'aimc' 88 target_executable = 'aimc'
86 target_executable = 'AIMCopy' 89 #target_executable = 'AIMCopy'
87 test_executable = 'aimc_tests' 90 test_executable = 'aimc_tests'
88 91
89 # Create build products directory if necessary 92 # Create build products directory if necessary
90 if not os.path.exists(build_dir): 93 if not os.path.exists(build_dir):
91 os.makedirs(build_dir) 94 os.makedirs(build_dir)
157 deplibs = ['sndfile'] 160 deplibs = ['sndfile']
158 161
159 if target_platform != 'win32': 162 if target_platform != 'win32':
160 for depname in deplibs: 163 for depname in deplibs:
161 env.ParseConfig('pkg-config --cflags --libs ' + depname) 164 env.ParseConfig('pkg-config --cflags --libs ' + depname)
162 env.AppendUnique(LIBS = deplibs)
163 else: 165 else:
164 #env.AppendUnique(LIBS = ['wsock32', 'winmm']) 166 #env.AppendUnique(LIBS = ['wsock32', 'winmm'])
165 if 'sndfile' in deplibs: 167 if 'sndfile' in deplibs:
166 ###### libsndfile ######################################## 168 ###### libsndfile ########################################
167 # This one is only valid for win32 and already precompiled 169 # This one is only valid for win32 and already precompiled
169 shutil.copyfile(windows_libsndfile_location + '/libsndfile-1.dll', 171 shutil.copyfile(windows_libsndfile_location + '/libsndfile-1.dll',
170 build_dir+'/libsndfile-1.dll') 172 build_dir+'/libsndfile-1.dll')
171 if compiler=='msvc': 173 if compiler=='msvc':
172 shutil.copyfile(windows_libsndfile_location + '/libsndfile-1.def', 174 shutil.copyfile(windows_libsndfile_location + '/libsndfile-1.def',
173 build_dir+'/libsndfile-1.def') 175 build_dir+'/libsndfile-1.def')
174 env.Command(build_dir + '/libsndfile.lib', build_dir + '/libsndfile.def', 176 env.Command(build_dir + '/libsndfile-1.lib', build_dir + '/libsndfile-1.def',
175 env['AR'] + ' /nologo /machine:i386 /def:$SOURCE /out:$TARGET') 177 env['AR'] + ' /nologo /machine:i386 /def:$SOURCE /out:$TARGET')
176 env.Append(CPPPATH = [windows_libsndfile_location]) 178 env.Append(CPPPATH = [windows_libsndfile_location + '/include/'])
177 env.AppendUnique(LIBPATH = [build_dir]) 179 env.AppendUnique(LIBPATH = [build_dir])
178 # Replace 'sndfile' with 'sndfile-1' 180 # Replace 'sndfile' with 'sndfile-1'
179 deplibs.remove('sndfile') 181 deplibs.remove('sndfile')
180 deplibs.append('sndfile-1') 182 deplibs.append('libsndfile-1')
183 env.AppendUnique(LIBS = deplibs)
181 184
182 185
183 186
184 # Builder for the main program 187 # Builder for the main program
185 program = env.Program(target = os.path.join(build_dir, target_executable), 188 program = env.Program(target = os.path.join(build_dir, target_executable),