3 files = [Glob('lib/*.c'),Glob('lib/alac/*.c'),Glob('lib/crypto/*.c')]
5 env.Append(CPPPATH = ['include'])
7 # Set up the environment for compiling the libraries
9 conf = Configure(libenv)
10 conf.CheckLib('pthread')
11 conf.CheckLib('dns_sd')
12 libenv = conf.Finish()
13 libenv.Append(CPPPATH = ['lib'])
15 # Make sure libraries are compiled with DLL_EXPORT on windows
16 if libenv['PLATFORM'] == 'win32' or GetOption('mingw32') or GetOption('mingw64'):
17 libenv.Append(CPPDEFINES = ['DLL_EXPORT'])
19 # Prepare the libobj and shlibobj object files
20 libobj = libenv.Object(files)
21 if libenv['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME']:
24 shlibobj = libenv.SharedObject(files)
26 # Compile the static library into lib directory and shared library
28 if not libenv['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME']:
29 libenv.Library('shairplay', libobj, install=False)
30 libenv.SharedLibrary('shairplay', shlibobj, install=False)
32 # If we want to create universal binaries of the dynamic library on Mac, do it here
33 if GetOption('universal'):
34 libenv["ENV"]["MACOSX_DEPLOYMENT_TARGET"] = "10.4"
35 libenv.Append(CFLAGS = ['-arch', 'i386', '-arch', 'x86_64'])
36 libenv32 = libenv.Clone()
37 libenv64 = libenv.Clone()
39 libenv32.Append(LINKFLAGS = ['-undefined', 'dynamic_lookup'])
40 libenv32.Append(LINKFLAGS = ['-arch', 'i386'])
41 libenv32.Append(LINKFLAGS = ['-install_name', 'libshairplay32.dylib'])
42 libenv32.SharedLibrary('shairplay32', shlibobj, install=False)
44 libenv64.Append(LINKFLAGS = ['-undefined', 'dynamic_lookup'])
45 libenv64.Append(LINKFLAGS = ['-arch', 'x86_64'])
46 libenv64.Append(LINKFLAGS = ['-install_name', 'libshairplay64.dylib'])
47 libenv64.SharedLibrary('shairplay64', shlibobj, install=False)
49 libenv.Append(LINKFLAGS = ['-undefined', 'dynamic_lookup'])
50 libenv.Append(LINKFLAGS = ['-arch', 'i386', '-arch', 'x86_64'])
51 libenv.Append(LINKFLAGS = ['-install_name', 'libshairplay.dylib'])
53 # Set up the environment for compiling the examples
55 conf = Configure(appenv)
56 conf.CheckLib('pthread')
57 conf.CheckLib('dns_sd')
58 appenv = conf.Finish()
59 appenv.Append(LIBPATH = ['.'])
60 appenv.Prepend(LIBS = ['shairplay'])
62 exampleobj = appenv.Object(['test/example.c'])
63 appenv.Program('example', exampleobj, install=False)