root/juggler/trunk/macros/sonix.m4

Revision 20974, 4.9 kB (checked in by patrick, 8 months ago)

Copyright update.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 dnl **************** <SNX heading BEGIN do not edit this line> ****************
2 dnl
3 dnl sonix
4 dnl
5 dnl Original Authors:
6 dnl   Kevin Meinert, Carolina Cruz-Neira
7 dnl
8 dnl ***************** <SNX heading END do not edit this line> *****************
9
10 dnl ************* <auto-copyright.pl BEGIN do not edit this line> *************
11 dnl
12 dnl VR Juggler is (C) Copyright 1998-2008 by Iowa State University
13 dnl
14 dnl Original Authors:
15 dnl   Allen Bierbaum, Christopher Just,
16 dnl   Patrick Hartling, Kevin Meinert,
17 dnl   Carolina Cruz-Neira, Albert Baker
18 dnl
19 dnl This library is free software; you can redistribute it and/or
20 dnl modify it under the terms of the GNU Library General Public
21 dnl License as published by the Free Software Foundation; either
22 dnl version 2 of the License, or (at your option) any later version.
23 dnl
24 dnl This library is distributed in the hope that it will be useful,
25 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
26 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27 dnl Library General Public License for more details.
28 dnl
29 dnl You should have received a copy of the GNU Library General Public
30 dnl License along with this library; if not, write to the
31 dnl Free Software Foundation, Inc., 59 Temple Place - Suite 330,
32 dnl Boston, MA 02111-1307, USA.
33 dnl
34 dnl ************** <auto-copyright.pl END do not edit this line> **************
35
36 dnl ---------------------------------------------------------------------------
37 dnl SNX_PATH([minimum-version, [action-if-found [, action-if-not-found]]])
38 dnl
39 dnl Test for SNX and then define the following variables:
40 dnl     SNX_CXXFLAGS
41 dnl     SNX_LIBS
42 dnl     SNX_PROF_LIBS
43 dnl     SNX_LIBS_STATIC
44 dnl     SNX_PROF_LIBS_STATIC
45 dnl     SNX_EXTRA_LIBS
46 dnl     SNX_VERSION
47 dnl ---------------------------------------------------------------------------
48 AC_DEFUN([SNX_PATH],
49 [
50     DPP_PREREQ([2.0.1])
51
52     dnl Get the cflags and libraries from flagpoll
53     AC_ARG_WITH(sonix-meta-file,
54                 [  --with-sonix-meta-file=<PATH>
55                           Flagpoll metadata file for
56                           Sonix (optional)                [No default]],
57                 [sonix_meta_file="$withval"], [sonix_meta_file=""])
58
59     dnl See if the user specified where to find the Sonix meta file. If not,
60     dnl take a guess.
61     if test "x$sonix_meta_file" != "x" ; then
62         sonix_meta_dir=`dirname $sonix_meta_file`
63         sonix_flagpoll_args="--extra-paths=$sonix_meta_dir sonix --from-file=$sonix_meta_file"
64     elif test -f "$instlinks/share/flagpoll/sonix.fpc" ; then
65         sonix_meta_dir="$instlinks/share/flagpoll"
66         sonix_flagpoll_args="--extra-paths=$sonix_meta_dir sonix --from-file=$sonix_meta_dir/sonix.fpc"
67     else
68         sonix_flagpoll_args="sonix"
69     fi
70
71     AM_PATH_FLAGPOLL([0.9.1], ,
72                      [AC_MSG_ERROR(*** Flagpoll required for Sonix flags ***)])
73     min_sonix_version=ifelse([$1], ,0.0.1,[$1])
74
75     dnl Do a sanity check to ensure that $FLAGPOLL actually works.
76     if ! (eval $FLAGPOLL --help >/dev/null 2>&1) 2>&1 ; then
77         FLAGPOLL='no'
78     fi
79
80     no_sonix=''
81     if test "x$FLAGPOLL" = "xno" ; then
82         no_sonix=yes
83     else
84         if ! (eval $FLAGPOLL $sonix_flagpoll_args --modversion >/dev/null 2>&1)
85         then
86             AC_MSG_WARN([*** Flagpoll has no valid Sonix configuration ***])
87             no_sonix=yes
88         else
89             SNX_CXXFLAGS=`$FLAGPOLL $sonix_flagpoll_args --cflags`
90             SNX_LIBS=`$FLAGPOLL $sonix_flagpoll_args --libs`
91             SNX_PROF_LIBS=`$FLAGPOLL $sonix_flagpoll_args --get-profiled-libs`
92             SNX_LIBS_STATIC=`$FLAGPOLL $sonix_flagpoll_args --get-static-libs`
93             SNX_PROF_LIBS_STATIC=`$FLAGPOLL $sonix_flagpoll_args --get-profiled-static-libs`
94             SNX_EXTRA_LIBS=`$FLAGPOLL $sonix_flagpoll_args --get-extra-libs`
95             SNX_VERSION=`$FLAGPOLL $sonix_flagpoll_args --modversion`
96             SNX_DATA_SUBDIR=`$FLAGPOLL $sonix_flagpoll_args --get-snx-data-subdir`
97             SNX_PLUGIN_SUBDIR=`$FLAGPOLL $sonix_flagpoll_args --get-snx-plugin-subdir`
98
99             DPP_VERSION_CHECK_MSG_NO_CACHE([Sonix], [$SNX_VERSION],
100                                            [$min_sonix_version], [$2], [$3])
101         fi
102     fi
103
104     if test "x$no_sonix" != x ; then
105         if test "$FLAGPOLL" = "no" ; then
106            echo "*** Flagpoll is required to build Sonix."
107            echo "*** Please check that the PATH variable is set to "
108            echo "*** include the proper path to flagpoll."
109         fi
110         SNX_CXXFLAGS=""
111         SNX_LIBS=""
112         SNX_PROF_LIBS=""
113         SNX_LIBS_STATIC=""
114         SNX_PROF_LIBS_STATIC=""
115         SNX_EXTRA_LIBS=""
116         SNX_VERSION="-1"
117
118         ifelse([$3], , :, [$3])
119     fi
120
121     AC_SUBST(SNX_CXXFLAGS)
122     AC_SUBST(SNX_LIBS)
123     AC_SUBST(SNX_PROF_LIBS)
124     AC_SUBST(SNX_LIBS_STATIC)
125     AC_SUBST(SNX_PROF_LIBS_STATIC)
126     AC_SUBST(SNX_EXTRA_LIBS)
127     AC_SUBST(SNX_VERSION)
128     AC_SUBST(SNX_DATA_SUBDIR)
129     AC_SUBST(SNX_PLUGIN_SUBDIR)
130 ])
Note: See TracBrowser for help on using the browser.