| 1 |
#!/bin/sh |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
%{ |
|---|
| 36 |
%} |
|---|
| 37 |
|
|---|
| 38 |
subsystem_cxxflags="@subsystem_cxxflags@" |
|---|
| 39 |
subsystem_libs="@subsystem_libs@" |
|---|
| 40 |
Juggler_lib="@Juggler_lib@" |
|---|
| 41 |
Juggler_utils_lib="@Juggler_utils_lib@" |
|---|
| 42 |
Juggler_ogl_lib="@Juggler_ogl_lib@" |
|---|
| 43 |
Juggler_pf_lib="@Juggler_pf_lib@" |
|---|
| 44 |
Juggler_aw_lib="@Juggler_aw_lib@" |
|---|
| 45 |
Juggler_sl_lib="@Juggler_sl_lib@" |
|---|
| 46 |
|
|---|
| 47 |
vrj_default_abi="@ABI@" |
|---|
| 48 |
vrj_default_isa="@ISA@" |
|---|
| 49 |
vrj_n32_flags="@vrj_n32_flags@" |
|---|
| 50 |
vrj_64_flags="@vrj_64_flags@" |
|---|
| 51 |
LIBBITSUF='@LIBBITSUF@' |
|---|
| 52 |
vrj_libbitsuf_n32="@vrj_libbitsuf_n32@" |
|---|
| 53 |
vrj_libbitsuf_64="@vrj_libbitsuf_64@" |
|---|
| 54 |
|
|---|
| 55 |
if [ "x$vrj_default_abi" = "xN32" ]; then |
|---|
| 56 |
vrj_abi_flags="$vrj_n32_flags" |
|---|
| 57 |
elif [ "x$vrj_default_abi" = "x64" ]; then |
|---|
| 58 |
vrj_abi_flags="$vrj_64_flags" |
|---|
| 59 |
else |
|---|
| 60 |
vrj_abi_flags='' |
|---|
| 61 |
fi |
|---|
| 62 |
|
|---|
| 63 |
if [ "x$vrj_default_isa" = "xmips3" -o "x$vrj_default_isa" = "xmips4" ]; then |
|---|
| 64 |
vrj_isa_flags="-$vrj_default_isa" |
|---|
| 65 |
else |
|---|
| 66 |
vrj_isa_flags='' |
|---|
| 67 |
fi |
|---|
| 68 |
|
|---|
| 69 |
prefix=@prefix@ |
|---|
| 70 |
exec_prefix=@exec_prefix@ |
|---|
| 71 |
exec_prefix_set=no |
|---|
| 72 |
|
|---|
| 73 |
usage() |
|---|
| 74 |
{ |
|---|
| 75 |
cat <<EOF |
|---|
| 76 |
Usage: juggler-config [OPTIONS] [LIBRARIES] |
|---|
| 77 |
Options: |
|---|
| 78 |
[--basedir] Use \$VJ_BASE_DIR when printing paths |
|---|
| 79 |
[--prefix[=DIR]] Print the installation prefix or set an |
|---|
| 80 |
alternate prefix to use when printing paths |
|---|
| 81 |
[--exec-prefix[=DIR]] Print the executable prefix or set an alternate |
|---|
| 82 |
executable prefix to use when printing paths |
|---|
| 83 |
[--libs [N32|64]] Print the basic VR Juggler libraries |
|---|
| 84 |
[--extra-libs [N32|64]] Print the extra linker options needed for |
|---|
| 85 |
making an executable |
|---|
| 86 |
[--cxxflags [N32|64]] Print the flags for the C++ compiler |
|---|
| 87 |
[--subsystem] Print the OS abstraction layer being used |
|---|
| 88 |
|
|---|
| 89 |
Libraries (prints the linker options for one or more of these libraries): |
|---|
| 90 |
vrj (all basic libraries) |
|---|
| 91 |
Juggler |
|---|
| 92 |
Juggler_utils |
|---|
| 93 |
Juggler_ogl |
|---|
| 94 |
Juggler_pf |
|---|
| 95 |
Juggler_aw |
|---|
| 96 |
Juggler_sl |
|---|
| 97 |
EOF |
|---|
| 98 |
|
|---|
| 99 |
exit $1 |
|---|
| 100 |
} |
|---|
| 101 |
|
|---|
| 102 |
if test $ |
|---|
| 103 |
usage 1 1>&2 |
|---|
| 104 |
fi |
|---|
| 105 |
|
|---|
| 106 |
lib_Juggler=no |
|---|
| 107 |
lib_Juggler_ogl=no |
|---|
| 108 |
lib_Juggler_pf=no |
|---|
| 109 |
lib_Juggler_aw=no |
|---|
| 110 |
lib_Juggler_sl=no |
|---|
| 111 |
lib_Juggler_utils=no |
|---|
| 112 |
|
|---|
| 113 |
while test $ |
|---|
| 114 |
case "$1" in |
|---|
| 115 |
-*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
|---|
| 116 |
*) optarg= ;; |
|---|
| 117 |
esac |
|---|
| 118 |
|
|---|
| 119 |
case $1 in |
|---|
| 120 |
--basedir) |
|---|
| 121 |
use_base_dir=yes |
|---|
| 122 |
;; |
|---|
| 123 |
--prefix=*) |
|---|
| 124 |
prefix=$optarg |
|---|
| 125 |
if test $exec_prefix_set = no ; then |
|---|
| 126 |
exec_prefix=$optarg |
|---|
| 127 |
fi |
|---|
| 128 |
;; |
|---|
| 129 |
--prefix) |
|---|
| 130 |
echo_prefix=yes |
|---|
| 131 |
;; |
|---|
| 132 |
--exec-prefix=*) |
|---|
| 133 |
exec_prefix=$optarg |
|---|
| 134 |
exec_prefix_set=yes |
|---|
| 135 |
;; |
|---|
| 136 |
--exec-prefix) |
|---|
| 137 |
echo_exec_prefix=yes |
|---|
| 138 |
;; |
|---|
| 139 |
--version) |
|---|
| 140 |
echo @VRJ_MAJOR_VERSION@.@VRJ_MINOR_VERSION@.@VRJ_MICRO_VERSION@ |
|---|
| 141 |
;; |
|---|
| 142 |
--cxxflags) |
|---|
| 143 |
echo_cxxflags=yes |
|---|
| 144 |
case $2 in |
|---|
| 145 |
--*) |
|---|
| 146 |
|
|---|
| 147 |
;; |
|---|
| 148 |
N32) |
|---|
| 149 |
vrj_extra_cxxflags="$vrj_extra_cxxflags $vrj_n32_flags $vrj_isa_flags" |
|---|
| 150 |
shift |
|---|
| 151 |
;; |
|---|
| 152 |
64) |
|---|
| 153 |
vrj_extra_cxxflags="$vrj_extra_cxxflags $vrj_64_flags $vrj_isa_flags" |
|---|
| 154 |
shift |
|---|
| 155 |
;; |
|---|
| 156 |
*) |
|---|
| 157 |
vrj_extra_cxxflags="$vrj_extra_cxxflags $vrj_abi_flags $vrj_isa_flags" |
|---|
| 158 |
if [ "x$2" = "x" ]; then |
|---|
| 159 |
shift |
|---|
| 160 |
fi |
|---|
| 161 |
;; |
|---|
| 162 |
esac |
|---|
| 163 |
;; |
|---|
| 164 |
--subsystem) |
|---|
| 165 |
echo @THREAD_SYS@ |
|---|
| 166 |
;; |
|---|
| 167 |
--libs) |
|---|
| 168 |
echo_libs=yes |
|---|
| 169 |
case $2 in |
|---|
| 170 |
--*) |
|---|
| 171 |
|
|---|
| 172 |
;; |
|---|
| 173 |
N32) |
|---|
| 174 |
ldflags="$vrj_n32_flags $vrj_isa_flags" |
|---|
| 175 |
LIBBITSUF="$vrj_libbitsuf_n32" |
|---|
| 176 |
shift |
|---|
| 177 |
;; |
|---|
| 178 |
64) |
|---|
| 179 |
ldflags="$vrj_64_flags $vrj_isa_flags" |
|---|
| 180 |
LIBBITSUF="$vrj_libbitsuf_64" |
|---|
| 181 |
shift |
|---|
| 182 |
;; |
|---|
| 183 |
*) |
|---|
| 184 |
ldflags="$vrj_abi_flags $vrj_isa_flags" |
|---|
| 185 |
if [ "x$2" = "x" ]; then |
|---|
| 186 |
shift |
|---|
| 187 |
fi |
|---|
| 188 |
;; |
|---|
| 189 |
esac |
|---|
| 190 |
;; |
|---|
| 191 |
--extra-libs) |
|---|
| 192 |
echo_extra_libs=yes |
|---|
| 193 |
case $2 in |
|---|
| 194 |
--*) |
|---|
| 195 |
|
|---|
| 196 |
;; |
|---|
| 197 |
N32) |
|---|
| 198 |
LIBBITSUF='32' |
|---|
| 199 |
shift |
|---|
| 200 |
;; |
|---|
| 201 |
64) |
|---|
| 202 |
LIBBITSUF='64' |
|---|
| 203 |
shift |
|---|
| 204 |
;; |
|---|
| 205 |
*) |
|---|
| 206 |
if [ "x$2" = "x" ]; then |
|---|
| 207 |
shift |
|---|
| 208 |
fi |
|---|
| 209 |
;; |
|---|
| 210 |
esac |
|---|
| 211 |
;; |
|---|
| 212 |
--static) |
|---|
| 213 |
echo_static=yes |
|---|
| 214 |
;; |
|---|
| 215 |
vrj) |
|---|
| 216 |
lib_Juggler_all=yes |
|---|
| 217 |
;; |
|---|
| 218 |
Juggler) |
|---|
| 219 |
lib_Juggler=yes |
|---|
| 220 |
lib_Juggler_all=no |
|---|
| 221 |
;; |
|---|
| 222 |
Juggler_utils) |
|---|
| 223 |
lib_Juggler_utils=yes |
|---|
| 224 |
lib_Juggler_all=no |
|---|
| 225 |
;; |
|---|
| 226 |
Juggler_ogl) |
|---|
| 227 |
lib_Juggler_ogl=yes |
|---|
| 228 |
lib_Juggler_all=no |
|---|
| 229 |
;; |
|---|
| 230 |
Juggler_pf) |
|---|
| 231 |
lib_Juggler_pf=yes |
|---|
| 232 |
lib_Juggler_all=no |
|---|
| 233 |
;; |
|---|
| 234 |
Juggler_aw) |
|---|
| 235 |
lib_Juggler_aw=yes |
|---|
| 236 |
lib_Juggler_all=no |
|---|
| 237 |
;; |
|---|
| 238 |
Juggler_sl) |
|---|
| 239 |
lib_Juggler_sl=yes |
|---|
| 240 |
lib_Juggler_all=no |
|---|
| 241 |
;; |
|---|
| 242 |
*) |
|---|
| 243 |
usage 1 1>&2 |
|---|
| 244 |
;; |
|---|
| 245 |
esac |
|---|
| 246 |
shift |
|---|
| 247 |
done |
|---|
| 248 |
|
|---|
| 249 |
if test "x$lib_Juggler_all" = "x" ; then |
|---|
| 250 |
lib_Juggler_all=yes |
|---|
| 251 |
fi |
|---|
| 252 |
|
|---|
| 253 |
if test "$echo_prefix" = "yes"; then |
|---|
| 254 |
if test "$use_base_dir" = "yes"; then |
|---|
| 255 |
echo $VJ_BASE_DIR |
|---|
| 256 |
else |
|---|
| 257 |
echo $prefix |
|---|
| 258 |
fi |
|---|
| 259 |
fi |
|---|
| 260 |
|
|---|
| 261 |
if test "$echo_exec_prefix" = "yes"; then |
|---|
| 262 |
if test "$use_base_dir" = "yes"; then |
|---|
| 263 |
echo $VJ_BASE_DIR |
|---|
| 264 |
else |
|---|
| 265 |
echo $exec_prefix |
|---|
| 266 |
fi |
|---|
| 267 |
fi |
|---|
| 268 |
|
|---|
| 269 |
if test "$echo_cxxflags" = "yes"; then |
|---|
| 270 |
if test "$use_base_dir" = "yes"; then |
|---|
| 271 |
echo @CXXFLAGS@ $vrj_extra_cxxflags -I$VJ_BASE_DIR/include $subsystem_cxxflags |
|---|
| 272 |
else |
|---|
| 273 |
echo @CXXFLAGS@ $vrj_extra_cxxflags -I@includedir@ $subsystem_cxxflags |
|---|
| 274 |
fi |
|---|
| 275 |
fi |
|---|
| 276 |
|
|---|
| 277 |
if test "$echo_static" = "yes" ; then |
|---|
| 278 |
static_begin='@static_begin@' |
|---|
| 279 |
static_end='@static_end@' |
|---|
| 280 |
fi |
|---|
| 281 |
|
|---|
| 282 |
if test "$echo_libs" = "yes"; then |
|---|
| 283 |
if test "$use_base_dir" = "yes"; then |
|---|
| 284 |
ldflags="-L$VJ_BASE_DIR/lib$LIBBITSUF" |
|---|
| 285 |
else |
|---|
| 286 |
ldflags="$ldflags @vrj_ldflags@" |
|---|
| 287 |
fi |
|---|
| 288 |
|
|---|
| 289 |
if test "x$lib_Juggler_all" = "xyes" ; then |
|---|
| 290 |
vrj_libs="@vrj_libs@" |
|---|
| 291 |
else |
|---|
| 292 |
if test "x$lib_Juggler" = "xyes" ; then |
|---|
| 293 |
vrj_libs="$Juggler_lib" |
|---|
| 294 |
fi |
|---|
| 295 |
|
|---|
| 296 |
if test "x$lib_Juggler_utils" = "xyes" ; then |
|---|
| 297 |
vrj_libs="$vrj_libs $Juggler_utils_lib" |
|---|
| 298 |
fi |
|---|
| 299 |
|
|---|
| 300 |
if test "x$lib_Juggler_ogl" = "xyes" ; then |
|---|
| 301 |
vrj_libs="$vrj_libs $Juggler_ogl_lib" |
|---|
| 302 |
fi |
|---|
| 303 |
|
|---|
| 304 |
if test "x$lib_Juggler_pf" = "xyes" ; then |
|---|
| 305 |
vrj_libs="$vrj_libs $Juggler_pf_lib" |
|---|
| 306 |
fi |
|---|
| 307 |
|
|---|
| 308 |
if test "x$lib_Juggler_aw" = "xyes" ; then |
|---|
| 309 |
vrj_libs="$vrj_libs $Juggler_aw_lib" |
|---|
| 310 |
fi |
|---|
| 311 |
|
|---|
| 312 |
if test "x$lib_Juggler_sl" = "xyes" ; then |
|---|
| 313 |
vrj_libs="$vrj_libs $Juggler_sl_lib" |
|---|
| 314 |
fi |
|---|
| 315 |
fi |
|---|
| 316 |
|
|---|
| 317 |
echo $ldflags $static_begin $vrj_libs $static_end |
|---|
| 318 |
fi |
|---|
| 319 |
|
|---|
| 320 |
if test "x$echo_extra_libs" = "xyes"; then |
|---|
| 321 |
vrj_extra_ldflags="@vrj_extra_ldflags@" |
|---|
| 322 |
vrj_extra_libs="@vrj_extra_libs@" |
|---|
| 323 |
echo $vrj_extra_ldflags $vrj_extra_libs |
|---|
| 324 |
fi |
|---|