root/juggler/branches/2.2/modules/gadgeteer/drivers/configure.ac

Revision 20795, 23.1 kB (checked in by patrick, 1 year ago)

MFT r20794: Changed the default installation location for libusb to /usr.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 # ************** <auto-copyright.pl BEGIN do not edit this line> **************
2 #
3 # VR Juggler is (C) Copyright 1998-2007 by Iowa State University
4 #
5 # Original Authors:
6 #   Allen Bierbaum, Christopher Just,
7 #   Patrick Hartling, Kevin Meinert,
8 #   Carolina Cruz-Neira, Albert Baker
9 #
10 # This library is free software; you can redistribute it and/or
11 # modify it under the terms of the GNU Library General Public
12 # License as published by the Free Software Foundation; either
13 # version 2 of the License, or (at your option) any later version.
14 #
15 # This library is distributed in the hope that it will be useful,
16 # but WITHOUT ANY WARRANTY; without even the implied warranty of
17 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18 # Library General Public License for more details.
19 #
20 # You should have received a copy of the GNU Library General Public
21 # License along with this library; if not, write to the
22 # Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 # Boston, MA 02111-1307, USA.
24 #
25 # *************** <auto-copyright.pl END do not edit this line> ***************
26
27 # -----------------------------------------------------------------------------
28 # Base configure.in for Gadgeteer.
29 # -----------------------------------------------------------------------------
30 # This file is "compiled" by GNU autoconf to generate the configure script
31 # that is actually run.
32 # -----------------------------------------------------------------------------
33
34 AC_INIT([Gadgeteer Device Drivers], [1.2],
35         [vrjuggler-devel@lists.sourceforge.net])
36 AC_PREREQ([2.53])
37 AC_COPYRIGHT([VR Juggler is (C) Copyright 1998-2007 by Iowa State University])
38 AC_CONFIG_SRCDIR([Makefile.in])
39 AC_REVISION($Revision$)
40 AC_CONFIG_AUX_DIR([../../../share/config])
41 DPP_PREREQ([2.1.2])
42 DPP_INIT
43
44 DPP_STD_CPP(yes)
45
46 # -----------------------------------------------------------------------------
47 # Command-line arguments (--enable-option, --with-pkg=package_name).
48 # -----------------------------------------------------------------------------
49
50 # ------------------------------------------------------ #
51 # --enable-feature[=arg] and --disable-feature arguments #
52 # ------------------------------------------------------ #
53
54 # -------------------------------------------- #
55 # --with-pkg[=arg] and --without-pkg arguments #
56 # -------------------------------------------- #
57
58 # Force the use of GCC as the compiler.
59 # NOTE: This is not fully implemented yet for any platform, but it is partially
60 # usable on Windows.
61 DPP_WITH_GCC(no)
62
63 AC_ARG_WITH(trackdapi,
64             [  --with-trackdapi=<PATH> Trackd API installation root    [default=/usr/local]],
65             [trackdapi_root="$withval"], [trackdapi_root='/usr/local'])
66
67 # Build the DTK wrapper using the DTK installation found at the given path.
68 # There is default path.
69 AC_ARG_WITH(dtk,
70             [  --with-dtk=<PATH>       DTK installation],
71             _with_dtk="$withval", _with_dtk='no')
72
73 #Build the VRPN wrapper using the VRPN installation found at the given path.
74 # There is default path.
75 AC_ARG_WITH(vrpn, [  --with-vrpn=<PATH>      VRPN installation],
76             _with_vrpn="$withval", _with_vrpn='no')
77
78 # Build with ftd2xx path. Then, include the X-IST drivers ...
79 # There is default path.
80 AC_ARG_WITH(ftd2xx, [  --with-ftd2xx=<PATH>    ftd2xx installation],
81             _with_ftd2xx="$withval", _with_ftd2xx='no')
82
83 # Build with libusb path. Then, include the P5Gove drivers ...
84 # There is default path.
85 AC_ARG_WITH(libusb, [  --with-libusb=<PATH>    libusb installation],
86             _with_libusb="$withval", _with_libusb='/usr')
87
88 # Define the binary format.
89 DPP_ABI_SETUP
90
91 # -----------------------------------------------------------------------------
92 # System-dependent stuff._CMA_NOWRAPPERS_
93 # -----------------------------------------------------------------------------
94 DPP_WIN32_SETUP
95 DPP_SYSTEM_SETUP
96
97 # Templates for Autoheader.
98 AH_TEMPLATE([_INCLUDE_TERMIO], [Define if building on HP-UX.])
99 AH_TEMPLATE([_CMA_NOWRAPPERS_], [Define if building on HP-UX.])
100
101 # Depending on the target operating system, set various command options and
102 # such.
103 case $target_os in
104    # SGI running IRIX 6.*.
105    irix6*)
106       if test "x$USE_GCC" != "xyes" ; then
107          DBG_FLAGS="$DBG_FLAGS -gslim"
108       fi
109       ;;
110    # HP PA-RISC machine running HP-UX 10.20.
111    hpux10.20)
112       AC_DEFINE(_INCLUDE_TERMIO,)
113       AC_DEFINE(_CMA_NOWRAPPERS_,)
114       ;;
115    # HP PA-RISC machine running HP-UX 11.x.
116    hpux11*)
117       AC_DEFINE(_INCLUDE_TERMIO,)
118       AC_DEFINE(_CMA_NOWRAPPERS_,)
119       ;;
120 esac
121
122 # -----------------------------------------------------------------------------
123 # Path setup.
124 # -----------------------------------------------------------------------------
125
126 # $srcdir is the root directory of the juggler source tree.  To get a value for
127 # $DRIVER_ROOT_ABS, we cd there and save the value of running pwd.  Then return
128 # to the directory where configure is being run ($topdir).
129 cd "$srcdir"
130 DRIVER_ROOT_ABS=`pwd`
131
132 cd "$DRIVER_ROOT_ABS/../../.."
133 UNIX_JUGGLERROOT_ABS=`pwd`
134 cd "$topdir"
135
136 if test "x$CYGPATH" != "xno" ; then
137    JUGGLERROOT_ABS=`cygpath -w "$UNIX_JUGGLERROOT_ABS" | sed -e 's/\\\\/\\//g'`
138 else
139    JUGGLERROOT_ABS="$UNIX_JUGGLERROOT_ABS"
140 fi
141
142 # -----------------------------------------------------------------------------
143 # Checks for programs.
144 # -----------------------------------------------------------------------------
145 VJ_COMPILER_SETUP
146 VJ_PROG_CC_PROF_FLAG(yes)
147 VJ_PROG_CXX_PROF_FLAG(yes)
148
149 # Ensure that the C++ compiler we've found is capable of compiling the newer
150 # newer C++ features that we need.
151 DPP_CXX_NAMESPACE([AC_MSG_ERROR([*** The library requires C++ namesapce support ***])])
152 DPP_CXX_HAVE_STD
153 DPP_CXX_INLINE([AC_MSG_ERROR([*** The library requires C++ inline support ***])])
154 DPP_CXX_RTTI([AC_MSG_ERROR([*** The library requires C++ RTTI support ***])])
155 DPP_CXX_STATIC_CAST([AC_MSG_ERROR([*** The library requires C++ static_cast<> ***])])
156 DPP_CXX_DYNAMIC_CAST([AC_MSG_ERROR([*** The library requires C++ dynamic_cast<> ***])])
157
158 # Ensure that a version of Perl greater than or equal to 5.004 is available.
159 DPP_PERL_VER(5.004, , , [AC_MSG_ERROR([*** Perl is required ***])])
160 AC_CHECK_PROG(MTREE_CMD, mtree, mtree, [\$(PERL) \$(scriptdir)/mtree.pl])
161 DPP_HAVE_GNU_MAKE(3.78, ,
162     [AC_MSG_ERROR([*** The build system requires GNU make 3.78 or newer ***])])
163 DPP_BASIC_PROGS($PLATFORM, $OS_TYPE)
164 DPP_PROG_INSTALL
165 DPP_PROG_LINKER
166
167 # -----------------------------------------------------------------------------
168 # Checks for libraries.
169 # -----------------------------------------------------------------------------
170
171 VPR_PATH([1.1.42], , [AC_MSG_ERROR([*** VPR required for Device Drivers ***])])
172 GADGETEER_PATH([1.1.28], ,
173                [AC_MSG_ERROR(*** Gadgeteer required for Device Drivers ***)])
174 JCCL_PATH_CXX([1.1.5], ,
175               [AC_MSG_ERROR([*** JCCL C++ API required for Device Drivers ***])])
176
177 # TODO: Add this back in.
178 #gadsave_CPPFLAGS="$CPPFLAGS"
179 #CPPFLAGS="$CPPFLAGS $STDFLAGS"
180 #GMTL_PATH(0.1.9, [/usr/local], , ,
181 #          [AC_MSG_ERROR([*** GMTL required for Gadgeteer ***])])
182 #CPPFLAGS="$gadsave_CPPFLAGS"
183
184 # -----------
185 # Trackd API
186 # -----------
187 DPP_LANG_SAVE
188 DPP_LANG_C
189
190 gadget_save_CFLAGS="$CFLAGS"
191 gadget_save_CPPFLAGS="$CPPFLAGS"
192
193 if test "x$trackdapi_root" != "x/usr" ; then
194    TRACKD_API_INCLUDES="-I$trackdapi_root/include -I$trackdapi_root/lib"
195
196
197    if test "x$OS_TYPE" = "xUNIX" ; then
198       if test "x$PLATFORM" = "xIRIX" ; then
199          if test "x$ABI" = "xN32" ; then
200             TRACKD_API_LIB_FLAGS="-L$trackdapi_root/lib -ltrackdAPI_n32"
201          elif test "x$ABI" = "x64" ; then
202             TRACKD_API_LIB_FLAGS="-L$trackdapi_root/lib -ltrackdAPI_64"
203          else
204             TRACKD_API_LIB_FLAGS="-L$trackdapi_root/lib -ltrackdAPI"
205          fi
206       else
207          TRACKD_API_LIB_FLAGS="-L$trackdapi_root/lib -ltrackdAPI"
208       fi
209    elif test "x$OS_TYPE" = "xWin32" ; then
210       TRACKD_API_LIB_FLAGS="/libpath:$trackdapi_root/lib trackdAPI_MT.lib"
211    fi
212 fi
213
214 CFLAGS="$CFLAGS $TRACKD_API_INCLUDES"
215 CPPFLAGS="$CPPFLAGS $TRACKD_API_INCLUDES"
216
217 # Test to see if trackdAPI.h is available.  If so, we leave
218 # $TRACKD_API_INCLUDES alone so that it may be used again later.  If it is
219 # not there, we will clear $TRACKD_API_INCLUDES to avoid polluting the compile
220 # line.
221 trackdapi_header=''
222 AC_CHECK_HEADER([trackdAPI.h], [trackdapi_header='trackdAPI.h'])
223
224 if test "x$trackdapi_header" != "x" ; then
225    HAVE_TRACKDAPI='Y'
226 else
227    # The test for Trackd API 4.x failed, so try the 5.x header file name.
228    AC_CHECK_HEADER([trackdAPI_CC.h], [trackdapi_header='trackdAPI_CC.h'])
229
230    if test "x$trackdapi_header" != "x" ; then
231       HAVE_TRACKDAPI='Y'
232    else
233       AC_MSG_WARN([*** Did not find TrackdAPI in $trackdapi_root ***])
234       TRACKD_API_INCLUDES=''
235       HAVE_TRACKDAPI='N'
236    fi
237 fi
238
239 # If the Trackd API was found, then define the preprocessor symbol
240 # GADGET_INCLUDE_TRACKDAPI_H to be the name of the header file to be
241 # included.
242 if test "x$trackdapi_header" != "x" ; then
243    AC_DEFINE_UNQUOTED([GADGET_INCLUDE_TRACKDAPI_H],
244                       [<$trackdapi_header>]
245                       [Define to include the Trackd API header file -- for example: <trackdAPI_CC.h>])
246 fi
247
248 CFLAGS="$gadget_save_CFLAGS"
249 CPPFLAGS="$gadget_save_CPPFLAGS"
250
251 DPP_LANG_RESTORE
252
253 # ----
254 # DTK
255 # ----
256 try_dtk='no'
257
258 # We can use DTK in one of the following two situations:
259 #     1) If the NSPR subsystem is enabled, the target platform is UNIX-based,
260 #        and NSPR threads are not being used.
261 #     2) If the POSIX subsystem is enabled.
262 case $vpr_subsystem in
263     NSPR)
264         if test "x$OS_TYPE" = "xUNIX"; then
265             try_dtk='yes'
266         fi
267         ;;
268     POSIX)
269         try_dtk='yes'
270         ;;
271 esac
272
273 # The user requested that the DTK wrapper be built, and the subsystem
274 # configuration is right for use with DTK.
275 if test "x${_with_dtk}" != "xno" -a "x$try_dtk" = "xyes" ; then
276     # Try to find dtk-config unless the user has already set a value for
277     # $DTK_CONFIG in their environment.
278     if test "x$DTK_CONFIG" = "x" ; then
279         AC_PATH_PROG(DTK_CONFIG, dtk-config, no, "${_with_dtk}/bin")
280     fi
281
282     # If dtk-config was not found, we cannot proceed with the DTK checks.
283     if test "x$DTK_CONFIG" = "xno" ; then
284         AC_MSG_WARN(*** Cannot build DTK wrapper without dtk-config ***)
285     # If dtk-config was found, $DTK_CONFIG has the path to it, so we can
286     # set things up to compile with DTK.
287     else
288         DPP_LANG_SAVE
289         DPP_LANG_CPLUSPLUS
290
291         _vjsave_CXXFLAGS="$CXXFLAGS"
292         _vjsave_CPPFLAGS="$CPPFLAGS"
293         _vjsave_LDFLAGS="$LDFLAGS"
294         _vjsave_LIBS="$LIBS"
295
296         # Based on the default ABI, tell $DTK_CONFIG
297         if test "x$ABI" = "xN32" ; then
298             bits='n32'
299         elif test "x$ABI" = "x64" ; then
300             bits='64'
301         fi
302
303         DTK_ROOT=`$DTK_CONFIG --root`
304         CXXFLAGS="$CXXFLAGS `$DTK_CONFIG --cflags $bits`"
305         CPPFLAGS="$CPPFLAGS `$DTK_CONFIG --include`"
306         LDFLAGS="$LDFLAGS -L`$DTK_CONFIG --lib-dir $bits`"
307         LIBS="$LIBS -ldtk"
308
309         HAVE_DTK='N'
310
311         # Determine if the installed DTK library is usable.
312         AC_CACHE_CHECK(for dtkMath_matrixPrint in -ldtk,
313             ac_cv_dtkMath_matrixPrint_in_dtk,
314             AC_TRY_LINK([
315 #include <dtk.h>
316 void dtkMath_matrixPrint(FILE *file, dtkMath_matrix* m); ],
317                         [ dtkMath_matrixPrint(0, 0); ],
318                         [ ac_cv_dtkMath_matrixPrint_in_dtk='yes'
319                           rm -rf ./ii_files ],
320                         ac_cv_dtkMath_matrixPrint_in_dtk='no'))
321
322         if test "x$ac_cv_dtkMath_matrixPrint_in_dtk" = "xyes" ; then
323             HAVE_DTK='Y'
324             DTK_INCLUDES=`$DTK_CONFIG --include`
325             DTK_LDFLAGS=`$DTK_CONFIG --libs $bits`
326         else
327             AC_MSG_WARN(*** Cannot find DTK ***)
328         fi
329
330         CXXFLAGS="${_vjsave_CXXFLAGS}"
331         CPPFLAGS="${_vjsave_CPPFLAGS}"
332         LDFLAGS="${_vjsave_LDFLAGS}"
333         LIBS="${_vjsave_LIBS}"
334
335         DPP_LANG_RESTORE
336     fi
337 # If the user wanted to compile the DTK wrapper but this script determined that
338 # the subsystem configuation would not allow its use, warn the user.
339 elif test "x${_with_dtk}" != "xno" -a "x$try_dtk" = "xno" ; then
340     AC_MSG_WARN(*** DTK cannot be used with this subsystem ***)
341 fi
342
343
344 # -----------------------------------------------------------------------------
345 # VRPN
346 # -----------------------------------------------------------------------------
347
348 # Test for the Vrpn library if the Vrpn API was enabled.
349 if test "x${_with_vrpn}" != "xno" ; then
350    if test "x${_with_vrpn}" = "xyes" ; then
351       VRPNROOT="/usr/local"
352    else
353       VRPNROOT="$_with_vrpn"
354    fi
355
356    _vjsave_CXXFLAGS="$CXXFLAGS"
357    _vjsave_CPPFLAGS="$CPPFLAGS"
358    _vjsave_LDFLAGS="$LDFLAGS"
359    _vjsave_LIBS="$LIBS"
360
361    if test "x$VRPNROOT" != "x/usr" ; then
362       VRPN_INCLUDES="-I$VRPNROOT/include"
363    fi
364
365    if test "x$OS_TYPE" = "xWin32" ; then
366       TEST_VRPN_LIBS="vrpn.lib quat.lib"
367       LDFLAGS="/libpath:\"$VRPNROOT/lib\" $LDFLAGS"
368    else
369       # SGI link order seems to clash with default rule VRPN_LDFLAGS
370       # reset below to proper value for subsequent builds.
371       if test "x$PLATFORM" = "xIRIX" ; then
372          TEST_VRPN_LIBS="-all -lvrpn -lm"
373       else
374          TEST_VRPN_LIBS="-lvrpn -lm"
375       fi
376
377       LDFLAGS="-L$VRPNROOT/lib $LDFLAGS"
378    fi
379
380    CPPFLAGS="$VRPN_INCLUDES $CPPFLAGS"
381    LIBS="$TEST_VRPN_LIBS $LIBS"
382
383    # VRPN will normally be compiled to use pthreads in the same context as
384    # when VPR was compiled to use pthreads.
385    if test "x$VPR_SUBSYSTEM" = "xPOSIX" ; then
386       DPP_CC_PTHREAD_ARG
387
388       if test "x$CC_ACCEPTS_PTHREAD" = "xno" ; then
389          DPP_CC_PTHREADS_ARG
390       fi
391
392       DPP_GET_PTHREAD_LIB
393
394       CXXFLAGS="$PTHREAD_ARG $CXXFLAGS"
395       LIBS="$LIBS $PTHREAD_LIB"
396    fi
397
398    vj_have_vrpn='no'
399
400    DPP_LANG_SAVE
401    DPP_LANG_CPLUSPLUS
402
403    CPPFLAGS="$CPPFLAGS $STDFLAGS"
404
405    # Try to link
406    AC_CACHE_CHECK([for vrpn_Button_Remote in -lvrpn],
407                   [ac_cv_vrpn_Button_Remote_in_vrpn],
408                   [AC_TRY_LINK([
409 #include <vrpn_Button.h>
410 ],
411                      [vrpn_Button_Remote* b = new vrpn_Button_Remote("");],
412                      [ac_cv_vrpn_Button_Remote_in_vrpn='yes'
413                        rm -rf ./ii_files ],
414                      [ac_cv_vrpn_Button_Remote_in_vrpn='no'])])
415
416    vj_have_vrpn="$ac_cv_vrpn_Button_Remote_in_vrpn"
417
418    CPPFLAGS="${_vjsave_CPPFLAGS}"
419
420    DPP_LANG_RESTORE
421
422    if test "x$vj_have_vrpn" = "xyes" ; then
423       HAVE_VRPN='Y'
424       VRPN_LDFLAGS="-L$VRPNROOT/lib $TEST_VRPN_LIBS"
425    else
426       HAVE_VRPN='N'
427       AC_MSG_WARN([*** Did not find VRPN in $VRPNROOT ***])
428    fi
429
430    CXXFLAGS="${_vjsave_CXXFLAGS}"
431    CPPFLAGS="${_vjsave_CPPFLAGS}"
432    LDFLAGS="${_vjsave_LDFLAGS}"
433    LIBS="${_vjsave_LIBS}"
434 fi
435
436 # -----------------------------------------------------------------------------
437 # FTD2XX
438 # -----------------------------------------------------------------------------
439
440 # Test for the ftd2xx library
441 if test "x${_with_ftd2xx}" != "xno" ; then
442    if test "x${_with_ftd2xx}" = "xyes" ; then
443       FTD2XX_ROOT="/usr/local"
444    else
445       FTD2XX_ROOT="${_with_ftd2xx}"
446    fi
447
448    _gadget_save_CFLAGS="$CFLAGS"
449    _gadget_save_CPPFLAGS="$CPPFLAGS"
450    _gadget_save_LDFLAGS="$LDFLAGS"
451    _gadget_save_LIBS="$LIBS"
452
453    FTD2XX_INCLUDES="-I$FTD2XX_ROOT/include"
454    FTD2XX_LDFLAGS="-L$FTD2XX_ROOT/lib"
455    FTD2XX_LIBS="-lftd2xx"
456
457    if test "x$PLATFORM" = "xLinux" ; then
458       FTD2XX_LIBS="$FTD2XX_LIBS -lusb -ldl"
459       gadget_ftd2xx_extra_libs='-pthread -lusb -ldl'
460    fi
461
462    CPPFLAGS="$FTD2XX_INCLUDES $CPPFLAGS"
463    LDFLAGS="$FTD2XX_LDFLAGS $LDFLAGS"
464
465    gadget_have_ftd2xx='no'
466
467    DPP_LANG_SAVE
468    DPP_LANG_C
469
470    CPPFLAGS="$CPPFLAGS $STDFLAGS"
471
472    AC_CHECK_LIB([ftd2xx], [FT_ListDevices],
473                 [AC_CHECK_HEADER([ftd2xx.h], [gadget_have_ftd2xx='yes'],
474                                  [gadget_have_ftd2xx='no'])],
475                 [gadget_have_ftd2xx='no'], [$gadget_ftd2xx_extra_libs])
476
477    DPP_LANG_RESTORE
478
479    if test "x$gadget_have_ftd2xx" = "xyes" ; then
480       HAVE_FTD2XX='Y'
481    else
482       HAVE_FTD2XX='N'
483       AC_MSG_WARN([*** Did not find FTD2XX in $FTD2XX_ROOT ***])
484    fi
485
486    CFLAGS="${_gadget_save_CFLAGS}"
487    CPPFLAGS="${_gadget_save_CPPFLAGS}"
488    LDFLAGS="${_gadget_save_LDFLAGS}"
489    LIBS="${_gadget_save_LIBS}"
490 fi
491
492 # -----------------------------------------------------------------------------
493 # libusb
494 # -----------------------------------------------------------------------------
495
496 # Test for the libusb library
497 if test "x${_with_libusb}" != "xno" ; then
498    AC_PATH_PROG([LIBUSB_CONFIG], [libusb-config], [no],
499                 [${_with_libusb}/bin])
500 else
501    AC_PATH_PROG([LIBUSB_CONFIG], [libusb-config], [no])
502 fi
503
504 if test "x$LIBUSB_CONFIG" != "xno" ; then
505    _gadget_save_CFLAGS="$CFLAGS"
506    _gadget_save_CPPFLAGS="$CPPFLAGS"
507    _gadget_save_LDFLAGS="$LDFLAGS"
508    _gadget_save_LIBS="$LIBS"
509
510    LIBUSB_CFLAGS=`$LIBUSB_CONFIG --cflags`
511    LIBUSB_LIBS=`$LIBUSB_CONFIG --libs`
512
513    CPPFLAGS="$LIBUSB_CFLAGS $CPPFLAGS"
514    LDFLAGS="$LIBUSB_LIBS $LDFLAGS"
515
516    gadget_have_libusb='no'
517
518    DPP_LANG_SAVE
519    DPP_LANG_C
520
521    AC_CHECK_LIB(usb, usb_init,
522                 [AC_CHECK_HEADER([usb.h], [gadget_have_libusb='yes'],
523                                  [gadget_have_libusb='no'])],
524                 [gadget_have_libusb='no'])
525
526    DPP_LANG_RESTORE
527
528    if test "x$gadget_have_libusb" = "xyes" ; then
529       HAVE_LIBUSB='Y'
530    else
531       HAVE_LIBUSB='N'
532       AC_MSG_WARN([*** Did not find libusb ***])
533    fi
534
535    CFLAGS="${_gadget_save_CFLAGS}"
536    CPPFLAGS="${_gadget_save_CPPFLAGS}"
537    LDFLAGS="${_gadget_save_LDFLAGS}"
538    LIBS="${_gadget_save_LIBS}"
539 fi
540
541 # -----------------------------------------------------------------------------
542 # Checks for header files.
543 # -----------------------------------------------------------------------------
544 AC_HEADER_STDC
545 AC_CHECK_HEADERS([fcntl.h sys/ioctl.h sys/time.h termios.h unistd.h      \
546                   sys/z8530.h sys/stdsyms.h])
547
548 # -----------------------------------------------------------------------------
549 # Checks for typedefs, structures, and compiler characteristics.
550 # -----------------------------------------------------------------------------
551 AC_TYPE_SIZE_T
552
553 # -----------------------------------------------------------------------------
554 # Checks for library functions.
555 # -----------------------------------------------------------------------------
556 AC_CHECK_FUNCS(strdup strerror)
557
558 # -----------------------------------------------------------------------------
559 # Miscellaneous checks.
560 # -----------------------------------------------------------------------------
561 DPP_INSTALLER(vrjuggler, 0644, 0755, 0755)
562
563 # -----------------------------------------------------------------------------
564 # Do Makefile substitutions.
565 # -----------------------------------------------------------------------------
566
567 DATA_SUBDIR="$GADGET_DATA_SUBDIR"
568 DRIVER_SUBDIR="$GADGET_PLUGIN_SUBDIR"
569
570 # Add these C++ options when compiling with G++.
571 #if test "x$GXX" = "xyes" ; then
572 #   CXXFLAGS="-fhonor-std $CXXFLAGS"
573 #fi
574
575 CXXFLAGS="$CXXFLAGS $CXX_VISIBILITY_FLAGS $GADGET_CXXFLAGS"
576 DEPEND_FLAGS="$GADGET_CXXFLAGS"
577
578 # Note that we do not have to add to $gadget_cxxflags because user code
579 # would never need to know where the Trackd API headers live.
580 if test "x$TRACKD_API_INCLUDES" != "x" ; then
581    INCLUDES="$INCLUDES $TRACKD_API_INCLUDES"
582 fi
583
584 # The same is true for DTK headers WRT $gadget_cxxflags.
585 if test "x$DTK_INCLUDES" != "x" ; then
586    INCLUDES="$INCLUDES $DTK_INCLUDES"
587 fi
588
589 if test "x$PLATFORM" = "xIRIX" -a "x$USE_GCC" != "xyes" ; then
590 #    CFLAGS="$CFLAGS -woff 1685,515,608,658,799,803,852,1048,1233,1499"
591     CXXFLAGS="$CXXFLAGS -w2"
592 elif test "x$PLATFORM" = "xDarwin" ; then
593     changequote(<<, >>)
594     vpr_gcc_major=`echo $dpp_gcc_ver | sed -e 's/^\([0-9]*\)\..*/\1/'`
595     changequote([, ])
596
597     # GCC 4.0 in Darwin removed -fexport-coalesced.
598     if test $vpr_gcc_major -lt 4 ; then
599        CXXFLAGS_DYNLIB="$CXXFLAGS_DYNLIB -fexport-coalesced"
600     fi
601 elif test "x$OS_TYPE" = "xWin32" -a "x$USE_GCC" != "xyes" ; then
602     vc_cflags='/QIfdiv /QI0f'
603     vc_cxxflags='/GR /GX /EHc /QIfdiv /QI0f'
604     CFLAGS="$CFLAGS $vc_cflags"
605     CXXFLAGS="$CXXFLAGS $vc_cxxflags"
606     DBG_FLAGS="$DBG_FLAGS /MDd"
607     OPT_FLAGS="$OPT_FLAGS /MD"
608 fi
609
610 # For makedepend(1) to work properly on HP-UX with aCC, we have to include
611 # these extra paths.
612 if test "x$PLATFORM" = "xHP" ; then
613     _aCC_ROOT="/opt/aCC"
614     DEPEND_EXTRAS="$DEPEND_EXTRAS -I${_aCC_ROOT} -I${_aCC_ROOT}/include -I${_aCC_ROOT}/include/iostream"
615 elif test "x$OS_TYPE" = "xWin32" ; then
616     DEPEND_EXTRAS="$DEPEND_EXTRAS -D__cplusplus"
617 fi
618
619 # Define the base path to the source directory using $(DRIVER_ROOT_ABS) as an
620 # alternative to using $(srcdir).
621 UNIX_DRIVER_ROOT_ABS="$DRIVER_ROOT_ABS"
622
623 DSO_DRIVER_DEPS="$LDFLAGS $GADGET_LIBS"
624
625 if test "x$OS_TYPE" = "xWin32" ; then
626    DSO_DRIVER_PROF_DEPS="$DSO_DRIVER_DEPS"
627 else
628    DSO_DRIVER_PROF_DEPS="$LDFLAGS $GADGET_PROF_LIBS"
629
630    VJ_BUILD_LIB_FILE_LIST([$DSO_DRIVER_DEPS], [DSO_DRIVER_DEP_FILES])
631    VJ_BUILD_LIB_FILE_LIST([$DSO_DRIVER_PROF_DEPS], [DSO_DRIVER_PROF_DEP_FILES])
632 fi
633
634 # Translate paths from UNIX-style to Win32.
635 if test "x$OS_TYPE" = "xWin32" ; then
636     DRIVER_ROOT_ABS=`dospath -p "$DRIVER_ROOT_ABS"`
637     JUGGLERROOT_ABS=`dospath -p "$JUGGLERROOT_ABS"`
638
639     DEPEND_EXTRAS=`dospath "$DEPEND_EXTRAS"`
640     INCLUDES=`dospath "$INCLUDES"`
641     LIBS=`dospath "$LIBS"`
642     LN_S='cp -r'
643     RM_LN='rm -rf'
644     MTREE_CMD=`dospath "$MTREE_CMD"`
645
646     JDK_HOME=`dospath -p "$JDK_HOME"`
647 else
648     RM_LN='rm -f'
649     DRIVER_ROOT_ABS="$DRIVER_ROOT_ABS"
650     JUGGLERROOT_ABS="$JUGGLERROOT_ABS"
651 fi
652
653 DPP_SUBST
654
655 AC_SUBST(topdir)
656 AC_SUBST(UNIX_DRIVER_ROOT_ABS)
657 AC_SUBST(UNIX_JUGGLERROOT_ABS)
658 AC_SUBST(DRIVER_ROOT_ABS)
659 AC_SUBST(JUGGLERROOT_ABS)
660 AC_SUBST(VPR_SUBSYSTEM)
661
662 AC_SUBST(DATA_SUBDIR)
663 AC_SUBST(DRIVER_SUBDIR)
664
665 AC_SUBST(EXTRA_LDFLAGS)
666 AC_SUBST(RM_LN)
667
668 AC_SUBST(DTK_CONFIG)
669 AC_SUBST(HAVE_DTK)
670
671 AC_SUBST(HAVE_VRPN)
672 AC_SUBST(VRPNROOT)
673 AC_SUBST(VRPN_LDFLAGS)
674
675 AC_SUBST(HAVE_FTD2XX)
676 AC_SUBST(FTD2XX_ROOT)
677 AC_SUBST(FTD2XX_INCLUDES)
678 AC_SUBST(FTD2XX_LDFLAGS)
679 AC_SUBST(FTD2XX_LIBS)
680
681 AC_SUBST(HAVE_LIBUSB)
682 AC_SUBST(LIBUSB_CFLAGS)
683 AC_SUBST(LIBUSB_LIBS)
684
685 AC_SUBST(DSO_DRIVER_DEPS)
686 AC_SUBST(DSO_DRIVER_DEP_FILES)
687 AC_SUBST(DSO_DRIVER_PROF_DEPS)
688 AC_SUBST(DSO_DRIVER_PROF_DEP_FILES)
689
690 AC_SUBST(HAVE_TRACKDAPI)
691 AC_SUBST(TRACKD_API_LIB_FLAGS)
692
693 # -----------------------------------------------------------------------------
694 # Final file generation step.
695 # -----------------------------------------------------------------------------
696 AC_CONFIG_FILES([
697    Makefile
698    Makefile.inc
699    common.defs.mk
700    driver.defs.mk
701    make.defs.mk
702    3Dconnexion/Makefile
703    3Dconnexion/SpaceBall/Makefile
704    5DT/Makefile
705    5DT/DataGlove/Makefile
706    ART/Makefile
707    ART/DTrack/Makefile
708    Ascension/Makefile
709    Ascension/Flock/Makefile
710    Ascension/MotionStar/Makefile
711    Ascension/Wanda/Makefile
712    Elexol/Makefile
713    Elexol/Ether24/Makefile
714    EssentialReality/Makefile
715    EssentialReality/P5Glove/Makefile
716    Fakespace/Makefile
717    Fakespace/PinchGlove/Makefile
718    Immersion/Makefile
719    Immersion/IBox/Makefile
720    Intersense/Makefile
721    Intersense/IS900/Makefile
722    Intersense/IntersenseAPI/Makefile
723    Logitech/Makefile
724    Logitech/ThreeDMouse/Makefile
725    Open/Makefile
726    Open/DTK/Makefile
727    Open/LinuxJoydev/Makefile
728    Open/Trackd/Makefile
729    Open/VRPN/Makefile
730    Polhemus/Makefile
731    Polhemus/Fastrak/Makefile
732    USDigital/Makefile
733    USDigital/SerialEncoder/Makefile
734    VRCO/Makefile
735    VRCO/TrackdAPI/Makefile
736    VirtualTechnologies/Makefile
737    VirtualTechnologies/CyberGlove/Makefile
738    noDNA/Makefile
739    noDNA/X-IST/Makefile
740    VARS.pl
741    ])
742
743 AC_OUTPUT
Note: See TracBrowser for help on using the browser.