Commit 8588908
Merge branch 'vapier-master'
Changed files (5)
modifiedbuild.pymodifiedconfiguremodifieddodo.pymodifiedscripts/builder.pymodifiedscripts/configfile.py
Diff
@@ -11,7 +11,6 @@ from scripts import version if platform == 'msys': process_tasks(dodo.make_libbirdgems('libbirdgems.dll', [])) process_tasks(dodo.make_libbirdfont('libbirdfont.dll', ['libbirdgems.dll']))- process_tasks(dodo.make_libbirdfont('libbirdfont.dll', ['libbirdgems.dll'])) process_tasks(dodo.make_birdfont_test('birdfont-test.exe', ['libbirdgems.so', 'libbirdfont.so'])) elif platform == 'darwin': gems = "libbirdgems." + str(version.LIBBIRDGEMS_SO_VERSION) + '.dylib'@@ -49,9 +49,10 @@ def test_program_version (program, a, b, c): version = [int(n) for n in v.split ('.')] return [a,b,c] <= version -def test_library_version (lib):+def test_library_version(pkg_config, lib, required=True, version=None): print ('Looking for library: ' + lib + '\t\t')- process = subprocess.Popen ('pkg-config --modversion ' + lib, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)+ process = subprocess.Popen(pkg_config + ' --modversion ' + lib, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)+ v = process.stdout.readline().decode('utf-8') process.communicate()[0] return process.returncode == 0 @@ -64,7 +65,7 @@ def has_posixvala (): print (OKGREEN + 'Using posix profile.' + ENDC) return 'True' -def configure(gtk, libbgee, valac):+def configure(gtk, libbgee, valac, pkg_config): global gee if not test_program_version(valac, 0, 16, 0):@@ -93,21 +94,21 @@ def configure(gtk, libbgee, valac): 'xmlbird' ] + test_library_version(pkg_config, 'xmlbird', True, '1.2.0')+ for lib in libs:- if not test_library_version (lib):- print (FAIL + 'Can not find ' + lib + ENDC)- exit (1)+ test_library_version(pkg_config, lib) if libbgee == 'Any':- if test_library_version ('gee-0.8'):+ if test_library_version(pkg_config, 'gee-0.8', False): gee = 'gee-0.8'- elif test_library_version ('gee-1.0'):+ elif test_library_version(pkg_config, 'gee-1.0', False): gee = 'gee-1.0' else: print (FAIL + 'Can not find libgee (version 0.8 or version 1.0).' + ENDC) exit (1) else:- if not test_library_version (libbgee):+ if not test_library_version(pkg_config, libbgee): print (FAIL + 'Can not find lib gee.' + ENDC) exit (1) gee = libbgee;@@ -126,6 +127,7 @@ parser.add_option('-c', '--cc', dest='cc', help='C compiler', metavar='CC') parser.add_option('-g', '--gtk', dest='gtk', help='Build Gtk version, default is True', metavar='GTK') parser.add_option('-e', '--gee', dest='gee', help='Version of libgee', metavar='GEE') parser.add_option('-v', '--valac', dest='valac', help='Vala compiler', metavar='VALAC')+parser.add_option('-P', '--pkg-config', dest='pkg_config', help='Package config tool', metavar='PKG_CONFIG') parser.add_option('-n', '--nonnull', dest='nonnull', action="store_true", help='Enable compiletime checks for null pointers', metavar='NONNULL') parser.add_option('', '--valac-flags', dest='valac_flags', help='Vala compiler flags for all targets', metavar='VALAC_FLAGS', default='')@@ -178,21 +180,24 @@ if not options.gee: options.gee = 'Any' if not options.valac: options.valac = 'valac'+if not options.pkg_config:+ options.pkg_config = 'pkg-config' if not options.nonnull: options.nonnull = False else: options.nonnull = True -configure(options.gtk, options.gee, options.valac)+configure(options.gtk, options.gee, options.valac, options.pkg_config) configfile.write_config(options.prefix) configfile.write_compile_parameters(options.prefix,- options.dest,- options.cc,- gee,- options.valac,- options.nonnull,- valacflags,- cflags,- ldflags,- options.gtk)+ options.dest,+ options.cc,+ gee,+ options.valac,+ options.pkg_config,+ options.nonnull,+ valacflags,+ cflags,+ ldflags,+ options.gtk)@@ -61,16 +61,16 @@ def soname(target_binary): return '-Wl,-soname,' + target_binary def make_birdfont(target_binary, deps):- valac_command = config.VALAC + """\+ valac_command = """{valac} \ -C \ --vapidir=./ \ --basedir build/birdfont/ \- """ + config.NON_NULL + """ \- """ + config.VALACFLAGS.get("birdfont", "") + """ \+ {non_null} \+ {valacflags[birdfont]} \ --enable-experimental \ birdfont/*.vala \ --vapidir=./ \- --pkg """ + config.GEE + """ \+ --pkg {gee} \ --pkg gio-2.0 \ --pkg cairo \ --pkg libsoup-2.4 \@@ -78,37 +78,37 @@ def make_birdfont(target_binary, deps): --pkg webkit2gtk-4.0 \ --pkg libnotify \ --pkg xmlbird \- --pkg libbirdfont- """+ --pkg libbirdfont \+ """.format(**config.SETTINGS) - cc_command = config.CC + " " + config.CFLAGS.get("birdfont", "") + """ \+ cc_command = """{cc} {cflags[birdfont]} \ -c C_SOURCE \ -D 'GETTEXT_PACKAGE="birdfont"' \ -I./build/libbirdfont \- $(pkg-config --cflags sqlite3) \- $(pkg-config --cflags """ + config.GEE + """) \- $(pkg-config --cflags gio-2.0) \- $(pkg-config --cflags cairo) \- $(pkg-config --cflags glib-2.0) \- $(pkg-config --cflags gdk-pixbuf-2.0) \- $(pkg-config --cflags webkit2gtk-4.0) \- $(pkg-config --cflags libnotify) \- -o OBJECT_FILE"""+ $({pkg-config} --cflags sqlite3) \+ $({pkg-config} --cflags {gee}) \+ $({pkg-config} --cflags gio-2.0) \+ $({pkg-config} --cflags cairo) \+ $({pkg-config} --cflags glib-2.0) \+ $({pkg-config} --cflags gdk-pixbuf-2.0) \+ $({pkg-config} --cflags webkit2gtk-4.0) \+ $({pkg-config} --cflags libnotify) \+ -o OBJECT_FILE""".format(**config.SETTINGS) - linker_command = config.CC + " " + config.LDFLAGS.get("birdfont", "") + """ \+ linker_command = """{cc} {ldflags[birdfont]} \ build/birdfont/*.o \ -L./build/bin -lbirdfont \- $(pkg-config --libs sqlite3) \- $(pkg-config --libs """ + config.GEE + """) \- $(pkg-config --libs gio-2.0) \- $(pkg-config --libs cairo) \- $(pkg-config --libs glib-2.0) \- $(pkg-config --libs gdk-pixbuf-2.0) \- $(pkg-config --libs webkit2gtk-4.0) \- $(pkg-config --libs xmlbird) \- $(pkg-config --libs libnotify) \- -L./build -L./build/bin -l birdgems\- -o build/bin/""" + target_binary+ $({pkg-config} --libs sqlite3) \+ $({pkg-config} --libs {gee}) \+ $({pkg-config} --libs gio-2.0) \+ $({pkg-config} --libs cairo) \+ $({pkg-config} --libs glib-2.0) \+ $({pkg-config} --libs gdk-pixbuf-2.0) \+ $({pkg-config} --libs webkit2gtk-4.0) \+ $({pkg-config} --libs xmlbird) \+ $({pkg-config} --libs libnotify) \+ -L./build -L./build/bin -l birdgems \+ -o build/bin/""".format(**config.SETTINGS) + target_binary birdfont = Builder('birdfont', valac_command, @@ -124,44 +124,44 @@ def task_birdfont(): yield make_birdfont('birdfont', ['libbirdgems.so', 'libbirdfont.so']) def make_birdfont_export(target_binary, deps):- valac_command = config.VALAC + """ \+ valac_command = """{valac} \ -C \ --enable-experimental \ --basedir build/birdfont-export/ \- """ + config.NON_NULL + """ \- """ + config.VALACFLAGS.get("birdfont-export", "") + """ \+ {non_null} \+ {valacflags[birdfont-export]} \ birdfont-export/*.vala \ --vapidir=./ \- --pkg """ + config.GEE + """ \+ --pkg {gee} \ --pkg gio-2.0 \ --pkg cairo \ --pkg xmlbird \- --pkg libbirdfont- """+ --pkg libbirdfont \+ """.format(**config.SETTINGS) - cc_command = config.CC + " " + config.CFLAGS.get("birdfont-export", "") + """ \+ cc_command = """{cc} {cflags[birdfont-export]} \ -c C_SOURCE \ -D 'GETTEXT_PACKAGE="birdfont"' \ -I./build/libbirdfont \- $(pkg-config --cflags sqlite3) \- $(pkg-config --cflags """ + config.GEE + """) \- $(pkg-config --cflags gio-2.0) \- $(pkg-config --cflags cairo) \- $(pkg-config --cflags glib-2.0) \- -o OBJECT_FILE"""+ $({pkg-config} --cflags sqlite3) \+ $({pkg-config} --cflags {gee}) \+ $({pkg-config} --cflags gio-2.0) \+ $({pkg-config} --cflags cairo) \+ $({pkg-config} --cflags glib-2.0) \+ -o OBJECT_FILE""".format(**config.SETTINGS) - linker_command = config.CC + " " + config.LDFLAGS.get("birdfont-export", "") + """ \+ linker_command = """{cc} {ldflags[birdfont-export]} \ build/birdfont-export/*.o \ -Lbuild/bin/ -lbirdfont \ -lm \- $(pkg-config --libs sqlite3) \- $(pkg-config --libs """ + config.GEE + """) \- $(pkg-config --libs gio-2.0) \- $(pkg-config --libs cairo) \- $(pkg-config --libs glib-2.0) \- $(pkg-config --libs xmlbird) \- -L./build -L./build/bin -l birdgems\- -o ./build/bin/""" + target_binary+ $({pkg-config} --libs sqlite3) \+ $({pkg-config} --libs {gee}) \+ $({pkg-config} --libs gio-2.0) \+ $({pkg-config} --libs cairo) \+ $({pkg-config} --libs glib-2.0) \+ $({pkg-config} --libs xmlbird) \+ -L./build -L./build/bin -l birdgems \+ -o ./build/bin/""".format(**config.SETTINGS) + target_binary birdfont_export = Builder('birdfont-export', valac_command, @@ -177,44 +177,44 @@ def task_birdfont_export(): yield make_birdfont_export('birdfont-export', ['libbirdgems.so', 'libbirdfont.so']) def make_birdfont_import(target_binary, deps):- valac_command = config.VALAC + """\+ valac_command = """{valac} \ -C \ --enable-experimental \ --basedir build/birdfont-import/ \- """ + config.NON_NULL + """ \- """ + config.VALACFLAGS.get("birdfont-import", "") + """ \+ {non_null} \+ {valacflags[birdfont-import]} \ birdfont-import/*.vala \ --vapidir=./ \- --pkg """ + config.GEE + """ \+ --pkg {gee} \ --pkg gio-2.0 \ --pkg cairo \ --pkg xmlbird \- --pkg libbirdfont- """+ --pkg libbirdfont \+ """.format(**config.SETTINGS) - cc_command = config.CC + " " + config.CFLAGS.get("birdfont-import", "") + """ \+ cc_command = """{cc} {cflags[birdfont-import]} \ -c C_SOURCE \ -D 'GETTEXT_PACKAGE="birdfont"' \ -I./build/libbirdfont \- $(pkg-config --cflags sqlite3) \- $(pkg-config --cflags """ + config.GEE + """) \- $(pkg-config --cflags gio-2.0) \- $(pkg-config --cflags cairo) \- $(pkg-config --cflags glib-2.0) \- -o OBJECT_FILE"""-- linker_command = config.CC + " " + config.LDFLAGS.get("birdfont-import", "") + """ \+ $({pkg-config} --cflags sqlite3) \+ $({pkg-config} --cflags {gee}) \+ $({pkg-config} --cflags gio-2.0) \+ $({pkg-config} --cflags cairo) \+ $({pkg-config} --cflags glib-2.0) \+ -o OBJECT_FILE""".format(**config.SETTINGS)++ linker_command = """{cc} {ldflags[birdfont-import]} \ build/birdfont-import/*.o \ -Lbuild/bin/ -lbirdfont \ -lm \- $(pkg-config --libs sqlite3) \- $(pkg-config --libs """ + config.GEE + """) \- $(pkg-config --libs gio-2.0) \- $(pkg-config --libs cairo) \- $(pkg-config --libs glib-2.0) \- $(pkg-config --libs xmlbird) \- -L./build -L./build/bin -l birdgems\- -o ./build/bin/""" + target_binary+ $({pkg-config} --libs sqlite3) \+ $({pkg-config} --libs {gee}) \+ $({pkg-config} --libs gio-2.0) \+ $({pkg-config} --libs cairo) \+ $({pkg-config} --libs glib-2.0) \+ $({pkg-config} --libs xmlbird) \+ -L./build -L./build/bin -l birdgems \+ -o ./build/bin/""".format(**config.SETTINGS) + target_binary birdfont_import = Builder('birdfont-import', valac_command, @@ -230,45 +230,45 @@ def task_birdfont_import(): yield make_birdfont_import('birdfont-import', ['libbirdgems.so', 'libbirdfont.so']) def make_birdfont_autotrace(target_binary, deps):- valac_command = config.VALAC + """\+ valac_command = """{valac} \ -C \ --enable-experimental \ --basedir build/birdfont-autotrace/ \- """ + config.NON_NULL + """ \- """ + config.VALACFLAGS.get("birdfont-autotrace", "") + """ \+ {non_null} \+ {valacflags[birdfont-autotrace]} \ birdfont-autotrace/*.vala \ --vapidir=./ \- --pkg """ + config.GEE + """ \+ --pkg {gee} \ --pkg gio-2.0 \ --pkg cairo \ --pkg xmlbird \ --pkg libbirdfont \- """+ """.format(**config.SETTINGS) - cc_command = config.CC + " " + config.CFLAGS.get("birdfont-autotrace", "") + """ \+ cc_command = """{cc} {cflags[birdfont-autotrace]} \ -c C_SOURCE \ -D 'GETTEXT_PACKAGE="birdfont"' \ -I./build/libbirdfont \- $(pkg-config --cflags sqlite3) \- $(pkg-config --cflags """ + config.GEE + """) \- $(pkg-config --cflags gio-2.0) \- $(pkg-config --cflags cairo) \- $(pkg-config --cflags glib-2.0) \- -o OBJECT_FILE"""+ $({pkg-config} --cflags sqlite3) \+ $({pkg-config} --cflags {gee}) \+ $({pkg-config} --cflags gio-2.0) \+ $({pkg-config} --cflags cairo) \+ $({pkg-config} --cflags glib-2.0) \+ -o OBJECT_FILE""".format(**config.SETTINGS) - linker_command = config.CC + " " + config.LDFLAGS.get("birdfont-autotrace", "") + """ \+ linker_command = """{cc} {ldflags[birdfont-autotrace]} \ build/birdfont-autotrace/*.o \ -I./build/libbirdfont \ -Lbuild/bin/ -lbirdfont \ -lm \- $(pkg-config --libs sqlite3) \- $(pkg-config --libs """ + config.GEE + """) \- $(pkg-config --libs gio-2.0) \- $(pkg-config --libs cairo) \- $(pkg-config --libs glib-2.0) \- $(pkg-config --libs xmlbird) \- -L./build -L./build/bin -l birdgems\- -o ./build/bin/""" + target_binary+ $({pkg-config} --libs sqlite3) \+ $({pkg-config} --libs {gee}) \+ $({pkg-config} --libs gio-2.0) \+ $({pkg-config} --libs cairo) \+ $({pkg-config} --libs glib-2.0) \+ $({pkg-config} --libs xmlbird) \+ -L./build -L./build/bin -l birdgems \+ -o ./build/bin/""".format(**config.SETTINGS) + target_binary birdfont_autotrace = Builder('birdfont-autotrace', valac_command, @@ -284,55 +284,57 @@ def task_birdfont_autotrace(): yield make_birdfont_autotrace('birdfont-autotrace', ['libbirdgems.so', 'libbirdfont.so']) def make_libbirdfont(target_binary, deps):- valac_command = config.VALAC + """\+ valac_command = """{valac} \ -C \ --vapidir=./ \ --basedir build/libbirdfont/ \- """ + config.NON_NULL + """ \- """ + config.VALACFLAGS.get("libbirdfont", "") + """ \+ {non_null} \+ {valacflags[libbirdfont]} \ --enable-experimental \ --library libbirdfont \ -H build/libbirdfont/birdfont.h \ libbirdfont/*.vala \ libbirdfont/OpenFontFormat/*.vala \ libbirdfont/Renderer/*.vala \- --pkg """ + config.GEE + """ \+ --pkg posix \+ --pkg {gee} \ --pkg gio-2.0 \ --pkg cairo \ --pkg xmlbird \ --pkg libbirdgems \ --pkg sqlite3 \- """+ --pkg gdk-pixbuf-2.0 \+ """.format(**config.SETTINGS) - cc_command = config.CC + " " + config.CFLAGS.get("libbirdfont", "") + """ \+ cc_command = """{cc} {cflags[libbirdfont]} \ -c C_SOURCE \ -fPIC \ -D 'GETTEXT_PACKAGE="birdfont"' \ -I ./build/libbirdfont \ -I ./build/libbirdgems \- $(pkg-config --cflags sqlite3) \- $(pkg-config --cflags fontconfig) \- $(pkg-config --cflags """ + config.GEE + """) \- $(pkg-config --cflags gio-2.0) \- $(pkg-config --cflags cairo) \- $(pkg-config --cflags glib-2.0) \- $(pkg-config --cflags xmlbird) \- -o OBJECT_FILE"""-- linker_command = config.CC + " " + config.LDFLAGS.get("libbirdfont", "") + """ \+ $({pkg-config} --cflags sqlite3) \+ $({pkg-config} --cflags fontconfig) \+ $({pkg-config} --cflags {gee}) \+ $({pkg-config} --cflags gio-2.0) \+ $({pkg-config} --cflags cairo) \+ $({pkg-config} --cflags glib-2.0) \+ $({pkg-config} --cflags xmlbird) \+ -o OBJECT_FILE""".format(**config.SETTINGS)++ linker_command = ("""{cc} {ldflags[libbirdfont]} \ -shared \ """ + soname(target_binary) + """ \ build/libbirdfont/*.o \- $(pkg-config --libs sqlite3) \+ $({pkg-config} --libs sqlite3) \ $(freetype-config --libs) \- $(pkg-config --libs """ + config.GEE + """) \- $(pkg-config --libs gio-2.0) \- $(pkg-config --libs fontconfig) \- $(pkg-config --libs cairo) \- $(pkg-config --libs glib-2.0) \- $(pkg-config --libs xmlbird) \- -L./build -L./build/bin -l birdgems\- -o ./build/bin/""" + target_binary+ $({pkg-config} --libs {gee}) \+ $({pkg-config} --libs gio-2.0) \+ $({pkg-config} --libs fontconfig) \+ $({pkg-config} --libs cairo) \+ $({pkg-config} --libs glib-2.0) \+ $({pkg-config} --libs xmlbird) \+ -L./build -L./build/bin -l birdgems \+ -o ./build/bin/""").format(**config.SETTINGS) + target_binary libbirdfont = Builder('libbirdfont', valac_command, @@ -346,36 +348,37 @@ def make_libbirdfont(target_binary, deps): def task_libbirdfont(): yield make_libbirdfont('libbirdfont.so.' + SO_VERSION, ['libbirdgems.so'])- ++ def make_libbirdgems(target_binary, deps):- valac_command = config.VALAC + """\+ valac_command = """{valac} \ -C \ -H build/libbirdgems/birdgems.h \ --pkg posix \ --vapidir=./ \ --basedir=build/libbirdgems/ \- """ + config.NON_NULL + """ \- """ + config.VALACFLAGS.get("libbirdgems", "") + """ \+ {non_null} \+ {valacflags[libbirdgems]} \ --enable-experimental \ --library libbirdgems \ libbirdgems/*.vala \- """+ """.format(**config.SETTINGS) - cc_command = config.CC + " " + config.CFLAGS.get("libbirdgems", "") + """ \+ cc_command = """{cc} {cflags[libbirdgems]} \ -fPIC \- $(pkg-config --cflags glib-2.0) \+ $({pkg-config} --cflags glib-2.0) \ -c C_SOURCE \ -o OBJECT_FILE \- """+ """.format(**config.SETTINGS) - linker_command = config.CC + " " + config.LDFLAGS.get("libbirdgems", "") + """ \+ linker_command = ("""{cc} {ldflags[libbirdgems]} \ -shared \ """ + soname(target_binary) + """ \ -fPIC \ build/libbirdgems/*.o \- $(pkg-config --libs glib-2.0) \- $(pkg-config --libs gobject-2.0) \- -o build/bin/""" + target_binary+ $({pkg-config} --libs glib-2.0) \+ $({pkg-config} --libs gobject-2.0) \+ -o build/bin/""").format(**config.SETTINGS) + target_binary libbirdgems = Builder('libbirdgems', valac_command, @@ -427,45 +430,44 @@ def task_build (): } def make_birdfont_test(target_binary, deps):- valac_command = config.VALAC + """\+ valac_command = """{valac} \ -C \ --vapidir=./ \ --basedir build/birdfont-test/ \- """ + config.NON_NULL + """ \- """ + config.VALACFLAGS.get("birdfont-test", "") + """ \+ {non_null} \+ {valacflags[birdfont-test]} \ --enable-experimental \ birdfont-test/*.vala \ --vapidir=./ \- --pkg """ + config.GEE + """ \+ --pkg {gee} \ --pkg gio-2.0 \ --pkg cairo \ --pkg xmlbird \- --pkg libbirdfont- """+ --pkg libbirdfont \+ """.format(**config.SETTINGS) - cc_command = config.CC + " " + config.CFLAGS.get("birdfont-test", "") + """ \+ cc_command = """{cc} {cflags[birdfont-test]} \ -c C_SOURCE \ -D 'GETTEXT_PACKAGE="birdfont"' \ -I./build/libbirdfont \- $(pkg-config --cflags sqlite3) \- $(pkg-config --cflags """ + config.GEE + """) \- $(pkg-config --cflags gio-2.0) \- $(pkg-config --cflags cairo) \- $(pkg-config --cflags glib-2.0) \- $(pkg-config --cflags xmlbird) \- -o OBJECT_FILE"""- - linker_command = config.CC + " " + config.LDFLAGS.get("birdfont-test", "") + """ \+ $({pkg-config} --cflags sqlite3) \+ $({pkg-config} --cflags {gee}) \+ $({pkg-config} --cflags gio-2.0) \+ $({pkg-config} --cflags cairo) \+ $({pkg-config} --cflags glib-2.0) \+ -o OBJECT_FILE""".format(**config.SETTINGS)++ linker_command = """{cc} {ldflags[birdfont-test]} \ build/birdfont-test/*.o \ -L./build/bin -lbirdfont \- $(pkg-config --libs sqlite3) \- $(pkg-config --libs """ + config.GEE + """) \- $(pkg-config --libs gio-2.0) \- $(pkg-config --libs cairo) \- $(pkg-config --libs glib-2.0) \- $(pkg-config --libs xmlbird) \- -L./build -L./build/bin -l birdgems\- -o build/bin/""" + target_binary+ $({pkg-config} --libs sqlite3) \+ $({pkg-config} --libs {gee}) \+ $({pkg-config} --libs gio-2.0) \+ $({pkg-config} --libs cairo) \+ $({pkg-config} --libs glib-2.0) \+ $({pkg-config} --libs xmlbird) \+ -L./build -L./build/bin -l birdgems \+ -o build/bin/""".format(**config.SETTINGS) + target_binary test = Builder('birdfont-test', valac_command, @@ -478,6 +480,4 @@ def make_birdfont_test(target_binary, deps): yield test.build() def task_birdfont_test():- yield make_birdfont_test('birdfont-test', ['libbirdgems.so', 'libbirdfont.so'])--+ yield make_birdfont_test('birdfont-test', ['libbirdgems.so', 'libbirdfont.so'])\ No newline at end of file@@ -138,7 +138,10 @@ def is_up_to_date(task): for dep in task['file_dep']: if not path.isfile(dep):- print('Dependency is not created yet: ' + dep + ' needed for ' + task['targets'])+ targets = " ".join(str(x) for x in task['targets'])+ print('Build failed because dependency is not created yet: ' + dep)+ print()+ print('Targetes depending on ' + dep + ":\n" + targets) exit(1) target_times = []@@ -37,22 +37,34 @@ def write_config (prefix): f.write("}") -def write_compile_parameters (prefix, dest, cc, gee, valac, non_null,- valacflags, cflags, ldflags, gtk):+def write_compile_parameters(prefix, dest, cc, gee, valac, pkg_config,+ non_null, valacflags, cflags, ldflags, gtk):+ settings = {+ 'prefix': prefix,+ 'dest': dest,+ 'cc': cc,+ 'cflags': cflags,+ 'ldflags': ldflags,+ 'valac': valac,+ 'valacflags': valacflags,+ 'pkg-config': pkg_config,+ 'non_null': '--enable-experimental-non-null' if non_null else '',+ 'gee': gee,+ }+ def autoquote(v):+ if isinstance(v, str):+ return '"' + v + '"'+ else:+ return str(v)+ f = open('./scripts/config.py', 'w+') f.write("#!/usr/bin/python3\n")- f.write("PREFIX = \"" + prefix + "\"\n")- f.write("DEST = \"" + dest + "\"\n")- f.write("CC = \"" + cc + "\"\n")- f.write("GEE = \"" + gee + "\"\n")- f.write("VALAC = \"" + valac + "\"\n")-- if non_null:- f.write("NON_NULL = \"--enable-experimental-non-null\"\n")- else:- f.write("NON_NULL = \"\"\n")- - f.write("VALACFLAGS = " + str(valacflags) + "\n")- f.write("CFLAGS = " + str(cflags) + "\n")- f.write("LDFLAGS = " + str(ldflags) + "\n")+ for k, v in settings.items():+ f.write("%s = %s\n" % (k.upper().replace('-', '_'), autoquote(v)))+ f.write("GTK = " + str(gtk) + "\n")++ f.write("SETTINGS = {\n")+ for k, v in settings.items():+ f.write(' "%s": %s,\n' % (k, autoquote(v)))+ f.write("}\n")