# HG changeset patch # User tomwalters # Date 1279761592 0 # Node ID b4657c63bab4e7e498645687b84a06ffb9e58d84 # Parent 0cd20c74830844595216a445add854569909c0fd - Windows build fixes diff -r 0cd20c748308 -r b4657c63bab4 SConstruct --- a/SConstruct Sun Jul 11 03:46:06 2010 +0000 +++ b/SConstruct Thu Jul 22 01:19:52 2010 +0000 @@ -28,6 +28,9 @@ import os import shutil +# Location of libsndfile on Windows +windows_libsndfile_location = "C:\\Program Files\\Mega-Nerd\\libsndfile\\" + # Sources common to every version common_sources = ['Support/Common.cc', 'Support/FileList.cc', @@ -153,10 +156,29 @@ # Dependencies deplibs = ['sndfile'] -for depname in deplibs: - env.ParseConfig('pkg-config --cflags --libs ' + depname) +if target_platform != 'win32': + for depname in deplibs: + env.ParseConfig('pkg-config --cflags --libs ' + depname) + env.AppendUnique(LIBS = deplibs) +else: + #env.AppendUnique(LIBS = ['wsock32', 'winmm']) + if 'sndfile' in deplibs: + ###### libsndfile ######################################## + # This one is only valid for win32 and already precompiled + # Only need to create .lib file from .def + shutil.copyfile(windows_libsndfile_location + '/libsndfile-1.dll', + build_dir+'/libsndfile-1.dll') + if compiler=='msvc': + shutil.copyfile(windows_libsndfile_location + '/libsndfile-1.def', + build_dir+'/libsndfile-1.def') + env.Command(build_dir + '/libsndfile.lib', build_dir + '/libsndfile.def', + env['AR'] + ' /nologo /machine:i386 /def:$SOURCE /out:$TARGET') + env.Append(CPPPATH = [windows_libsndfile_location]) + env.AppendUnique(LIBPATH = [build_dir]) + # Replace 'sndfile' with 'sndfile-1' + deplibs.remove('sndfile') + deplibs.append('sndfile-1') -env.AppendUnique(LIBS = deplibs) # Builder for the main program