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

Revision 159, 23.4 kB (checked in by patrick, 10 years ago)

Added a new argument "—with-jdkhome" for defining the installation
directory for the JDK. A check is now made for the JDK so that an
attempt can be made to make the building of the vjConfig GUI with javac
and jar more cross-platform.

  • 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.C)
11 AC_CONFIG_HEADER(config.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]
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 OBJECT_STYLE='32'
101 LIBBITSUF=''
102 ABI='32'
103
104 # Based on the value of $abi_type, set the internal variable $OBJECT_STYLE
105 # for later use and the Makefile substitution variables $LIBBITSUF and $ABI.
106 if test "x$abi_type" = "x64_M3" ; then
107     OBJECT_STYLE='64_M3'
108     LIBBITSUF='64'
109     ABI='64'
110 elif test "x$abi_type" = "x64_M4" ; then
111     OBJECT_STYLE='64_M4'
112     LIBBITSUF='64'
113     ABI='64'
114 elif test "x$abi_type" = "xN32_M3" ; then
115     OBJECT_STYLE='N32_M3'
116     LIBBITSUF='32'
117     ABI='N32'
118 elif test "x$abi_type" = "xN32_M4" ; then
119     OBJECT_STYLE='N32_M4'
120     LIBBITSUF='32'
121     ABI='N32'
122 elif test "x$abi_type" = "xO32" ; then
123     OBJECT_STYLE='O32'
124     LIBBITSUF=''
125     ABI='O32'
126 fi
127
128 # -----------------------------------------------------------------------------
129 # System-dependent stuff.
130 # -----------------------------------------------------------------------------
131 AC_CANONICAL_HOST
132
133 RELEASE=`uname -r`      # Operating system version number
134
135 AR=''                   # Archive library command (generally ar(1))
136 LD=''                   # Shared library command (usually ld(1))
137 LIBOPTS=''              # Options for shared library generator
138 LDOPTS=''               # More options for shared library generator
139 SHAREDLIB_EXT=''        # Extension for shared libraries (usually 'so')
140
141 OPT_FLAGS=''            # Compiler optimization flags
142
143 DSOREGFILE=''
144 DSOVERSION=''
145 DSOVERSIONOPTS=''
146 PLATFORM=''             # Platform name
147
148 # Depending on the host type, set various command options and such.
149 case $host in
150     # SGI running IRIX [56].*.
151     mips-sgi-irix*)
152         if test $RELEASE -lt 6.2 ; then
153             AC_DEFINE(IRIXREL, "IRIX5")
154         else
155             AC_DEFINE(IRIXREL, "IRIX6")
156         fi
157
158         # Set compiler flags and the location of $DSOREGFILE depending on
159         # $OBJECT_STYLE.
160         if test "$OBJECT_STYLE" = "64_M3" ; then
161             DSOREGFILE='/usr/lib64/so_locations'
162             CFLAGS="$CFLAGS -mips3 -64"
163             CXXFLAGS="$CXXFLAGS -mips3 -64"
164             LDOPTS="-mips3 -64"
165             OPT_FLAGS='-OPT:Olimit=2000'
166         elif test "$OBJECT_STYLE" = "64_M4" ; then
167             DSOREGFILE='/usr/lib64/so_locations'
168             CFLAGS="$CFLAGS -mips4 -64"
169             CXXFLAGS="$CXXFLAGS -mips4 -64"
170             LDOPTS="-mips4 -64"
171             OPT_FLAGS='-OPT:Olimit=2000'
172         elif test "$OBJECT_STYLE" = "N32_M3" ; then
173             DSOREGFILE='/usr/lib32/so_locations'
174             CFLAGS="$CFLAGS -mips3 -n32"
175             CXXFLAGS="$CXXFLAGS -mips3 -n32"
176             LDOPTS="-mips3 -n32"
177             OPT_FLAGS='-OPT:Olimit=2000'
178         elif test "$OBJECT_STYLE" = "N32_M4" ; then
179             DSOREGFILE='/usr/lib32/so_locations'
180             CFLAGS="$CFLAGS -mips4 -n32"
181             CXXFLAGS="$CXXFLAGS -mips4 -n32"
182             LDOPTS="-mips4 -n32"
183             OPT_FLAGS='-OPT:Olimit=2000'
184         elif test "$OBJECT_STYLE" = "O32" ; then
185             DSOREGFILE='/usr/lib/so_locations'
186             CFLAGS="$CFLAGS -mips2 -o32"
187             CXXFLAGS="$CXXFLAGS -mips2 -o32"
188             LDOPTS="-mips2 -o32"
189             OPT_FLAGS='-Olimit 2000'
190         fi
191
192         AR='${CXX} -ar -WR,-v -o'
193         CFLAGS="-ptv $CFLAGS"
194         CXXFLAGS="-ptv $CXXFLAGS"
195         INCLUDES="$INCLUDES -I/usr/include/CC -I/usr/include"
196         LD='${CXX} -shared'
197         LIBOPTS='-check_registry'
198         LDFLAGS="$LDFLAGS"
199         LDOPTS="$LDOPTS -all"
200         SHAREDLIB_EXT='so'
201
202         DSOVERSION='sgi4.0'
203         DSOVERSIONOPTS='-set_version ${DSOVERSION}'
204
205         PLATFORM='SGI'
206
207         AC_DEFINE(VJ_OS_SGI,)
208         AC_DEFINE(_BSD_TYPES,)
209         ;;
210     # HP PA-RISC machine running HP-UX 10.20.
211     hppa*hpux10.20)
212         AR='ar r'
213         CFLAGS="-Aa $CFLAGS"
214         CXXFLAGS="+p $CXXFLAGS"
215         LD='ld'
216         LDFLAGS="$LDFLAGS -L/usr/lib/X11R6"
217         LIBOPTS=''
218         LDOPTS='-b'
219         OPT_FLAGS='+inline_level 3'
220         SHAREDLIB_EXT='sl'
221
222         # We have to use POSIX threads on HP-UX.
223         if test "x$thread_pkg" != "xPOSIX" ; then
224             AC_MSG_WARN(*** POSIX threads must be used on $host ***)
225             thread_pkg='POSIX'
226         fi
227
228         PLATFORM='HP'
229
230         AC_DEFINE(VJ_OS_HPUX,)
231         AC_DEFINE(_HPUX_SOURCE,)
232         AC_DEFINE(_INCLUDE_TERMIO,)
233         AC_DEFINE(_CMA_NOWRAPPERS_,)
234         AC_DEFINE(notdef,)
235         ;;
236     # DEC Alpha running Digital UNIX 4.0.
237     alpha-[a-z]*-osf4.0)
238         AC_DEFINE(VJ_OS_DUX,)
239         PLATFORM='alpha-DUX'
240         ;;
241     # i386-class machine running FreeBSD.
242     i386-[a-z]*-freebsd*)
243         AC_DEFINE(VJ_OS_FreeBSD,)
244         PLATFORM='i386-FBSD'
245         ;;
246     # Unkown operating system (to config.guess).
247     *-unknown)
248         AC_DEFINE(VJ_OS_GENERIC,)
249         PLATFORM='UNKNOWN'
250         ;;
251 esac
252
253 # -----------------------------------------------------------------------------
254 # Checks for programs.
255 # -----------------------------------------------------------------------------
256
257 # On HP-UX, we have to use the aCC C++ compiler.
258 if test "$PLATFORM" = "HP" ; then
259     AC_CHECK_PROG(CXX, aCC, aCC,
260         AC_MSG_ERROR(*** The library requires the HP-UX aCC C++ compiler ***))
261 # On IRIX, we have to use cc and CC (not gcc or g++).
262 elif test "$PLATFORM" = "SGI" ; then
263     AC_CHECK_PROG(CC, cc, cc,
264         AC_MSG_ERROR(*** The library requires the IRIX cc C compiler ***))
265     AC_CHECK_PROG(CXX, CC, CC,
266         AC_MSG_ERROR(*** The library requires the IRIX CC C++ compiler ***))
267 fi
268
269 AC_PROG_CC
270 AC_PROG_CXX
271 AC_PROG_CPP
272 AC_PROG_CXXCPP
273
274 # Check for the JDK (specifically try to find javac(1) in $JDK_HOME).
275 JAVAC=''
276 JAR=''
277
278 # In checking for javac(1), "${JDK_HOME}/bin" is added to the script's $PATH
279 # variable.  This directory may already be in the path, but this ensures that
280 # javac(1) will be found by AC_PATH_PROG().
281 vjsave_PATH="$PATH"
282 PATH="$PATH:${JDK_HOME}/bin"
283 AC_PATH_PROG(JAVAC, javac)
284 PATH="$vjsave_PATH"
285
286 # If $JAVAC was not set by AC_PATH_PROG(), try to find the JDK installation
287 # directory using the list in $JDK_HOME_ALT_LIST.
288 if test -z "$JAVAC" ; then
289     # Add the default value for $JDK_HOME (found in $JDK_HOME_DEFAULT) to
290     # the list of alternate installation directories in case the user gave
291     # a different value for $JDK_HOME on the command line.
292     if test "x$JDK_HOME" != "x$JDK_HOME_DEFAULT" ; then
293         JDK_HOME_ALT_LIST="$JDK_HOME_DEFAULT $JDK_HOME_ALT_LIST"
294     fi
295
296     # Loop over the list of possible alternate installation directories for
297     # the JDK found in $JDK_HOME_ALT_LIST.
298     for JDK_HOME_TMP in $JDK_HOME_ALT_LIST ; do
299         # Only check the directory in $JDK_HOME_TMP if it is not the same as
300         # the path given by the user on the command line.
301         if test "$JDK_HOME_TMP" != "$JDK_HOME" ; then
302             AC_MSG_CHECKING(for javac in $JDK_HOME_TMP)
303
304             # If an executable javac is found in $JDK_HOME_TMP, set $JAVAC to
305             # the full path to it, save $JDK_HOME_TMP in $JDK_HOME and quit
306             # looping.
307             if test -x "$JDK_HOME_TMP/bin/javac" ; then
308                 JAVAC="$JDK_HOME_TMP/bin/javac"
309                 JDK_HOME="$JDK_HOME_TMP"
310                 AC_MSG_RESULT(yes)
311                 break
312             # Otherwise, print "no" and go on to the next directory.
313             else
314                 AC_MSG_RESULT(no)
315             fi
316         fi
317     done
318 fi
319
320 BUILD_GUI=''
321
322 # If there is still no value in $JAVAC, then warn that the GUI will not be
323 # built.
324 if test -z "$JAVAC" ; then
325     AC_MSG_WARN(*** The GUI requires javac -- it will not be built ***)
326 # Otherwise, set $JAR to the path to jar(1) and continue.
327 else
328     JAR="${JDK_HOME}/bin/jar"
329     BUILD_GUI='yes'
330 fi
331
332 AC_PROG_INSTALL
333 AC_PROG_MAKE_SET
334 dnl # AC_PROG_RANLIB
335
336 # -----------------------------------------------------------------------------
337 # Checks for libraries.
338 # -----------------------------------------------------------------------------
339
340 THREADS=''
341
342 # Test for libpthread or for libcma if libpthread is not present.
343 # If the library is found, check for pthread_kill().  If it is present,
344 # Draft 10 (the "final" draft) of the POSIX threads standard is in place.  If
345 # not, Draft 4 is available.
346 if test "x$thread_pkg" = "xPOSIX" ; then
347     AC_CHECK_LIB(pthread, pthread_create,
348         AC_CHECK_HEADER(pthread.h,
349             [ THREADS='POSIX'; LIBS="$LIBS -lpthread";
350               AC_CHECK_LIB(pthread, pthread_kill,
351                   AC_DEFINE(_PTHREADS_DRAFT_10,),
352                   AC_DEFINE(_PTHREADS_DRAFT_4,)) ],
353             AC_MSG_WARN(*** POSIX threads will not be used (header file not found) ***)))
354
355     # On HP-UX 10.20, the pthreads library is in the cma library rather than
356     # pthreads, so test for that if $THREADS was not set above.
357     if test -z "$THREADS" ; then
358         AC_CHECK_LIB(cma, pthread_create,
359             AC_CHECK_HEADER(pthread.h,
360                 [ THREADS='POSIX'; LIBS="$LIBS -lcma";
361                   AC_CHECK_LIB(cma, pthread_kill,
362                       AC_DEFINE(_PTHREADS_DRAFT_10,),
363                       AC_DEFINE(_PTHREADS_DRAFT_4,)) ],
364                 AC_MSG_WARN(*** POSIX threads will not be used (header file not found) ***)),
365             AC_MSG_WARN(*** POSIX threads will not be used (no library found) ***))
366     fi
367 # If we are not using POSIX threads, we must be using the SGI IPC model, but
368 # we test $thread_pkg just to be sure it is set right.
369 elif test "x$thread_pkg" = "xSGI_IPC" ; then
370     AC_CHECK_HEADERS(sys/prctl.h,
371         THREADS='SGI_IPC',
372         AC_MSG_WARN(*** SGI IPC threading will not be used (no headers found) ***))
373 fi
374
375
376 #---------------------------------------
377 # SHARED MEM
378 # SYNC PRIMS
379 #---------------------------------------
380 SYNC_SYS=''                     # POSIX, SGI_IPC
381 SHMEM_SYS=''                    # SGI_IPC
382 THREAD_SYS=''                   # POSIX, SGI_IPC
383
384 # Define various CPP macros depending on which threads implementation will
385 # be used.  If no implementation was defined above, exit configure.
386 if test "$THREADS" = "POSIX" ; then
387     # Do not define _POSIX_C_SOURCE here because it will cause problems when
388     # compiling on IRIX.  Instead, define that in the source files where
389     # appropriate.
390     AC_DEFINE(VJ_USE_PTHREADS,)
391     AC_DEFINE(_THREAD_SAFE,)
392     AC_DEFINE(RWSTD_MULTI_THREAD,)
393     AC_DEFINE(RW_MULTI_THREAD,)
394     AC_DEFINE(_REENTRANT,)
395
396     # Set to POSIX THREADING
397     THREAD_SYS="POSIX"
398
399     # Nothing for these at this time.
400     SYNC_SYS='POSIX'
401     SHMEM_SYS=''
402 elif test "$THREADS" = "SGI_IPC" ; then
403     AC_DEFINE(VJ_SGI_IPC,)
404
405     # Set to SGI_IPC threading
406     THREAD_SYS="SGI_IPC"
407
408     SYNC_SYS='SGI_IPC'
409     SHMEM_SYS='SGI_IPC'
410 elif test -z "$THREADS" ; then
411     AC_MSG_ERROR(No threading package defined!)
412 fi
413
414 #------------------------------------------
415 # OPEN GL
416 #------------------------------------------
417 OPENGL_API=''                   # 'Y' then we are using OpenGL
418
419 LIBOPENGL=''
420 SYSTEM_OPENGL=''
421
422 # Test for the OpenGL library if the OpenGL API was enabled.
423 if test "x$enable_opengl" = "xyes" ; then
424     # Save these values in case they need to be restored later.
425     vjsave_CFLAGS="$CFLAGS"
426     vjsave_INCLUDES="$INCLUDES"
427     vjsave_LDFLAGS="$LDFLAGS"
428
429     # Add the user-specified OpenGL installation directory to these paths.
430     # Ensure that /usr/include and /usr/lib are not included multiple times
431     # if $OGLROOT is "/usr".
432     if test "x${OGLROOT}" != "x/usr" ; then
433         INCLUDES="$INCLUDES -I${OGLROOT}/include"
434
435         if test "$PLATFORM" = "SGI" ; then
436             LDFLAGS="-L${OGLROOT}/lib${LIBBITSUF} $LDFLAGS"
437         else
438             LDFLAGS="-L${OGLROOT}/lib $LDFLAGS"
439         fi
440     fi
441
442     CFLAGS="$CFLAGS $INCLUDES"
443
444     # On HP-UX, we have to compile the test code with aCC (which is required
445     # by an above test) because the HP-UX OpenGL 1.1 implementation mandates
446     # this.
447     if test "$PLATFORM" = "HP" ; then
448         vjsave_CC="$CC"
449         vjsave_LIBS="$LIBS"
450         CC="$CXX"
451         LIBS="$LIBS -lGL"
452
453         # Check the cache in case this test was run previously and if not,
454         # compile the given code and try to link it against the GL library.
455         # We don't need to test for the existence of GL/gl.h after linking
456         # because the test program already includes it.
457         AC_CACHE_CHECK(for glEnable in -lGL, ac_cv_glEnable_available,
458             AC_TRY_LINK([#include <GL/gl.h>], [glEnable(GL_CULL_FACE)],
459                 ac_cv_glEnable_available='yes',
460                 [ LIBS="$vjsave_LIBS";
461                   AC_MSG_ERROR(*** OpenGL API will not be used (library not found) ***) ] ))
462
463         # If the library was found, add the OpenGL API object files to the
464         # files to be compiled and enable the OpenGL API compile-time option.
465         if test "$ac_cv_glEnable_available" = "yes" ; then
466             OPENGL_API="Y"
467             AC_DEFINE(VJ_API_OPENGL,)
468         fi
469
470         CC="$vjsave_CC"
471     else
472         # If the OpenGL library was found, add the API object files to the
473         # files to be compiled and enable the OpenGL API compile-time option.
474         AC_CHECK_LIB(GL, glEnable,
475             AC_CHECK_HEADER(GL/gl.h,
476                 [ OPENGL_API="Y";
477                   AC_DEFINE(VJ_API_OPENGL,) ],
478                 AC_MSG_ERROR(*** OpenGL API will not be used (header not found) ***)),
479             AC_MSG_ERROR(*** OpenGL API will not be used (library not found) ***))
480     fi
481
482     # Restore $CFLAGS now that we are done testing.
483     CFLAGS="$vjsave_CFLAGS"
484
485     # If OpenGL API files were added, define this extra stuff that is used
486     # in some Makefiles.
487     if test ! -z "$OPENGL_API" ; then
488         LIBOPENGL="-L${OGLROOT} -lGLU -lGL -lXext"
489
490         if test "$PLATFORM" = "HP" ; then
491             SYSTEM_OPENGL="$LIBOPENGL -lX11 -lm -lC"
492         else
493             if test "$OBJECT_STYLE" = "64" ; then
494                 SYSTEM_OPENGL="-limage $LIBOPENGL -lXmu -lX11 -lm -lC"
495             elif test "$OBJECT_STYLE" = "N32_M3" -o \
496                       "$OBJECT_STYLE" = "N32_M4" ; then
497                 SYSTEM_OPENGL="-limage $LIBOPENGL -lXmu -lX11 -lm -lC"
498             elif test "$OBJECT_STYLE" = "O32" ; then
499                 SYSTEM_OPENGL="-lmpc -limage -lGLw $LIBOPENGL -lfpe -lXm -lXt -lXmu -lX11 -lm -lmalloc -lC"
500             fi
501         fi
502     # No OpenGL API files were added, so restore $INCLUDES and $LDFLAGS so
503     # that no OpenGL stuff in included in them.
504     else
505         INCLUDES="$vjsave_INCLUDES"
506         LDFLAGS="$vjsave_LDFLAGS"
507     fi
508 fi
509
510 #----------------------------------------------------
511 # PERFORMER
512 #----------------------------------------------------
513 PERFORMER_API=''                # 'Y' then we are using Performer
514
515 # Test for the Performer library if the Performer API was enabled.
516 if test "x$enable_perf" = "xyes" ; then
517     vjsave_CFLAGS="$CFLAGS"
518     vjsave_INCLUDES="$INCLUDES"
519     vjsave_LDFLAGS="$LDFLAGS"
520
521     # Ensure that /usr/include and /usr/lib are not included multiple times
522     # if $PFROOT is "/usr".
523     if test "x${PFROOT}" != "x/usr" ; then
524         INCLUDES="$INCLUDES -I${PFROOT}/include"
525         LDFLAGS="-L${PFROOT}/lib${LIBBITSUF} $LDFLAGS"
526     fi
527
528     CFLAGS="$CFLAGS $INCLUDES"
529
530     # If the Performer library was found, add the API object files to the
531     # files to be compiled and enable the Performer API compile-time option.
532     AC_CHECK_LIB(pf, pfInit,
533         AC_CHECK_HEADER(Performer/pf.h,
534             PERFORMER_API="Y";  \
535             OGLLIB='-ignore_unresolved -lpf_ogl -lpfdu_ogl -lpfui -lpfutil_ogl'; \
536             AC_DEFINE(VJ_API_PERFORMER,),
537             AC_MSG_WARN(*** Performer API will not be used (pfChannel.h not found) ***)),
538         AC_MSG_WARN(*** Performer API will not be used (library not found) ***))
539
540     # Restore $CFLAGS now that we are done testing.
541     CFLAGS="$vjsave_CFLAGS"
542
543     # No Performer API files were added, so restore $INCLUDES and $LDFLAGS
544     # so that no OpenGL stuff in included in them.
545     if test -z "$PERFORMER_API" ; then
546         INCLUDES="$vjsave_INCLUDES"
547         LDFLAGS="$vjsave_LDFLAGS"
548     fi
549 fi
550
551 # -----------------------------------------------------------------------------
552 # Checks for header files.
553 # -----------------------------------------------------------------------------
554 AC_PATH_X
555 AC_HEADER_STDC
556 AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/file.h sys/ioctl.h      \
557                  sys/time.h termio.h unistd.h sys/z8530.h sys/stdsyms.h)
558
559 dnl # All of the above header file checks may not be necessary ...
560
561 # -----------------------------------------------------------------------------
562 # Checks for typedefs, structures, and compiler characteristics.
563 # -----------------------------------------------------------------------------
564 AC_TYPE_PID_T
565 AC_TYPE_SIZE_T
566 AC_TYPE_SIGNAL
567 AC_HEADER_TIME
568 AC_CHECK_TYPE(u_int, unsigned int)
569
570 # -----------------------------------------------------------------------------
571 # Checks for library functions.
572 # -----------------------------------------------------------------------------
573 AC_CHECK_FUNCS(gettimeofday socket strdup strerror strtod sginap)
574
575 dnl # All of the above function checks may not be necessary ...
576
577 # -----------------------------------------------------------------------------
578 # Do Makefile substitutions.
579 # -----------------------------------------------------------------------------
580 if test "$PLATFORM" = "SGI" ; then
581     CFLAGS="$CFLAGS -nostdinc -woff 1685,515,608,658,799,803,852,1048,1233,1499 -MDupdate Makedepend"
582     CXXFLAGS="$CXXFLAGS -nostdinc -woff 3322 -w2 -MDupdate Makedepend"
583 fi
584
585 DEPENDFLAGS=""
586 DEPEND_EXTRAS=""
587
588 # For makedepend(1) to work properly on HP-UX with aCC, we have to include
589 # these extra paths.
590 if test "$PLATFORM" = "HP" ; then
591     aCC_ROOT="/opt/aCC"
592     DEPEND_EXTRAS="-I${aCC_ROOT} -I${aCC_ROOT}/include -I${aCC_ROOT}/include/iostream"
593 fi
594
595 dnl # This build directory stuff is not presently being used.
596 if test -z "$vj_builddir" ; then
597     builddir='${top_srcdir}/lib'
598 else
599     if test -d "$vj_builddir" ; then
600         old_wd=`pwd`
601         cd "$vj_builddir"
602         builddir=`pwd`
603         cd "$old_wd"
604     else
605         AC_MSG_ERROR(Build directory $vj_builddir does not exist!)
606     fi
607 fi
608
609 # $srcdir is the root directory of the vjlib source tree.  To get a value for
610 # $VJROOT_ABS, we cd there and save the value of running pwd.  Then return to
611 # the directory where configure is being run ($topdir).
612 topdir=`pwd`
613 cd "$srcdir"
614 VJROOT_ABS=`pwd`
615 cd "$topdir"
616
617 # Define the base path to the source directory using ${VJROOT_ABS} as an
618 # alternative to using ${srcdir}.
619 VJ_SRCDIR='${VJROOT_ABS}'
620
621 TEST_EXTRA_LIBS="$LDFLAGS -L${OGLROOT}/lib${LIBBITSUF} $OGLLIB $SYSTEM_OPENGL $LIBS"
622
623 dnl # AC_SUBST(builddir)
624 AC_SUBST(topdir)
625 AC_SUBST(VJROOT_ABS)
626 AC_SUBST(VJ_SRCDIR)
627
628 AC_SUBST(AR)
629 AC_SUBST(CFLAGS)
630 AC_SUBST(CXXFLAGS)
631 AC_SUBST(DEPENDFLAGS)
632 AC_SUBST(DEPEND_EXTRAS)
633 AC_SUBST(INCLUDES)
634 AC_SUBST(LD)
635 AC_SUBST(LIBOPTS)
636 AC_SUBST(LIBS)
637 AC_SUBST(LDOPTS)
638 AC_SUBST(OPT_FLAGS)
639 AC_SUBST(SHAREDLIB_EXT)
640
641 AC_SUBST(ABI)
642 AC_SUBST(LIBBITSUF)
643 AC_SUBST(PLATFORM)
644 AC_SUBST(DSOREGFILE)
645 AC_SUBST(DSOVERSION)
646 AC_SUBST(DSOVERSIONOPTS)
647
648 AC_SUBST(JDK_HOME)
649 AC_SUBST(JAVAC)
650 AC_SUBST(JAR)
651 AC_SUBST(BUILD_GUI)
652
653 #AC_SUBST(OGLROOT)
654 #AC_SUBST(PFROOT)
655
656 AC_SUBST(OPENGL_API)
657 AC_SUBST(PERFORMER_API)
658
659 AC_SUBST(SHMEM_SYS)
660 AC_SUBST(SYNC_SYS)
661 AC_SUBST(THREAD_SYS)
662
663 AC_SUBST(TEST_EXTRA_LIBS)
664
665 # -----------------------------------------------------------------------------
666 # Final file generation step.
667 # -----------------------------------------------------------------------------
668 AC_OUTPUT(Makefile Makefile.base Config/Makefile Math/Makefile
669           Input/Makefile Input/vjGlove/Makefile Input/vjInput/Makefile
670           Input/vjPosition/Makefile Input/InputManager/Makefile
671           Input/ibox/Makefile Kernel/Makefile Kernel/Pf/Makefile
672           Kernel/GL/Makefile SharedMem/Makefile Sync/Makefile
673           Threads/Makefile test/Makefile test/CfgTest/Makefile
674           test/input/Makefile test/ogl/Makefile test/ogl/cubes/Makefile
675           test/ogl/wand/Makefile test/pfNav/Makefile test/Sync/Makefile
676           test/Quat/Makefile test/testDynamicCastSTL/Makefile GUI/Makefile)
Note: See TracBrowser for help on using the browser.