root/juggler/tags/1.0_alpha_04/configure.in

Revision 461, 28.1 kB (checked in by allenb, 10 years ago)

Created simple glove application

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 # -----------------------------------------------------------------------------
2 # Base configure.in for VR Juggler.
3 # $Date$
4 # -----------------------------------------------------------------------------
5 # This file is "compiled" by GNU autoconf to generate the configure script
6 # that is actually run.
7 # -----------------------------------------------------------------------------
8
9 AC_REVISION($Revision$)
10 AC_INIT(Config/vjChunkDesc.cpp)
11 AC_CONFIG_HEADER(vjDefines.h)
12
13 # -----------------------------------------------------------------------------
14 # Command-line arguments (--enable-option, --with-pkg=package_name).
15 # -----------------------------------------------------------------------------
16
17 dnl # -------------------------------------------- #
18 dnl # --with-pkg[=arg] and --without-pkg arguments #
19 dnl # -------------------------------------------- #
20
21 dnl # Enable binary format.  Possible values are "O32", "N32" or "64".
22 dnl # The default is "N32".
23 AC_ARG_WITH(abi,
24             [  --with-abi=[O32|N32_M3|N32_M4|64_M3|64_M4|HP]
25                           define the Application Binary Interface to use
26                           [default=N32_M3]],
27             _abi_type="$withval", _abi_type='N32_M3')
28
29 dnl # Define the location where the library will be built.  This is not
30 dnl # currently used anyhwere in this script.
31 dnl # The default is "$srcdir/lib".
32 AC_ARG_WITH(builddir,
33             [  --with-builddir=[PATH]
34                           define the location where the library will be built
35                           [default=\$srcdir/lib]],
36             _vj_builddir="$withval")
37
38 dnl # Define which threading model to use.  Possible values are "SGI_IPC" or
39 dnl # "POSIX".
40 dnl # The default is "SGI_IPC".
41 AC_ARG_WITH(threads,
42             [  --with-threads=[SGI_IPC|POSIX]
43                           define thread package [default=SGI_IPC]],
44             _thread_pkg="$withval", _thread_pkg='SGI_IPC')
45
46 dnl # Define the root directory for the Java installation.
47 dnl # The default is /usr/java.
48 _JDK_HOME_DEFAULT="/usr/java"
49 _JDK_HOME_ALT_LIST="/usr/local/java"
50 AC_ARG_WITH(jdkhome,
51             [  --with-jdkhome=[PATH]  JDK installation directory [default=/usr/java]],
52             JDK_HOME="$withval", JDK_HOME="${_JDK_HOME_DEFAULT}")
53
54 dnl # Define the root directory for the Performer installation.
55 dnl # The default is /usr.
56 AC_ARG_WITH(pfroot,
57             [  --with-pfroot=[PATH]    Performer installation directory [default=/usr]],
58             PFROOT="$withval", PFROOT='/usr')
59
60 dnl # Define the root directory for the OpenGL installation.
61 dnl # The default is /usr.
62 AC_ARG_WITH(oglroot,
63             [  --with-oglroot=[PATH]   OpenGL installation directory [default=/usr]],
64             OGLROOT="$withval", OGLROOT='/usr')
65
66 dnl # ------------------------------------------------------ #
67 dnl # --enable-feature[=arg] and --disable-feature arguments #
68 dnl # ------------------------------------------------------ #
69
70 dnl # Enable debugging.  Possible values are "yes" or "no".  "yes" is set
71 dnl # with --enable-debug and "no" is set with --disable-debug.
72 dnl # The default is "yes".
73 AC_ARG_ENABLE(debug,
74               [  --enable-debug          enable debugging [default=yes]],
75               _enable_debug="$enableval", _enable_debug="yes")
76
77 dnl # Enable compilation of the OpenGL API.  Possible values are "yes" or
78 dnl # "no".  "yes" is set with --enable-opengl and "no" is set with
79 dnl # --disable-opengl.
80 dnl # The default is "yes".
81 AC_ARG_ENABLE(opengl,
82               [  --enable-opengl         use OpenGL API [default=yes]],
83               _enable_opengl="$enableval", _enable_opengl='yes')
84
85 dnl # Enable compilation of the Performer API.  Possible values are "yes" or
86 dnl # "no".  "yes" is set with --enable-perf and "no" is set with
87 dnl # --disable-perf.
88 dnl # The default is "yes".
89 AC_ARG_ENABLE(perf,
90               [  --enable-perf           use Perfromer API [default=yes]],
91               _enable_perf="$enableval", _enable_perf='yes')
92
93 # Enable compile-time debugging blocks.
94 if test "x${_enable_debug}" = "xyes" ; then
95     AC_DEFINE(VJ_DEBUG,)
96 fi
97
98 # Set default values for these before checking $abi_type.  Currently, these
99 # are for non-SGI platforms.
100 ABI='32'
101 LIBBITSUF=''
102
103 # Based on the value of $abi_type, set $ABI for later use and the Makefile
104 # substitution variables $LIBBITSUF and $ABI.
105 if test "x${_abi_type}" = "x64_M3" ; then
106     ABI='64'
107     ISA='mips3'
108     LIBBITSUF='64'
109     _EXTRA_FLAGS='-64 -mips3'
110 elif test "x${_abi_type}" = "x64_M4" ; then
111     ABI='64'
112     ISA='mips4'
113     LIBBITSUF='64'
114     _EXTRA_FLAGS='-64 -mips4'
115 elif test "x${_abi_type}" = "xN32_M3" ; then
116     ABI='N32'
117     ISA='mips3'
118     LIBBITSUF='32'
119     _EXTRA_FLAGS='-n32 -mips3'
120 elif test "x${_abi_type}" = "xN32_M4" ; then
121     ABI='N32'
122     ISA='mips4'
123     LIBBITSUF='32'
124     _EXTRA_FLAGS='-n32 -mips4'
125 elif test "x${_abi_type}" = "xO32" ; then
126     ABI='O32'
127     ISA='mips2'
128     LIBBITSUF=''
129     _EXTRA_FLAGS='-o32 -mips2'
130 elif test "x${_abi_type}" = "xHP" ; then
131     ABI=''
132     ISA=''
133     LIBBITSUF=''
134     _EXTRA_FLAGS=''
135 fi
136
137 # -----------------------------------------------------------------------------
138 # System-dependent stuff.
139 # -----------------------------------------------------------------------------
140 AC_CANONICAL_HOST
141
142 # Operating system release information.  This may contain anything and should
143 # be treated as a string.
144 _OS_REL_STR=`uname -r`
145
146 # Operating system version number only (any miscellaneous text is stripped).
147 # This will only contain a number and can be treated as a float-point value.
148 # NOTE: It is currently not used in config.h.
149 _OS_REL_NUM=`uname -r | sed -e 's/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\)[^0-9]*$/\1/'`
150
151 # Major and minor version numbers from ${_OS_REL_NUM} separated for use with
152 # the C preprocessor.  Using cut(1) is kind of a hack, but at least it's a
153 # clean one.
154 _OS_REL_NUM_MAJOR=`echo "${_OS_REL_NUM}" | cut -f1 -d'.'`
155 _OS_REL_NUM_MINOR=`echo "${_OS_REL_NUM}" | cut -f2 -d'.'`
156
157 AR=''                   # Archive library command (generally ar(1))
158 ARFLAGS=''              # Flags for $AR
159 LD=''                   # Shared library command (usually ld(1))
160 LDOPTS=''               # More options for shared library generator
161 SHAREDLIB_EXT=''        # Extension for shared libraries (usually 'so')
162
163 OPT_FLAGS=''            # Compiler optimization flags
164
165 DSOREGFILE=''
166 DSOVERSION=''
167 DSOVERSIONOPTS=''
168 ABI_LIST=''             # List of supported ABIs on a given platform
169 PLATFORM=''             # Platform name
170
171 # Depending on the host type, set various command options and such.
172 case $host in
173     # SGI running IRIX [56].*.
174     mips-sgi-irix*)
175         # Set compiler flags and the location of $DSOREGFILE depending on
176         # $ABI.
177         if test "$ABI" = "64" ; then
178             DSOREGFILE='/usr/lib64/so_locations'
179             OPT_FLAGS='-OPT:Olimit=2000'
180         elif test "$ABI" = "N32" ; then
181             DSOREGFILE='/usr/lib32/so_locations'
182             OPT_FLAGS='-OPT:Olimit=2000'
183         elif test "$ABI" = "O32" ; then
184             DSOREGFILE='/usr/lib/so_locations'
185             OPT_FLAGS='-Olimit 2000'
186         fi
187
188         AR='${CXX}'
189         ARFLAGS='-ar -WR,-v -o'
190         CFLAGS="$CFLAGS"
191         CXXFLAGS="-ptv $CXXFLAGS"
192         INCLUDES="$INCLUDES -I/usr/include/CC -I/usr/include"
193         LD='${CXX} -shared'
194         LDFLAGS="$LDFLAGS"
195         _LD_REGOPTS='-check_registry ${DSOREGFILE}'
196         LDOPTS="$LDOPTS -all ${_LD_REGOPTS}"
197         SHAREDLIB_EXT='so'
198
199         DSOVERSION='sgi4.0'
200         DSOVERSIONOPTS='-set_version ${DSOVERSION}'
201
202         ABI_LIST='64_M4 64_M3 N32_M4 N32_M3'
203         PLATFORM='SGI'
204
205         AC_DEFINE(VJ_OS_SGI,)
206         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE, "${_OS_REL_STR}")
207         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE_MAJOR, ${_OS_REL_NUM_MAJOR})
208         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE_MINOR, ${_OS_REL_NUM_MINOR})
209         AC_DEFINE(_BSD_TYPES,)
210
211         if test ${_OS_REL_NUM_MAJOR} -lt 6 ; then
212             AC_DEFINE(IRIXREL, "IRIX5")
213         else
214             AC_DEFINE(IRIXREL, "IRIX6")
215         fi
216         ;;
217     # HP PA-RISC machine running HP-UX 10.20.
218     hppa*hpux10.20)
219         AR='ar'
220         ARFLAGS='r'
221         CFLAGS="-Aa $CFLAGS"
222         CXXFLAGS="+p $CXXFLAGS"
223         LD='ld'
224         LDFLAGS="$LDFLAGS -L/usr/lib/X11R6"
225         LDOPTS='-b'
226         OPT_FLAGS='+inline_level 3'
227         SHAREDLIB_EXT='sl'
228
229         # We have to use POSIX threads on HP-UX.
230         if test "x${_thread_pkg}" != "xPOSIX" ; then
231             AC_MSG_WARN(*** POSIX threads must be used on $host ***)
232             _thread_pkg='POSIX'
233         fi
234
235         AC_DEFINE(VJ_OS_HPUX,)
236         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE, "${_OS_REL_STR}")
237         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE_MAJOR, ${_OS_REL_NUM_MAJOR})
238         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE_MINOR, ${_OS_REL_NUM_MINOR})
239         AC_DEFINE(_HPUX_SOURCE,)
240         AC_DEFINE(_INCLUDE_TERMIO,)
241         AC_DEFINE(_CMA_NOWRAPPERS_,)
242         AC_DEFINE(notdef,)
243         ABI_LIST=''
244         PLATFORM='HP'
245         ;;
246     # DEC Alpha running Digital UNIX 4.0.
247     alpha-[a-z]*-osf4.0)
248         AC_DEFINE(VJ_OS_DUX,)
249         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE, "${_OS_REL_STR}")
250         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE_MAJOR, ${_OS_REL_NUM_MAJOR})
251         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE_MINOR, ${_OS_REL_NUM_MINOR})
252         PLATFORM='alpha-DUX'
253         ;;
254     # i386-class machine running FreeBSD.
255     i386-[a-z]*-freebsd*)
256         AC_DEFINE(VJ_OS_FreeBSD,)
257         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE, "${_OS_REL_STR}")
258         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE_MAJOR, ${_OS_REL_NUM_MAJOR})
259         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE_MINOR, ${_OS_REL_NUM_MINOR})
260         ABI_LIST='AOUT ELF'
261         PLATFORM='i386-FBSD'
262         ;;
263     # Unkown operating system (to config.guess).
264     *-unknown)
265         AC_DEFINE(VJ_OS_GENERIC,)
266         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE, "${_OS_REL_STR}")
267         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE_MAJOR, ${_OS_REL_NUM_MAJOR})
268         AC_DEFINE_UNQUOTED(VJ_OS_RELEASE_MINOR, ${_OS_REL_NUM_MINOR})
269         PLATFORM='UNKNOWN'
270         ;;
271 esac
272
273 # -----------------------------------------------------------------------------
274 # Checks for programs.
275 # -----------------------------------------------------------------------------
276
277 _vjsave_CFLAGS="$CFLAGS"
278 _vjsave_CXXFLAGS="$CXXFLAGS"
279
280 # On HP-UX, we have to use the aCC C++ compiler.
281 if test "$PLATFORM" = "HP" ; then
282     AC_CHECK_PROG(CXX, aCC, aCC,
283         AC_MSG_ERROR(*** The library requires the HP-UX aCC C++ compiler ***))
284 # On IRIX, we have to use cc and CC (not gcc or g++).
285 elif test "$PLATFORM" = "SGI" ; then
286     AC_CHECK_PROG(CC, cc, cc,
287         AC_MSG_ERROR(*** The library requires the IRIX cc C compiler ***))
288     AC_CHECK_PROG(CXX, CC, CC,
289         AC_MSG_ERROR(*** The library requires the IRIX CC C++ compiler ***))
290 fi
291
292 CFLAGS="$CFLAGS ${_EXTRA_FLAGS}"
293 CXXFLAGS="$CXXFLAGS ${_EXTRA_FLAGS}"
294
295 AC_PROG_CC
296 AC_PROG_CXX
297 AC_PROG_CPP
298 AC_PROG_CXXCPP
299
300 CFLAGS="${_vjsave_CFLAGS}"
301 CXXFLAGS="${_vjsave_CXXFLAGS}"
302
303 # Check for the JDK (specifically try to find javac(1) in $JDK_HOME).
304 JAVAC=''
305 JAR=''
306
307 # In checking for javac(1), "${JDK_HOME}/bin" is added to the script's $PATH
308 # variable.  This directory may already be in the path, but this ensures that
309 # javac(1) will be found by AC_PATH_PROG().
310 _vjsave_PATH="$PATH"
311 PATH="$PATH:${JDK_HOME}/bin"
312 AC_PATH_PROG(JAVAC, javac)
313 PATH="${_vjsave_PATH}"
314
315 # If $JAVAC was not set by AC_PATH_PROG(), try to find the JDK installation
316 # directory using the list in $JDK_HOME_ALT_LIST.
317 if test -z "$JAVAC" ; then
318     # Add the default value for $JDK_HOME (found in ${_JDK_HOME_DEFAULT}) to
319     # the list of alternate installation directories in case the user gave
320     # a different value for $JDK_HOME on the command line.
321     if test "x$JDK_HOME" != "x${_JDK_HOME_DEFAULT}" ; then
322         _JDK_HOME_ALT_LIST="${_JDK_HOME_DEFAULT} ${_JDK_HOME_ALT_LIST}"
323     fi
324
325     # Loop over the list of possible alternate installation directories for
326     # the JDK found in ${_JDK_HOME_ALT_LIST}.
327     for _JDK_HOME_TMP in ${_JDK_HOME_ALT_LIST} ; do
328         # Only check the directory in ${_JDK_HOME_TMP} if it is not the same
329         # as the path given by the user on the command line.
330         if test "${_JDK_HOME_TMP}" != "$JDK_HOME" ; then
331             AC_MSG_CHECKING(for javac in ${_JDK_HOME_TMP})
332
333             # If an executable javac is found in ${_JDK_HOME_TMP}, set $JAVAC
334             # to the full path to it, save ${_JDK_HOME_TMP} in $JDK_HOME and
335             # quit looping.
336             if test -x "${_JDK_HOME_TMP}/bin/javac" ; then
337                 JAVAC="${_JDK_HOME_TMP}/bin/javac"
338                 JDK_HOME="${_JDK_HOME_TMP}"
339                 AC_MSG_RESULT(yes)
340                 break
341             # Otherwise, print "no" and go on to the next directory.
342             else
343                 AC_MSG_RESULT(no)
344             fi
345         fi
346     done
347 fi
348
349 BUILD_GUI='N'
350
351 # If there is still no value in $JAVAC, then warn that the GUI will not be
352 # built.
353 if test -z "$JAVAC" ; then
354     AC_MSG_WARN(*** The GUI requires javac -- it will not be built ***)
355 # Otherwise, set $JAR to the path to jar(1) and continue.
356 else
357     JAR="${JDK_HOME}/bin/jar"
358     BUILD_GUI='Y'
359 fi
360
361 AC_PROG_INSTALL
362 AC_CHECK_PROG(MTREE_CMD, mtree, mtree, \${scriptdir}/mtree.pl)
363 AC_PROG_MAKE_SET
364 dnl # AC_PROG_RANLIB
365
366 # -----------------------------------------------------------------------------
367 # Checks for libraries.
368 # -----------------------------------------------------------------------------
369
370 THREADS=''
371
372 # Test for libpthread or for libcma if libpthread is not present.
373 # If the library is found, check for pthread_kill().  If it is present,
374 # Draft 10 (the "final" draft) of the POSIX threads standard is in place.  If
375 # not, Draft 4 is available.
376 if test "x${_thread_pkg}" = "xPOSIX" ; then
377     AC_CHECK_LIB(pthread, pthread_create,
378         AC_CHECK_HEADER(pthread.h,
379             [ THREADS='POSIX'; LIBS="$LIBS -lpthread"; ],
380             AC_MSG_WARN(*** POSIX threads will not be used (header file not found) ***)))
381
382     # On HP-UX 10.20, the pthreads library is in the cma library rather than
383     # pthreads, so test for that if $THREADS was not set above.
384     if test -z "$THREADS" ; then
385         AC_CHECK_LIB(cma, pthread_create,
386             AC_CHECK_HEADER(pthread.h,
387                 [ THREADS='POSIX'; LIBS="$LIBS -lcma"; ],
388                 AC_MSG_WARN(*** POSIX threads will not be used (header file not found) ***)),
389             AC_MSG_WARN(*** POSIX threads will not be used (no library found) ***))
390     fi
391
392     # If $THREADS is equal to "POSIX" at this point, then the pthread
393     # libraries needed are in $LIBS, so now we make a check for the draft
394     # revision being used.  This is done by determining if pthread_kill() is
395     # in the library.  If it is, Draft 10 is in use.  Otherwise, assume it is
396     # Draft 4.
397     if test "$THREADS" = "POSIX" ; then
398         AC_CACHE_CHECK(POSIX threads draft revision,
399             ac_cv_pthread_version,
400             AC_TRY_LINK([ #include <pthread.h> ],
401                 [ pthread_t t; pthread_kill(t, 1); ],
402                 ac_cv_pthread_version='Draft 10',
403                 ac_cv_pthread_version='Draft 4'))
404
405         if test "$ac_cv_pthread_version" = "Draft 10" ; then
406             AC_DEFINE(_PTHREADS_DRAFT_10,)
407         else
408             AC_DEFINE(_PTHREADS_DRAFT_4,)
409         fi
410
411         # Define the default thread scope depending on the platform.  On IRIX,
412         # only process scope is avaiable.  Other systems may support system
413         # scope.
414         if test "$PLATFORM" = "SGI" ; then
415             AC_DEFINE(VJ_THREAD_SCOPE, PTHREAD_SCOPE_PROCESS)
416         else
417             AC_DEFINE(VJ_THREAD_SCOPE, PTHREAD_SCOPE_SYSTEM)
418         fi
419     fi
420
421 # If we are not using POSIX threads, we must be using the SGI IPC model, but
422 # we test ${_thread_pkg} just to be sure it is set right.
423 elif test "x${_thread_pkg}" = "xSGI_IPC" ; then
424     AC_CHECK_HEADERS(sys/prctl.h,
425         THREADS='SGI_IPC',
426         AC_MSG_WARN(*** SGI IPC threading will not be used (no headers found) ***))
427 fi
428
429 #---------------------------------------
430 # SHARED MEM
431 # SYNC PRIMS
432 #---------------------------------------
433 SYNC_SYS=''                     # POSIX, SGI_IPC
434 SHMEM_SYS=''                    # SGI_IPC
435 THREAD_SYS=''                   # POSIX, SGI_IPC
436
437 # Define various CPP macros depending on which threads implementation will
438 # be used.  If no implementation was defined above, exit configure.
439 if test "$THREADS" = "POSIX" ; then
440     # Do not define _POSIX_C_SOURCE here because it will cause problems when
441     # compiling on IRIX.  Instead, define that in the source files where
442     # appropriate.
443     AC_DEFINE(VJ_USE_PTHREADS,)
444     AC_DEFINE(_THREAD_SAFE,)
445     AC_DEFINE(RWSTD_MULTI_THREAD,)
446     AC_DEFINE(RW_MULTI_THREAD,)
447     AC_DEFINE(_REENTRANT,)
448
449     # Set to POSIX THREADING
450     THREAD_SYS="POSIX"
451
452     # Nothing for these at this time.
453     SYNC_SYS='POSIX'
454     SHMEM_SYS=''
455 elif test "$THREADS" = "SGI_IPC" ; then
456     AC_DEFINE(VJ_SGI_IPC,)
457
458     # Set to SGI_IPC threading
459     THREAD_SYS="SGI_IPC"
460
461     SYNC_SYS='SGI_IPC'
462     SHMEM_SYS='SGI_IPC'
463 elif test -z "$THREADS" ; then
464     AC_MSG_ERROR(No threading package defined!)
465 fi
466
467 #------------------------------------------
468 # OPEN GL
469 #------------------------------------------
470 OPENGL_API=''                   # 'Y' then we are using OpenGL
471
472 _LIBOPENGL=''
473 _SYSTEM_OPENGL=''
474
475 # Test for the OpenGL library if the OpenGL API was enabled.
476 if test "x${_enable_opengl}" = "xyes" ; then
477     # Save these values in case they need to be restored later.
478     _vjsave_CFLAGS="$CFLAGS"
479     _vjsave_CPPFLAGS="$CPPFLAGS"
480     _vjsave_INCLUDES="$INCLUDES"
481     _vjsave_LDFLAGS="$LDFLAGS"
482
483     # Add the user-specified OpenGL installation directory to these paths.
484     # Ensure that /usr/include and /usr/lib are not included multiple times
485     # if $OGLROOT is "/usr".
486     if test "x${OGLROOT}" != "x/usr" ; then
487         CPPFLAGS="$CPPFLAGS -I${OGLROOT}/include"
488         INCLUDES="$INCLUDES -I${OGLROOT}/include"
489         LDFLAGS="-L${OGLROOT}/lib${LIBBITSUF} $LDFLAGS"
490     fi
491
492     CFLAGS="$CFLAGS ${_EXTRA_FLAGS}"
493
494     # On HP-UX, we have to compile the test code with aCC (which is required
495     # by an above test) because the HP-UX OpenGL 1.1 implementation mandates
496     # this.
497     if test "$PLATFORM" = "HP" ; then
498         _vjsave_CC="$CC"
499         _vjsave_LIBS="$LIBS"
500         CC="$CXX"
501         LIBS="$LIBS -lGL"
502
503         # Check the cache in case this test was run previously and if not,
504         # compile the given code and try to link it against the GL library.
505         # We don't need to test for the existence of GL/gl.h after linking
506         # because the test program already includes it.
507         AC_CACHE_CHECK(for glEnable in -lGL, ac_cv_glEnable_available,
508             AC_TRY_LINK([#include <GL/gl.h>], [glEnable(GL_CULL_FACE)],
509                 ac_cv_glEnable_available='yes',
510                 [ LIBS="${_vjsave_LIBS}";
511                   AC_MSG_ERROR(*** OpenGL API will not be used (library not found) ***) ] ))
512
513         # If the library was found, add the OpenGL API object files to the
514         # files to be compiled and enable the OpenGL API compile-time option.
515         if test "$ac_cv_glEnable_available" = "yes" ; then
516             OPENGL_API="Y"
517             AC_DEFINE(VJ_API_OPENGL,)
518         fi
519
520         CC="${_vjsave_CC}"
521     else
522         # If the OpenGL library was found, add the API object files to the
523         # files to be compiled and enable the OpenGL API compile-time option.
524         AC_CHECK_LIB(GL, glEnable,
525             AC_CHECK_HEADER(GL/gl.h,
526                 [ OPENGL_API="Y";
527                   AC_DEFINE(VJ_API_OPENGL,) ],
528                 AC_MSG_ERROR(*** OpenGL API will not be used (header not found) ***)),
529             AC_MSG_ERROR(*** OpenGL API will not be used (library not found) ***))
530     fi
531
532     # Restore $CFLAGS and $CPPFLAGS now that we are done testing.
533     CFLAGS="${_vjsave_CFLAGS}"
534     CPPFLAGS="${_vjsave_CPPFLAGS}"
535
536     # If OpenGL API files were added, define this extra stuff that is used
537     # in some Makefiles.
538     if test ! -z "$OPENGL_API" ; then
539         _LIBOPENGL="-L${OGLROOT} -lGLU -lGL -lXext"
540
541         if test "$PLATFORM" = "HP" ; then
542             _SYSTEM_OPENGL="${_LIBOPENGL} -lX11"
543         else
544             if test "$ABI" = "64" ; then
545                 _SYSTEM_OPENGL="-limage ${_LIBOPENGL} -lXmu -lX11"
546             elif test "$ABI" = "N32" ; then
547                 _SYSTEM_OPENGL="-limage ${_LIBOPENGL} -lXmu -lX11"
548             elif test "$ABI" = "O32" ; then
549                 _SYSTEM_OPENGL="-lmpc -limage -lGLw ${_LIBOPENGL} -lfpe -lXm -lXt -lXmu -lX11 -lmalloc"
550             fi
551         fi
552     # No OpenGL API files were added, so restore $INCLUDES and $LDFLAGS so
553     # that no OpenGL stuff in included in them.
554     else
555         INCLUDES="${_vjsave_INCLUDES}"
556         LDFLAGS="${_vjsave_LDFLAGS}"
557     fi
558 fi
559
560 #----------------------------------------------------
561 # PERFORMER
562 #----------------------------------------------------
563 PERFORMER_API=''                # 'Y' then we are using Performer
564
565 # Test for the Performer library if the Performer API was enabled.
566 if test "x${_enable_perf}" = "xyes" ; then
567     _vjsave_CFLAGS="$CFLAGS"
568     _vjsave_INCLUDES="$INCLUDES"
569     _vjsave_LDFLAGS="$LDFLAGS"
570
571     # Ensure that /usr/include and /usr/lib are not included multiple times
572     # if $PFROOT is "/usr".
573     if test "x${PFROOT}" != "x/usr" ; then
574         INCLUDES="$INCLUDES -I\${PFROOT}/include"
575         LDFLAGS="-L\${PFROOT}/lib\${LIBBITSUF} $LDFLAGS"
576     fi
577
578     CFLAGS="$CFLAGS $INCLUDES ${_EXTRA_FLAGS}"
579
580     # If the Performer library was found, add the API object files to the
581     # files to be compiled and enable the Performer API compile-time option.
582     AC_CHECK_LIB(pf, pfInit,
583         AC_CHECK_HEADER(Performer/pf.h,
584             PERFORMER_API="Y";  \
585             _PFOGLLIB='-ignore_unresolved -lpf_ogl -lpfdu_ogl -lpfui -lpfutil_ogl'; \
586             AC_DEFINE(VJ_API_PERFORMER,),
587             AC_MSG_WARN(*** Performer API will not be used (pfChannel.h not found) ***)),
588         AC_MSG_WARN(*** Performer API will not be used (library not found) ***))
589
590     # Restore $CFLAGS now that we are done testing.
591     CFLAGS="${_vjsave_CFLAGS}"
592
593     # No Performer API files were added, so restore $INCLUDES and $LDFLAGS
594     # so that no OpenGL stuff in included in them.
595     if test -z "$PERFORMER_API" ; then
596         INCLUDES="${_vjsave_INCLUDES}"
597         LDFLAGS="${_vjsave_LDFLAGS}"
598     fi
599 fi
600
601 # -----------------------------------------------------------------------------
602 # Checks for header files.
603 # -----------------------------------------------------------------------------
604 AC_PATH_X
605 AC_HEADER_STDC
606 AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/file.h sys/ioctl.h      \
607                  sys/time.h termio.h unistd.h sys/z8530.h sys/stdsyms.h)
608
609 dnl # All of the above header file checks may not be necessary ...
610
611 # -----------------------------------------------------------------------------
612 # Checks for typedefs, structures, and compiler characteristics.
613 # -----------------------------------------------------------------------------
614 AC_TYPE_PID_T
615 AC_TYPE_SIZE_T
616 AC_TYPE_SIGNAL
617 AC_HEADER_TIME
618 AC_CHECK_TYPE(u_int, unsigned int)
619
620 # -----------------------------------------------------------------------------
621 # Checks for library functions.
622 # -----------------------------------------------------------------------------
623 AC_CHECK_FUNCS(gettimeofday socket strdup strerror strtod sginap)
624
625 dnl # All of the above function checks may not be necessary ...
626
627 # -----------------------------------------------------------------------------
628 # Do Makefile substitutions.
629 # -----------------------------------------------------------------------------
630 if test "$PLATFORM" = "SGI" ; then
631     CFLAGS="$CFLAGS -nostdinc -woff 1685,515,608,658,799,803,852,1048,1233,1499"
632     CXXFLAGS="$CXXFLAGS -nostdinc -woff 3322 -w2"
633 fi
634
635 DEPENDFLAGS=""
636 DEPEND_EXTRAS=""
637
638 # For makedepend(1) to work properly on HP-UX with aCC, we have to include
639 # these extra paths.
640 if test "$PLATFORM" = "HP" ; then
641     _aCC_ROOT="/opt/aCC"
642     DEPEND_EXTRAS="-I${_aCC_ROOT} -I${_aCC_ROOT}/include -I${_aCC_ROOT}/include/iostream"
643 fi
644
645 dnl # This build directory stuff is not presently being used.
646 if test -z "${_vj_builddir}" ; then
647     builddir='${top_srcdir}/lib'
648 else
649     if test -d "${_vj_builddir}" ; then
650         _old_wd=`pwd`
651         cd "${_vj_builddir}"
652         builddir=`pwd`
653         cd "${_old_wd}"
654     else
655         AC_MSG_ERROR(Build directory ${_vj_builddir} does not exist!)
656     fi
657 fi
658
659 # $srcdir is the root directory of the vjlib source tree.  To get a value for
660 # $VJROOT_ABS, we cd there and save the value of running pwd.  Then return to
661 # the directory where configure is being run ($topdir).
662 topdir=`pwd`
663 cd "$srcdir"
664 VJROOT_ABS=`pwd`
665 cd "$topdir"
666
667 # Define the base path to the source directory using ${VJROOT_ABS} as an
668 # alternative to using ${srcdir}.
669 VJ_SRCDIR='${VJROOT_ABS}'
670
671 # Variables set in Makefiles found in the test tree.  All variables listed are
672 # for use only in the Makefile.in's found in that tree unless otherwise noted.
673 # They are used in the following way:
674 #
675 #     * TEST_VJ_LIBS_BASIC: The basic VR Juggler library.
676 #     * TEST_VJ_LIBS_BASIC_SUBST: Used only in the top-level Makefile.in.  It
677 #       is used when generating Makefiles in the test directory tree during
678 #       the installation process.  Some variables in its assigned value are
679 #       not interpolated until that time (making it different from
680 #       $TEST_VJ_LIBS_BASIC whose varabiles are interpolated at assignment
681 #       time).
682 #     * TEST_VJ_LIBS_GL: The VR Juggler OpenGL API library.
683 #     * TEST_VJ_LIBS_PF: The VR Juggler Performer API library.
684 #     * TEST_LIBS_BASIC: The _most basic_ basic libraries needed for compiling
685 #       (e.g., -lC).
686 #     * TEST_EXTRA_LIBS_BASIC: A basic set of extra libraries and linker flags
687 #       needed for compiling.  These are put after those listed in the
688 #       previous variables in the compile line.
689 #     * TEST_EXTRA_LIBS_BASIC_SUBST: Used only in the top-level Makefile.in.
690 #       It is used in the same way as $TEST_VJ_LIBS_BASIC_SUBST but is for the
691 #       $TEST_EXTRA_LIBS_BASIC variable.
692 #     * TEST_VJ_LIBS_GL: The OpenGL libraries needed for compiling with the
693 #       OpenGL API.
694 #     * TEST_VJ_LIBS_GL_SUBST: Used only in the top-level Makefile.in.  It is
695 #       used in the same way as $TEST_VJ_LIBS_BASIC_SUBST but is for the
696 #       $TEST_VJ_LIBS_GL variable.
697 #     * TEST_VJ_LIBS_PF: The Performer libraries needed for compiling with the
698 #       Performer API.
699 #
700 TEST_VJ_LIBS_BASIC="-B static -L\${VJ_BASE_DIR}/lib${LIBBITSUF} -lJuggler"
701 TEST_VJ_LIBS_BASIC_SUBST="-B dynamic -L$\${VJ_BASE_DIR}/lib\${LIBBITSUF} -lJuggler"
702 TEST_VJ_LIBS_GL="-lJuggler_ogl"
703 TEST_VJ_LIBS_PF="-lJuggler_pf"
704 TEST_LIBS_BASIC="-B dynamic -lm -lC"
705 TEST_EXTRA_LIBS_BASIC="$LDFLAGS $LIBS"
706 TEST_EXTRA_LIBS_BASIC_SUBST="$LDFLAGS $LIBS"
707 TEST_EXTRA_LIBS_GL="-L${OGLROOT}/lib${LIBBITSUF} ${_SYSTEM_OPENGL}"
708 TEST_EXTRA_LIBS_GL_SUBST="-L${OGLROOT}/lib\${LIBBITSUF} ${_SYSTEM_OPENGL}"
709 TEST_EXTRA_LIBS_PF="${_PFOGLLIB}"
710
711 dnl # AC_SUBST(builddir)
712 AC_SUBST(topdir)
713 AC_SUBST(VJROOT_ABS)
714 AC_SUBST(VJ_SRCDIR)
715
716 AC_SUBST(AR)
717 AC_SUBST(ARFLAGS)
718 AC_SUBST(CFLAGS)
719 AC_SUBST(CXXFLAGS)
720 AC_SUBST(DEPENDFLAGS)
721 AC_SUBST(DEPEND_EXTRAS)
722 AC_SUBST(INCLUDES)
723 AC_SUBST(LD)
724 AC_SUBST(LIBS)
725 AC_SUBST(LDOPTS)
726 AC_SUBST(OPT_FLAGS)
727 AC_SUBST(SHAREDLIB_EXT)
728
729 AC_SUBST(ABI)
730 AC_SUBST(ISA)
731 AC_SUBST(ABI_LIST)
732 AC_SUBST(LIBBITSUF)
733 AC_SUBST(PLATFORM)
734 AC_SUBST(DSOREGFILE)
735 AC_SUBST(DSOVERSION)
736 AC_SUBST(DSOVERSIONOPTS)
737
738 AC_SUBST(JDK_HOME)
739 AC_SUBST(JAVAC)
740 AC_SUBST(JAR)
741 AC_SUBST(BUILD_GUI)
742
743 AC_SUBST(OGLROOT)
744 AC_SUBST(PFROOT)
745
746 AC_SUBST(OPENGL_API)
747 AC_SUBST(PERFORMER_API)
748
749 AC_SUBST(SHMEM_SYS)
750 AC_SUBST(SYNC_SYS)
751 AC_SUBST(THREAD_SYS)
752
753 AC_SUBST(TEST_VJ_LIBS_BASIC)
754 AC_SUBST(TEST_VJ_LIBS_BASIC_SUBST)
755 AC_SUBST(TEST_VJ_LIBS_GL)
756 AC_SUBST(TEST_VJ_LIBS_PF)
757 AC_SUBST(TEST_LIBS_BASIC)
758 AC_SUBST(TEST_EXTRA_LIBS_BASIC)
759 AC_SUBST(TEST_EXTRA_LIBS_BASIC_SUBST)
760 AC_SUBST(TEST_EXTRA_LIBS_GL)
761 AC_SUBST(TEST_EXTRA_LIBS_GL_SUBST)
762 AC_SUBST(TEST_EXTRA_LIBS_PF)
763
764 # -----------------------------------------------------------------------------
765 # Final file generation step.
766 # -----------------------------------------------------------------------------
767 AC_OUTPUT(Makefile Makefile.base Config/Makefile Math/Makefile
768           Input/Makefile Input/vjGlove/Makefile Input/vjInput/Makefile
769           Input/vjPosition/Makefile Input/InputManager/Makefile
770           Input/ibox/Makefile Kernel/Makefile Kernel/Pf/Makefile
771           Input/vjKeyboard/Makefile Input/vjSim/Makefile Input/vjGesture/Makefile
772           Kernel/GL/Makefile SharedMem/Makefile Sync/Makefile
773           Threads/Makefile Environment/Makefile Performance/Makefile
774           test/Makefile test/CfgTest/Makefile test/Matrix/Makefile
775           test/Sync/Makefile test/Quat/Makefile test/input/Makefile
776           test/ogl/Makefile test/ogl/cubes/Makefile test/ogl/wand/Makefile
777           test/ogl/simpleGlove/Makefile
778           test/pfNav/Makefile test/testDynamicCastSTL/Makefile
779           test/threads/Makefile GUI/Makefile)
Note: See TracBrowser for help on using the browser.