| 1 |
#!/bin/sh |
| 2 |
# Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. |
| 3 |
# |
| 4 |
# This file is free software; as a special exception the author gives |
| 5 |
# unlimited permission to copy and/or distribute it, with or without |
| 6 |
# modifications, as long as this notice is preserved. |
| 7 |
# |
| 8 |
# This file is distributed in the hope that it will be useful, but |
| 9 |
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the |
| 10 |
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 11 |
|
| 12 |
PGM=libassuan-config |
| 13 |
lib="@LIBASSUAN_CONFIG_LIB@" |
| 14 |
extralibs="@LIBASSUAN_CONFIG_EXTRA_LIBS@" |
| 15 |
cflags="@LIBASSUAN_CONFIG_CFLAGS@" |
| 16 |
api_version="@LIBASSUAN_CONFIG_API_VERSION@" |
| 17 |
all_thread_modules="@LIBASSUAN_CONFIG_THREAD_MODULES@" |
| 18 |
thread_module= |
| 19 |
prefix=@prefix@ |
| 20 |
exec_prefix=@exec_prefix@ |
| 21 |
includes="" |
| 22 |
libdirs="" |
| 23 |
exec_prefix_set=no |
| 24 |
echo_libs=no |
| 25 |
echo_cflags=no |
| 26 |
echo_prefix=no |
| 27 |
echo_exec_prefix=no |
| 28 |
|
| 29 |
if test x"$all_thread_modules" = x; then |
| 30 |
all_thread_modules="none pthread" |
| 31 |
else |
| 32 |
all_thread_modules="none pthread $all_thread_modules" |
| 33 |
fi |
| 34 |
|
| 35 |
usage() |
| 36 |
{ |
| 37 |
cat <<EOF |
| 38 |
Usage: $PGM [OPTIONS] |
| 39 |
Options: |
| 40 |
[--thread={`echo "${all_thread_modules}" | sed 's/ /|/g'`}] |
| 41 |
[--prefix[=DIR]] |
| 42 |
[--exec-prefix[=DIR]] |
| 43 |
[--version] |
| 44 |
[--libs] |
| 45 |
[--cflags] |
| 46 |
EOF |
| 47 |
exit $1 |
| 48 |
} |
| 49 |
|
| 50 |
if test $# -eq 0; then |
| 51 |
usage 1 1>&2 |
| 52 |
fi |
| 53 |
|
| 54 |
while test $# -gt 0; do |
| 55 |
case "$1" in |
| 56 |
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
| 57 |
*) optarg= ;; |
| 58 |
esac |
| 59 |
|
| 60 |
case $1 in |
| 61 |
--prefix=*) |
| 62 |
# Dummy |
| 63 |
;; |
| 64 |
--prefix) |
| 65 |
echo_prefix=yes |
| 66 |
;; |
| 67 |
--exec-prefix=*) |
| 68 |
# Dummy |
| 69 |
;; |
| 70 |
--exec-prefix) |
| 71 |
echo_exec_prefix=yes |
| 72 |
;; |
| 73 |
--version) |
| 74 |
echo "@VERSION@" |
| 75 |
exit 0 |
| 76 |
;; |
| 77 |
--api-version) |
| 78 |
echo_api_version=yes |
| 79 |
;; |
| 80 |
--thread=*) |
| 81 |
for mod in $all_thread_modules; do |
| 82 |
if test "$mod" = "$optarg"; then |
| 83 |
thread_module="-$mod" |
| 84 |
fi |
| 85 |
done |
| 86 |
if test "x$thread_module" = "x"; then |
| 87 |
usage 1 1>&2 |
| 88 |
fi |
| 89 |
if test "$thread_module" = "-none"; then |
| 90 |
thread_module="" |
| 91 |
fi |
| 92 |
if test "$thread_module" = "-pthread"; then |
| 93 |
thread_module="" |
| 94 |
fi |
| 95 |
;; |
| 96 |
--cflags) |
| 97 |
echo_cflags=yes |
| 98 |
;; |
| 99 |
--libs) |
| 100 |
echo_libs=yes |
| 101 |
;; |
| 102 |
*) |
| 103 |
usage 1 1>&2 |
| 104 |
;; |
| 105 |
esac |
| 106 |
shift |
| 107 |
done |
| 108 |
|
| 109 |
if test "$echo_prefix" = "yes"; then |
| 110 |
echo $prefix |
| 111 |
fi |
| 112 |
|
| 113 |
if test "$echo_exec_prefix" = "yes"; then |
| 114 |
echo $exec_prefix |
| 115 |
fi |
| 116 |
|
| 117 |
if test "$echo_api_version" = "yes"; then |
| 118 |
echo $api_version |
| 119 |
fi |
| 120 |
|
| 121 |
|
| 122 |
if test "$echo_cflags" = "yes"; then |
| 123 |
if test "@includedir@" != "/usr/include" ; then |
| 124 |
includes="-I@includedir@" |
| 125 |
for i in $cflags ; do |
| 126 |
if test "$i" = "-I@includedir@" ; then |
| 127 |
includes="" |
| 128 |
fi |
| 129 |
done |
| 130 |
fi |
| 131 |
echo $includes $cflags |
| 132 |
fi |
| 133 |
|
| 134 |
if test "$echo_libs" = "yes"; then |
| 135 |
if test "@libdir@" != "/usr/lib" ; then |
| 136 |
libdirs="-L@libdir@" |
| 137 |
for i in $lib $extralibs ; do |
| 138 |
if test "$i" = "-L@libdir@" ; then |
| 139 |
libdirs="" |
| 140 |
fi |
| 141 |
done |
| 142 |
fi |
| 143 |
echo $libdirs $lib${thread_module} $extralibs |
| 144 |
fi |