Changes in / [25e1490:de96d3b] in mainline


Ignore:
Files:
4 added
5 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • meson.build

    r25e1490 rde96d3b  
    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.
    78 exported_devel_files = [
    79     [ 'includenamedsymlink', 'libc', 'common' ]
    80 ]
    81 
    8274# Install script for headers.
    8375# TODO: Make a list of directories and turn into script later.
  • meson/part/exports/meson.build

    r25e1490 rde96d3b  
    8585        capture: true,
    8686)
    87 
    88 run_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 )
  • tools/xcw/bin/helenos-pkg-config

    r25e1490 rde96d3b  
    1 #!/usr/bin/env python3
    2 
     1#!/bin/bash
    32#
    4 # Copyright (c) 2024 Vojtech Horky
     3# Copyright (c) 2020 Jiri Svoboda
    54# All rights reserved.
    65#
     
    3332#
    3433
     34XCW="$(dirname "$0")"
     35BUILD_ROOT="$(dirname "$(dirname "$(dirname "$XCW")")")"
     36if [ -z "$EXPORT_DIR" ]; then
     37        EXPORT_DIR="$BUILD_ROOT/export"
     38fi
    3539
    36 import argparse
    37 import os
    38 import sys
     40INCLUDE_DIR="$EXPORT_DIR/include"
     41LIB_DIR="$EXPORT_DIR/lib"
    3942
    40 # Package dependencies: always list only immediate dependencies so that
    41 # we can get proper ordering for static libraries
    42 CONFIG_DEPENDENCIES = {
    43     'libui': ['libdisplay', 'libcongfx', 'libgfxfont', 'libriff', 'libmemgfx', 'libconsole'],
    44     'libdisplay': ['libgfx', 'libipcgfx', 'libinput'],
    45     'libconsole': ['libinput', 'liboutput'],
    46     'libipcfgfx': ['libgfx'],
    47     'libgfximage': ['libpixconv'],
    48 }
     43libmath_cflags="-I$INCLUDE_DIR/libmath"
     44libmath_libs="$LIB_DIR/libmath.a"
    4945
    50 CONFIG_CFLAGS = {
    51 }
     46libui_cflags="-I$INCLUDE_DIR/libui -I$INCLUDE_DIR/libdisplay -I$INCLUDE_DIR/libgfx -I$INCLUDE_DIR/libipcgfx -I$INCLUDE_DIR/libcongfx"
     47libui_libs="$LIB_DIR/libui.a $LIB_DIR/libdisplay.a $LIB_DIR/libipcgfx.a $LIB_DIR/libcongfx.a $LIB_DIR/libgfx.a $LIB_DIR/libgfxfont.a $LIB_DIR/libriff.a $LIB_DIR/libmemgfx.a"
    5248
    53 CONFIG_LIBS = {
    54 }
     49libgfximage_cflags="-I$INCLUDE_DIR/libgfximage"
     50libgfximage_libs="$LIB_DIR/libgfximage.a $LIB_DIR/libpixconv.a"
    5551
    56 def get_with_dependencies(package, dependencies_first=True):
    57     deps = CONFIG_DEPENDENCIES.get(package, [])
    58     all_deps = [
    59         i
    60         for d in deps
    61         for i in get_with_dependencies(d, dependencies_first)
    62     ]
    63     result = (all_deps if dependencies_first else []) + [package] + ([] if dependencies_first else all_deps)
    64     seen = set()
    65     return [
    66         i
    67         for i in result
    68         if not (i in seen or seen.add(i))
    69     ]
     52libhound_cflags="-I$INCLUDE_DIR/libhound"
     53libhound_libs="$LIB_DIR/libhound.a"
    7054
    71 def get_build_root():
    72     dn = lambda x : os.path.dirname(x)
    73     return dn(dn(dn(dn(os.path.abspath(sys.argv[0])))))
     55libpcm_cflags="-I$INCLUDE_DIR/libpcm"
     56libpcm_libs="$LIB_DIR/libpcm.a"
    7457
    75 def main():
    76     args = argparse.ArgumentParser(description='pkg-config-like tool for HelenOS')
    77     args.add_argument(
    78         '--cflags',
    79         dest='cflags',
    80         action='store_true',
    81         default=False,
    82         help='Print required C compiler flags to stdout.'
    83     )
    84     args.add_argument(
    85         '--libs',
    86         dest='libs',
    87         action='store_true',
    88         default=False,
    89         help='Print required linker flags to stdout.'
    90     )
    91     args.add_argument('packages', metavar='PACKAGE', nargs='+')
     58libgfx_cflags="-I$INCLUDE_DIR/libgfx"
     59libgfx_libs="$LIB_DIR/libgfx.a"
    9260
    93     config = args.parse_args()
     61libipcgfx_cflags="-I$INCLUDE_DIR/libipcgfx"
     62libipcgfx_libs="$LIB_DIR/libipcgfx.a"
    9463
    95     export_dir = os.getenv('EXPORT_DIR', get_build_root())
     64libdisplay_cflags="-I$INCLUDE_DIR/libdisplay"
     65libdisplay_libs="$LIB_DIR/libdisplay.a"
    9666
    97     result = []
    98     for package in config.packages:
    99         if config.cflags:
    100             for i in get_with_dependencies(package, False):
    101                 if i in CONFIG_CFLAGS:
    102                     result.extend(CONFIG_CFLAGS[i])
    103                 else:
    104                     result.append(f'-I{export_dir}/include/{i}')
    105         if config.libs:
    106             for i in get_with_dependencies(package, False):
    107                 if i in CONFIG_LIBS:
    108                     result.extend(CONFIG_LIBS[i])
    109                 else:
    110                     result.append(f'{export_dir}/lib/{i}.a')
     67action=none
     68pkg=
    11169
    112     print(' '.join(result))
     70while [ ".$1" != . ] ; do
     71        case ".$1" in
     72        (.--cflags) action=cflags;;
     73        (.--libs) action=libs;;
     74        (.-*) echo "Uknwown option $1" >&2; exit 1;;
     75        (.*)
     76            case "$1" in
     77            (libui) ;;
     78            (libgfximage) ;;
     79            (libmath) ;;
     80            (libhound) ;;
     81            (libpcm) ;;
     82            (libgfx) ;;
     83            (libipcgfx) ;;
     84            (libdisplay) ;;
     85            (*) echo "Unknown package $1" >&2; exit 1;;
     86            esac
    11387
     88            echo "$pkg" | grep -w "$1" >/dev/null 2>&1
     89            if [ $? -ne 0 ] ; then
     90                    pkg="$pkg $1"
     91            fi;;
     92        esac
     93        shift 1
     94done
    11495
    115 if __name__ == '__main__':
    116     main()
     96if [ ."$pkg" = . ]; then
     97        echo "Package name(s) required." >&2
     98        exit 1
     99fi
     100
     101for p in $pkg ; do
     102        case "$action" in
     103        (cflags) eval "printf ' %s' \$${p}_cflags";;
     104        (libs) eval "printf ' %s' \$${p}_libs";;
     105        esac
     106done
     107
     108echo
  • uspace/lib/c/meson.build

    r25e1490 rde96d3b  
    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']
    5655endforeach
    5756
     
    210209        pic: false,
    211210)
    212 exported_devel_files += ['staticlib', libstartfiles, 'libstartfiles.a']
    213211
    214212if CONFIG_DEVEL_FILES
  • uspace/lib/clui/meson.build

    r25e1490 rde96d3b  
    2929deps = [ 'clipboard', 'console' ]
    3030src = files(
    31         'src/nchoice.c',
    32         'src/tinput.c',
     31        'nchoice.c',
     32        'tinput.c',
    3333)
  • uspace/lib/meson.build

    r25e1490 rde96d3b  
    180180                if run_command('[', '-d', incdir, ']').returncode() == 0
    181181                        includes += include_directories(incdir)
    182                         _sdir = meson.current_source_dir() / l / 'include'
    183182
    184183                        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]
    189187                else
    190188                        includes += include_directories(l)
     
    295293                        install_deps += [ _static_lib ]
    296294                endif
    297 
    298                 exported_devel_files += ['staticlib', _static_lib, 'lib' + l + '.a']
    299295
    300296                _static_dep = declare_dependency(
  • uspace/lib/posix/meson.build

    r25e1490 rde96d3b  
    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 
    70 exported_devel_files += [ 'include', meson.current_source_dir() / 'include' / 'posix', 'libposix' ]
    71 exported_devel_files += [ 'includesymlink', 'libc', 'libposix' ]
Note: See TracChangeset for help on using the changeset viewer.