# This file contains the default configuration to compile for Linux # platforms. It contains sensitive enviroment configuration that # shouldn't be modified unless you know what you are doing. # PLEASE, DO NOT EDIT THIS FILE import os from cerbero.config import Architecture if 'noalsa' not in variants: variants.append('alsa') if 'nox11' not in variants: variants.append('x11') if 'nopulse' not in variants: variants.append('pulse') if 'nocdparanoia' not in variants: variants.append('cdparanoia') if 'nov4l2' not in variants: variants.append('v4l2') if 'nosdl' not in variants: variants.append('sdl') if 'nogtk2' not in variants: variants.append('gtk2') if 'nogtk3' not in variants: variants.append('gtk3') if 'nogi' not in variants: variants.append('gi') if 'nounwind' not in variants: variants.append('unwind') for f in ['CPPFLAGS', 'CFLAGS', 'CCASFLAGS', 'CXXFLAGS', 'LDFLAGS', 'OBJCFLAGS']: os.environ[f] = os.environ.get(f, '') arch_flags = '' if target_arch == Architecture.X86: arch_flags += ' -m32 ' _host = 'i686-linux-gnu' elif target_arch == Architecture.X86_64: arch_flags += ' -m64 ' _host = 'x86_64-linux-gnu' if target_arch in [Architecture.ARM, Architecture.ARMv7]: if target_arch == Architecture.ARMv7: arch_flags += ' -march=armv7-a ' _host = 'arm-linux-gnueabi' os.environ['glib_cv_stack_grows'] = 'no' os.environ['glib_cv_uscore'] = 'no' os.environ['ac_cv_func_posix_getgrgid_r'] = 'yes' os.environ['ac_cv_func_posix_getpwuid_r'] = 'yes' os.environ['ac_cv_func_register_printf_specifier'] = 'no' os.environ['ac_cv_func_register_printf_function'] = 'no' if target_arch_flags is not None: arch_flags += ' %s ' % (target_arch_flags) if host is None and target_arch != arch: host = _host if tools_prefix is None: if host is not None and host != '': tools_prefix = '%s-' % host else: tools_prefix = '' if isysroot is not None: os.environ['CPPFLAGS'] += ' -isysroot %s' % (isysroot) os.environ['CFLAGS'] += ' -isysroot %s' % (isysroot) os.environ['CXXFLAGS'] += ' -isysroot %s' % (isysroot) os.environ['OBJCFLAGS'] += ' -isysroot %s' % (isysroot) if sysroot is not None: os.environ['CPPFLAGS'] += ' --sysroot=%s' % (sysroot) os.environ['CFLAGS'] += ' --sysroot=%s' % (sysroot) os.environ['CXXFLAGS'] += ' --sysroot=%s' % (sysroot) os.environ['OBJCFLAGS'] += ' --sysroot=%s' % (sysroot) os.environ['LDFLAGS'] += ' --sysroot=%s' % (sysroot) # Some cross compilers have a bug in the search for indirect dependencies # during linking. # http://stackoverflow.com/questions/16593519/finding-shared-library-dependencies-when-linking-executable workaround_cflags = '' if target_arch != arch: workaround_cflags = ' -Wl,-rpath-link=%s/lib ' % (prefix) # Disable gi if we are cross-compiling if 'gi' in variants: variants.remove('gi') os.environ['CFLAGS'] += ' -Wall -g -O2' + arch_flags + workaround_cflags os.environ['CXXFLAGS'] += ' -Wall -g -O2' + arch_flags os.environ['OBJCFLAGS'] += ' -Wall -g -O2' + arch_flags os.environ['CCASFLAGS'] += ' -Wall -g -O2' + arch_flags os.environ['LDFLAGS'] += arch_flags os.environ['am_cv_python_pyexecdir'] = '%s/%s/site-packages' % (prefix, py_prefix) os.environ['am_cv_python_pythondir'] = '%s/%s/site-packages' % (prefix, py_prefix) def cmd(command): return '%s%s' % (tools_prefix, command) os.environ['CC']= cmd('gcc') os.environ['CXX']= cmd('g++') os.environ['LD']= cmd('ld') os.environ['CPP']= cmd('cpp') os.environ['RANLIB']= cmd('ranlib') os.environ['AR']= cmd('ar') os.environ['AS']= cmd('as') os.environ['NM']= cmd('nm') os.environ['STRIP']= cmd('strip') os.environ['OBJCOPY']= cmd('objcopy') if use_ccache: comp = os.environ.get('CC', 'gcc') if not 'ccache' in comp: os.environ['CC'] = 'ccache ' + comp comp = os.environ.get('CXX', 'g++') if not 'ccache' in comp: os.environ['CXX'] = 'ccache ' + comp