diff options
author | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2015-10-09 22:59:03 +0200 |
commit | 972dcfcdbfe75dcfeb777150c136576cf1a71e99 (patch) | |
tree | 97a61cd7e293d7ae9d56ef7ed0f81253365bb026 /meta/classes/cml1.bbclass | |
download | poky-972dcfcdbfe75dcfeb777150c136576cf1a71e99.tar.gz |
initial commit for Enea Linux 5.0 arm
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/classes/cml1.bbclass')
-rw-r--r-- | meta/classes/cml1.bbclass | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/meta/classes/cml1.bbclass b/meta/classes/cml1.bbclass new file mode 100644 index 0000000000..43acfd531b --- /dev/null +++ b/meta/classes/cml1.bbclass | |||
@@ -0,0 +1,74 @@ | |||
1 | cml1_do_configure() { | ||
2 | set -e | ||
3 | unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS | ||
4 | oe_runmake oldconfig | ||
5 | } | ||
6 | |||
7 | EXPORT_FUNCTIONS do_configure | ||
8 | addtask configure after do_unpack do_patch before do_compile | ||
9 | |||
10 | inherit terminal | ||
11 | |||
12 | OE_TERMINAL_EXPORTS += "HOST_EXTRACFLAGS HOSTLDFLAGS TERMINFO CROSS_CURSES_LIB CROSS_CURSES_INC" | ||
13 | HOST_EXTRACFLAGS = "${BUILD_CFLAGS} ${BUILD_LDFLAGS}" | ||
14 | HOSTLDFLAGS = "${BUILD_LDFLAGS}" | ||
15 | CROSS_CURSES_LIB = "-lncurses -ltinfo" | ||
16 | CROSS_CURSES_INC = '-DCURSES_LOC="<curses.h>"' | ||
17 | TERMINFO = "${STAGING_DATADIR_NATIVE}/terminfo" | ||
18 | |||
19 | python do_menuconfig() { | ||
20 | import shutil | ||
21 | |||
22 | try: | ||
23 | mtime = os.path.getmtime(".config") | ||
24 | shutil.copy(".config", ".config.orig") | ||
25 | except OSError: | ||
26 | mtime = 0 | ||
27 | |||
28 | oe_terminal("${SHELL} -c \"make menuconfig; if [ \$? -ne 0 ]; then echo 'Command failed.'; printf 'Press any key to continue... '; read r; fi\"", '${PN} Configuration', d) | ||
29 | |||
30 | # FIXME this check can be removed when the minimum bitbake version has been bumped | ||
31 | if hasattr(bb.build, 'write_taint'): | ||
32 | try: | ||
33 | newmtime = os.path.getmtime(".config") | ||
34 | except OSError: | ||
35 | newmtime = 0 | ||
36 | |||
37 | if newmtime > mtime: | ||
38 | bb.note("Configuration changed, recompile will be forced") | ||
39 | bb.build.write_taint('do_compile', d) | ||
40 | } | ||
41 | do_menuconfig[depends] += "ncurses-native:do_populate_sysroot" | ||
42 | do_menuconfig[nostamp] = "1" | ||
43 | addtask menuconfig after do_configure | ||
44 | |||
45 | python do_diffconfig() { | ||
46 | import shutil | ||
47 | import subprocess | ||
48 | |||
49 | workdir = d.getVar('WORKDIR', True) | ||
50 | fragment = workdir + '/fragment.cfg' | ||
51 | configorig = '.config.orig' | ||
52 | config = '.config' | ||
53 | |||
54 | try: | ||
55 | md5newconfig = bb.utils.md5_file(configorig) | ||
56 | md5config = bb.utils.md5_file(config) | ||
57 | isdiff = md5newconfig != md5config | ||
58 | except IOError as e: | ||
59 | bb.fatal("No config files found. Did you do menuconfig ?\n%s" % e) | ||
60 | |||
61 | if isdiff: | ||
62 | statement = 'diff --unchanged-line-format= --old-line-format= --new-line-format="%L" ' + configorig + ' ' + config + '>' + fragment | ||
63 | subprocess.call(statement, shell=True) | ||
64 | |||
65 | shutil.copy(configorig, config) | ||
66 | |||
67 | bb.plain("Config fragment has been dumped into:\n %s" % fragment) | ||
68 | else: | ||
69 | if os.path.exists(fragment): | ||
70 | os.unlink(fragment) | ||
71 | } | ||
72 | |||
73 | do_diffconfig[nostamp] = "1" | ||
74 | addtask diffconfig | ||