Changeset 00e6288 in mainline


Ignore:
Timestamp:
2024-01-05T14:10:56Z (11 months ago)
Author:
Vojtech Horky <vojtech.horky@…>
Branches:
master, topic/simplify-dev-export
Children:
7b907a0a
Parents:
de96d3b
git-author:
Vojtech Horky <vojtech.horky@…> (2024-01-05 13:50:59)
git-committer:
Vojtech Horky <vojtech.horky@…> (2024-01-05 14:10:56)
Message:

Add export-dev target to export all libraries

The new target export-dev builds all libraries and copies the created .a
archives and library headers to export-dev subdirectory.

Unlike the existing approach from tools/export.sh we do not list the
libraries manually but copy all of them automatically. This simplifies
maintenance when new library is added and it should also simplify
coastline builds as no change to HelenOS tree would be needed when the
ported software needs another library not yet mentioned in export.sh.

The approach relies as much on Meson to do the heavy-lifting as possible
and the invoked shell script merely copies the files (seems that Meson
is not able to do that by itself inside a target). The script honors
exported DESTDIR variable if set and ensures thin archives are converted
before export.

Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • meson.build

    rde96d3b r00e6288  
    7272install_files = []
    7373install_deps = []
     74
     75# Exported libraries and include files
     76# Format: [ type, source_file, destination ]
     77# See meson/part/exports/copy-export.sh for supported file types.
     78exported_devel_files = []
     79
    7480# Install script for headers.
    7581# TODO: Make a list of directories and turn into script later.
  • meson/part/exports/meson.build

    rde96d3b r00e6288  
    8585        capture: true,
    8686)
     87
     88run_target('export-dev',
     89    command: [
     90        sh,
     91        meson.source_root() / 'meson' / 'part' / 'exports' / 'copy-export.sh',
     92    ] + [
     93        'config', config_mk, 'config.mk',
     94        'config', config_sh, 'config.sh',
     95    ] + exported_devel_files
     96)
  • uspace/lib/c/meson.build

    rde96d3b r00e6288  
    5353        _sdir = meson.current_source_dir() / idir
    5454        uspace_lib_devel_install_script_text += 'cp -R -L -T "@0@" "${DESTDIR}include/libc"'.format(_sdir)
     55        exported_devel_files += ['include', _sdir, 'libc']
    5556endforeach
    5657
  • uspace/lib/meson.build

    rde96d3b r00e6288  
    180180                if run_command('[', '-d', incdir, ']').returncode() == 0
    181181                        includes += include_directories(incdir)
     182                        _sdir = meson.current_source_dir() / l / 'include'
    182183
    183184                        if installed_libs.contains(l)
    184                                 _sdir = meson.current_source_dir() / l / 'include'
    185185                                uspace_lib_devel_install_script_text += 'cp -R -L -T "@0@" "${DESTDIR}include/lib@1@"'.format(_sdir, l)
    186186                        endif
     187
     188                        exported_devel_files += ['include', _sdir, 'lib' + l]
    187189                else
    188190                        includes += include_directories(l)
     
    293295                        install_deps += [ _static_lib ]
    294296                endif
     297
     298                exported_devel_files += ['staticlib', _static_lib, 'lib' + l + '.a']
    295299
    296300                _static_dep = declare_dependency(
  • uspace/lib/posix/meson.build

    rde96d3b r00e6288  
    6767uspace_lib_devel_install_script_text += 'cp -R -L -T "@0@" "${DESTDIR}include/libposix"'.format(_sdir)
    6868uspace_lib_devel_install_script_text += 'ln -s -r "${DESTDIR}include/libc" "${DESTDIR}/include/common"'
     69
     70exported_devel_files += [ 'include', meson.current_source_dir() / 'include' / 'posix', 'libposix' ]
     71exported_devel_files += [ 'includesymlink', 'libc', 'libposix' ]
Note: See TracChangeset for help on using the changeset viewer.