summaryrefslogtreecommitdiffstats
path: root/libart2-config
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2019-04-22 16:13:09 +0200
committerSlávek Banko <slavek.banko@axis.cz>2019-04-28 16:02:46 +0200
commitb72d215669ce409ed6d6b6443b2fedb6c8045289 (patch)
tree3dc87bfe6c0c8925d03eb2b79f5dae6ce4c1e71a /libart2-config
parente041d2bbeb82171495aafc3d34cafdfc7204cdf5 (diff)
downloadlibart-lgpl-b72d215669ce409ed6d6b6443b2fedb6c8045289.tar.gz
libart-lgpl-b72d215669ce409ed6d6b6443b2fedb6c8045289.zip
Use pkg-config to get values in libart2-config.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 7c59d8ccd2155e4184eccc76da99094d8f63d5ec)
Diffstat (limited to 'libart2-config')
-rw-r--r--libart2-config68
1 files changed, 68 insertions, 0 deletions
diff --git a/libart2-config b/libart2-config
new file mode 100644
index 0000000..2d97c61
--- /dev/null
+++ b/libart2-config
@@ -0,0 +1,68 @@
+#!/bin/sh
+
+usage="\
+Usage: libart2-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags]"
+
+if test $# -eq 0; then
+ echo "${usage}" 1>&2
+ exit 1
+fi
+
+if ! which pkg-config >/dev/null; then
+ echo "pkg-config not found on your system" 1>&2
+ exit 1
+fi
+
+prefix=`pkg-config --variable=prefix libart-2.0`
+exec_prefix=`pkg-config --variable=exec_prefix libart-2.0`
+exec_prefix_set=no
+libs=""
+output_libs=no
+
+while test $# -gt 0; do
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case $1 in
+ --prefix=*)
+ prefix=$optarg
+ if test $exec_prefix_set = no ; then
+ exec_prefix=$optarg
+ fi
+ ;;
+ --prefix)
+ echo $prefix
+ ;;
+ --exec-prefix=*)
+ exec_prefix=$optarg
+ exec_prefix_set=yes
+ ;;
+ --exec-prefix)
+ echo $exec_prefix
+ ;;
+ --version)
+ echo `pkg-config --modversion libart-2.0`
+ ;;
+ --cflags)
+ echo `pkg-config --cflags-only-I libart-2.0`
+ ;;
+ --libs)
+ libs=`pkg-config --libs libart-2.0`
+ output_libs=yes
+ ;;
+ --static)
+ libs="$libs -lm"
+ ;;
+ *)
+ echo "${usage}" 1>&2
+ exit 1
+ ;;
+ esac
+ shift
+done
+
+if test $output_libs = yes ; then
+ echo $libs
+fi