23 """ locate required libraries.
24 setup platform specific options.
25 Abort build in case of failure.
27 if isCleanupOperation(env)
or isHelpRequest():
30 conf = env.Configure()
35 if not conf.TryAction(
'pkg-config --version > $TARGET')[0]:
36 problems.append(
'We need pkg-config for including library configurations, exiting.')
39 compiler = env.subst(
'$CXX')
41 expectedFeature =
'solid C++23 support'
42 if compiler.startswith(
"g++"):
46 res = subprocess.check_output([compiler,
'-dumpversion'], universal_newlines=
True).strip()
47 res = tuple(int(x)
for x
in res.split(
'.'))
51 if res
and res < verGCCmin:
52 problems.append(
'The compiler "%s" reports version %s, yet we need at least %s for %s.'
53 % (compiler, res, verGCCmin, expectedFeature))
55 if not conf.CheckLibWithHeader(
'm',
'math.h',
'C'):
56 problems.append(
'Did not find math.h / libm.')
58 if not conf.CheckLibWithHeader(
'dl',
'dlfcn.h',
'C'):
59 problems.append(
'Functions for runtime dynamic loading not available.')
61 if not conf.CheckLibWithHeader(
'pthread',
'pthread.h',
'C'):
62 problems.append(
'Did not find the pthread lib or pthread.h.')
64 conf.env.Append(CPPFLAGS =
' -DHAVE_PTHREAD')
65 conf.env.Append(CCFLAGS =
' -pthread')
67 if not conf.CheckLib(symbol=
'clock_gettime', library=
'rt'):
68 problems.append(
'We expect the POSIX realtime extensions to be available through librt. ' +
69 'Unable to use clock_gettime()')
71 if conf.CheckCHeader(
'execinfo.h'):
72 conf.env.Append(CPPFLAGS =
' -DHAVE_EXECINFO_H')
74 if conf.CheckCHeader(
'valgrind/valgrind.h'):
75 conf.env.Append(CPPFLAGS =
' -DHAVE_VALGRIND_H')
77 print(
'Valgrind not found. The use of Valgrind is optional; building without.')
79 if not conf.CheckPkgConfig(
'nobugmt', 201008.1):
80 problems.append(
'Did not find NoBug [https://nobug.pipapo.org/].')
82 conf.env.mergeConf(
'nobugmt')
84 if not conf.CheckCXXHeader(
'memory'):
85 problems.append(
'We rely on the C++11 smart-pointers.')
87 if not conf.CheckCXXHeader(
'functional'):
88 problems.append(
'We rely on the C++11 functor objects.')
90 if not conf.CheckLibWithHeader(
'stdc++fs',
'filesystem',
'C++'):
91 problems.append(
'We need the C++17 filesystem support.')
93 if not conf.CheckCXXHeader(
'boost/config.hpp'):
94 problems.append(
'We need the C++ boost-libraries.')
96 if not conf.CheckCXXHeader(
'boost/lexical_cast.hpp'):
97 problems.append(
'We need boost::lexical_cast')
98 if not conf.CheckCXXHeader(
'boost/format.hpp'):
99 problems.append(
'We need boost::format (header).')
100 if not conf.CheckLibWithHeader(
'boost_program_options',
'boost/program_options.hpp',
'C++'):
101 problems.append(
'We need boost::program_options (including binary lib for linking).')
104 if not conf.CheckPkgConfig(
'gavl',
'2.0'):
105 problems.append(
'Did not find Gmerlin Audio Video Lib [https://github.com/bplaum/gavl].')
107 conf.env.mergeConf(
'gavl')
109 if not conf.CheckPkgConfig(
'alsa',
'1.2'):
110 problems.append(
'Support for ALSA sound output is required')
112 if not conf.CheckPkgConfig(
'gtkmm-3.0',
'3.20'):
113 problems.append(
'Unable to configure the mm-bindings for GTK-3')
115 if not conf.CheckPkgConfig(
'glibmm-2.4',
'2.66'):
116 problems.append(
'Unable to configure the mm-bindings for Glib')
118 if not conf.CheckPkgConfig(
'sigc++-2.0',
'2.12'):
119 problems.append(
'Need the signal-slot-binding library SigC++2')
121 if not conf.CheckPkgConfig(
'glib-2.0',
'2.80'):
122 problems.append(
'Need a suitable Glib version.')
124 if not conf.CheckPkgConfig(
'gthread-2.0',
'2.80'):
125 problems.append(
'Need gthread support lib for Glib based thread handling.')
127 if not conf.CheckPkgConfig(
'cairomm-1.0',
'1.14'):
128 problems.append(
'Unable to configure Cairo--')
132 urlGDLmm =
'git://git.lumiera.org/debian/gdlmm'
133 urlGDLmmDEB =
'http://lumiera.org/debian/'
134 if not conf.CheckPkgConfig(
'gdl-3.0', verGDL):
135 problems.append(
'GNOME Docking Library not found. We need at least GDL %s '
136 'and suitable C++ ("mm")-bindings (GDLmm >=%s)' % (verGDL, verGDLmm))
137 if not conf.CheckPkgConfig(
'gdlmm-3.0', verGDLmm, alias=
'gdl'):
138 problems.append(
'We need the C++ bindings for GDL by Fabien Parent: GDLmm >=%s '
139 '(either from %s or use the debian package from %s)' %
140 (verGDLmm, urlGDLmm, urlGDLmmDEB))
142 if not conf.CheckPkgConfig(
'librsvg-2.0',
'2.40'):
143 problems.append(
'Need rsvg Library for rendering icons.')
145 if not conf.CheckCHeader([
'X11/Xutil.h',
'X11/Xlib.h'],
'<>'):
146 problems.append(
'Xlib.h and Xutil.h required. Please install libx11-dev.')
150 if not conf.CheckPkgConfig(
'xv') : problems.append(
'Need libXv...')
151 if not conf.CheckPkgConfig(
'x11') : problems.append(
'Need X-lib...')
152 if not conf.CheckPkgConfig(
'xext'): problems.append(
'Need libXext.')
157 print(
"*** unable to build due to the following problems:")
158 for isue
in problems:
159 print(
" * %s" % isue)
160 print(
"\nbuild aborted.")
163 print(
"** Gathered Library Info: %s" % list(conf.env.libInfo.keys()))