| 1 |
#! /bin/sh |
| 2 |
usage() |
| 3 |
{ |
| 4 |
cat <<EOF |
| 5 |
Usage: libIDL-config [OPTIONS] |
| 6 |
Options: |
| 7 |
[--prefix] |
| 8 |
[--exec-prefix] |
| 9 |
[--version] |
| 10 |
[--libs] |
| 11 |
[--cflags] |
| 12 |
EOF |
| 13 |
exit $1 |
| 14 |
} |
| 15 |
|
| 16 |
if test $# -eq 0; then |
| 17 |
usage 1 1>&2 |
| 18 |
fi |
| 19 |
|
| 20 |
call_pkgconfig=no |
| 21 |
pkgconfig_flags= |
| 22 |
|
| 23 |
while test $# -gt 0; do |
| 24 |
case "$1" in |
| 25 |
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
| 26 |
*) optarg= ;; |
| 27 |
esac |
| 28 |
|
| 29 |
case $1 in |
| 30 |
--prefix) |
| 31 |
pkg-config --variable=prefix libIDL-2.0 |
| 32 |
;; |
| 33 |
--exec-prefix) |
| 34 |
pkg-config --variable=exec_prefix libIDL-2.0 |
| 35 |
;; |
| 36 |
--version) |
| 37 |
pkg-config --modversion libIDL-2.0 |
| 38 |
exit 0 |
| 39 |
;; |
| 40 |
--cflags) |
| 41 |
call_pkgconfig=yes |
| 42 |
pkgconfig_flags="$pkgconfig_flags --cflags" |
| 43 |
;; |
| 44 |
--libs) |
| 45 |
call_pkgconfig=yes |
| 46 |
pkgconfig_flags="$pkgconfig_flags --libs" |
| 47 |
;; |
| 48 |
*) |
| 49 |
usage 1 1>&2 |
| 50 |
;; |
| 51 |
esac |
| 52 |
shift |
| 53 |
done |
| 54 |
|
| 55 |
if test "$call_pkgconfig" = "yes"; then |
| 56 |
exec pkg-config $pkgconfig_flags libIDL-2.0 |
| 57 |
fi |
| 58 |
|
| 59 |
exit 0 |