diff options
| author | Eugen Wissner <belka@caraus.de> | 2025-01-02 16:25:07 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2025-01-02 16:25:07 +0100 |
| commit | 65ead3714da9bf53680a3147c6e4ffbc0a3c0ac2 (patch) | |
| tree | 11444dc032c41d5adc0ea9b12e12abb5dcb85057 /rakelib/cross.rake | |
| parent | a1c99103003bfd466c77a369fb3312f922f336d0 (diff) | |
| download | elna-haskell.tar.gz | |
Pass target to the cross taskhaskell
Diffstat (limited to 'rakelib/cross.rake')
| -rw-r--r-- | rakelib/cross.rake | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/rakelib/cross.rake b/rakelib/cross.rake index 03a69cb..e213bb0 100644 --- a/rakelib/cross.rake +++ b/rakelib/cross.rake @@ -35,6 +35,20 @@ class BuildTarget def tools tmp + 'tools' end + + def configuration + case target + when /^riscv[[:digit:]]+-/ + [ + '--with-arch=rv32imafdc', + '--with-abi=ilp32d', + '--with-tune=rocket', + '--with-isa-spec=20191213' + ] + else + [] + end + end end def gcc_verbose(gcc_binary) @@ -155,15 +169,11 @@ namespace :cross do options.sysroot.mkpath sh 'contrib/download_prerequisites', chdir: source_directory.to_path - configure_options = [ + configure_options = options.configuration + [ "--prefix=#{options.rootfs.realpath}", "--with-sysroot=#{options.sysroot.realpath}", '--enable-languages=c,c++', '--disable-shared', - '--with-arch=rv32imafdc', - '--with-abi=ilp32d', - '--with-tune=rocket', - '--with-isa-spec=20191213', '--disable-bootstrap', '--disable-multilib', '--disable-libmudflap', @@ -275,16 +285,12 @@ namespace :cross do rm_rf cwd cwd.mkpath - configure_options = [ + configure_options = options.configuration + [ "--prefix=#{options.rootfs.realpath}", "--with-sysroot=#{options.sysroot.realpath}", '--enable-languages=c,c++,lto', '--enable-lto', '--enable-shared', - '--with-arch=rv32imafdc', - '--with-abi=ilp32d', - '--with-tune=rocket', - '--with-isa-spec=20191213', '--disable-bootstrap', '--disable-multilib', '--enable-checking=release', @@ -323,7 +329,7 @@ namespace :cross do end desc 'Build cross toolchain' -task cross: [ +task :cross, [:target] => [ 'cross:binutils', 'cross:gcc1', 'cross:headers', |
