Changeset a8ccc7e in mainline


Ignore:
Timestamp:
2019-08-17T12:49:43Z (5 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2b2783b
Parents:
7b1ae09
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-06-27 10:50:12)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2019-08-17 12:49:43)
Message:

Make the installation workaround less esoteric

Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • install.sh

    r7b1ae09 ra8ccc7e  
    3434        fi
    3535
    36         # Due to certain quirks of our build, executables need to be built with a different name than what they are installed with.
    37         # Meson doesn't support renaming installed files (at least not as of mid-2019) so we do it here manually.
    38 
    39         echo "######## Installing executables ########"
    40 
    41         cd ${MESON_BUILD_ROOT}/uspace
    42 
    43         find -name 'install@*' |
    44                 sed -e 'h; s:^.*/install@:@DESTDIR@:; s:\$:/:g; x; G; s:\s: :g' -e "s:@DESTDIR@:${MESON_INSTALL_DESTDIR_PREFIX}:g" |
    45                 xargs -L1 --verbose install -C -D -m755 -T
    46 
    4736) > ${MESON_BUILD_ROOT}/install_custom.log 2>&1
  • uspace/meson.build

    r7b1ae09 ra8ccc7e  
    133133endforeach
    134134
     135install_script_text = []
     136
    135137foreach tst : bin_targets
    136138        _ldargs = tst.get('link_args')
    137139        _src = tst.get('src')
    138140
    139         _install_dir = tst.get('install_dir').split('/')
    140         _install_dir += tst.get('basename')
    141141        _install = tst.get('install')
     142        _install_dir = tst.get('install_dir')
     143        _basename = tst.get('basename')
     144        _full_install_path = _install_dir / _basename
     145        _build_name = _full_install_path.underscorify()
     146        _full_build_name = meson.current_build_dir() / _build_name
    142147
    143148        if _install
    144                 _install_name = 'install@' + '$'.join(_install_dir)
    145         else
    146                 _install_name = '_'.join(_install_dir)
    147         endif
    148 
    149         if _install and install_debug_files
    150                 _debug_name = 'install@' + '$'.join([ 'debug' ] + _install_dir)
    151         else
    152                 _debug_name = '_'.join(_install_dir)
     149                # Due to certain quirks of our build, executables need to be built with a different name than what they are installed with.
     150                # Meson doesn't support renaming installed files (at least not as of mid-2019) so we do it here manually.
     151
     152                install_script_text += [
     153                        'mkdir -p ${MESON_INSTALL_DESTDIR_PREFIX}"@0@"'.format(_install_dir),
     154                        'cp "@0@" ${MESON_INSTALL_DESTDIR_PREFIX}"@1@"'.format(_full_build_name, _full_install_path),
     155                ]
     156
     157                if install_debug_files
     158                        install_script_text += [
     159                                'cp "@0@".disasm ${MESON_INSTALL_DESTDIR_PREFIX}debug/"@1@".disasm'.format(_full_build_name, _full_install_path),
     160                                'cp "@0@".map ${MESON_INSTALL_DESTDIR_PREFIX}debug/"@1@".map'.format(_full_build_name, _full_install_path)
     161                        ]
     162                endif
    153163        endif
    154164
    155165        if link_map
    156166                # We want linker to generate link map for debugging.
    157                 _ldargs += [ '-Wl,-Map,' + meson.current_build_dir() / _debug_name + '.map' ]
    158         endif
    159 
    160         _bin = executable(_install_name, _src,
     167                _ldargs += [ '-Wl,-Map,' + _full_build_name + '.map' ]
     168        endif
     169
     170        _bin = executable(_build_name, _src,
    161171                include_directories: tst.get('includes'),
    162172                dependencies: tst.get('dependencies'),
     
    167177                implicit_include_directories: false,
    168178                install: false,
    169                 #install_dir: tst.get('install_dir'),
     179                #install_dir: _install_dir,
    170180                build_by_default: true,
    171181        )
    172182
    173183        if disassemble
    174                 custom_target(_debug_name + '.disasm',
     184                custom_target(_build_name + '.disasm',
    175185                        command: [ objdump, '-S', '@INPUT@' ],
    176186                        input: _bin,
    177                         output: _debug_name + '.disasm',
     187                        output: _build_name + '.disasm',
    178188                        capture: true,
    179189                        install: false,
    180                         #install_dir: 'debug' / tst.get('install_dir'),
     190                        #install_dir: 'debug' / _install_dir,
    181191                        build_by_default: true,
    182192                )
    183193        endif
    184194endforeach
     195
     196# Emit and register the install script.
     197
     198configure_file(
     199        configuration: { 'text' : '\n'.join(install_script_text) },
     200        input: 'install.sh.in',
     201        output: 'install.sh',
     202)
     203
     204meson.add_install_script(meson.current_build_dir() / 'install.sh')
Note: See TracChangeset for help on using the changeset viewer.