root/juggler/branches/2.0/macros/vrj.m4

Revision 17069, 6.3 kB (checked in by patrickh, 4 years ago)

Use the new macro in Doozer++ 2.0.1 for simplifying non-cached version
comparison tests.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 dnl ************ <auto-copyright.pl BEGIN do not edit this line> ************
2 dnl
3 dnl VR Juggler is (C) Copyright 1998-2005 by Iowa State University
4 dnl
5 dnl Original Authors:
6 dnl   Allen Bierbaum, Christopher Just,
7 dnl   Patrick Hartling, Kevin Meinert,
8 dnl   Carolina Cruz-Neira, Albert Baker
9 dnl
10 dnl This library is free software; you can redistribute it and/or
11 dnl modify it under the terms of the GNU Library General Public
12 dnl License as published by the Free Software Foundation; either
13 dnl version 2 of the License, or (at your option) any later version.
14 dnl
15 dnl This library is distributed in the hope that it will be useful,
16 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
17 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 dnl Library General Public License for more details.
19 dnl
20 dnl You should have received a copy of the GNU Library General Public
21 dnl License along with this library; if not, write to the
22 dnl Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 dnl Boston, MA 02111-1307, USA.
24 dnl
25 dnl -----------------------------------------------------------------
26 dnl File:          $RCSfile$
27 dnl Date modified: $Date$
28 dnl Version:       $Revision$
29 dnl -----------------------------------------------------------------
30 dnl
31 dnl ************* <auto-copyright.pl END do not edit this line> *************
32
33 dnl ---------------------------------------------------------------------------
34 dnl VRJUGGLER_PATH([minimum-version, [action-if-found [, action-if-not-found [, modules]]]])
35 dnl
36 dnl Test for VR Juggler and then define the following variables:
37 dnl     VRJ_CXXFLAGS
38 dnl     VRJ_CXXFLAGS_MIN
39 dnl     VRJ_INCLUDES
40 dnl     VRJ_INCLUDES_MIN
41 dnl     VRJ_LIBS_CC
42 dnl     VRJ_LIBS_LD
43 dnl     VRJ_LIBS_STATIC_CC
44 dnl     VRJ_LIBS_STATIC_LD
45 dnl     VRJ_EXTRA_LIBS_CC
46 dnl     VRJ_EXTRA_LIBS_LD
47 dnl ---------------------------------------------------------------------------
48 AC_DEFUN([VRJUGGLER_PATH],
49 [
50     DPP_PREREQ([2.0.1])
51
52     dnl Get the cflags and libraries from the vrjuggler-config script
53     AC_ARG_WITH(vrjuggler,
54                 [  --with-vrjuggler=<PATH> Directory where VR Juggler is
55                           installed                       [No default]],
56                 vrj_config_prefix="$withval", vrj_config_prefix="")
57     AC_ARG_WITH(vrjuggler-exec-prefix,
58                 [  --with-vrjuggler-exec-prefix=<PATH>
59                           Exec prefix where VR Juggler is
60                           installed (optional)            [No default]],
61                 vrj_config_exec_prefix="$withval", vrj_config_exec_prefix="")
62
63     if test "x$vrj_config_exec_prefix" != "x" ; then
64         vrj_config_args="$vrj_config_args --exec-prefix=$vrj_config_exec_prefix"
65
66         if test x${VRJ_CONFIG+set} != xset ; then
67             VRJ_CONFIG="$vrj_config_exec_prefix/bin/vrjuggler-config"
68         fi
69     fi
70
71     if test "x$vrj_config_prefix" != "x" ; then
72         vrj_config_args="$vrj_config_args --prefix=$vrj_config_prefix"
73
74         if test x${VRJ_CONFIG+set} != xset ; then
75             VRJ_CONFIG="$vrj_config_prefix/bin/vrjuggler-config"
76         fi
77     fi
78
79     if test "x$VJ_BASE_DIR" != "x" ; then
80         vrj_config_args="$vrj_config_args --prefix=$VJ_BASE_DIR"
81
82         if test x${VRJ_CONFIG+set} != xset ; then
83             VRJ_CONFIG="$VJ_BASE_DIR/bin/vrjuggler-config"
84         fi
85     fi
86
87     AC_PATH_PROG(VRJ_CONFIG, vrjuggler-config, no)
88     min_vrj_version=ifelse([$1], ,0.0.1,$1)
89
90     dnl Do a sanity check to ensure that $VRJ_CONFIG actually works.
91     if ! (eval $VRJ_CONFIG --cxxflags >/dev/null 2>&1) 2>&1 ; then
92         VRJ_CONFIG='no'
93     fi
94
95     no_vrj=''
96     if test "x$VRJ_CONFIG" = "xno" ; then
97         no_vrj=yes
98     else
99 dnl        VRJ_LIBS="`$VRJ_CONFIG $vrj_config_args --libs $ABI` $VRJ_EXTRA_LIBS"
100 dnl        VRJ_LIBS_STATIC="`$VRJ_CONFIG $vrj_config_args --libs $ABI --static` $VRJ_EXTRA_LIBS"
101
102         VRJ_CXXFLAGS=`$VRJ_CONFIG $vrj_config_args --cxxflags $ABI`
103         VRJ_INCLUDES=`$VRJ_CONFIG $vrj_config_args --includes`
104         VRJ_LIBS_CC="`$VRJ_CONFIG $vrj_config_args --libs $ABI`"
105         VRJ_LIBS_LD="`$VRJ_CONFIG $vrj_config_args --linker --libs $ABI`"
106         VRJ_LIBS_STATIC_CC="`$VRJ_CONFIG $vrj_config_args --libs $ABI --static`"
107         VRJ_LIBS_STATIC_LD="`$VRJ_CONFIG $vrj_config_args --linker --libs $ABI --static`"
108         VRJ_EXTRA_LIBS_CC=`$VRJ_CONFIG $vrj_config_args --extra-libs $ABI`
109         VRJ_EXTRA_LIBS_LD=`$VRJ_CONFIG $vrj_config_args --extra-libs $ABI --linker`
110         VRJ_VERSION=`$VRJ_CONFIG --version`
111
112         VRJ_CXXFLAGS_MIN=`$VRJ_CONFIG $vrj_config_args --cxxflags $ABI --min`
113         VRJ_INCLUDES_MIN=`$VRJ_CONFIG $vrj_config_args --includes --min`
114         VRJ_LIBS_CC_MIN="`$VRJ_CONFIG $vrj_config_args --libs $ABI --min`"
115         VRJ_LIBS_LD_MIN="`$VRJ_CONFIG $vrj_config_args --linker --libs $ABI --min`"
116         VRJ_EXTRA_LIBS_CC_MIN=`$VRJ_CONFIG $vrj_config_args --extra-libs $ABI --min`
117         VRJ_EXTRA_LIBS_LD_MIN=`$VRJ_CONFIG $vrj_config_args --extra-libs $ABI --min --linker`
118
119         DPP_VERSION_CHECK_MSG_NO_CACHE([VR Juggler], [$VRJ_VERSION],
120                                        [$min_vrj_version], [$2], [$3])
121     fi
122
123     if test "x$no_vrj" != x ; then
124         if test "$VRJ_CONFIG" = "no" ; then
125             echo "*** The vrjuggler-config script installed by VR Juggler could not be found"
126             echo "*** If VR Juggler was installed in PREFIX, make sure PREFIX/bin is in"
127             echo "*** your path, or set the VRJ_CONFIG environment variable to the"
128             echo "*** full path to vrjuggler-config."
129         fi
130         VRJ_CXXFLAGS=""
131         VRJ_CXXFLAGS_MIN=""
132         VRJ_INCLUDES=""
133         VRJ_INCLUDES_MIN=""
134         VRJ_LIBS_CC=""
135         VRJ_LIBS_LD=""
136         VRJ_LIBS_STATIC_CC=""
137         VRJ_LIBS_STATIC_LD=""
138         VRJ_EXTRA_LIBS_CC=""
139         VRJ_EXTRA_LIBS_LD=""
140         VRJ_EXTRA_LIBS_CC_MIN=""
141         VRJ_EXTRA_LIBS_LD_MIN=""
142         VRJ_VERSION="-1"
143         ifelse([$3], , :, [$3])
144     fi
145
146     AC_SUBST(VRJ_CXXFLAGS)
147     AC_SUBST(VRJ_INCLUDES)
148     AC_SUBST(VRJ_LIBS_CC)
149     AC_SUBST(VRJ_LIBS_LD)
150     AC_SUBST(VRJ_LIBS_STATIC_CC)
151     AC_SUBST(VRJ_LIBS_STATIC_LD)
152     AC_SUBST(VRJ_EXTRA_LIBS_CC)
153     AC_SUBST(VRJ_EXTRA_LIBS_LD)
154     AC_SUBST(VRJ_VERSION)
155
156     AC_SUBST(VRJ_CXXFLAGS_MIN)
157     AC_SUBST(VRJ_INCLUDES_MIN)
158     AC_SUBST(VRJ_LIBS_CC_MIN)
159     AC_SUBST(VRJ_LIBS_LD_MIN)
160     AC_SUBST(VRJ_EXTRA_LIBS_CC_MIN)
161     AC_SUBST(VRJ_EXTRA_LIBS_LD_MIN)
162 ])
Note: See TracBrowser for help on using the browser.