4 Install the release and debug libs and includes under --prefix
7 from optparse import OptionParser
12 default_prefix="/usr/local"
14 pkgconfig_filename = "tbb.pc"
15 pkgconfig_file_contents = """\
18 libdir=${exec_prefix}/lib
19 includedir=${prefix}/include
22 Description: Intel Threading Building Blocks
25 Libs: -L${libdir} -ltbb -ltbbmalloc
26 Cflags: -I${includedir}
29 debug_pkgconfig_filename = "tbb_debug.pc"
30 debug_pkgconfig_file_contents = """\
33 libdir=${exec_prefix}/lib
34 includedir=${prefix}/include
37 Description: Intel Threading Building Blocks
40 Libs: -L${libdir} -ltbb_debug -ltbbmalloc_debug
41 Cflags: -I${includedir}
45 parser = OptionParser()
46 parser.add_option('','--prefix', default=default_prefix,
47 help="install architecture-independent files in PREFIX [default=%default]")
48 (options, args) = parser.parse_args()
53 prefix = options.prefix
55 # are we installing 64-bit libs?
58 files = glob.glob('build/*_em64t_*_release')
59 # print "files: ", files
63 # FIXME add 32 and 64-bit PPC support
70 os.system('install -d ' + os.path.join(prefix, 'include/tbb'))
71 os.system('install -d ' + os.path.join(prefix, 'include/tbb/machine'))
72 os.system('install -d ' + os.path.join(prefix, lib))
73 os.system('install -d ' + os.path.join(prefix, lib, 'pkgconfig'))
74 os.system('install -t ' + os.path.join(prefix, lib) + ' build/linux*release/*.so*')
75 os.system('install -t ' + os.path.join(prefix, lib) + ' build/linux*debug/*.so*')
76 os.system('install -t ' + os.path.join(prefix, 'include/tbb') + ' include/tbb/*.h')
77 os.system('install -t ' + os.path.join(prefix, 'include/tbb/machine') + ' include/tbb/machine/*.h')
79 f = open(os.path.join(prefix, lib, 'pkgconfig', pkgconfig_filename), 'w')
80 f.write(pkgconfig_file_contents % (prefix,))
83 f = open(os.path.join(prefix, lib, 'pkgconfig', debug_pkgconfig_filename), 'w')
84 f.write(debug_pkgconfig_file_contents % (prefix,))
87 if __name__ == "__main__":