1 | | Modify .soclib/global.conf as the following: |
| 1 | |
| 2 | ''Note: The following information is taken from the [http://www.soclib.fr/trac/dev/wiki/SoclibCc/SoclibConf soclib] trac.'' |
| 3 | |
| 4 | SoCLib's configuration file is used by `soclib-cc` to find your tools paths. You may override: |
| 5 | |
| 6 | * `libraries`: SystemC implementation to use (its paths, ...), tlm, ... |
| 7 | * `toolchain`: Compiler and compiler flags |
| 8 | * `build env`: toolchain, libraries and other flags (where objects reside, ...) |
| 9 | |
| 10 | Let's suppose we want to override SystemC's path, we can write the following `~/.soclib/global.conf`: |
| 26 | |
| 27 | Now let's suppose we would like to add another configuration where we use !SystemCass. We don't want compiled objects to mix-up, so we'll set another repository for built files. |
| 28 | |
| 29 | {{{ |
| 30 | #!python |
| 31 | config.libsystemcass = Library( |
| 32 | parent = config.systemc, |
| 33 | dir = "/home/me/tools/systemc/cass", |
| 34 | libs = config.systemc.libs + ["-Wl,-rpath,%(libdir)s", "-ldl", "-fopenmp"], |
| 35 | ) |
| 36 | |
| 37 | config.systemcass = BuildEnv( |
| 38 | parent = config.default, |
| 39 | repos = "repos/systemcass_objs", |
| 40 | libraries = [config.libsystemcass], |
| 41 | ) |
| 42 | }}} |
| 43 | |
| 44 | Now if we want to compile a platform with !SystemCass, the only thing to do is to tell it to `soclib-cc`: |
| 45 | |
| 46 | {{{ |
| 47 | $ soclib-cc -t systemcass |
| 48 | }}} |
| 49 | |
| 50 | The argument after -t is the configuration name, attribute set to config in this line: |
| 51 | |
| 52 | {{{ |
| 53 | config.systemcass = BuildEnv( .... |
| 54 | }}} |
| 55 | |
| 56 | |
| 57 | The only configuration names that can be passed to `-t` are the ones associated to `BuildEnvs`. |