root/juggler/trunk/macros/gadget.m4

Revision 20974, 5.3 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 ************ <auto-copyright.pl BEGIN do not edit this line> ************
2 dnl
3 dnl VR Juggler is (C) Copyright 1998-2008 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 ************* <auto-copyright.pl END do not edit this line> *************
26
27 dnl ---------------------------------------------------------------------------
28 dnl GADGETEER_PATH([minimum-version, [action-if-found [, action-if-not-found]]])
29 dnl
30 dnl Test for Gadgeteer and then define the following variables:
31 dnl     GADGET_CXXFLAGS
32 dnl     GADGET_LIBS
33 dnl     GADGET_PROF_LIBS
34 dnl     GADGET_LIBS_STATIC
35 dnl     GADGET_PROF_LIBS_STATIC
36 dnl     GADGET_EXTRA_LIBS
37 dnl     GADGET_USE_X11
38 dnl     GADGET_USE_COCOA
39 dnl ---------------------------------------------------------------------------
40 AC_DEFUN([GADGETEER_PATH],
41 [
42     DPP_PREREQ([2.0.1])
43
44     dnl Get the cflags and libraries from flagpoll
45     AC_ARG_WITH(gadgeteer-meta-file,
46                 [  --with-gadgeteer-meta-file=<PATH> Flagpoll metadata file
47                           for Gadgeteer (optional)      [No default]],
48                 [gadget_meta_file="$withval"], [gadget_meta_file=""])
49
50     dnl See if the user specified where to find the Gadgeteer meta file. If
51     dnl not, take a guess.
52     if test "x$gadget_meta_file" != "x" ; then
53         gadget_meta_dir=`dirname $gadget_meta_file`
54         gadget_flagpoll_args="--extra-paths=$gadget_meta_dir gadgeteer --from-file=$gadget_meta_file"
55     elif test -f "$instlinks/share/flagpoll/gadgeteer.fpc" ; then
56         gadget_meta_dir="$instlinks/share/flagpoll"
57         gadget_flagpoll_args="--extra-paths=$gadget_meta_dir gadgeteer --from-file=$gadget_meta_dir/gadgeteer.fpc"
58     else
59         gadget_flagpoll_args="gadgeteer"
60     fi
61
62     AM_PATH_FLAGPOLL([0.9.1], ,
63                      [AC_MSG_ERROR(*** Flagpoll required for Gadgeteer flags ***)])
64     min_gadget_version=ifelse([$1], ,0.0.1,[$1])
65
66     dnl Do a sanity check to ensure that $FLAGPOLL actually works.
67     if ! (eval $FLAGPOLL --help >/dev/null 2>&1) 2>&1 ; then
68         FLAGPOLL='no'
69     fi
70
71     no_gadgeteer=''
72     if test "x$FLAGPOLL" = "xno" ; then
73         no_gadgeteer=yes
74     else
75         if ! (eval $FLAGPOLL $gadget_flagpoll_args --modversion >/dev/null 2>&1)
76         then
77             AC_MSG_WARN([*** Flagpoll has no valid Gadgeteer configuration ***])
78             no_gadgeteer=yes
79         else
80             GADGET_CXXFLAGS=`$FLAGPOLL $gadget_flagpoll_args --cflags`
81             GADGET_LIBS=`$FLAGPOLL $gadget_flagpoll_args --libs`
82             GADGET_PROF_LIBS=`$FLAGPOLL $gadget_flagpoll_args --get-profiled-libs`
83             GADGET_LIBS_STATIC=`$FLAGPOLL $gadget_flagpoll_args --get-static-libs`
84             GADGET_PROF_LIBS_STATIC=`$FLAGPOLL $gadget_flagpoll_args --get-profiled-static-libs`
85             GADGET_EXTRA_LIBS_LD=`$FLAGPOLL $gadget_flagpoll_args --get-extra-libs`
86             GADGET_VERSION=`$FLAGPOLL $gadget_flagpoll_args --modversion`
87
88             GADGET_USE_X11=`$FLAGPOLL $gadget_flagpoll_args --get-use-x11`
89             GADGET_USE_COCOA=`$FLAGPOLL $gadget_flagpoll_args --get-use-cocoa`
90             GADGET_HEADER_SUBDIR=`$FLAGPOLL $gadget_flagpoll_args --get-gadget-header-subdir`
91             GADGET_DATA_SUBDIR=`$FLAGPOLL $gadget_flagpoll_args --get-gadget-data-subdir`
92             GADGET_PLUGIN_SUBDIR=`$FLAGPOLL $gadget_flagpoll_args --get-gadget-plugin-subdir`
93
94             DPP_VERSION_CHECK_MSG_NO_CACHE([Gadgeteer], [$GADGET_VERSION],
95                                            [$min_gadget_version], [$2], [$3])
96         fi
97     fi
98
99     if test "x$no_gadgeteer" != x ; then
100         if test "$FLAGPOLL" = "no" ; then
101            echo "*** Flagpoll is required to build Gadgeteer."
102            echo "*** Please check that the PATH variable is set to "
103            echo "*** include the proper path to flagpoll."
104         fi
105         GADGET_CXXFLAGS=""
106         GADGET_INCLUDES=""
107         GADGET_LIBS_LD=""
108         GADGET_PROF_LIBS_LD=""
109         GADGET_LIBS_STATIC_LD=""
110         GADGET_PROF_LIBS_STATIC_LD=""
111         GADGET_EXTRA_LIBS_LD=""
112         GADGET_VERSION="-1"
113
114         GADGET_USE_X11=''
115         GADGET_USE_COCOA=''
116
117         ifelse([$3], , :, [$3])
118     fi
119
120     AC_SUBST(GADGET_CXXFLAGS)
121     AC_SUBST(GADGET_LIBS)
122     AC_SUBST(GADGET_PROF_LIBS)
123     AC_SUBST(GADGET_LIBS_STATIC)
124     AC_SUBST(GADGET_PROF_LIBS_STATIC)
125     AC_SUBST(GADGET_EXTRA_LIBS)
126     AC_SUBST(GADGET_VERSION)
127
128     AC_SUBST(GADGET_USE_X11)
129     AC_SUBST(GADGET_USE_COCOA)
130     AC_SUBST(GADGET_HEADER_SUBDIR)
131     AC_SUBST(GADGET_DATA_SUBDIR)
132     AC_SUBST(GADGET_PLUGIN_SUBDIR)
133 ])
Note: See TracBrowser for help on using the browser.