source: mainline/tools/xcw/bin/helenos-pkg-config@ 1388f7f0

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

Export libgfx, libipcgfx, libdisplay

  • Property mode set to 100755
File size: 3.1 KB
Line 
1#!/bin/bash
2#
3# Copyright (c) 2015 Jiri Svoboda
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")"
35BUILD_ROOT="$(dirname "$(dirname "$(dirname "$XCW")")")"
36if [ -z "$EXPORT_DIR" ]; then
37 EXPORT_DIR="$BUILD_ROOT/export"
38fi
39
40INCLUDE_DIR="$EXPORT_DIR/include"
41LIB_DIR="$EXPORT_DIR/lib"
42
43libmath_cflags="-I$INCLUDE_DIR/libmath"
44libmath_libs="$LIB_DIR/libmath.a"
45
46libgui_cflags="-I$INCLUDE_DIR/libgui"
47libgui_libs="$LIB_DIR/libgui.a"
48
49libdraw_cflags="-I$INCLUDE_DIR/libdraw"
50libdraw_libs="$LIB_DIR/libdraw.a $LIB_DIR/libsoftrend.a"
51
52libhound_cflags="-I$INCLUDE_DIR/libhound"
53libhound_libs="$LIB_DIR/libhound.a"
54
55libpcm_cflags="-I$INCLUDE_DIR/libpcm"
56libpcm_libs="$LIB_DIR/libpcm.a"
57
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
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
77 (libgui) ;;
78 (libdraw) ;;
79 (libmath) ;;
80 (libhound) ;;
81 (libpcm) ;;
82 (libgfx) ;;
83 (libipcgfx) ;;
84 (libdisplay) ;;
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.