56 | | BoolOption( "PROFILE", "Build with symbols and other profiling info", False ), |
---|
57 | | PathOption( "PREFIX", "The prefix where ffado will be installed to.", "/usr/local", PathOption.PathAccept ), |
---|
58 | | PathOption( "BINDIR", "Overwrite the directory where apps are installed to.", "$PREFIX/bin", PathOption.PathAccept ), |
---|
59 | | PathOption( "LIBDIR", "Overwrite the directory where libs are installed to.", "$PREFIX/lib", PathOption.PathAccept ), |
---|
60 | | PathOption( "INCLUDEDIR", "Overwrite the directory where headers are installed to.", "$PREFIX/include", PathOption.PathAccept ), |
---|
61 | | PathOption( "SHAREDIR", "Overwrite the directory where misc shared files are installed to.", "$PREFIX/share/libffado", PathOption.PathAccept ), |
---|
62 | | BoolOption( "ENABLE_BEBOB", "Enable/Disable support for the BeBoB platform.", True ), |
---|
63 | | BoolOption( "ENABLE_FIREWORKS", "Enable/Disable support for the ECHO Audio FireWorks platform.", True ), |
---|
64 | | BoolOption( "ENABLE_OXFORD", "Enable/Disable support for the Oxford Semiconductor FW platform.", True ), |
---|
65 | | BoolOption( "ENABLE_MOTU", "Enable/Disable support for the MOTU platform.", True ), |
---|
66 | | BoolOption( "ENABLE_DICE", "Enable/Disable support for the TCAT DICE platform.", True ), |
---|
67 | | BoolOption( "ENABLE_METRIC_HALO", "Enable/Disable support for the Metric Halo platform.", False ), |
---|
68 | | BoolOption( "ENABLE_RME", "Enable/Disable support for the RME platform.", False ), |
---|
69 | | BoolOption( "ENABLE_MAUDIO", "Enable/Disable support for the M-Audio custom BeBoB devices.", False ), |
---|
70 | | BoolOption( "ENABLE_BOUNCE", "Enable/Disable the BOUNCE device.", False ), |
---|
71 | | BoolOption( "ENABLE_GENERICAVC", """\ |
---|
| 57 | BoolOption( "PROFILE", "Build with symbols and other profiling info", False ), |
---|
| 58 | PathOption( "PREFIX", "The prefix where ffado will be installed to.", "/usr/local", PathOption.PathAccept ), |
---|
| 59 | PathOption( "BINDIR", "Overwrite the directory where apps are installed to.", "$PREFIX/bin", PathOption.PathAccept ), |
---|
| 60 | PathOption( "LIBDIR", "Overwrite the directory where libs are installed to.", "$PREFIX/lib", PathOption.PathAccept ), |
---|
| 61 | PathOption( "INCLUDEDIR", "Overwrite the directory where headers are installed to.", "$PREFIX/include", PathOption.PathAccept ), |
---|
| 62 | PathOption( "SHAREDIR", "Overwrite the directory where misc shared files are installed to.", "$PREFIX/share/libffado", PathOption.PathAccept ), |
---|
| 63 | PathOption( "PYPKGDIR", "The directory where the python modules get installed.", |
---|
| 64 | distutils.sysconfig.get_python_lib( prefix="$PREFIX" ), PathOption.PathAccept ), |
---|
| 65 | BoolOption( "ENABLE_BEBOB", "Enable/Disable support for the BeBoB platform.", True ), |
---|
| 66 | BoolOption( "ENABLE_FIREWORKS", "Enable/Disable support for the ECHO Audio FireWorks platform.", True ), |
---|
| 67 | BoolOption( "ENABLE_OXFORD", "Enable/Disable support for the Oxford Semiconductor FW platform.", True ), |
---|
| 68 | BoolOption( "ENABLE_MOTU", "Enable/Disable support for the MOTU platform.", True ), |
---|
| 69 | BoolOption( "ENABLE_DICE", "Enable/Disable support for the TCAT DICE platform.", True ), |
---|
| 70 | BoolOption( "ENABLE_METRIC_HALO", "Enable/Disable support for the Metric Halo platform.", False ), |
---|
| 71 | BoolOption( "ENABLE_RME", "Enable/Disable support for the RME platform.", False ), |
---|
| 72 | BoolOption( "ENABLE_MAUDIO", "Enable/Disable support for the M-Audio custom BeBoB devices.", False ), |
---|
| 73 | BoolOption( "ENABLE_BOUNCE", "Enable/Disable the BOUNCE device.", False ), |
---|
| 74 | BoolOption( "ENABLE_GENERICAVC", """\ |
---|
213 | | # |
---|
214 | | # Check for working gcc and g++ compilers and their environment. |
---|
215 | | # |
---|
216 | | if not conf.CompilerCheck(): |
---|
217 | | print "\nIt seems as if your system isn't even able to compile any C-/C++-programs. Probably you don't have gcc and g++ installed. Compiling a package from source without a working compiler is very hard to do, please install the needed packages.\nHint: on *ubuntu you need both gcc- and g++-packages installed, easiest solution is to install build-essential which depends on gcc and g++." |
---|
218 | | Exit( 1 ) |
---|
219 | | |
---|
220 | | # Check for pkg-config before using pkg-config to check for other dependencies. |
---|
221 | | if not conf.CheckForPKGConfig(): |
---|
222 | | print "\nThe program 'pkg-config' could not be found.\nEither you have to install the corresponding package first or make sure that PATH points to the right directions." |
---|
223 | | Exit( 1 ) |
---|
224 | | |
---|
225 | | # |
---|
226 | | # The following checks are for headers and libs and packages we need. |
---|
227 | | # |
---|
228 | | allpresent = 1; |
---|
229 | | # for DBUS C++ bindings |
---|
230 | | allpresent &= conf.CheckHeader( "expat.h" ) |
---|
231 | | allpresent &= conf.CheckLib( 'expat', 'XML_ExpatVersion', '#include <expat.h>' ) |
---|
232 | | |
---|
233 | | pkgs = { |
---|
234 | | 'libraw1394' : '1.3.0', |
---|
235 | | 'libiec61883' : '1.1.0', |
---|
236 | | 'dbus-1' : '1.0', |
---|
237 | | } |
---|
238 | | |
---|
239 | | if env['REQUIRE_LIBAVC']: |
---|
240 | | pkgs['libavc1394'] = '0.5.3' |
---|
241 | | |
---|
242 | | if not env['SERIALIZE_USE_EXPAT']: |
---|
243 | | pkgs['libxml++-2.6'] = '2.13.0' |
---|
244 | | |
---|
245 | | for pkg in pkgs: |
---|
246 | | name2 = pkg.replace("+","").replace(".","").replace("-","").upper() |
---|
247 | | env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg, pkgs[pkg] ) |
---|
248 | | #print '%s_FLAGS' % name2 |
---|
249 | | if env['%s_FLAGS'%name2] == 0: |
---|
250 | | allpresent &= 0 |
---|
251 | | |
---|
252 | | if not allpresent: |
---|
253 | | print """ |
---|
| 216 | # |
---|
| 217 | # Check for working gcc and g++ compilers and their environment. |
---|
| 218 | # |
---|
| 219 | if not conf.CompilerCheck(): |
---|
| 220 | print "\nIt seems as if your system isn't even able to compile any C-/C++-programs. Probably you don't have gcc and g++ installed. Compiling a package from source without a working compiler is very hard to do, please install the needed packages.\nHint: on *ubuntu you need both gcc- and g++-packages installed, easiest solution is to install build-essential which depends on gcc and g++." |
---|
| 221 | Exit( 1 ) |
---|
| 222 | |
---|
| 223 | # Check for pkg-config before using pkg-config to check for other dependencies. |
---|
| 224 | if not conf.CheckForPKGConfig(): |
---|
| 225 | print "\nThe program 'pkg-config' could not be found.\nEither you have to install the corresponding package first or make sure that PATH points to the right directions." |
---|
| 226 | Exit( 1 ) |
---|
| 227 | |
---|
| 228 | # |
---|
| 229 | # The following checks are for headers and libs and packages we need. |
---|
| 230 | # |
---|
| 231 | allpresent = 1; |
---|
| 232 | # for DBUS C++ bindings |
---|
| 233 | allpresent &= conf.CheckHeader( "expat.h" ) |
---|
| 234 | allpresent &= conf.CheckLib( 'expat', 'XML_ExpatVersion', '#include <expat.h>' ) |
---|
| 235 | |
---|
| 236 | pkgs = { |
---|
| 237 | 'libraw1394' : '1.3.0', |
---|
| 238 | 'libiec61883' : '1.1.0', |
---|
| 239 | 'dbus-1' : '1.0', |
---|
| 240 | } |
---|
| 241 | |
---|
| 242 | if env['REQUIRE_LIBAVC']: |
---|
| 243 | pkgs['libavc1394'] = '0.5.3' |
---|
| 244 | |
---|
| 245 | if not env['SERIALIZE_USE_EXPAT']: |
---|
| 246 | pkgs['libxml++-2.6'] = '2.13.0' |
---|
| 247 | |
---|
| 248 | for pkg in pkgs: |
---|
| 249 | name2 = pkg.replace("+","").replace(".","").replace("-","").upper() |
---|
| 250 | env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg, pkgs[pkg] ) |
---|
| 251 | #print '%s_FLAGS' % name2 |
---|
| 252 | if env['%s_FLAGS'%name2] == 0: |
---|
| 253 | allpresent &= 0 |
---|
| 254 | |
---|
| 255 | if not allpresent: |
---|
| 256 | print """ |
---|
261 | | Exit( 1 ) |
---|
262 | | |
---|
263 | | # Check for C99 lrint() and lrintf() functions used to convert from |
---|
264 | | # float to integer more efficiently via float_cast.h. If not |
---|
265 | | # present the standard slower methods will be used instead. This |
---|
266 | | # might not be the best way of testing for these but it's the only |
---|
267 | | # way which seems to work properly. CheckFunc() fails due to |
---|
268 | | # argument count problems. |
---|
269 | | if env.has_key( 'CFLAGS' ): |
---|
270 | | oldcf = env['CFLAGS'] |
---|
271 | | else: |
---|
272 | | oldcf = "" |
---|
273 | | oldcf = env.Append(CFLAGS = '-std=c99') |
---|
274 | | if conf.CheckLibWithHeader( "m", "math.h", "c", "lrint(3.2);" ): |
---|
275 | | HAVE_LRINT = 1 |
---|
276 | | else: |
---|
277 | | HAVE_LRINT = 0 |
---|
278 | | if conf.CheckLibWithHeader( "m", "math.h", "c", "lrintf(3.2);" ): |
---|
279 | | HAVE_LRINTF = 1 |
---|
280 | | else: |
---|
281 | | HAVE_LRINTF = 0 |
---|
282 | | env['HAVE_LRINT'] = HAVE_LRINT; |
---|
283 | | env['HAVE_LRINTF'] = HAVE_LRINTF; |
---|
284 | | env.Replace(CFLAGS=oldcf) |
---|
| 264 | Exit( 1 ) |
---|
| 265 | |
---|
| 266 | # Check for C99 lrint() and lrintf() functions used to convert from |
---|
| 267 | # float to integer more efficiently via float_cast.h. If not |
---|
| 268 | # present the standard slower methods will be used instead. This |
---|
| 269 | # might not be the best way of testing for these but it's the only |
---|
| 270 | # way which seems to work properly. CheckFunc() fails due to |
---|
| 271 | # argument count problems. |
---|
| 272 | if env.has_key( 'CFLAGS' ): |
---|
| 273 | oldcf = env['CFLAGS'] |
---|
| 274 | else: |
---|
| 275 | oldcf = "" |
---|
| 276 | oldcf = env.Append(CFLAGS = '-std=c99') |
---|
| 277 | if conf.CheckLibWithHeader( "m", "math.h", "c", "lrint(3.2);" ): |
---|
| 278 | HAVE_LRINT = 1 |
---|
| 279 | else: |
---|
| 280 | HAVE_LRINT = 0 |
---|
| 281 | if conf.CheckLibWithHeader( "m", "math.h", "c", "lrintf(3.2);" ): |
---|
| 282 | HAVE_LRINTF = 1 |
---|
| 283 | else: |
---|
| 284 | HAVE_LRINTF = 0 |
---|
| 285 | env['HAVE_LRINT'] = HAVE_LRINT; |
---|
| 286 | env['HAVE_LRINTF'] = HAVE_LRINTF; |
---|
| 287 | env.Replace(CFLAGS=oldcf) |
---|
607 | | def CleanAction( action ): |
---|
608 | | if env.GetOption( "clean" ): |
---|
609 | | env.Execute( action ) |
---|
610 | | |
---|
611 | | if env.has_key( 'XDG_TOOLS' ) and env.has_key( 'PYUIC4' ): |
---|
612 | | if not env.GetOption("clean"): |
---|
613 | | action = "install" |
---|
614 | | else: |
---|
615 | | action = "uninstall" |
---|
616 | | mixerdesktopaction = env.Action( "xdg-desktop-menu %s support/xdg/ffado.org-ffadomixer.desktop" % action ) |
---|
617 | | mixericonaction = env.Action( "xdg-icon-resource %s --size 64 --novendor --context apps support/xdg/hi64-apps-ffado.png ffado" % action ) |
---|
618 | | env.Command( "__xdgstuff1", None, mixerdesktopaction ) |
---|
619 | | env.Command( "__xdgstuff2", None, mixericonaction ) |
---|
620 | | env.Alias( "install", ["__xdgstuff1", "__xdgstuff2" ] ) |
---|
621 | | CleanAction( mixerdesktopaction ) |
---|
622 | | CleanAction( mixericonaction ) |
---|
| 614 | def CleanAction( action ): |
---|
| 615 | if env.GetOption( "clean" ): |
---|
| 616 | env.Execute( action ) |
---|
| 617 | |
---|
| 618 | if env.has_key( 'XDG_TOOLS' ) and env.has_key( 'PYUIC4' ): |
---|
| 619 | if not env.GetOption("clean"): |
---|
| 620 | action = "install" |
---|
| 621 | else: |
---|
| 622 | action = "uninstall" |
---|
| 623 | mixerdesktopaction = env.Action( "xdg-desktop-menu %s support/xdg/ffado.org-ffadomixer.desktop" % action ) |
---|
| 624 | mixericonaction = env.Action( "xdg-icon-resource %s --size 64 --novendor --context apps support/xdg/hi64-apps-ffado.png ffado" % action ) |
---|
| 625 | env.Command( "__xdgstuff1", None, mixerdesktopaction ) |
---|
| 626 | env.Command( "__xdgstuff2", None, mixericonaction ) |
---|
| 627 | env.Alias( "install", ["__xdgstuff1", "__xdgstuff2" ] ) |
---|
| 628 | CleanAction( mixerdesktopaction ) |
---|
| 629 | CleanAction( mixericonaction ) |
---|