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

Revision 19546, 15.1 kB (checked in by patrick, 2 years ago)

Identify JCCL_VERRSION and TWEEK_VERSION as substitution variables. I
forgot to commit these chagens with the rest of the work done to allow
the use of Flagpoll with VR Juggler 2.0.

  • 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 NOTE: This should not be called by external code.
35 dnl ---------------------------------------------------------------------------
36 AC_DEFUN([_TWEEK_PATH_SETUP],
37 [
38     dnl Get the cflags and libraries from the tweek-config script
39     AC_ARG_WITH(tweek,
40                 [  --with-tweek=<PATH>     Directory where Tweek is
41                           installed                       [No default]],
42                 tweek_config_prefix="$withval", tweek_config_prefix="")
43     AC_ARG_WITH(tweek-exec-prefix,
44                 [  --with-tweek-exec-prefix=<PATH>
45                           Exec prefix where Tweek is
46                           installed (optional)            [No default]],
47                 tweek_config_exec_prefix="$withval",
48                 tweek_config_exec_prefix="")
49
50     if test "x$tweek_config_exec_prefix" != "x" ; then
51         tweek_config_args="$tweek_config_args --exec-prefix=$tweek_config_exec_prefix"
52
53         if test x${TWEEK_CONFIG+set} != xset ; then
54             TWEEK_CONFIG="$tweek_config_exec_prefix/bin/tweek-config"
55         fi
56     fi
57
58     if test "x$tweek_config_prefix" != "x" ; then
59         tweek_config_args="$tweek_config_args --prefix=$tweek_config_prefix"
60
61         if test x${TWEEK_CONFIG+set} != xset ; then
62             TWEEK_CONFIG="$tweek_config_prefix/bin/tweek-config"
63         fi
64     fi
65
66     if test "x$TWEEK_BASE_DIR" != "x" ; then
67         tweek_config_args="$tweek_config_args --prefix=$TWEEK_BASE_DIR"
68
69         if test x${TWEEK_CONFIG+set} != xset ; then
70             TWEEK_CONFIG="$TWEEK_BASE_DIR/bin/tweek-config"
71         fi
72     fi
73
74     AC_PATH_PROG(TWEEK_CONFIG, tweek-config, no)
75
76     dnl Do a sanity check to ensure that $TWEEK_CONFIG actually works.
77     if ! (eval $TWEEK_CONFIG --cxxflags >/dev/null 2>&1) 2>&1 ; then
78         TWEEK_CONFIG='no'
79         echo "*** The tweek-config script installed by Tweek could not be found"
80         echo "*** If Tweek was installed in PREFIX, make sure PREFIX/bin is in"
81         echo "*** your path, or set the TWEEK_CONFIG environment variable to the"
82         echo "*** full path to tweek-config."
83     fi
84 ])
85
86 dnl ---------------------------------------------------------------------------
87 dnl _TWEEK_VERSION_CHECK(minimum-version, [action-if-found [, action-if-not-found]])
88 dnl NOTE: This should not be called by external code.
89 dnl ---------------------------------------------------------------------------
90 AC_DEFUN([_TWEEK_VERSION_CHECK],
91 [
92    DPP_PREREQ([2.0.1])
93
94    if test "x$TWEEK_CONFIG" = "x" ; then
95       _TWEEK_PATH_SETUP()
96    fi
97
98    if test "x$TWEEK_CONFIG" = "xno" ; then
99       ifelse([$3], , :, [$3])
100    else
101       TWEEK_VERSION=`$TWEEK_CONFIG --version`
102
103       min_tweek_version=ifelse([$1], ,0.0.1,[$1])
104       DPP_VERSION_CHECK_MSG_NO_CACHE([Tweek], [$TWEEK_VERSION],
105                                      [$min_tweek_version], [$2], [$3])
106    fi
107
108    AC_SUBST(TWEEK_VERSION)
109 ])
110
111 dnl ---------------------------------------------------------------------------
112 dnl TWEEK_PATH_CXX([minimum-version, [action-if-found [, action-if-not-found]]])
113 dnl
114 dnl Tests for Tweek C++ API and then defines the following variables:
115 dnl     TWEEK_CXXFLAGS
116 dnl     TWEEK_CXXFLAGS_MIN
117 dnl     TWEEK_INCLUDES
118 dnl     TWEEK_INCLUDES_MIN
119 dnl     TWEEK_LIBS_LD
120 dnl     TWEEK_LIBS_LD_MIN
121 dnl     TWEEK_LIBS_STATIC_LD
122 dnl     TWEEK_LIBS_STATIC_LD_MIN
123 dnl     TWEEK_LIBS_CC
124 dnl     TWEEK_LIBS_CC_MIN
125 dnl     TWEEK_LIBS_STATIC_CC
126 dnl     TWEEK_LIBS_STATIC_CC_MIN
127 dnl     TWEEK_PROF_LIBS_LD
128 dnl     TWEEK_PROF_LIBS_LD_MIN
129 dnl     TWEEK_PROF_LIBS_STATIC_LD
130 dnl     TWEEK_PROF_LIBS_STATIC_LD_MIN
131 dnl     TWEEK_PROF_LIBS_CC
132 dnl     TWEEK_PROF_LIBS_CC_MIN
133 dnl     TWEEK_PROF_LIBS_STATIC_CC
134 dnl     TWEEK_PROF_LIBS_STATIC_CC_MIN
135 dnl     TWEEK_CXX_IDL
136 dnl     TWEEK_CXX_IDL_OPTS
137 dnl     TWEEK_CXX_IDL_GENDIR_OPT
138 dnl ---------------------------------------------------------------------------
139 AC_DEFUN([TWEEK_PATH_CXX],
140 [
141    if test "x$TWEEK_CONFIG" = "x" ; then
142       _TWEEK_PATH_SETUP()
143    fi
144
145    TWEEK_CXXFLAGS=""
146    TWEEK_CXXFLAGS_MIN=""
147    TWEEK_INCLUDES=""
148    TWEEK_INCLUDES_MIN=""
149    TWEEK_LIBS_LD=""
150    TWEEK_LIBS_LD_MIN=""
151    TWEEK_LIBS_STATIC_LD=""
152    TWEEK_LIBS_STATIC_LD_MIN=""
153    TWEEK_LIBS_CC=""
154    TWEEK_LIBS_CC_MIN=""
155    TWEEK_LIBS_STATIC_CC=""
156    TWEEK_LIBS_STATIC_CC_MIN=""
157    TWEEK_PROF_LIBS_LD=""
158    TWEEK_PROF_LIBS_LD_MIN=""
159    TWEEK_PROF_LIBS_STATIC_LD=""
160    TWEEK_PROF_LIBS_STATIC_LD_MIN=""
161    TWEEK_PROF_LIBS_CC=""
162    TWEEK_PROF_LIBS_CC_MIN=""
163    TWEEK_PROF_LIBS_STATIC_CC=""
164    TWEEK_PROF_LIBS_STATIC_CC_MIN=""
165    TWEEK_CXX_IDL=""
166    TWEEK_CXX_IDL_OPTS=""
167    TWEEK_CXX_IDL_GENDIR_OPT=""
168    TWEEK_CXX_IDL_INCFLAG=""
169
170    if test "x$TWEEK_CONFIG" = "xno" ; then
171       ifelse([$3], , :, [$3])
172    else
173       AC_MSG_CHECKING([whether Tweek C++ API is available])
174       has_cxx=`$TWEEK_CONFIG --too-much-pressure`
175
176       if test "x$has_cxx" = "xY" ; then
177          AC_MSG_RESULT([yes])
178          if test "x$TWEEK_VERSION" = "x" ; then
179             _TWEEK_VERSION_CHECK($1, [tweek_version_okay='yes'],
180                                  [tweek_version_okay='no'
181                                   $3])
182          fi
183
184          if test "x$tweek_version_okay" = "xyes" ; then
185             TWEEK_CXXFLAGS=`$TWEEK_CONFIG $tweek_config_args --cxxflags $ABI`
186             TWEEK_INCLUDES=`$TWEEK_CONFIG $tweek_config_args --includes`
187             TWEEK_EXTRA_LIBS_CC=`$TWEEK_CONFIG $tweek_config_args --extra-libs $ABI`
188             TWEEK_EXTRA_LIBS_LD=`$TWEEK_CONFIG $tweek_config_args --extra-libs $ABI --linker`
189             TWEEK_LIBS_CC=`$TWEEK_CONFIG $tweek_config_args --libs $ABI`
190             TWEEK_LIBS_LD=`$TWEEK_CONFIG $tweek_config_args --libs $ABI --linker`
191             TWEEK_PROF_LIBS_CC=`$TWEEK_CONFIG $tweek_config_args --libs $ABI --profiled`
192             TWEEK_PROF_LIBS_LD=`$TWEEK_CONFIG $tweek_config_args --libs $ABI --linker --profiled`
193             TWEEK_LIBS_STATIC_CC=`$TWEEK_CONFIG $tweek_config_args --libs $ABI --static`
194             TWEEK_LIBS_STATIC_LD=`$TWEEK_CONFIG $tweek_config_args --libs $ABI --linker --static`
195             TWEEK_PROF_LIBS_STATIC_CC=`$TWEEK_CONFIG $tweek_config_args --libs $ABI --static --profiled`
196             TWEEK_PROF_LIBS_STATIC_LD=`$TWEEK_CONFIG $tweek_config_args --libs $ABI --linker --static --profiled`
197
198             TWEEK_CXX_IDL="`$TWEEK_CONFIG $tweek_config_args --idl cxx`"
199             TWEEK_CXX_IDL_OPTS="`$TWEEK_CONFIG $tweek_config_args --idlflags cxx`"
200             TWEEK_CXX_IDL_GENDIR_OPT="`$TWEEK_CONFIG $tweek_config_args --idlgendir cxx`"
201             TWEEK_CXX_IDL_INCFLAG="`$TWEEK_CONFIG $tweek_config_args --idlincflag cxx`"
202
203             TWEEK_CXXFLAGS_MIN=`$TWEEK_CONFIG $tweek_config_args --cxxflags $ABI --min`
204             TWEEK_INCLUDES_MIN=`$TWEEK_CONFIG $tweek_config_args --includes --min`
205             TWEEK_EXTRA_LIBS_CC_MIN=`$TWEEK_CONFIG $tweek_config_args --extra-libs $ABI --min`
206             TWEEK_EXTRA_LIBS_LD_MIN=`$TWEEK_CONFIG $tweek_config_args --extra-libs $ABI --linker --min`
207             TWEEK_LIBS_CC_MIN="`$TWEEK_CONFIG $tweek_config_args --libs $ABI --min`"
208             TWEEK_LIBS_LD_MIN="`$TWEEK_CONFIG $tweek_config_args --libs $ABI --linker --min`"
209             TWEEK_PROF_LIBS_CC_MIN="`$TWEEK_CONFIG $tweek_config_args --libs $ABI --min --profiled`"
210             TWEEK_PROF_LIBS_LD_MIN="`$TWEEK_CONFIG $tweek_config_args --libs $ABI --linker --min --profiled`"
211             TWEEK_LIBS_STATIC_CC_MIN="`$TWEEK_CONFIG $tweek_config_args --libs $ABI --static --min`"
212             TWEEK_LIBS_STATIC_LD_MIN="`$TWEEK_CONFIG $tweek_config_args --libs $ABI --linker --static --min`"
213             TWEEK_PROF_LIBS_STATIC_CC_MIN="`$TWEEK_CONFIG $tweek_config_args --libs $ABI --static --min --profiled`"
214             TWEEK_PROF_LIBS_STATIC_LD_MIN="`$TWEEK_CONFIG $tweek_config_args --libs $ABI --linker --static --min --profiled`"
215
216             ifelse([$2], , :, [$2])
217          fi
218       else
219          AC_MSG_RESULT([no])
220          ifelse([$3], , :, [$3])
221       fi
222    fi
223
224    AC_SUBST([TWEEK_CXXFLAGS])
225    AC_SUBST([TWEEK_LIBS_CC])
226    AC_SUBST([TWEEK_LIBS_LD])
227    AC_SUBST([TWEEK_PROF_LIBS_CC])
228    AC_SUBST([TWEEK_PROF_LIBS_LD])
229    AC_SUBST([TWEEK_LIBS_STATIC_LD])
230    AC_SUBST([TWEEK_LIBS_STATIC_CC])
231    AC_SUBST([TWEEK_PROF_LIBS_STATIC_LD])
232    AC_SUBST([TWEEK_PROF_LIBS_STATIC_CC])
233
234    AC_SUBST([TWEEK_CXX_IDL])
235    AC_SUBST([TWEEK_CXX_IDL_OPTS])
236    AC_SUBST([TWEEK_CXX_IDL_GENDIR_OPT])
237    AC_SUBST([TWEEK_CXX_IDL_INCFLAG])
238
239    AC_SUBST([TWEEK_CXXFLAGS_MIN])
240    AC_SUBST([TWEEK_INCLUDES_MIN])
241    AC_SUBST([TWEEK_LIBS_CC_MIN])
242    AC_SUBST([TWEEK_LIBS_LD_MIN])
243    AC_SUBST([TWEEK_PROF_LIBS_CC_MIN])
244    AC_SUBST([TWEEK_PROF_LIBS_LD_MIN])
245    AC_SUBST([TWEEK_LIBS_STATIC_CC_MIN])
246    AC_SUBST([TWEEK_LIBS_STATIC_LD_MIN])
247    AC_SUBST([TWEEK_PROF_LIBS_STATIC_CC_MIN])
248    AC_SUBST([TWEEK_PROF_LIBS_STATIC_LD_MIN])
249 ])
250
251 dnl ---------------------------------------------------------------------------
252 dnl TWEEK_PATH_JAVA([minimum-version, [action-if-found [, action-if-not-found]]])
253 dnl
254 dnl Tests for Tweek Java API and then defines the following variables:
255 dnl     TWEEK_JAVA_IDL
256 dnl     TWEEK_JAVA_IDL_OPTS
257 dnl     TWEEK_JAVA_IDL_GENDIR_OPT
258 dnl     TWEEK_JAVA_IDL_INCFLAG
259 dnl     TWEEK_EXT_JARS
260 dnl ---------------------------------------------------------------------------
261 AC_DEFUN([TWEEK_PATH_JAVA],
262 [
263    if test "x$TWEEK_CONFIG" = "x" ; then
264       _TWEEK_PATH_SETUP()
265    fi
266
267    TWEEK_JAVA_IDL=''
268    TWEEK_JAVA_IDL_OPTS=''
269    TWEEK_JAVA_IDL_GENDIR_OPT=''
270    TWEEK_JAVA_IDL_INCFLAG=''
271    TWEEK_JARS=''
272    TWEEK_EXT_JARS=''
273
274    if test "x$TWEEK_CONFIG" = "xno" ; then
275       ifelse([$3], , :, [$3])
276    else
277       AC_MSG_CHECKING([whether Tweek Java API is available])
278       has_java=`$TWEEK_CONFIG --is-jittery`
279
280       if test "x$has_java" = "xY" ; then
281          AC_MSG_RESULT([yes])
282          if test "x$TWEEK_VERSION" = "x" ; then
283             _TWEEK_VERSION_CHECK($1, [tweek_version_okay='yes'],
284                                  [tweek_version_okay='no'
285                                   $3])
286          fi
287
288          if test "x$tweek_version_okay" = "xyes" ; then
289             TWEEK_JAVA_IDL="`$TWEEK_CONFIG $tweek_config_args --idl java`"
290             TWEEK_JAVA_IDL_OPTS="`$TWEEK_CONFIG $tweek_config_args --idlflags java`"
291             TWEEK_JAVA_IDL_GENDIR_OPT="`$TWEEK_CONFIG $tweek_config_args --idlgendir java`"
292             TWEEK_JAVA_IDL_INCFLAG="`$TWEEK_CONFIG $tweek_config_args --idlincflag java`"
293             TWEEK_JARS="`$TWEEK_CONFIG $tweek_config_args --jars`"
294             TWEEK_EXT_JARS="`$TWEEK_CONFIG $tweek_config_args --ext-jars`"
295
296             ifelse([$2], , :, [$2])
297          fi
298       else
299          AC_MSG_RESULT([no])
300          ifelse([$3], , :, [$3])
301       fi
302    fi
303
304    AC_SUBST([TWEEK_JAVA_IDL])
305    AC_SUBST([TWEEK_JAVA_IDL_OPTS])
306    AC_SUBST([TWEEK_JAVA_IDL_GENDIR_OPT])
307    AC_SUBST([TWEEK_JAVA_IDL_INCFLAG])
308    AC_SUBST([TWEEK_JARS])
309    AC_SUBST([TWEEK_EXT_JARS])
310 ])
311
312 dnl ---------------------------------------------------------------------------
313 dnl TWEEK_PATH_PYTHON([minimum-version, [action-if-found [, action-if-not-found]]])
314 dnl
315 dnl Tests for Tweek Python API and then defines the following variables:
316 dnl     TWEEK_PYTHON_IDL
317 dnl     TWEEK_PYTHON_IDL_OPTS
318 dnl     TWEEK_PYTHON_IDL_GENDIR_OPT
319 dnl     TWEEK_PYTHON_IDL_INCFLAG
320 dnl ---------------------------------------------------------------------------
321 AC_DEFUN([TWEEK_PATH_PYTHON],
322 [
323    if test "x$TWEEK_CONFIG" = "x" ; then
324       _TWEEK_PATH_SETUP()
325    fi
326
327    TWEEK_PYTHON_IDL=''
328    TWEEK_PYTHON_IDL_OPTS=''
329    TWEEK_PYTHON_IDL_GENDIR_OPT=''
330    TWEEK_PYTHON_IDL_INCFLAG=''
331
332    if test "x$TWEEK_CONFIG" = "xno" ; then
333       ifelse([$3], , :, [$3])
334    else
335       AC_MSG_CHECKING([whether Tweek Python API is available])
336       has_java=`$TWEEK_CONFIG --is-jittery`
337
338       if test "x$has_java" = "xY" ; then
339          AC_MSG_RESULT([yes])
340          if test "x$TWEEK_VERSION" = "x" ; then
341             _TWEEK_VERSION_CHECK($1, [tweek_version_okay='yes'],
342                                  [tweek_version_okay='no'
343                                   $3])
344          fi
345
346          if test "x$tweek_version_okay" = "xyes" ; then
347             TWEEK_PYTHON_IDL="`$TWEEK_CONFIG $tweek_config_args --idl java`"
348             TWEEK_PYTHON_IDL_OPTS="`$TWEEK_CONFIG $tweek_config_args --idlflags java`"
349             TWEEK_PYTHON_IDL_GENDIR_OPT="`$TWEEK_CONFIG $tweek_config_args --idlgendir java`"
350             TWEEK_PYTHON_IDL_INCFLAG="`$TWEEK_CONFIG $tweek_config_args --idlincflag java`"
351             TWEEK_JARS="`$TWEEK_CONFIG $tweek_config_args --jars`"
352             TWEEK_EXT_JARS="`$TWEEK_CONFIG $tweek_config_args --ext-jars`"
353
354             ifelse([$2], , :, [$2])
355          fi
356       else
357          AC_MSG_RESULT([no])
358          ifelse([$3], , :, [$3])
359       fi
360    fi
361
362    AC_SUBST([TWEEK_PYTHON_IDL])
363    AC_SUBST([TWEEK_PYTHON_IDL_OPTS])
364    AC_SUBST([TWEEK_PYTHON_IDL_GENDIR_OPT])
365    AC_SUBST([TWEEK_PYTHON_IDL_INCFLAG])
366 ])
367
368 dnl ---------------------------------------------------------------------------
369 dnl TWEEK_PATH([minimum-version, [action-if-found [, action-if-not-found]]])
370 dnl
371 dnl Tests for Tweek C++, Java, and Python APIs and then defines the following
372 dnl variables:
373 dnl     TWEEK_CXXFLAGS
374 dnl     TWEEK_CXXFLAGS_MIN
375 dnl     TWEEK_LIBS_LD
376 dnl     TWEEK_LIBS_LD_MIN
377 dnl     TWEEK_LIBS_STATIC_LD
378 dnl     TWEEK_LIBS_STATIC_LD_MIN
379 dnl     TWEEK_LIBS_CC
380 dnl     TWEEK_LIBS_CC_MIN
381 dnl     TWEEK_LIBS_STATIC_CC
382 dnl     TWEEK_LIBS_STATIC_CC_MIN
383 dnl     TWEEK_CXX_IDL
384 dnl     TWEEK_CXX_IDL_OPTS
385 dnl     TWEEK_CXX_IDL_GENDIR_OPT
386 dnl     TWEEK_JAVA_IDL
387 dnl     TWEEK_JAVA_IDL_OPTS
388 dnl     TWEEK_JAVA_IDL_GENDIR_OPT
389 dnl     TWEEK_JAVA_IDL_INCFLAG
390 dnl     TWEEK_JARS
391 dnl     TWEEK_EXT_JARS
392 dnl     TWEEK_PYTHON_IDL
393 dnl     TWEEK_PYTHON_IDL_OPTS
394 dnl     TWEEK_PYTHON_IDL_GENDIR_OPT
395 dnl     TWEEK_PYTHON_IDL_INCFLAG
396 dnl ---------------------------------------------------------------------------
397 AC_DEFUN([TWEEK_PATH],
398 [
399    TWEEK_PATH_CXX($1, [tweek_have_cxx='yes'], $3)
400
401    if test "x$tweek_have_cxx" = "xyes" ; then
402       TWEEK_PATH_JAVA($1, $2, $3)
403       TWEEK_PATH_PYTHON($1, $2, $3)
404    fi
405 ])
Note: See TracBrowser for help on using the browser.