Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/openal-0.0.8/admin/pkgconfig/openal-config.in @ 33

Last change on this file since 33 was 17, checked in by landauf, 17 years ago

added openal

File size: 3.5 KB
Line 
1#!/bin/sh
2
3prefix="@prefix@"
4exec_prefix="@exec_prefix@"
5bindir="@bindir@"
6includedir="@includedir@"
7libdir="@libdir@"
8PACKAGE_VERSION="@PACKAGE_VERSION@"
9# PTHREAD_CFLAGS="@PTHREAD_CFLAGS@"
10# PTHREAD_LIBS="@PTHREAD_LIBS@"
11
12openal_dynamic_ldflags="-lopenal"
13# TODO: configure should provide the following...
14openal_static_ldflags="-lopenal"
15
16prefix_set=no
17echo_prefix=no
18exec_prefix_set=no
19echo_exec_prefix=no
20bindir_set=no
21echo_bindir=no
22includedir_set=no
23echo_includedir=no
24libdir_set=no
25echo_libdir=no
26echo_version=no
27echo_cflags=no
28static_libs=no
29echo_libs=no
30
31usage()
32{
33  cat <<EOF 1>&2
34Usage: openal-config [OPTIONS]
35Options:
36  --prefix[=DIR]       print/set default prefix
37  --exec-prefix[=DIR]  print/set prefix for machine-specific files
38  --bindir[=DIR]       print/set prefix for executable programs
39  --includedir[=DIR]   print/set prefix for include files
40  --libdir[=DIR]       print/set prefix for libraries
41  --version            print OpenAL package version
42  --cflags             print flags for C compiler
43  --static             specify that static linker flags are wanted
44  --libs               print flags for linker
45EOF
46  exit 1
47}
48
49if test $# -eq 0; then
50  usage
51fi
52
53while test $# -gt 0; do
54  case "$1" in
55  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
56  *) optarg="" ;;
57  esac
58
59  case $1 in
60    --prefix=*)
61      prefix="${optarg}"
62      prefix_set="yes"
63      ;;
64    --prefix)
65      echo_prefix="yes"
66      ;;
67    --exec-prefix=*)
68      exec_prefix="${optarg}"
69      exec_prefix_set="yes"
70      ;;
71    --exec-prefix)
72      echo_exec_prefix="yes"
73      ;;
74    --bindir=*)
75      bindir="${optarg}"
76      bindir_set="yes"
77      ;;
78    --bindir)
79      echo_bindir="yes"
80      ;;
81    --includedir=*)
82      includedir="${optarg}"
83      includedir_set="yes"
84      ;;
85    --includedir)
86      echo_includedir="yes"
87      ;;
88    --libdir=*)
89      libdir="${optarg}"
90      libdir_set="yes"
91      ;;
92    --libdir)
93      echo_libdir="yes"
94      ;;
95    --version)
96      echo_version="yes"
97      ;;
98    --cflags)
99      echo_cflags="yes"
100      ;;
101    --static)
102      static_libs="yes"
103      ;;
104    --libs)
105      echo_libs="yes"
106      ;;
107    *)
108      usage
109      ;;
110  esac
111  shift
112done
113
114if test "${echo_prefix}" = "yes"; then
115  echo "${prefix}"
116fi
117
118if test "${exec_prefix_set}" = "no" && test "${prefix_set}" = "yes"; then
119  exec_prefix="$prefix"
120  exec_prefix_set="yes"
121fi
122
123if test "$echo_exec_prefix" = "yes"; then
124  echo "${exec_prefix}"
125fi
126
127if test "${bindir_set}" = "no" && test "${exec_prefix_set}" = "yes"; then
128  bindir="${exec_prefix}/bin"
129fi
130
131if test "$echo_bindir" = "yes"; then
132  echo "${bindir}"
133fi
134
135if test "${includedir_set}" = "no" && test "${prefix_set}" = "yes"; then
136  includedir="${prefix}/include"
137fi
138
139if test "$echo_includedir" = "yes"; then
140  echo "${includedir}"
141fi
142
143if test "${libdir_set}" = "no" && test "${exec_prefix_set}" = "yes"; then
144  libdir="${exec_prefix}/lib"
145fi
146
147if test "$echo_libdir" = "yes"; then
148  echo "${libdir}"
149fi
150
151if test "$echo_version" = "yes"; then
152  echo "${PACKAGE_VERSION}"
153fi
154
155if test "$echo_cflags" = "yes"; then
156  if test "${includedir}" = "/usr/include" ; then
157    incpath=""
158  else
159    incpath="-I${includedir}"
160  fi
161  echo "${PTHREAD_CFLAGS} ${incpath}"
162fi
163
164if test "$echo_libs" = "yes"; then
165  if test "${libdir}" = "/usr/lib" ; then
166    libpathflag=""
167  else
168    libpathflag="-L${libdir}"
169  fi
170  if test "${static_libs}" = "yes"; then
171     ldflags="${openal_static_ldflags}"
172  else
173     ldflags="${openal_dynamic_ldflags}"
174  fi
175  echo "${libpathflag} ${ldflags} ${PTHREAD_LIBS}"
176fi
Note: See TracBrowser for help on using the repository browser.