root/juggler/branches/1.0/juggler-config.in

Revision 8789, 8.8 kB (checked in by patrickh, 7 years ago)

Copyright update.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 #!/bin/sh
2
3 # ************** <auto-copyright.pl BEGIN do not edit this line> **************
4 #
5 # VR Juggler is (C) Copyright 1998, 1999, 2000, 2001, 2002
6 #   by Iowa State University
7 #
8 # Original Authors:
9 #   Allen Bierbaum, Christopher Just,
10 #   Patrick Hartling, Kevin Meinert,
11 #   Carolina Cruz-Neira, Albert Baker
12 #
13 # This library is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU Library General Public
15 # License as published by the Free Software Foundation; either
16 # version 2 of the License, or (at your option) any later version.
17 #
18 # This library is distributed in the hope that it will be useful,
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21 # Library General Public License for more details.
22 #
23 # You should have received a copy of the GNU Library General Public
24 # License along with this library; if not, write to the
25 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26 # Boston, MA 02111-1307, USA.
27 #
28 # -----------------------------------------------------------------
29 # File:          $RCSfile$
30 # Date modified: $Date$
31 # Version:       $Revision$
32 # -----------------------------------------------------------------
33 #
34 # *************** <auto-copyright.pl END do not edit this line> ***************
35
36 %{
37 %}
38
39 subsystem_cxxflags="@subsystem_cxxflags@"
40 subsystem_libs="@subsystem_libs@"
41 Juggler_lib="@Juggler_lib@"
42 Juggler_utils_lib="@Juggler_utils_lib@"
43 Juggler_ogl_lib="@Juggler_ogl_lib@"
44 Juggler_pf_lib="@Juggler_pf_lib@"
45 Juggler_aw_lib="@Juggler_aw_lib@"
46 Juggler_sl_lib="@Juggler_sl_lib@"
47
48 vrj_default_abi="@ABI@"
49 vrj_default_isa="@ISA@"
50 vrj_n32_flags="@vrj_n32_flags@"
51 vrj_64_flags="@vrj_64_flags@"
52 LIBBITSUF='@LIBBITSUF@'
53 vrj_libbitsuf_n32="@vrj_libbitsuf_n32@"
54 vrj_libbitsuf_64="@vrj_libbitsuf_64@"
55
56 if [ "x$vrj_default_abi" = "xN32" ]; then
57     vrj_abi_flags="$vrj_n32_flags"
58 elif [ "x$vrj_default_abi" = "x64" ]; then
59     vrj_abi_flags="$vrj_64_flags"
60 else
61     vrj_abi_flags=''
62 fi
63
64 if [ "x$vrj_default_isa" = "xmips3" -o "x$vrj_default_isa" = "xmips4" ]; then
65     vrj_isa_flags="-$vrj_default_isa"
66 else
67     vrj_isa_flags=''
68 fi
69
70 prefix=@prefix@
71 exec_prefix=@exec_prefix@
72 exec_prefix_set=no
73
74 usage()
75 {
76     cat <<EOF
77 Usage: juggler-config [OPTIONS] [LIBRARIES]
78 Options:
79         [--basedir]             Use \$VJ_BASE_DIR when printing paths
80         [--prefix[=DIR]]        Print the installation prefix or set an
81                                 alternate prefix to use when printing paths
82         [--exec-prefix[=DIR]]   Print the executable prefix or set an alternate
83                                 executable prefix to use when printing paths
84         [--libs [N32|64]]       Print the basic VR Juggler libraries
85         [--extra-libs [N32|64]] Print the extra linker options needed for
86                                 making an executable
87         [--cxxflags [N32|64]]   Print the flags for the C++ compiler
88         [--subsystem]           Print the OS abstraction layer being used
89
90 Libraries (prints the linker options for one or more of these libraries):
91         vrj (all basic libraries)
92         Juggler
93         Juggler_utils
94         Juggler_ogl
95         Juggler_pf
96         Juggler_aw
97         Juggler_sl
98 EOF
99
100     exit $1
101 }
102
103 if test $# -eq 0; then
104     usage 1 1>&2
105 fi
106
107 lib_Juggler=no
108 lib_Juggler_ogl=no
109 lib_Juggler_pf=no
110 lib_Juggler_aw=no
111 lib_Juggler_sl=no
112 lib_Juggler_utils=no
113
114 while test $# -gt 0; do
115     case "$1" in
116         -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
117         *) optarg= ;;
118     esac
119
120     case $1 in
121         --basedir)
122             use_base_dir=yes
123             ;;
124         --prefix=*)
125             prefix=$optarg
126             if test $exec_prefix_set = no ; then
127                 exec_prefix=$optarg
128             fi
129             ;;
130         --prefix)
131             echo_prefix=yes
132             ;;
133         --exec-prefix=*)
134             exec_prefix=$optarg
135             exec_prefix_set=yes
136             ;;
137         --exec-prefix)
138             echo_exec_prefix=yes
139             ;;
140         --version)
141             echo @VRJ_MAJOR_VERSION@.@VRJ_MINOR_VERSION@.@VRJ_MICRO_VERSION@
142             ;;
143         --cxxflags)
144             echo_cxxflags=yes
145             case $2 in
146                 --*)
147                     # This is another option flag, so leave it alone.
148                     ;;
149                 N32)
150                     vrj_extra_cxxflags="$vrj_extra_cxxflags $vrj_n32_flags $vrj_isa_flags"
151                     shift
152                     ;;
153                 64)
154                     vrj_extra_cxxflags="$vrj_extra_cxxflags $vrj_64_flags $vrj_isa_flags"
155                     shift
156                     ;;
157                 *)
158                     vrj_extra_cxxflags="$vrj_extra_cxxflags $vrj_abi_flags $vrj_isa_flags"
159                     if [ "x$2" = "x" ]; then
160                         shift
161                     fi
162                     ;;
163             esac
164             ;;
165         --subsystem)
166             echo @THREAD_SYS@
167             ;;
168         --libs)
169             echo_libs=yes
170             case $2 in
171                 --*)
172                     # This is another option flag, so leave it alone.
173                     ;;
174                 N32)
175                     ldflags="$vrj_n32_flags $vrj_isa_flags"
176                     LIBBITSUF="$vrj_libbitsuf_n32"
177                     shift
178                     ;;
179                 64)
180                     ldflags="$vrj_64_flags $vrj_isa_flags"
181                     LIBBITSUF="$vrj_libbitsuf_64"
182                     shift
183                     ;;
184                 *)
185                     ldflags="$vrj_abi_flags $vrj_isa_flags"
186                     if [ "x$2" = "x" ]; then
187                         shift
188                     fi
189                     ;;
190             esac
191             ;;
192         --extra-libs)
193             echo_extra_libs=yes
194             case $2 in
195                 --*)
196                     # This is another option flag, so leave it alone.
197                     ;;
198                 N32)
199                     LIBBITSUF='32'
200                     shift
201                     ;;
202                 64)
203                     LIBBITSUF='64'
204                     shift
205                     ;;
206                 *)
207                     if [ "x$2" = "x" ]; then
208                         shift
209                     fi
210                     ;;
211             esac
212             ;;
213         --static)
214             echo_static=yes
215             ;;
216         vrj)
217             lib_Juggler_all=yes
218             ;;
219         Juggler)
220             lib_Juggler=yes
221             lib_Juggler_all=no
222             ;;
223         Juggler_utils)
224             lib_Juggler_utils=yes
225             lib_Juggler_all=no
226             ;;
227         Juggler_ogl)
228             lib_Juggler_ogl=yes
229             lib_Juggler_all=no
230             ;;
231         Juggler_pf)
232             lib_Juggler_pf=yes
233             lib_Juggler_all=no
234             ;;
235         Juggler_aw)
236             lib_Juggler_aw=yes
237             lib_Juggler_all=no
238             ;;
239         Juggler_sl)
240             lib_Juggler_sl=yes
241             lib_Juggler_all=no
242             ;;
243         *)
244             usage 1 1>&2
245             ;;
246     esac
247     shift
248 done
249
250 if test "x$lib_Juggler_all" = "x" ; then
251     lib_Juggler_all=yes
252 fi
253
254 if test "$echo_prefix" = "yes"; then
255     if test "$use_base_dir" = "yes"; then
256         echo $VJ_BASE_DIR
257     else
258         echo $prefix
259     fi
260 fi
261
262 if test "$echo_exec_prefix" = "yes"; then
263     if test "$use_base_dir" = "yes"; then
264         echo $VJ_BASE_DIR
265     else
266         echo $exec_prefix
267     fi
268 fi
269
270 if test "$echo_cxxflags" = "yes"; then
271     if test "$use_base_dir" = "yes"; then
272         echo @CXXFLAGS@ $vrj_extra_cxxflags -I$VJ_BASE_DIR/include $subsystem_cxxflags
273     else
274         echo @CXXFLAGS@ $vrj_extra_cxxflags -I@includedir@ $subsystem_cxxflags
275     fi
276 fi
277
278 if test "$echo_static" = "yes" ; then
279     static_begin='@static_begin@'
280     static_end='@static_end@'
281 fi
282
283 if test "$echo_libs" = "yes"; then
284     if test "$use_base_dir" = "yes"; then
285         ldflags="-L$VJ_BASE_DIR/lib$LIBBITSUF"
286     else
287         ldflags="$ldflags @vrj_ldflags@"
288     fi
289
290     if test "x$lib_Juggler_all" = "xyes" ; then
291         vrj_libs="@vrj_libs@"
292     else
293         if test "x$lib_Juggler" = "xyes" ; then
294             vrj_libs="$Juggler_lib"
295         fi
296
297         if test "x$lib_Juggler_utils" = "xyes" ; then
298             vrj_libs="$vrj_libs $Juggler_utils_lib"
299         fi
300
301         if test "x$lib_Juggler_ogl" = "xyes" ; then
302             vrj_libs="$vrj_libs $Juggler_ogl_lib"
303         fi
304
305         if test "x$lib_Juggler_pf" = "xyes" ; then
306             vrj_libs="$vrj_libs $Juggler_pf_lib"
307         fi
308
309         if test "x$lib_Juggler_aw" = "xyes" ; then
310             vrj_libs="$vrj_libs $Juggler_aw_lib"
311         fi
312
313         if test "x$lib_Juggler_sl" = "xyes" ; then
314             vrj_libs="$vrj_libs $Juggler_sl_lib"
315         fi
316     fi
317
318     echo $ldflags $static_begin $vrj_libs $static_end
319 fi      
320
321 if test "x$echo_extra_libs" = "xyes"; then
322     vrj_extra_ldflags="@vrj_extra_ldflags@"
323     vrj_extra_libs="@vrj_extra_libs@"
324     echo $vrj_extra_ldflags $vrj_extra_libs
325 fi
Note: See TracBrowser for help on using the browser.