diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-03 18:04:08 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2020-01-03 20:24:29 +0200 |
commit | 23a7f3baa33265519840609dc54e950615ec39b1 (patch) | |
tree | ff2737f76b63a2acf5f8a9fffd5c15e3eb4c46c8 /configure | |
parent | WebProfile refactoring (diff) | |
download | smolbote-23a7f3baa33265519840609dc54e950615ec39b1.tar.xz |
Merge some QoL improvements from staging branch
- Build executable in top-level buildroot
- Use meson sourceset
- Pull in poi-crash and poi-update from staging
- Remove extraneous scripts in tools/
- Pull in configure scripts in scripts/
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/configure b/configure deleted file mode 100755 index fb011b0..0000000 --- a/configure +++ /dev/null @@ -1,62 +0,0 @@ -#!/usr/bin/env python3 -import shutil -import os -import subprocess - -def concat_options(default, options=[]): - if not options: - return default - r = '' - for option in options: - if option is default: - r += '*' + option + '* ' - else: - r += option + ' ' - return r.strip() - -def prompt(prompt, default, options=[]): - v = input("{} ({}): ".format(prompt, concat_options(default, options))) - if v is not '': - return v - return default - -if __name__ == "__main__": - # build options - build_dir = prompt('build folder', 'build') - build_type = prompt('build type', 'release', ['plain', 'debug', 'debugoptimized', 'release']) - build_prefix = prompt('prefix', '/usr/local') - - build_pie = prompt('position-independent executable', 'true', ['true', 'false']) - build_lto = prompt('link-time optimization', 'true', ['true', 'false']) - - # feature selection - auto_features = prompt('Feature auto state', 'disabled', ['auto', 'enabled', 'disabled']) - f_breakpad = prompt('Use breakpad', 'disabled', ['enabled', 'disabled']) - f_plasma = prompt('Use plasma', 'disabled', ['enabled', 'disabled']) - f_manpage = prompt('make manpage', 'enabled', ['enabled', 'disabled']) - - # compilers - cc = prompt('C compiler', 'gcc') - cpp = prompt('CPP compiler', 'g++') - ld = prompt('Linker', 'gold') - - # clean build folder - if os.path.isdir(build_dir): - shutil.rmtree(build_dir) - os.mkdir(build_dir, 0o700) - - env = { - **os.environ, - 'CC' : cc, - 'CXX' : cpp - } - # configure build dir - subprocess.run(['meson', '--buildtype={}'.format(build_type), '--prefix={}'.format(build_prefix), '--auto-features={}'.format(auto_features), - '-Db_pie={}'.format(build_pie), '-Db_lto={}'.format(build_lto), '-Dcpp_link_args="-fuse-ld={}"'.format(ld), - '-DBreakpad={}'.format(f_breakpad), '-DPlasma={}'.format(f_plasma), '-Dmanpage={}'.format(f_manpage), - build_dir], env=env, check=True) - - print("\n\n--- Configure step complete ---") - print("For more configuration options run 'meson configure' in the configured build directory.") - print("You can now build with 'ninja -C {}'.".format(build_dir)) - |