blob: 5c4dfbd797938d9ea4c12e0aa5d43abcb2928bfa [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#!/bin/sh
2
3PCFILE=libmariadb
4
5command -v pkg-config > /dev/null 2>&1
6ret="$?"
7if [ "$ret" -ne 0 ]; then
8 echo pkg-config not found >&2
9 exit 1
10fi
11
12pkg-config $PCFILE > /dev/null 2>&1
13ret="$?"
14if [ "$ret" -ne 0 ]; then
15 echo $PCFILE pkg-config file missing >&2
16 exit 1
17fi
18
19cflags=$(pkg-config $PCFILE --cflags)
20include=$(pkg-config $PCFILE --cflags)
21libs=$(pkg-config $PCFILE --libs)
22plugindir=PLUGIN_DIR
23socket=SOCKET
24port=PORT
25version=VERSION
26
27usage () {
28 cat <<EOF
29Usage: $0 [OPTIONS]
30Options:
31 --cflags [$cflags]
32 --include [$include]
33 --libs [$libs]
34 --libs_r [$libs]
35 --plugindir [$plugindir]
36 --socket [$socket]
37 --port [$port]
38 --version [$version]
39EOF
40 exit "$1"
41}
42
43if test $# -le 0; then usage 0 ; fi
44
45while test $# -gt 0; do
46 case $1 in
47 --cflags) echo "$cflags" ;;
48 --include) echo "$include" ;;
49 --libs) echo "$libs" ;;
50 --libs_r) echo "$libs" ;;
51 --plugindir) echo "$plugindir" ;;
52 --socket) echo "$socket" ;;
53 --port) echo "$port" ;;
54 --version) echo "$version" ;;
55 *) usage 1 >&2 ;;
56 esac
57
58 shift
59done
60
61exit 0