4 ffmpeg_path=fobs.FFMPEG_HOME
5 jni_path=fobs.JNI_H_PATH
6 jni_md_path=fobs.JNI_MD_H_PATH
9 ffmpeg_lib_deps = ['avformat', 'avcodec', 'avutil'] + fobs.EXTERNAL_LIBS
11 if env['PLATFORM'] == 'posix':
12 ffmpeg_lib_deps += ['dl']
13 elif env['PLATFORM'] == 'win32':
14 env = Environment(tools=['mingw'],CCFLAGS=['-DHAVE_AV_CONFIG_H'])
15 env.Prepend(LINKFLAGS = ['-shared', '-D_JNI_IMPLEMENTATION_', '-Wl,--kill-at']);
17 ffmpeg_lib_deps += ['z']
20 env.Append(CPPPATH=[ffmpeg_path,ffmpeg_path+'/include/ffmpeg', ffmpeg_path+'/libavcodec', ffmpeg_path+'/libavformat', ffmpeg_path+'/libswscale', ffmpeg_path+'/libavutil',jni_path,jni_md_path,jni_path+'/win32', jni_path+'/linux','#src/cppapi']+fobs.EXTERNAL_INC_PATHS)
21 env.Append(LIBPATH=[ffmpeg_path+'/lib',ffmpeg_path+'/libavcodec', ffmpeg_path+'/libavformat',ffmpeg_path+'/libavutil', '#lib']+fobs.EXTERNAL_LIB_PATHS)
24 if fobs.DEBUG_SYMBOLS == 'yes':
25 env.Append(LINKFLAGS=['-g'])
26 env.Append(CCFLAGS=['-g'])
27 if fobs.OPTIMIZATIONS == 'yes':
28 env.Append(LINKFLAGS=['-O3'])
29 env.Append(CCFLAGS=['-O3'])
32 if sys.platform == 'darwin':
33 env['SHLINKFLAGS'] = '$LINKFLAGS -dynamiclib -read_only_relocs warning -single_module'
34 env['SHLIBSUFFIX'] = '.jnilib'
35 # env.Append(CCFLAGS=['-falign-loops=16', '-faltivec'])
36 # env.Append(CCFLAGS=['-D', '__STDC_CONSTANT_MACROS'])
39 env.Append(LIBS=['fobs']+ffmpeg_lib_deps)
40 env.Append(LINKFLAGS=['-dynamic'])
41 if env['PLATFORM'] == 'win32':
42 env.Program('#lib/fobs4jmf/fobs4jmf.dll',Split('decoder.cpp stand_alone_codec.cpp'))
44 env.SharedLibrary('#lib/fobs4jmf/fobs4jmf',Split('decoder.cpp stand_alone_codec.cpp'))
46 #Create Fobs4Jmf Jar file
47 envjava = Environment(tools = ['javac', 'jar'])
48 envjava['ENV']['PATH'] = os.environ['PATH']
49 if env['PLATFORM'] == 'win32':
50 envjava.Java(target = '#lib/fobs4jmf/classes', source = 'com', JAVACFLAGS=['-classpath', 'resources/jmf.jar;resources/jogl.jar;resources/junit.jar','-target','1.4.2','-source','1.4'])
52 envjava.Java(target = '#lib/fobs4jmf/classes', source = 'com', JAVACFLAGS=['-classpath', 'resources/jmf.jar:resources/jogl.jar:resources/junit.jar','-target','1.4.2','-source','1.4'])
53 envjava['JARCHDIR'] = 'lib/fobs4jmf/classes'
54 envjava.Jar(target = '#lib/fobs4jmf/fobs4jmf.jar', source = '#lib/fobs4jmf/classes')
56 #install other resources
57 Install('#lib/fobs4jmf', '#resources/jmf.properties')
58 Install('#lib/fobs4jmf', '#resources/jmf.jar')