source: mainline/tools/xcw/bin/helenos-pkg-config@ 140e21a

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 140e21a was 140e21a, checked in by Jiri Svoboda <jiri@…>, 5 years ago

Update export.sh and helenos-pkg-config

  • Property mode set to 100755
File size: 3.2 KB
RevLine 
[616f5dd3]1#!/bin/bash
2#
[140e21a]3# Copyright (c) 2020 Jiri Svoboda
[616f5dd3]4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions
8# are met:
9#
10# - Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer.
12# - Redistributions in binary form must reproduce the above copyright
13# notice, this list of conditions and the following disclaimer in the
14# documentation and/or other materials provided with the distribution.
15# - The name of the author may not be used to endorse or promote products
16# derived from this software without specific prior written permission.
17#
18# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28#
29# pkg-config-like tool for HelenOS libraries
30# HelenOS Cross Compiler Wrapper (XCW)
31# Facilitate cross-compiling external software to HelenOS
32#
33
34XCW="$(dirname "$0")"
[b78300f]35BUILD_ROOT="$(dirname "$(dirname "$(dirname "$XCW")")")"
[b501de7]36if [ -z "$EXPORT_DIR" ]; then
[b78300f]37 EXPORT_DIR="$BUILD_ROOT/export"
[b501de7]38fi
[b78300f]39
[b501de7]40INCLUDE_DIR="$EXPORT_DIR/include"
41LIB_DIR="$EXPORT_DIR/lib"
[616f5dd3]42
[b501de7]43libmath_cflags="-I$INCLUDE_DIR/libmath"
44libmath_libs="$LIB_DIR/libmath.a"
[616f5dd3]45
[140e21a]46libui_cflags="-I$INCLUDE_DIR/libui -I$INCLUDE_DIR/libdisplay -I$INCLUDE_DIR/libgfx -I$INCLUDE_DIR/libipcgfx"
47libui_libs="$LIB_DIR/libui.a $LIB_DIR/libdisplay.a $LIB_DIR/libipcgfx.a $LIB_DIR/libgfx.a"
[616f5dd3]48
[140e21a]49libgfximage_cflags="-I$INCLUDE_DIR/libgfximage"
50libgfximage_libs="$LIB_DIR/libgfximage.a $LIB_DIR/libpixconv.a"
[616f5dd3]51
[b501de7]52libhound_cflags="-I$INCLUDE_DIR/libhound"
53libhound_libs="$LIB_DIR/libhound.a"
[f98434b8]54
[b501de7]55libpcm_cflags="-I$INCLUDE_DIR/libpcm"
56libpcm_libs="$LIB_DIR/libpcm.a"
[f98434b8]57
[ecb7828]58libgfx_cflags="-I$INCLUDE_DIR/libgfx"
59libgfx_libs="$LIB_DIR/libgfx.a"
60
61libipcgfx_cflags="-I$INCLUDE_DIR/libipcgfx"
62libipcgfx_libs="$LIB_DIR/libipcgfx.a"
63
64libdisplay_cflags="-I$INCLUDE_DIR/libdisplay"
65libdisplay_libs="$LIB_DIR/libdisplay.a"
66
[616f5dd3]67action=none
68pkg=
69
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
[140e21a]77 (libui) ;;
78 (libgfximage) ;;
[616f5dd3]79 (libmath) ;;
[f98434b8]80 (libhound) ;;
81 (libpcm) ;;
[ecb7828]82 (libgfx) ;;
83 (libipcgfx) ;;
84 (libdisplay) ;;
[616f5dd3]85 (*) echo "Unknown package $1" >&2; exit 1;;
86 esac
87
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
95
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
Note: See TracBrowser for help on using the repository browser.