| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
# mmxnow-config |
| 4 |
# |
| 5 |
# Tool for retrieving the library/include paths mmxnow was compiled with. |
| 6 |
# |
| 7 |
# Written by Unknown Author |
| 8 |
# Based *HEAVILY* on xmps-config from the XMPS program. |
| 9 |
# Based *HEAVILY* on xmms-config from the XMMS program. |
| 10 |
# Based *HEAVILY* on gtk-config from the GTK+ library package. |
| 11 |
# |
| 12 |
# This work is released under the GNU GPL, version 2 or later. |
| 13 |
|
| 14 |
prefix="@prefix@" |
| 15 |
exec_prefix="@exec_prefix@" |
| 16 |
exec_prefix_set=no |
| 17 |
data_dir="@datadir@/@PACKAGE@" |
| 18 |
|
| 19 |
include_dir="@includedir@/mmxnow" |
| 20 |
lib_dir="@libdir@" |
| 21 |
|
| 22 |
usage() |
| 23 |
{ |
| 24 |
cat <<EOF |
| 25 |
Usage: @PACKAGE@-config [OPTIONS] |
| 26 |
Options: |
| 27 |
[--prefix[=DIR]] |
| 28 |
[--exec-prefix[=DIR]] |
| 29 |
[--libs] |
| 30 |
[--cflags] |
| 31 |
[--data-dir] |
| 32 |
EOF |
| 33 |
exit $1 |
| 34 |
} |
| 35 |
|
| 36 |
if test $# -eq 0; then |
| 37 |
usage 1 1>&2 |
| 38 |
fi |
| 39 |
|
| 40 |
while test $# -gt 0; do |
| 41 |
case "$1" in |
| 42 |
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
| 43 |
*) optarg= ;; |
| 44 |
esac |
| 45 |
|
| 46 |
case $1 in |
| 47 |
--prefix=*) |
| 48 |
prefix=$optarg |
| 49 |
if test $exec_prefix_set = no ; then |
| 50 |
exec_prefix=$optarg |
| 51 |
fi |
| 52 |
;; |
| 53 |
|
| 54 |
--prefix) |
| 55 |
echo_prefix=yes |
| 56 |
;; |
| 57 |
|
| 58 |
--exec-prefix=*) |
| 59 |
exec_prefix=$optarg |
| 60 |
exec_prefix_set=yes |
| 61 |
;; |
| 62 |
|
| 63 |
--exec-prefix) |
| 64 |
echo_exec_prefix=yes |
| 65 |
;; |
| 66 |
|
| 67 |
--cflags) |
| 68 |
echo_cflags=yes |
| 69 |
;; |
| 70 |
|
| 71 |
--libs) |
| 72 |
echo_libs=yes |
| 73 |
;; |
| 74 |
|
| 75 |
--data-dir) |
| 76 |
echo_data_dir=yes |
| 77 |
;; |
| 78 |
|
| 79 |
*) |
| 80 |
usage 1 1>&2 |
| 81 |
;; |
| 82 |
esac |
| 83 |
shift |
| 84 |
done |
| 85 |
|
| 86 |
if test "$echo_prefix" = "yes"; then |
| 87 |
echo $prefix |
| 88 |
fi |
| 89 |
|
| 90 |
if test "$echo_exec_prefix" = "yes"; then |
| 91 |
echo $exec_prefix |
| 92 |
fi |
| 93 |
|
| 94 |
|
| 95 |
if test "$include_dir" != "/usr/include"; then |
| 96 |
cflags="-I$include_dir" |
| 97 |
else |
| 98 |
cflags="" |
| 99 |
fi |
| 100 |
|
| 101 |
if test "$lib_dir" != "/usr/lib"; then |
| 102 |
libs="-L$lib_dir @MMXNOW_RLD_FLAGS@ -lmmxnow" |
| 103 |
else |
| 104 |
libs="@MMXNOW_RLD_FLAGS@ -lmmxnow" |
| 105 |
fi |
| 106 |
|
| 107 |
if test "$echo_cflags" = "yes"; then |
| 108 |
echo $cflags |
| 109 |
fi |
| 110 |
|
| 111 |
if test "$echo_libs" = "yes"; then |
| 112 |
echo $libs |
| 113 |
fi |
| 114 |
|
| 115 |
if test "$echo_data_dir" = "yes"; then |
| 116 |
echo $data_dir |
| 117 |
fi |