configure.in 103 KB
Newer Older
hrchilds's avatar
hrchilds committed
1 2 3 4
dnl Process this file with autoconf to produce configure.
dnl 
dnl 
dnl 
hrchilds's avatar
hrchilds committed
5
dnl                            Copyright 2000 - 2005
hrchilds's avatar
hrchilds committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
dnl                 The Regents of the University of California.
dnl                             All rights reserved.
dnl 
dnl This work was produced at the University of California, Lawrence Livermore
dnl National Laboratory (UC LLNL)  under contract no.  W-7405-ENG-48 (Contract
dnl 48) between  the U.S. Department of Energy  (DOE)  and The Regents  of the
dnl University  of  California  (University)  for  the  operation of  UC LLNL.
dnl Copyright   is  reserved to  the   University for  purposes  of controlled
dnl dissemination,   commercialization  through  formal licensing,   or  other
dnl disposition under  terms of Contract   48; DOE policies,  regulations  and
dnl orders; and  U.S. statutes.  The    rights of the  Federal Government  are
dnl reserved under Contract 48 subject to  the restrictions agreed upon by DOE
dnl and University.
dnl 
dnl                                 DISCLAIMER
dnl 
dnl This software was prepared as an account of work sponsored by an agency of
dnl the United States Government. Neither the United States Government nor the
dnl University  of California nor any of  their employees, makes any warranty,
dnl express or implied,  or assumes  any liability  or responsiblity  for  the
dnl accuracy, completeness, or    usefullness of any  information,  apparatus,
dnl product, or  process   disclosed, or represents that  its   use would  not
dnl infringe privately    owned  rights. Reference   herein  to  any  specific
dnl commercial  products, process,  or    service by trade   name,  trademark,
dnl manufacturer, or otherwise, does  not necessarily constitute or imply  its
dnl endorsement, recommendation, or  favoring by the United  States Government
dnl or the   University  of  California.  The views   and  opinions of authors
dnl expressed herein do not  necessarily state or  reflect those of the United
dnl States Government  or the University of  California, and shall not be used
dnl for advertising or product endorsement purposes.
dnl

dnl
dnl
dnl Modifications:
dnl    Jeremy Meredith, Mon Aug  7 12:02:49 PDT 2000
dnl    Added the parsing of object files from the Makefile.in's.
dnl
dnl    Kathleen Bonnell, Thu Oct 12 12:18:02 PDT 2000
dnl    Added visit_vtk subdirectory, VISIT_VTK_CPPFLAGS, VISIT_VTK_FILES
dnl
dnl    Brad Whitlock, Tue Oct 31 14:40:24 PST 2000
dnl    Made sure libvtkqt.a gets built. I also removed the check for GLR
dnl    remotely rendered hw accelerated graphics.
dnl
dnl    Eric Brugger, Tue Nov 14 08:20:47 PST 2000
dnl    Remove unnecessary tests.
dnl
dnl    Eric Brugger, Fri Nov 17 11:51:58 PST 2000
dnl    I added checks for -lXt and -lXext on AIX systems.  I removed the test
dnl    for inline.
dnl
dnl    Hank Childs, Mon Nov 20 15:24:32 PST 2000
dnl    Set up components for parallel.
dnl
dnl    Eric Brugger, Wed Dec  6 12:35:25 PST 2000
dnl    I added the option --disable-mdserver.  I modified the script to not
dnl    build components/VisWindow if --disable-gui is on.  I made a few
dnl    other fixes for building a parallel version on AIX systems.
dnl
dnl    Eric Brugger, Thu Dec  7 12:03:10 PST 2000
dnl    I added checks for -lXt on OSF systems.
dnl
dnl    Jeremy Meredith, Tue Dec 12 13:48:44 PST 2000
dnl    Added "mir" common directory.
dnl
dnl    Eric Brugger, Fri Feb 16 17:57:34 PST 2001
dnl    I made the checks for the X and OpenGL always occur since the engine
dnl    now needs them and the engine is always built.
dnl
dnl    Eric Brugger, Mon Feb 26 15:35:22 PST 2001
dnl    I added the outputing of Makefiles for all the directories in the
dnl    plot directory tree.
dnl
dnl    Eric Brugger, Fri Mar  2 14:43:44 PST 2001
dnl    I added the outputing of the Makefile in the plot/Contour directory.
dnl
dnl    Eric Brugger, Tue Mar  6 16:34:17 PST 2001
dnl    I renamed the file config.h to visit-config.h to avoid name conflicts
dnl    with public header files.
dnl
dnl    Hank Childs, Thu Mar  8 15:40:26 PST 2001
dnl    Added directories for components/Database.
dnl
dnl    Eric Brugger, Thu Mar  8 08:42:05 PST 2001
dnl    I added the outputing of the Makefile in the plot/Manager directory.
dnl
dnl    Hank Childs, Sat Mar 10 18:20:57 PST 2001
dnl    Added an option for timings.
dnl
hrchilds's avatar
hrchilds committed
96
dnl    Eric Brugger, Thu Mar 15 17:13:09 PST 2001dnl    Modify the script to not generate viewer/cli/Makefile since the cli
hrchilds's avatar
hrchilds committed
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312
dnl    directory has been removed.
dnl
dnl    Jim Reus, Fri Mar 23 06:42:10 PST 2001
dnl    Add tests for ZLIB, HDF5, VBT/DSL, and SAF. These are loosely based
dnl    on previous work I had done for the SAF read-only driver for SILO.
dnl    This added four new "with" options to configure:
dnl
dnl        --with-zlib=INCDIR,LIBDIR
dnl        --with-hdf=INCDIR,LIBDIR
dnl        --with-vbt=INCDIR,LIBDIR
dnl        --with-saf=INCDIR,LIBDIR
dnl
dnl    Eric Brugger, Mon Mar 26 13:07:16 PST 2001
dnl    Turn off the compilation of the GUI sources in the plot directories
dnl    if the GUI is disabled.
dnl
dnl    Jeremy Meredith, Wed Mar 28 15:15:25 PST 2001
dnl    Changed the way the GUI is disabled.  Added substitution parameters
dnl    to disable the viewer and engine as well.
dnl
dnl    Sean Ahern, Wed Apr 25 08:52:41 PDT 2001
dnl    Made the OS_RULE apply always so we don't wink in things across OSes.
dnl    Changed some of the "dnl" comments to "#" so that we get them in
dnl    "configure".
dnl
dnl    Jeremy Meredith, Thu Apr 26 13:53:14 PDT 2001
dnl    Added check for SysV vs BSD style pseudo-tty.
dnl
dnl    Eric Brugger, Fri Apr 27 18:40:54 PDT 2001
dnl    I added a check to see if there exists a prototype for ftime in
dnl    "sys/timeb.h".
dnl
dnl    Jeremy Meredith, Thu May 10 17:26:29 PDT 2001
dnl    Added checks for network libraries for SunOS (nsl, socket, resolv).
dnl    Added check for qgl.  Added code for plugins.
dnl    Added stuff to figure out how to build shared libraries.
dnl
dnl    Jeremy Meredith, Wed Jun  6 22:19:11 PDT 2001
dnl    Added a check to see if socklen_t exists.
dnl
dnl    Hank Childs, Wed Jun 13 16:01:50 PDT 2001
dnl    Changed around the location of a bunch of Makefiles.
dnl
dnl    Jeremy Meredith, Mon Jun 25 21:43:10 PDT 2001
dnl    Added PX (Parallel eXtension) as either _ser or _par.
dnl    Changed the definitions of SHLIB_POSTPROCESS slightly.
dnl    Added definition of PLUGIN_EXTENSION.
dnl
dnl    Jeremy Meredith, Mon Jul 23 00:46:57 PDT 2001
dnl    Made it search for qgl in the $QTDIR/lib directory.  It sometimes
dnl    happened that QTDIR pointed to one without a separate qgl, but there
dnl    was still a qgl elsewhere in the library search path.
dnl
dnl    Jeremy Meredith, Thu Jul 26 02:45:06 PDT 2001
dnl    Added operator plugins.
dnl
dnl    Jeremy Meredith, Fri Jul 27 13:51:00 PDT 2001
dnl    Made it automatically disable the gui, viewer, mdserver when building
dnl    in parallel.  Also made engine proxy build only when viewer is built.
dnl
dnl    Hank Childs, Wed Aug  8 17:41:12 PDT 2001
dnl    Add --disable-annotation.  Also add support for Qt-2.2.1.
dnl
dnl    Jeremy Meredith, Tue Aug 28 16:04:51 PDT 2001
dnl    Added tools/xml.
dnl
dnl    Sean Ahern, Thu Aug 30 16:54:07 PDT 2001
dnl    Added the splash screen.
dnl
dnl    Jeremy Meredith, Tue Sep  4 10:37:27 PDT 2001
dnl    Added ./include/make-targets-libmulti.in as LIBMULTITARGETS
dnl    and ./include/maketargets-lisingle.in as LIBSINGLETARGETS.
dnl
dnl    Hank Childs, Sun Sep  9 20:34:43 PDT 2001
dnl    Added tools/avtprep, components/Preprocessor.
dnl
dnl    Hank Childs, Wed Sep 12 10:52:30 PDT 2001
dnl    Added --enable-buildall option.
dnl
dnl    Jeremy Meredith, Mon Sep 24 17:41:28 PDT 2001
dnl    Added Transform operator and removed Shift operator.
dnl
dnl    Jeremy Meredith, Fri Sep 28 13:24:26 PDT 2001
dnl    Added ILIBS for engine, gui, viewer.
dnl
dnl    Hank Childs, Mon Oct  8 15:38:52 PDT 2001
dnl    Added enable/disable exodus.
dnl
dnl    Brad Whitlock, Mon Oct 1 12:28:19 PDT 2001
dnl    Added Tools directory to components/VisWindow.
dnl
dnl    Kathleen Bonnell, Fri Oct 19 15:33:35 PDT 2001 
dnl    Added Subset directory to plots.
dnl
dnl    Brad Whitlock, Tue Oct 16 15:38:32 PST 2001
dnl    Added Math directory to components.
dnl
dnl    Hank Childs, Tue Oct 23 11:22:33 PDT 2001
dnl    Add ColorIso directory.
dnl
dnl    Hank Childs, Tue Oct 23 15:25:40 PDT 2001
dnl    Add Threshold operator.
dnl
dnl    Jeremy Meredith, Thu Oct 25 13:00:54 PDT 2001
dnl    Added Database/Ghost, and moved MIR from Pipeline to Database.
dnl
dnl    Hank Childs, Mon Nov  5 16:37:59 PST 2001
dnl    Added Displace operator.
dnl
dnl    Eric Brugger, Wed Nov  7 13:35:23 PST 2001
dnl    Removed --enable-timings.
dnl
dnl    Jeremy Meredith, Mon Nov 12 13:36:36 PST 2001
dnl    Added tools/silex.
dnl    Added check for static QT so we can use it if possible.
dnl
dnl    Hank Childs, Mon Nov 12 16:52:17 PST 2001
dnl    Added box operator.
dnl
dnl    Eric Brugger, Wed Dec  5 11:04:36 PST 2001
dnl    Added tools/curv3dprep.
dnl
dnl    Brad Whitlock, Sun Jul 8 2001
dnl    Added visitpy directory and support for scripting plugins.
dnl
dnl    Kathleen Bonnell, Thu Nov 15 12:48:49 PST 2001
dnl    Modified VTK_INCLUDES and VTK_LIB to match VTK 4.0 directory tree. 
dnl
dnl    Jeremy Meredith, Thu Jan  3 15:25:42 PST 2002
dnl    Cleared out SHLIB_MPI_LIBS if not building in parallel.
dnl    Split library target includes into ones for serial/parallel and ones
dnl    for parallel only.  Changed AIX to check to make sure parallel is
dnl    enabled before setting SHLIB_MPI_LIBS.  Explicitly substitute
dnl    SHLIB_MPI_LIBS instead of always stuffing it into SHLIB_LIBS.
dnl
dnl    Jeremy Meredith, Sat Jan  5 17:53:36 PST 2002
dnl    Added SiloDump operator.
dnl    Created a PARALLEL_CPPFLAGS.
dnl
dnl    Jeremy Meredith, Wed Jan  9 13:17:05 PST 2002
dnl    Removed the strangeness of AIX's shared library processes.
dnl    The right combination of things has converged to make building them
dnl    mostly "normal" finally.
dnl
dnl    Jeremy Meredith, Wed Jan 16 09:43:06 PST 2002
dnl    Allow concurrent serial and parallel builds:
dnl    --enable-parallel no longer implies --disable-mdserver and --disable-gui
dnl    removed PX, duplicated other defines into PAR and SER versions.
dnl
dnl    Jeremy Meredith, Fri Feb  1 10:05:04 PST 2002
dnl    Added LIBSHAREDPAR_UPDATEONLY.
dnl
dnl    Jeremy Meredith, Fri Feb 15 13:49:37 PST 2002
dnl    Removed some AIX shared library stuff I forgot to remove earlier.
dnl
dnl    Eric Brugger, Tue Feb 19 14:49:34 PST 2002
dnl    I added the creation of a makefile in the data directory.
dnl
dnl    Sean Ahern, Thu Mar  7 13:03:35 PST 2002
dnl    Changed how BUILDALL for operators works.
dnl
dnl    Hank Childs, Thu Mar  7 10:20:47 PST 2002
dnl    Added reflect operator.
dnl
dnl    Hank Childs, Thu Mar  7 12:54:44 PST 2002
dnl    Fix a bug with specifying --without-exodus.
dnl
dnl    Jeremy Meredith, Mon Mar 11 16:43:35 PST 2002
dnl    Renamed SplashScreen to splashscreen.
dnl    Removed the multi lib targets; everything is single.
dnl
dnl    Brad Whitlock, Tue Mar 12 14:29:39 PST 2002
dnl    I rewrote the check for Qt's version and made it check for version
dnl    3.0.0 or later.
dnl
dnl    Eric Brugger, Thu Mar 21 15:10:34 PST 2002
dnl    Add the sphere slice operator.
dnl
dnl    Kathleen Bonnell, Tue Apr  9 16:51:14 PDT 2002 
dnl    Add new vtk libs. 
dnl
dnl    Jeremy Meredith, Mon Apr 15 12:20:36 PDT 2002
dnl    Added check for streambuf::setbuf publicly accessible.
dnl
dnl    Brad Whitlock, Thu Mar 21 17:13:22 PST 2002
dnl    Removed the rpc library. Added slash character check.
dnl
dnl    Eric Brugger, Tue Apr 16 09:23:42 PDT 2002
dnl    Added a check for mesa.
dnl
dnl    Hank Childs, Tue Apr 16 10:44:14 PDT 2002
dnl    Added Isosurface operator.
dnl
dnl    Jeremy Meredith, Fri Apr 19 15:23:49 PDT 2002
dnl    Removed IsoSurfaceVolume and RangeVolume plots.
dnl
dnl    Kathleen Bonnell, Thu Apr 25 15:46:34 PDT 2002  
dnl    Added subdirs: plots/Curve,  operators/Lineout. 
dnl
dnl    Brad Whitlock, Wed May 15 13:07:35 PST 2002
dnl    Added help viewer.
dnl
dnl    Hank Childs, Wed May 22 14:02:48 PDT 2002 
dnl    Put an extra set of '[]' around the 'tr' command so that m4 doesn't
dnl    take them out.  The '[]' are required for 'tr' with Solaris 5.8
dnl
dnl    Hank Childs, Wed May 29 15:33:12 PDT 2002 
dnl    Added cone operator.
dnl
dnl    Hank Chidls, Wed Jun  5 08:14:29 PDT 2002
dnl    Added IndexSelect operator.  Removed ColorIso.
dnl
dnl    Sean Ahern, Mon Jun 10 16:20:48 PDT 2002
dnl    Added make-targets-dir so that we can get rid of a lot of rules.
dnl
dnl    Jeremy Meredith, Fri Jul 12 14:35:08 PDT 2002
hrchilds's avatar
hrchilds committed
313
dnl    Unified the include file locations to the root /include tree.
hrchilds's avatar
hrchilds committed
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356
dnl    This includes mesa, qt, vtk, and visit.  Also linked moc to our
dnl    private bin directory and used it there.  Added makefiles for our
dnl    root include and bin directories.  Added check for ios::noreplace.
dnl    Removed all plot and operator plugin makefile.in's since all are
dnl    now generated at runtime.
dnl
dnl    Jeremy Meredith, Thu Jul 18 13:11:36 PDT 2002
dnl    Assume python library is in our private lib directory (probably as
dnl    a symbolic link).
dnl
dnl    Jeremy Meredith, Thu Jul 18 13:11:36 PDT 2002
dnl    Made it build the include and lib directories, and xml2atts and
dnl    the plot and operator plugin makefiles automatically after 
dnl    config.status is created and has been run.
dnl
dnl    Jeremy Meredith, Thu Jul 25 15:24:44 PDT 2002
dnl    Added a message for parallel enabled.
dnl
dnl    Jeremy Meredith, Sat Aug  3 11:38:23 PDT 2002
dnl    Renamed BUILDALL.
dnl
dnl    Brad Whitlock, Wed Aug 14 16:48:22 PST 2002
dnl    I added a --enable-java test.
dnl
dnl    Eric Brugger, Tue Aug 20 11:44:00 PDT 2002
dnl    Disable the exodus reader if the VTK exodus reader doesn't exist.
dnl
dnl    Brad Whitlock, Wed Aug 21 11:45:18 PDT 2002
dnl    I made tools make clean before building xml2makefile in case I've
dnl    run configure on another platform before running it again on the
dnl    current platform. I also made configure build a small Java class
dnl    file that contains the VisIt version.
dnl
dnl    Jeremy Meredith, Wed Aug 21 14:46:24 PDT 2002
dnl    Added database plugins.  Changed the exodus and saf checks a little.
dnl
dnl    Brad Whitlock, Thu Sep 26 15:54:03 PST 2002
dnl    If the test for pthreads succeeds, I made it define a macro in
dnl    visit-config.h
dnl
dnl    Hank Childs, Thu Oct  3 11:32:29 PDT 2002
dnl    Made an HDF5 symbol for database plugins.
dnl
hrchilds's avatar
hrchilds committed
357 358 359
dnl    Sean Ahern, Fri Oct  4 11:16:52 PDT 2002
dnl    Moved the expression parser to its own library.
dnl
hrchilds's avatar
hrchilds committed
360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413
dnl    Hank Childs, Sun Oct 13 21:07:20 PDT 2002
dnl    Add PDB check based on work by Brad Whitlock.
dnl
dnl    Jeremy Meredith, Thu Oct 17 16:07:02 PDT 2002
dnl    Added xml editor.
dnl
dnl    Brad Whitlock, Wed Nov 6 12:25:37 PDT 2002
dnl    I added a check for Java's jar utility.
dnl
dnl    Sean Ahern, Mon Nov 18 13:10:38 PST 2002
dnl    Added --with-{plots,operators,dbs} options.
dnl
dnl    Hank Childs, Tue Nov 19 06:44:03 PST 2002
dnl    Added Expressions and Queries directory.
dnl
dnl    Sean Ahern, Tue Nov 19 13:10:27 PST 2002
dnl    Added --with-config option.
dnl
dnl    Eric Brugger, Tue Dec  3 08:03:09 PST 2002
dnl    Removed -I/usr/local/include from CPPFLAGS and -L/usr/local/lib from
dnl    LDFLAGS.
dnl
dnl    Brad Whitlock, Fri Dec 13 11:49:40 PDT 2002
dnl    I added PTHREAD_CXXFLAGS that is defined when we can find pthreads.
dnl
dnl    Hank Childs, Sun Dec 29 12:12:17 PST 2002
dnl    Added tools/annotations.
dnl
dnl    Kathleen Bonnell, Thu Jan  2 09:06:57 PST 2003 
dnl    Add new vtk libs vtkfreetype, vtkftgl. 
dnl
dnl    Brad Whitlock, Thu Jan 16 16:37:35 PST 2003
dnl    Added tools/escan to the list of Makefiles.
dnl
dnl    Jeremy Meredith, Fri Jan 24 11:51:58 PST 2003
dnl    Fixed bug with building optional plugins.
dnl
dnl    Eric Brugger, Thu Mar 27 14:29:09 PST 2003
dnl    Changed the location of vtkexpat, vtkfreetype, vtkftgl, vtkjpeg,
dnl    vtkpng, vtktiff and vtkzlib in the link line so that they are loaded
dnl    in the proper order.  Removed some unnecessary X libraries.  Moved
dnl    the GL library to the end of VTK_LIBS since it is only used by VTK.
dnl
dnl    Hank Childs, Thu Apr 10 16:45:02 PDT 2003
dnl    Added support for Mili.
dnl
dnl    Jeremy Meredith, Tue Apr 15 21:12:12 PDT 2003
dnl    Made references to TOPDIR interpolate at build time instead of
dnl    configure-time.  This also required adding TOPDIR as a variable
dnl    substitution and replacing some references to "pwd" to use TOPDIR.
dnl
dnl    Brad Whitlock, Fri May 2 15:06:12 PST 2003
dnl    I added libproxybase and the new launcher component.
dnl
hrchilds's avatar
hrchilds committed
414 415 416 417
dnl    Sean Ahern, Fri Aug  9 15:52:39 PDT 2002
dnl    Made UNAME be run as few times as possible.  Removed the memmove
dnl    test, as we weren't using it.  Added Darwin (Mac OS X) support.
dnl
hrchilds's avatar
hrchilds committed
418 419 420
dnl    Sean Ahern, Wed Jun 11 16:36:52 PDT 2003
dnl    Fixed pthreads test.
dnl
hrchilds's avatar
hrchilds committed
421 422 423
dnl    Akira Haddox, Thu Jun 12 08:56:16 PDT 2003
dnl    Added support for HDF4.
dnl
hrchilds's avatar
hrchilds committed
424 425 426
dnl    Akira Haddox, Tue Jul  1 12:36:01 PDT 2003
dnl    Added tools/makemili.
dnl
hrchilds's avatar
hrchilds committed
427 428 429
dnl    Hank Childs, Wed Jul  2 09:50:00 PDT 2003
dnl    Added tools/surfcomp.
dnl
hrchilds's avatar
hrchilds committed
430 431 432
dnl    Brad Whitlock, Thu Jun 19 13:10:18 PST 2003
dnl    I removed the splashscreen.
dnl
hrchilds's avatar
hrchilds committed
433 434 435 436 437 438
dnl    Brad Whitlock, Tue Jul 29 15:51:29 PST 2003
dnl    Added mpeg_encode to the tools directory.
dnl
dnl    Hank Childs, Wed Jul 30 18:05:32 PDT 2003
dnl    Add support for fake exceptions.
dnl
hrchilds's avatar
hrchilds committed
439 440 441 442 443 444
dnl    Jeremy Meredith, Wed Aug 20 09:52:28 PDT 2003
dnl    Added the MIR library.
dnl
dnl    Akira Haddox, Wed Aug 20 10:45:41 PDT 2003
dnl    Added support for Boxlib3D.
dnl
hrchilds's avatar
hrchilds committed
445 446 447
dnl    Hank Childs, Tue Sep  9 07:36:21 PDT 2003
dnl    Added tools/convert.
dnl
hrchilds's avatar
hrchilds committed
448 449 450
dnl    Jeremy Meredith, Fri Oct 10 12:32:27 PDT 2003
dnl    Added check for 3D texturing support in OpenGL.
dnl
hrchilds's avatar
hrchilds committed
451 452 453
dnl    Brad Whitlock, Wed Sep 3 10:55:28 PDT 2003
dnl    Added more Darwin support and added logic to create bundles.
dnl
hrchilds's avatar
hrchilds committed
454 455 456
dnl    Kathleen Bonnell, Wed Nov 12 17:20:03 PST 2003 
dnl    Add new vtk lib vtkDICOMParser. 
dnl
hrchilds's avatar
hrchilds committed
457 458 459
dnl    Eric Brugger, Thu Nov 20 08:54:13 PST 2003
dnl    Modify the script to handle the absence of the help directory.
dnl
hrchilds's avatar
hrchilds committed
460 461 462
dnl    Hank Childs, Sat Jan 24 11:39:13 PST 2004
dnl    Re-organized many libraries to enable mdserver to link against less.
dnl
hrchilds's avatar
hrchilds committed
463 464 465
dnl    Brad Whitlock, Thu Jan 29 10:48:59 PDT 2004
dnl    I added more versions of Qt to the list of supported versions.
dnl
hrchilds's avatar
hrchilds committed
466 467 468 469
dnl    Mark C. Miller, Thu Feb 26 10:44:14 PDT 2004
dnl    Modified to defualt to using PDB lite (in libsilo.a) but still
dnl    accept --with-pdb option if PDB proper is desired
dnl
hrchilds's avatar
hrchilds committed
470 471 472
dnl    Hank Childs, Thu Mar  4 08:32:01 PST 2004
dnl    Added new Qt VisWindow library.
dnl
hrchilds's avatar
hrchilds committed
473 474 475
dnl    Brad Whitlock, Mon Mar 15 09:39:17 PDT 2004
dnl    Fixed the pthreads test when PTHREAD_LIB is defined in the config-site.
dnl
hrchilds's avatar
hrchilds committed
476 477 478
dnl    Brad Whitlock, Tue Mar 30 09:05:27 PDT 2004
dnl    Added PDB_EXEC to fix test suite.
dnl
hrchilds's avatar
hrchilds committed
479 480 481 482
dnl    Brad Whitlock, Wed Apr 21 17:42:20 PST 2004
dnl    Added Makefile magic for MacOS X to make automatic segment offset
dnl    calculations possible for prebinding.
dnl
hrchilds's avatar
hrchilds committed
483 484 485
dnl    Brad Whitlock, Thu May 20 18:58:29 PST 2004
dnl    Fixed a bug that made configure report the wrong Qt version.
dnl
hrchilds's avatar
hrchilds committed
486 487 488 489
dnl    Jeremy Meredith, Tue Jun 22 09:45:01 PDT 2004
dnl    Have it build optimized if no CXXFLAGS were specified through
dnl    the environment variable.
dnl
hrchilds's avatar
hrchilds committed
490 491 492 493
dnl    Brad Whitlock, Tue Jun 29 09:01:46 PDT 2004
dnl    Prevented links to Silo, Mili, and HDF5 from being created on MacOS X
dnl    if those libraries are not found by configure.
dnl
hrchilds's avatar
hrchilds committed
494 495 496
dnl    Jeremy Meredith, Wed Jul  7 11:48:33 PDT 2004
dnl    Made the VTK_LIGHTWEIGHT_LIBS include all VTK libraries under OSX.
dnl
hrchilds's avatar
hrchilds committed
497 498 499 500
dnl    Jeremy Meredith, Thu Jul  8 11:35:29 PDT 2004
dnl    Remove xml2makefile before trying to build it to ensure it does get
dnl    rebuilt even if your make program doesn't realize it is needed.
dnl
hrchilds's avatar
hrchilds committed
501 502 503
dnl    Eric Brugger, Mon Jul 26 15:44:24 PDT 2004
dnl    Replaced fstream.h with fstream.
dnl
hrchilds's avatar
hrchilds committed
504 505 506 507 508 509
dnl    Brad Whitlock, Wed Aug 11 15:04:49 PST 2004
dnl    I changed the build offset for MacOS X.
dnl
dnl    Jeremy Meredith, Tue Aug 24 21:26:15 PDT 2004
dnl    Added engine wrapper library and simulation prototype.
dnl
hrchilds's avatar
hrchilds committed
510 511 512
dnl    Mark C. Miller, Tue Sep 28 19:32:50 PDT 2004
dnl    Added ViSUS
dnl
hrchilds's avatar
hrchilds committed
513 514 515 516
dnl    Eric Brugger, Thu Sep 30 10:51:22 PDT 2004
dnl    I corrected a bug that was causing the check for using siloh5 to fail
dnl    if hdf5 was built with z lib support.
dnl
hrchilds's avatar
hrchilds committed
517 518 519
dnl    Eric Brugger, Tue Oct  5 10:46:12 PDT 2004
dnl    I replaced QTDIR with QT_BIN, QT_INCLUDE and QT_LIB.
dnl
hrchilds's avatar
hrchilds committed
520 521 522 523
dnl    Mark C. Miller, Tue Oct  5 12:41:41 PDT 2004
dnl    Fixed issues '--with-<lib>=' argument where '-I' and '-L' would be
dnl    missing from final make variable names that were created
dnl
hrchilds's avatar
hrchilds committed
524 525 526
dnl    Jeremy Meredith, Mon Aug 30 16:55:36 PDT 2004
dnl    Added parallel directory to visit_vtk.
dnl
hrchilds's avatar
hrchilds committed
527 528 529
dnl    Jeremy Meredith, Wed Nov 24 11:40:55 PST 2004
dnl    Refactored the expression parser into two separate libraries.
dnl
hrchilds's avatar
hrchilds committed
530 531 532 533 534 535 536
dnl    Jeremy Meredith, Thu Nov 11 12:38:16 PST 2004
dnl    Made host-specific site configs come before OS-type site configs.  
dnl    This lets us do host-type flags conditioned on what kind of compiler
dnl    we are using.  Added support for xlC on AIX.  Put back some
dnl    commented-out code to support strangeness on shared libraries on AIX
dnl    if we decide we want to use it again.  
dnl
hrchilds's avatar
hrchilds committed
537 538 539
dnl    Brad Whitlock, Thu Jan 6 13:01:21 PST 2005
dnl    Added support for creating a link to the HDF4 libraries on MacOS X.
dnl
hrchilds's avatar
hrchilds committed
540 541 542
dnl    Jeremy Meredith, Tue Feb 22 18:48:19 PST 2005
dnl    Renamed "convert" to "visitconvert".
dnl
hrchilds's avatar
hrchilds committed
543 544 545
dnl    Hank Childs, Wed Apr  6 13:13:10 PDT 2005
dnl    Added tools/writer.
dnl
hrchilds's avatar
hrchilds committed
546 547 548
dnl    Brad Whitlock, Mon Apr 11 16:58:53 PST 2005
dnl    Changed the location of the linkedit.py script used on the Mac.
dnl
hrchilds's avatar
hrchilds committed
549 550 551
dnl    Jeremy Meredith, Thu Apr 28 17:46:44 PDT 2005
dnl    Added explicit versioning for the VisIt Engine Library.
dnl
hrchilds's avatar
hrchilds committed
552 553 554
dnl    Brad Whitlock, Wed Jul 13 09:36:25 PDT 2005
dnl    Updated MacOS X start address due to library size changes.
dnl
hrchilds's avatar
hrchilds committed
555 556 557
dnl    Brad Whitlock, Tue Aug 9 17:31:30 PST 2005
dnl    I added checks for netCDF.
dnl
hrchilds's avatar
hrchilds committed
558 559 560 561 562 563
dnl    Brad Whitlock, Tue Aug 30 15:57:15 PST 2005
dnl    I added checks for CGNS.
dnl
dnl    Brad Whitlock, Fri Sep 2 15:07:19 PST 2005
dnl    Fixed up some things for MacOS X 10.4
dnl
hrchilds's avatar
hrchilds committed
564 565 566
dnl    Brad Whitlock, Tue Sep 6 11:24:53 PDT 2005
dnl    I added checks for GDAL.
dnl
hrchilds's avatar
hrchilds committed
567 568 569 570
dnl    Kathleen Bonnell, Thu Sep 22 16:49:12 PDT 2005 
dnl    Added 'vtkexpat' to lightweight libs, so VTK XML file format can
dnl    link properly to mdserver. 
dnl
hrchilds's avatar
hrchilds committed
571 572 573 574
dnl    Jeremy Meredith, Thu Oct 13 13:55:32 PDT 2005
dnl    Added cqscore, the tool for scoring tickets.  Also forced a make on
dnl    the bin directory before exiting configure.
dnl
hrchilds's avatar
hrchilds committed
575 576 577 578 579
dnl    Mark C. Miller, Thu Nov  3 16:59:41 PST 2005
dnl    I added code to check for libbz2 (bzip2)
dnl    I also added -I$(TOPDIR)/include to COMPONENT_CPPFLAGS so that
dnl    components could include visit-config.h
dnl
hrchilds's avatar
hrchilds committed
580 581 582
dnl    Eric Brugger, Mon Nov 14 11:25:18 PST 2005
dnl    I removed VTK_CAMERA_SRC.
dnl
hrchilds's avatar
hrchilds committed
583 584 585
dnl    Kathleen Bonnell, Wed Nov 16 08:51:43 PST 2005 
dnl    Added -lXt to X_LIBS. 
dnl
hrchilds's avatar
hrchilds committed
586 587 588 589 590
dnl    Mark C. Miller, Thu Dec  1 19:31:07 PST 2005
dnl    Changed support for bzip2 to a third_party_builtin library
dnl    This means it is part of the distribution and gets built whenever
dnl    VisIt gets built. It can be disabled with --disable-bzip2
dnl
hrchilds's avatar
hrchilds committed
591 592 593
dnl    Mark C. Miller, Mon Dec 12 20:53:03 PST 2005
dnl    Moved -lbz2 to BZIP2_LIBS config/make variable
dnl
hrchilds's avatar
hrchilds committed
594 595 596
dnl    Brad Whitlock, Fri Dec 16 17:03:10 PST 2005
dnl    Improved glTexImage3D detection on MacOS X.
dnl
hrchilds's avatar
hrchilds committed
597 598 599 600
dnl    Eric Brugger, Tue Jan 24 11:21:01 PST 2006
dnl    I added QUI_LIBS which is used by the gui to dynamically load custom
dnl    simulation control windows.
dnl
hrchilds's avatar
hrchilds committed
601 602 603
dnl    Eric Brugger, Thu Feb  2 08:51:04 PST 2006
dnl    I removed -lg2c as a boxlib library dependence when using gcc.
dnl
hrchilds's avatar
hrchilds committed
604 605 606
dnl    Hank Childs, Mon Feb 13 20:58:37 PST 2006
dnl    Added subdirectory /components/DDF.
dnl
hrchilds's avatar
hrchilds committed
607 608 609
dnl    Shelly Prevost, Mon Mar 13 16:14:47 PST 2006
dnl    Moved the location of the simulation Makefile from sim to sim/lib.
dnl
hrchilds's avatar
hrchilds committed
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630
dnl --------------------------------------------------------------------------

dnl
dnl Configuration header stuff...
dnl
AC_REVISION($Id$)dnl
AC_INIT(Makefile.in)
AC_CONFIG_HEADER(include/visit-config.h)
AC_CONFIG_AUX_DIR(./bin)

dnl The builtin `pwd' command fails with `bad file unit number' from the
dnl shell on some systems, so try to use `/bin/pwd' instead.
dnl
if test -x /bin/pwd; then
   pwd=/bin/pwd
else
   pwd=pwd
fi
TOPDIR=`$pwd`
AC_SUBST(TOPDIR)

hrchilds's avatar
hrchilds committed
631 632 633 634 635 636 637 638 639
dnl
dnl Make note if no CXXFLAGS have yet been specified; we won't like the
dnl defaults that configure chooses and this lets us override them easily
dnl
emptycxxflags="no"
if test -z $CXXFLAGS; then
    emptycxxflags="yes"
fi

hrchilds's avatar
hrchilds committed
640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708
### Init the tflops_override variable.
tflops_override=no

###     Derive the OS type, as a check for reusing the autoconf cache
OS_type="`(uname -s -r) 2>/dev/null`"
if test -z "$OS_type" ; then
    OS_type="`(hostname) 2>/dev/null`"
fi
AC_CACHE_VAL(vc_cv_os_type,[vc_cv_os_type="$OS_type"])
test -z "$OS_type" && OS_type="$vc_cv_os_type"
test -n "$vc_cv_os_type" && AC_MSG_RESULT("Configuring for $vc_cv_os_type")

if test ".$OS_type" != ".$vc_cv_os_type" ; then
    AC_MSG_RESULT("The cached Operating System does not agree with this OS type.")
    AC_ERROR("Please run \"make distclean\" and try again.")
fi

# Grab the version number
AC_MSG_CHECKING(what version the package is)
VERSION=`cat VERSION`
AC_DEFINE_UNQUOTED(VERSION,"$VERSION")
AC_MSG_RESULT($VERSION)

# Set the slash characters used in filenames.
AC_DEFINE_UNQUOTED(SLASH_CHAR,'/')
AC_DEFINE_UNQUOTED(SLASH_STRING,"/")

# Load the site configuration file if present.
# Also check for hostnames where the first field is a node name.
AC_MSG_CHECKING(for site configuration file)
site_conf=config-site/`hostname`.conf
if test -r $site_conf; then
   AC_MSG_RESULT($site_conf)
   . $site_conf
else
   site_conf=config-site/`hostname | cut -f2- -d.`.conf
   if test -r $site_conf; then
      AC_MSG_RESULT($site_conf)
      . $site_conf
   else
      AC_MSG_RESULT(none found)
   fi
fi

# If the user has a ~/.visit/default.conf file, load that
AC_MSG_CHECKING([for user configuration file $HOME/.visit/default.conf])
if test -r "$HOME/.visit/default.conf"; then
   AC_MSG_RESULT(found)
   . $HOME/.visit/default.conf
else
   AC_MSG_RESULT([none found])
fi

# Load any user-specified configuration file
AC_MSG_CHECKING([for user-specified configuration file])
AC_ARG_WITH(config,
            [  --with-config=file      Specify a configuration file to execute],
            user_conf=$withval,
            user_conf="none")
if test "$user_conf" = "yes" -o "$user_conf" = ""; then
    AC_MSG_ERROR([You must specify a file when using --with-config=file])
fi
if test "$user_conf" != "none"; then
   AC_MSG_RESULT($user_conf)
   . $user_conf
else
   AC_MSG_RESULT([none specified])
fi

hrchilds's avatar
hrchilds committed
709 710 711 712 713 714 715 716 717 718 719 720
# Load the OS configuration file if present.
UNAME="`uname 2>/dev/null`"
SHORT_UNAME=`uname -s | tr A-Z a-z | tr -d 0-9`
AC_MSG_CHECKING(for OS configuration file)
site_conf=config-site/$UNAME.conf
if test -r $site_conf; then
    AC_MSG_RESULT($site_conf)
    . $site_conf
else
    AC_MSG_RESULT(none found)
fi

hrchilds's avatar
hrchilds committed
721 722 723 724 725
#
# Check for platform specific flags.
#
AC_SUBST(PLATFORM_CPPFLAGS)

hrchilds's avatar
hrchilds committed
726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751
#
# Set up fake exceptions if requested.
#
AC_ARG_ENABLE(fake-exceptions,
   [  --enable-fake-exceptions       do not make use of C++'s exception library ],
   UseFakeExceptions=$enableval, UseFakeExceptions=not_specified)
doFakeExceptions="no"
if test "$UseFakeExceptions" = "yes" ; then
  doFakeExceptions="yes"
fi
AC_MSG_CHECKING([whether or not to use fake exceptions])
FAKE_EXCEPTIONS_BY_DEFAULT="xx$FAKE_EXCEPTIONS_BY_DEFAULT"
if test "$FAKE_EXCEPTIONS_BY_DEFAULT" = "xxyes" ; then
  if test "$UseFakeExceptions" = "not_specified" ; then
     doFakeExceptions="yes"
  fi
fi
if test "$doFakeExceptions" = "yes" ; then
  AC_MSG_RESULT([yes])
  CXXFLAGS="$CXXFLAGS -DFAKE_EXCEPTIONS"
else
  AC_MSG_RESULT([no])
fi
AC_SUBST(CXXFLAGS)


hrchilds's avatar
hrchilds committed
752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767
#
# Check to see if the parallel version is enabled.
#
AC_ARG_ENABLE(parallel,
   [  --enable-parallel       make the parallel version],
   UseParallel=$enableval, UseParallel=no)

AC_MSG_CHECKING(for parallel features)
if test "$UseParallel" = "yes"; then
   AC_MSG_RESULT(enabled)
   PARALLEL="parallel"
   PARALLEL_CPPFLAGS="-DPARALLEL"
   LIBSTATICPAR="$""(LIBSTATICPAR)"
   LIBSHAREDPAR="$""(LIBSHAREDPAR)"
   LIBSHAREDPAR_UPDATEONLY="libsharedpar_updateonly"

hrchilds's avatar
hrchilds committed
768
   if test "$UNAME" != "AIX"; then
hrchilds's avatar
hrchilds committed
769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823
       if (test -z "$MPI_LIBS") then
           MPI_LIBS="-lmpi"
       fi
   fi

   # Check if the user has specified a C compiler for MPI
   if test -n "$MPI_CC"; then
       MPI_CC="CC=$MPI_CC"
   fi

   # Check if the user has specified a C++ compiler for MPI
   if test -n "$MPI_CXX"; then
       MPI_CXX="CXX=$MPI_CXX"
   fi
else
   AC_MSG_RESULT(disabled)
   PARALLEL=""
   PARALLEL_CPPFLAGS=""
   MPI_LIBS=""
   SHLIB_MPI_LIBS=""
   MPI_CC=""
   MPI_CXX=""
   LIBSTATICPAR=""
   LIBSHAREDPAR=""
   LIBSHAREDTEMPPAR=""
fi
AC_SUBST(PARALLEL)
AC_SUBST(PARALLEL_CPPFLAGS)
AC_SUBST(MPI_LIBS)
AC_SUBST(MPI_CC)
AC_SUBST(MPI_CXX)
AC_SUBST(LIBSTATICPAR)
AC_SUBST(LIBSHAREDPAR)
AC_SUBST(LIBSHAREDPAR_UPDATEONLY)

#
# Set up some Mesa variables.
#
AC_MSG_CHECKING(for Mesa)
if test -n "$MESA"; then
   AC_MSG_RESULT(found)
   MESA_DIR=$MESA
   MESA_INCLUDE="-I$""(TOPDIR)/include/mesa"
   MESA_LIBS="-lOSMesa -lMesaGL"
else
   AC_MSG_RESULT(not found)
   MESA_DIR=""
   MESA_INCLUDE=""
   MESA_LIBS=""
fi
AC_SUBST(MESA_DIR)
AC_SUBST(MESA_INCLUDE)
AC_SUBST(MESA_LIBS)

#
hrchilds's avatar
hrchilds committed
824
# The check for OpenGL can be disabled with `--disable-ogl'.
hrchilds's avatar
hrchilds committed
825 826 827 828 829 830
#
AC_ARG_ENABLE(ogl,
   [  --disable-ogl           do not check for the SGI ogl library],
   UseOGL="$enable_ogl", UseOGL=yes)

#
hrchilds's avatar
hrchilds committed
831
# Try to find the OpenGL libraries
hrchilds's avatar
hrchilds committed
832 833 834 835 836
#
GL_LIBS=""
if test "$UseOGL" = "yes"; then
    AC_CHECK_LIB(GL, main,   GL_LIBS="-lGL")
fi
hrchilds's avatar
hrchilds committed
837 838 839 840 841 842 843 844
# If we're on Darwin, OpenGL is a framework.
if test "$SHORT_UNAME" = "darwin"; then
    # We're on MacOS X and it always has an OpenGL framework.
    AC_MSG_CHECKING(for OpenGL)
    GL_LIBS="-framework OpenGL"
    AC_MSG_RESULT(found $GL_LIBS)
fi
AC_SUBST(GL_LIBS)
hrchilds's avatar
hrchilds committed
845

hrchilds's avatar
hrchilds committed
846 847 848 849 850 851
#
# Check for 3D texturing support in OpenGL
#
oldlibs="$LIBS"
LIBS="$LIBS $GL_LIBS"
AC_MSG_CHECKING(for glTexImage3D in OpenGL)
hrchilds's avatar
hrchilds committed
852 853 854 855 856
AC_TRY_LINK([#ifdef __APPLE__
#include <OpenGL/gl.h>
#else
#include <GL/gl.h>
#endif],
hrchilds's avatar
hrchilds committed
857 858 859 860 861 862 863 864
	    [glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, 0,0,0,
                          0, GL_RGBA, GL_UNSIGNED_BYTE, 0);],
            
            AC_DEFINE(HAVE_GL_TEX_IMAGE_3D)
            AC_MSG_RESULT(yes),
            AC_MSG_RESULT(no));
LIBS="$oldlibs"

hrchilds's avatar
hrchilds committed
865 866 867 868 869 870 871 872 873
#
# Set up some VTK variables.
#
AC_MSG_CHECKING(for VTK)
if test -n "$VTK"; then
    AC_MSG_RESULT(found)
    VTK_DIR=$VTK
    VTK_INCROOT="$""(TOPDIR)/include/vtk"
    VTK_INCLUDES="-I$VTK_INCROOT -I$VTK_INCROOT/Common -I$VTK_INCROOT/Filtering -I$VTK_INCROOT/Graphics -I$VTK_INCROOT/Hybrid -I$VTK_INCROOT/IO -I$VTK_INCROOT/Imaging -I$VTK_INCROOT/Rendering"
hrchilds's avatar
hrchilds committed
874
    VTK_LIBS="-lvtkCommon -lvtkDICOMParser -lvtkFiltering -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging -lvtkRendering -lvtkzlib -lvtkexpat -lvtkjpeg -lvtkpng -lvtktiff -lvtkftgl -lvtkfreetype $MESA_LIBS $GL_LIBS "
hrchilds's avatar
hrchilds committed
875 876 877
    if test "$SHORT_UNAME" = "darwin"; then
        VTK_LIGHTWEIGHT_LIBS=$VTK_LIBS
    else
hrchilds's avatar
hrchilds committed
878
        VTK_LIGHTWEIGHT_LIBS="-lvtkCommon -lvtkFiltering -lvtkzlib -lvtkexpat"
hrchilds's avatar
hrchilds committed
879
    fi
hrchilds's avatar
hrchilds committed
880 881 882 883 884
else
    AC_MSG_RESULT(not found)
    VTK_DIR=""
    VTK_INCLUDES=""
    VTK_LIBS=""
hrchilds's avatar
hrchilds committed
885
    VTK_LIGHTWEIGHT_LIBS=""
hrchilds's avatar
hrchilds committed
886 887 888 889
fi
AC_SUBST(VTK_DIR)
AC_SUBST(VTK_INCLUDES)
AC_SUBST(VTK_LIBS)
hrchilds's avatar
hrchilds committed
890
AC_SUBST(VTK_LIGHTWEIGHT_LIBS)
hrchilds's avatar
hrchilds committed
891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923

#
# Check for the common directory
#
AC_MSG_CHECKING(for common)
if test -d common; then
    AC_MSG_RESULT(found)
    COMMON="common"
else
    AC_MSG_RESULT(not found)
    COMMON=""
fi

#
# Check for the avtprep directory
#
AC_MSG_CHECKING(for avtprep)
if test -d tools/avtprep; then
    AC_MSG_RESULT(found)
    AVTPREP_SER="$""(tmpbin)/avtprep_ser"
    if test -n "$PARALLEL"; then
        AVTPREP_PAR="$""(tmpbin)/avtprep_par"
    else
        AVTPREP_PAR=""
    fi
else
    AC_MSG_RESULT(not found)
    AVTPREP_SER=""
    AVTPREP_PAR=""
fi
AC_SUBST(AVTPREP_SER)
AC_SUBST(AVTPREP_PAR)

hrchilds's avatar
hrchilds committed
924 925 926 927 928 929
#
# Check for the convert directory
#
AC_MSG_CHECKING(for convert)
if test -d tools/convert; then
    AC_MSG_RESULT(found)
hrchilds's avatar
hrchilds committed
930
    CONVERT_SER="$""(tmpbin)/visitconvert_ser"
hrchilds's avatar
hrchilds committed
931
    if test -n "$PARALLEL"; then
hrchilds's avatar
hrchilds committed
932
        CONVERT_PAR="$""(tmpbin)/visitconvert_par"
hrchilds's avatar
hrchilds committed
933 934 935 936 937 938 939 940 941 942 943 944
    else
        CONVERT_PAR=""
    fi
else
    AC_MSG_RESULT(not found)
    CONVERT_SER=""
    CONVERT_PAR=""
fi
AC_SUBST(CONVERT_SER)
AC_SUBST(CONVERT_PAR)

#
hrchilds's avatar
hrchilds committed
945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964
#
# Check for the makemili directory
#
AC_MSG_CHECKING(for makemili)
if test -d tools/makemili; then
    AC_MSG_RESULT(found)
    MAKEMILI_SER="$""(tmpbin)/makemili_ser"
    if test -n "$PARALLEL"; then
        MAKEMILI_PAR="$""(tmpbin)/makemili_par"
    else
        MAKEMILI_PAR=""
    fi
else
    AC_MSG_RESULT(not found)
    MAKEMILI_SER=""
    MAKEMILI_PAR=""
fi
AC_SUBST(MAKEMILI_SER)
AC_SUBST(MAKEMILI_PAR)

hrchilds's avatar
hrchilds committed
965 966 967 968 969 970 971 972 973 974 975 976 977 978 979
#
# Check for the engine directory
#
AC_MSG_CHECKING(for engine)
if test -d engine; then
    AC_MSG_RESULT(found)
    ENGINE="engine"
    ENGINE_SER="$""(tmpbin)/engine_ser"
    ENGINELIBSER="$""(ESERDSO)"
    if test -n "$PARALLEL"; then
        ENGINE_PAR="$""(tmpbin)/engine_par"
        ENGINELIBPAR="$""(EPARDSO)"
    else
        ENGINE_PAR=""
        ENGINELIBPAR=""
hrchilds's avatar
hrchilds committed
980
        ENGINEWRAPPAR=""
hrchilds's avatar
hrchilds committed
981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079
    fi
    if test -z "$VTK"; then
        AC_MSG_ERROR([engine is here, but no VTK library was specified. 
The engine cannot be built without VTK.  Make sure the VTK environment variable
is set and rerun 'configure'.])
    fi
else
    AC_MSG_RESULT(not found)
    ENGINE_SER=""
    ENGINE_PAR=""
    ENGINELIBSER=""
    ENGINELIBPAR=""
fi
AC_SUBST(ENGINE_SER)
AC_SUBST(ENGINE_PAR)
AC_SUBST(ENGINELIBSER)
AC_SUBST(ENGINELIBPAR)

#
# Check to see if the mdserver was enabled.
#
AC_MSG_CHECKING(if mdserver is enabled)
AC_ARG_ENABLE(mdserver,
              [  --disable-mdserver      build without mdserver],
              UseMDSERVER="$enable_mdserver", UseMDSERVER=yes)
if test "$UseMDSERVER" = "yes"; then
    AC_MSG_RESULT(yes)

    dnl
    dnl Check for the mdserver directory
    dnl
    AC_MSG_CHECKING(for mdserver)
    if test -d mdserver; then
        AC_MSG_RESULT(found)
        METADATA_SERVER="mdserver"
        MDSERVERLIB="$""(MDSO)"
        MDSERVEROBJ="$""(MOBJ)"
    else
        AC_MSG_RESULT(not found)
        METADATA_SERVER=""
    fi
else
    AC_MSG_RESULT(no)
    METADATA_SERVER=""
fi
AC_SUBST(METADATA_SERVER)
AC_SUBST(MDSERVERLIB)
AC_SUBST(MDSERVEROBJ)

#
# Check to see if scripting features are enabled.
#
AC_MSG_CHECKING(if scripting features are enabled)
AC_ARG_ENABLE(scripting,
              [  --disable-scripting     build without Python scripting capability],
              UseScripting="$enable_scripting", UseScripting=yes)
if test "X$UseScripting" = "Xyes"; then
    AC_MSG_RESULT(yes)
    enable_scripting=yes

    VISITPY="visitpy"
    SCRIPTINGLIB="$""(SDSO)"
    SCRIPTINGOBJ="$""(SOBJ)"
else
    AC_MSG_RESULT(no)
    enable_scripting=no

    VISITPY=""
    SCRIPTINGLIB=""
    SCRIPTINGOBJ=""
fi
AC_SUBST(VISITPY)
AC_SUBST(SCRIPTINGLIB)
AC_SUBST(SCRIPTINGOBJ)

# Check to see if the --disable-gui configure flag was given. If
# if was then we will use the enable_gui variable later on to see
# if we should test for X. We will also not build the Gui or the
# viewer.
#
dnl
AC_MSG_CHECKING(if GUI features are enabled)
AC_ARG_ENABLE(gui,
              [  --disable-gui           build without gui],
              UseGUI="$enable_gui", UseGUI=yes)
if test "$UseGUI" = "yes"; then
    AC_MSG_RESULT(yes)
    enable_gui=yes

    dnl
    dnl Check for the viewer directory
    dnl
    AC_MSG_CHECKING(for viewer)
    if test -d viewer; then
        AC_MSG_RESULT(found)
        VIEWER="viewer"
        VISWINDOW="VisWindow"
        VIEWERLIB="$""(VDSO)"
        VIEWEROBJ="$""(VOBJ)"
hrchilds's avatar
hrchilds committed
1080 1081
        # The private source can go into the executable on all UNIX versions
        # except for MacOS X.
hrchilds's avatar
hrchilds committed
1082
        if test "$SHORT_UNAME" = "darwin" ; then
hrchilds's avatar
hrchilds committed
1083 1084 1085 1086 1087 1088 1089
            VIEWERLIB_SRC="$""(PUBLIC_SRC) $""(PRIVATE_SRC) $""(SRCMOC)"
            VIEWEREXE_SRC="$""(MAINSRC)"
        else
            VIEWERLIB_SRC="$""(PUBLIC_SRC)"
            VIEWEREXE_SRC="$""(MAINSRC) $""(PRIVATE_SRC) $""(SRCMOC)"
        fi

hrchilds's avatar
hrchilds committed
1090 1091 1092 1093 1094 1095 1096 1097 1098
        if test -z "$VTK"; then
            AC_MSG_ERROR([viewer is here, but no VTK library was specified. 
The viewer cannot be built without VTK.  Make sure the VTK environment variable
is set and rerun 'configure'.])
        fi
    else
        AC_MSG_RESULT(not found)
        VIEWER=""
        VISWINDOW=""
hrchilds's avatar
hrchilds committed
1099 1100
        VIEWERLIB_SRC=""
        VIEWEREXE_SRC=""
hrchilds's avatar
hrchilds committed
1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111
    fi

    dnl
    dnl Gui checking is enabled, look for the gui directory.
    dnl
    AC_MSG_CHECKING(for gui)
    if test -d gui; then
        AC_MSG_RESULT(found)
        GUI="gui"
        GUILIB="$""(GDSO)"
        GUIOBJ="$""(GOBJ)"
hrchilds's avatar
hrchilds committed
1112 1113 1114 1115 1116
        if test "$SHORT_UNAME" = "darwin"; then
            GUIFRAMEWORKS="-framework Carbon"
        else
            GUIFRAMEWORKS=""
        fi
hrchilds's avatar
hrchilds committed
1117 1118 1119 1120 1121 1122 1123 1124 1125
        if test -z "$METADATA_SERVER"; then
            AC_MSG_ERROR([gui is here, but the metadata server is not.
The gui will not run without the metadata server. Check to see that the
mdserver directory exists and rerun 'configure'.])
        fi
    else
        AC_MSG_RESULT(not found)
        GUI=""
        GUIOBJ=""
hrchilds's avatar
hrchilds committed
1126
        GUIFRAMEWORKS=""
hrchilds's avatar
hrchilds committed
1127 1128 1129 1130 1131 1132 1133
    fi

    ENGINEPROXYDIR="proxy"
else
    AC_MSG_RESULT(no)
    enable_gui=no
    ENGINEPROXYDIR=""
hrchilds's avatar
hrchilds committed
1134
    GUI_CXXFLAGS=""
hrchilds's avatar
hrchilds committed
1135 1136 1137 1138
fi
AC_SUBST(GUI)
AC_SUBST(GUILIB)
AC_SUBST(GUIOBJ)
hrchilds's avatar
hrchilds committed
1139
AC_SUBST(GUIFRAMEWORKS)
hrchilds's avatar
hrchilds committed
1140 1141 1142 1143
AC_SUBST(VIEWER)
AC_SUBST(VISWINDOW)
AC_SUBST(VIEWERLIB)
AC_SUBST(VIEWEROBJ)
hrchilds's avatar
hrchilds committed
1144 1145
AC_SUBST(VIEWERLIB_SRC)
AC_SUBST(VIEWEREXE_SRC)
hrchilds's avatar
hrchilds committed
1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190
AC_SUBST(ENGINEPROXYDIR)

#
# Check to see if we should disable annotations.
#
AC_ARG_ENABLE(annotations,
              [  --disable-annotations   build without annotations],
              UseAnnotations="$enable_annotations", UseAnnotations=yes)
if test "$UseAnnotations" = "no"; then
    ANNOTATION_FLAGS="$ANNOTATION_FLAGS -DNO_ANNOTATIONS"
fi
AC_SUBST(ANNOTATION_FLAGS)

#
# Check to see if the java client is enabled.
#
AC_ARG_ENABLE(java,
   [  --enable-java           build the Java client library],
   UseJava=$enableval, UseJava=no)

AC_MSG_CHECKING(if Java client is enabled)
if test "$UseJava" = "yes"; then
    AC_MSG_RESULT(yes)
 
    # Somehow check that Java is at least Java 2 v1.4.0

    JAVAC="javac"
    JAVA_TARGET="java"
    JAR="jar"
    JAVAFLAGS=""
    JAVAPLUGINFLAGS=""
else
    AC_MSG_RESULT(no)
    JAVAC=""
    JAVA_TARGET=""
    JAR=""
    JAVAFLAGS=""
    JAVAPLUGINFLAGS=""
fi
AC_SUBST(JAVAC)
AC_SUBST(JAVA_TARGET)
AC_SUBST(JAR)
AC_SUBST(JAVAFLAGS)
AC_SUBST(JAVAPLUGINFLAGS)

hrchilds's avatar
hrchilds committed
1191 1192 1193 1194 1195 1196 1197 1198 1199 1200
#
# Check if the help directory is present.
#
if test -d help; then
    HELP="help"
else
    HELP=""
fi
AC_SUBST(HELP)

hrchilds's avatar
hrchilds committed
1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265
#
# Check to see if we should build all of the plugins.
#
AC_ARG_ENABLE(buildall,
  [  --enable-buildall       build all plugins],
  buildall="all", buildall=base)

AC_MSG_CHECKING([which plot plugins to build])
AC_ARG_WITH(plots,
            [  --with-plots=all,base   What plot plugins to build (overrides --enable-buildall)],
            ,
            withval=$buildall)
case $withval in
    all)
        PLOT_OPTIONAL_DIRS="$""(OPTIONAL)"
        AC_MSG_RESULT([all])
        ;;
    base)
        PLOT_OPTIONAL_DIRS=""
        AC_MSG_RESULT([base only])
        ;;
    *)
        AC_MSG_ERROR([Please specify one of "all" or "base" for --with-plots.])
        PLOT_OPTIONAL_DIRS="error"
esac
AC_SUBST(PLOT_OPTIONAL_DIRS)

AC_MSG_CHECKING([which operator plugins to build])
AC_ARG_WITH(operators,
            [  --with-operators=all,base What operator plugins to build (overrides --enable-buildall)],
            ,
            withval=$buildall)
case $withval in
    all)
        OPERATOR_OPTIONAL_DIRS="$""(OPTIONAL)"
        AC_MSG_RESULT([all])
        ;;
    base)
        OPERATOR_OPTIONAL_DIRS=""
        AC_MSG_RESULT([base only])
        ;;
    *)
        AC_MSG_ERROR([Please specify one of "all" or "base" for --with-operators.])
esac
AC_SUBST(OPERATOR_OPTIONAL_DIRS)

AC_MSG_CHECKING([which database plugins to build])
AC_ARG_WITH(dbs,
            [  --with-dbs=all,base     What database plugins to build (overrides --enable-buildall)],
            ,
            withval=$buildall)
case $withval in
    all)
        DB_OPTIONAL_DIRS="$""(OPTIONAL)"
        AC_MSG_RESULT([all])
        ;;
    base)
        DB_OPTIONAL_DIRS=""
        AC_MSG_RESULT([base only])
        ;;
    *)
        AC_MSG_ERROR([Please specify one of "all" or "base" for --with-dbs.])
esac
AC_SUBST(DB_OPTIONAL_DIRS)

hrchilds's avatar
hrchilds committed
1266 1267 1268 1269 1270 1271 1272
dnl
dnl Disable building bzip2. Only necessary if bzip2 won't buid somewhere 
dnl
AC_ARG_ENABLE(bzip2,
   [  --disable-bzip2         do not build or use bzip2 library -- disables compression],
   Usebzip2="$enable_bzip2", Usebzip2=yes)
BUILD_BZIP2=""
hrchilds's avatar
hrchilds committed
1273
BZIP2_LIBS=""
hrchilds's avatar
hrchilds committed
1274 1275 1276
if test "$Usebzip2" = "yes"; then
    BUILD_BZIP2="bzip2"
    AC_DEFINE(HAVE_LIBBZ2)
hrchilds's avatar
hrchilds committed
1277
    BZIP2_LIBS="-lbz2"
hrchilds's avatar
hrchilds committed
1278 1279
fi
AC_SUBST(BUILD_BZIP2)
hrchilds's avatar
hrchilds committed
1280
AC_SUBST(BZIP2_LIBS)
hrchilds's avatar
hrchilds committed
1281

hrchilds's avatar
hrchilds committed
1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292
dnl
dnl Make note if no CXXFLAGS have STILL yet been specified; this is the
dnl same check as for emptycxxflags above, except it is possible that a
dnl config-site file added some, in which case we need to append, not
dnl replace, the cxxflags.
dnl
defaultcxxflags="no"
if test -z "$CXXFLAGS"; then
    defaultcxxflags="yes"
fi

hrchilds's avatar
hrchilds committed
1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305
# Check for programs.
# We shouldn't depend on too many!
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_CC
AC_PROG_CPP

# Keep checking for programs.
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_CHECK_PROG(MAKEDEPEND,makedepend,makedepend)
AC_ISC_POSIX

hrchilds's avatar
hrchilds committed
1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317
dnl
dnl If they didn't specify any CXXFLAGS through an environment variable,
dnl then we should choose optimized for them.
dnl
if test $emptycxxflags = "yes"; then
    if test $defaultcxxflags = "yes"; then
        CXXFLAGS="-O2"
    else
        CXXFLAGS="-O2 $CXXFLAGS"
    fi
fi

hrchilds's avatar
hrchilds committed
1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368
# Check to see if we're running clearmake.
# If we are, set the build verbosity to 0 so that output won't mess up the rest
# of "configure".
AC_MSG_CHECKING(for clearmake)
if test "`${MAKE-make} -version 2>/dev/null | cut -d' ' -f1`" = "clearmake"; then
    AC_MSG_RESULT(yes)
    CLEARCASE_BLD_VERBOSITY=0; export CLEARCASE_BLD_VERBOSITY
else
    AC_MSG_RESULT(no)
fi
# Set the compilation rule to include the OS, so that clearmake won't wink
# in object files across OSes.
#
# Note that the first character in the OS_RULE is a tab.  Don't change this 
# to spaces; it's used in the Makefiles.
OS_RULE="	: $OS_type"
AC_SUBST(OS_RULE)

dnl We always use the install-sh script, so don't uncomment the following line.
dnl AC_PROG_INSTALL

#
# Check for C++ specific features.
#
AC_LANG_CPLUSPLUS

dnl Check for bool type.
AC_MSG_CHECKING(C++ for bool)
AC_TRY_COMPILE(, bool t=true;bool f=false, AC_MSG_RESULT(yes),
  AC_MSG_RESULT(no)
  CPPFLAGS=$CPPFLAGS" -Dbool=int -Dtrue=1 -Dfalse=0"
  AC_SUBST(CPPFLAGS))

dnl Check for exceptions
AC_MSG_CHECKING(C++ for exceptions)
AC_TRY_COMPILE(, try{int a = 5;}catch(...){int b=2;}, AC_MSG_RESULT(yes)
  HAVE_EXCEPTIONS="yes",
  AC_MSG_RESULT(no)
  HAVE_EXCEPTIONS="false")

dnl Check for the prototype for ftime in "sys/timeb.h".
AC_MSG_CHECKING(for prototype for ftime)
AC_TRY_COMPILE([#include <sys/time.h>
                #include <sys/timeb.h>],
               [struct timeb *tp; ftime(tp)],
               AC_MSG_RESULT(yes)
               AC_DEFINE(HAVE_FTIME_PROTOTYPE),
               AC_MSG_RESULT(no))
               
dnl Check for setbuf in streambuf
AC_MSG_CHECKING(for setbuf)
hrchilds's avatar
hrchilds committed
1369 1370
AC_TRY_COMPILE([#include <fstream>],
                [fstream out("/dev/null",std::ios::out); out.rdbuf()->setbuf((char*)0,0);],
hrchilds's avatar
hrchilds committed
1371 1372 1373 1374 1375 1376
                AC_MSG_RESULT(yes),
                AC_MSG_RESULT(no)
                AC_DEFINE(NO_SETBUF))

dnl Check for ios::noreplace
AC_MSG_CHECKING(for ios::noreplace)
hrchilds's avatar
hrchilds committed
1377 1378
AC_TRY_COMPILE([#include <fstream>],
               [ofstream f("dummy",std::ios::out|std::ios::noreplace);],
hrchilds's avatar
hrchilds committed
1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400
               AC_MSG_RESULT(yes)
               AC_DEFINE(HAVE_IOS_NOREPLACE),
               AC_MSG_RESULT(no))
               
AC_LANG_C


#
# Check for use of PTYs
#
AC_MSG_CHECKING(whether to use PTYs)
AC_ARG_WITH(pty,
	[  --without-pty           Disable PTY use],
        USE_PTY=$withval,
        USE_PTY="yes")
AC_MSG_RESULT($USE_PTY)

if test "$USE_PTY" = "yes"; then
    AC_DEFINE(USE_PTY)

    # Check for SYSV versus BSD style pseudo-ttys
    AC_MSG_CHECKING(for SYSV vs BSD style ptys)
hrchilds's avatar
hrchilds committed
1401
    if test "$UNAME" = "Linux" || test "$UNAME" = "AIX" || test "$UNAME" = "Darwin"; then
hrchilds's avatar
hrchilds committed
1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412
        AC_MSG_RESULT(BSD)
    else
        AC_TRY_LINK([#include <stdlib.h>], grantpt(0),
            AC_MSG_RESULT(SYSV)
            AC_DEFINE(PTY_SYSV),
            AC_MSG_RESULT(BSD))
    fi

fi

#
hrchilds's avatar
hrchilds committed
1413
# Check for -ldl if we're on SunOS or linux.
hrchilds's avatar
hrchilds committed
1414 1415
#
AC_MSG_CHECKING(for Linux and -ldl)
hrchilds's avatar
hrchilds committed
1416
if test "$UNAME" = "Linux" || test "$UNAME" = "SunOS"; then
hrchilds's avatar
hrchilds committed
1417 1418 1419 1420 1421 1422 1423 1424 1425
    AC_CHECK_LIB(dl, main,   LIBS="-ldl $LIBS")
else
    AC_MSG_RESULT(no)
fi

#
# We need to check for the networking libraries on SunOS
#
AC_MSG_CHECKING(for SunOS and -lnsl)
hrchilds's avatar
hrchilds committed
1426
if test "$UNAME" = "SunOS"; then
hrchilds's avatar
hrchilds committed
1427 1428 1429 1430 1431
    AC_CHECK_LIB(nsl, main,   LIBS="-lnsl $LIBS")
else
    AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for SunOS and -lsocket)
hrchilds's avatar
hrchilds committed
1432
if test "$UNAME" = "SunOS"; then
hrchilds's avatar
hrchilds committed
1433 1434 1435 1436 1437
    AC_CHECK_LIB(socket, main,   LIBS="-lsocket $LIBS")
else
    AC_MSG_RESULT(no)
fi
AC_MSG_CHECKING(for SunOS and -lresolv)
hrchilds's avatar
hrchilds committed
1438
if test "$UNAME" = "SunOS"; then
hrchilds's avatar
hrchilds committed
1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475
    AC_CHECK_LIB(resolv, main,   LIBS="-lresolv $LIBS")
else
    AC_MSG_RESULT(no)
fi

#
# Check if socklen_t is a type.
#
AC_MSG_CHECKING(for socklen_t)
AC_TRY_COMPILE([#include <sys/types.h>
                #include <sys/socket.h>],
               [socklen_t dummy;],
               AC_MSG_RESULT(yes)
               AC_DEFINE(HAVE_SOCKLEN_T),
               AC_MSG_RESULT(no))


#
# Check for non-graphics libraries in the reverse order that they
# are needed.  The libraries are added to the beginning of `LIBS'.
#
AC_CHECK_LIB(m,        main,      LIBS="-lm $LIBS")

dnl  Is zlib present?
dnl
dnl  It's required if hdf5 was compiled with deflate support. Normally check
dnl  for zlib.h and libz.a but skip the test if `--without-zlib' is specified.
dnl  Alternate directories can be specified for the header and library by
dnl  giving names like this `--with-zlib=INC,LIB' (if only the LIB directory
dnl  is supplied then it must still be preceded by a comma).
dnl

saved_CPPFLAGS="$CPPFLAGS"
saved_CFLAGS="$CFLAGS"
saved_LDFLAGS="$LDFLAGS"
saved_LIBS="$LIBS"

hrchilds's avatar
hrchilds committed
1476
AC_ARG_WITH(zlib,[  --with-zlib=INC-DIR,LIB-DIR     Use the GNU zlib compression],
hrchilds's avatar
hrchilds committed
1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508
            ,withval=yes)
case $withval in
    yes)
	#
	# Header
	#

        AC_CHECK_HEADERS(zlib.h)
        AC_CHECK_LIB(z, compress2,
				   ZLIB_LIB="-lz $ZLIB_LIB"
				   AC_DEFINE(HAVE_LIBZ)
		    )
        ;;
    no)
        AC_MSG_CHECKING(for GNU zlib)
        AC_MSG_RESULT(suppressed)
        ;;
    *)
	#
	# Header
	#

        zlib_inc="`echo $withval |cut -f1 -d,`"
        if test "X" != "$zlib_inc"; then
            CPPFLAGS="$CPPFLAGS -I$zlib_inc"
	    AC_CHECK_HEADERS(zlib.h,ZLIB_INCLUDE="-I$zlib_inc $ZLIB_INCLUDE")
	    CPPFLAGS="$saved_CPPFLAGS"
        else
            AC_CHECK_HEADERS(zlib.h)
        fi

        zlib_lib="`echo $withval |cut -f2 -d, -s`"
hrchilds's avatar
hrchilds committed
1509
        if test "X" != "$zlib_lib"; then
hrchilds's avatar
hrchilds committed
1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541
	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE"
            LDFLAGS="$LDFLAGS -L$zlib_lib"
	    AC_CHECK_LIB(z, compress2,
				       ZLIB_LIB="-L$zlib_lib -lz $ZLIB_LIB"
				       AC_DEFINE(HAVE_LIBZ)
			)
	    LIBS="$saved_LIBS"
	    LDFLAGS="$saved_LDFLAGS"
	    CPPFLAGS="$saved_CPPFLAGS"
        else
	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE"
            AC_CHECK_LIB(z, compress2,
				       ZLIB_LIB="-lz $ZLIB_LIB"
				       AC_DEFINE(HAVE_LIBZ)
		        )
	    LIBS="$saved_LIBS"
	    CPPFLAGS="$saved_CPPFLAGS"
        fi
        ;;
esac
AC_SUBST(ZLIB_INCLUDE)
AC_SUBST(ZLIB_LIB)

dnl
dnl  Is HDF5 present?
dnl
dnl  It's needed for the SAF driver. Normally check for hdf5.h and libhdf5.a but
dnl  skip the test if `--without-hdf5' is specified. Alternate directories can
dnl  be specified for hdf5.h and/or libhdf5.a by giving the names like this:
dnl  `--with-hdf5=INC,LIB' (if only the LIB directory is given then it must
dnl  still be preceded by a comma).
dnl
hrchilds's avatar
hrchilds committed
1542 1543 1544
dnl  Note that in order to force libhdf5 to link statically, we do something
dnl  funny and define HDF5_LIB to be the path to the .a file
dnl
hrchilds's avatar
hrchilds committed
1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557
dnl  Note that testing for HDF5 may require the use of ZLIB.
dnl

saved_CPPFLAGS="$CPPFLAGS"
saved_CFLAGS="$CFLAGS"
saved_LDFLAGS="$LDFLAGS"
saved_LIBS="$LIBS"

AC_MSG_CHECKING(for HDF5)
HDF5=""
HDF5_INCLUDE=""
HDF5_LIB=""
AC_ARG_WITH(hdf5,
hrchilds's avatar
hrchilds committed
1558
	    [  --with-hdf5=INC-DIR,LIB-DIR     Location of HDF5 header and library],
hrchilds's avatar
hrchilds committed
1559 1560 1561
           hdf5_specified="yes",
           hdf5_specified="no"
           )
hrchilds's avatar
hrchilds committed
1562 1563 1564 1565 1566
if test "$SHORT_UNAME" = "darwin"; then
    H5_LIBEXT="dylib"
else
    H5_LIBEXT="a"
fi
hrchilds's avatar
hrchilds committed
1567 1568
if test "$hdf5_specified" = "yes"; then
   if test "$withval" != "no"; then
hrchilds's avatar
hrchilds committed
1569
      HDF5_INCLUDE="-I`echo $withval |cut -f1 -d,`"
hrchilds's avatar
hrchilds committed
1570
      HDF5_LIB="`echo $withval |cut -f2 -d, -s`/libhdf5.$H5_LIBEXT"
hrchilds's avatar
hrchilds committed
1571 1572 1573 1574 1575 1576
   fi
else
   if test "$DEFAULT_HDF5_INCLUDE" != "" ; then
      HDF5_INCLUDE="-I$DEFAULT_HDF5_INCLUDE $HDF5_INCLUDE"
   fi
   if test "$DEFAULT_HDF5_LIB" != "" ; then
hrchilds's avatar
hrchilds committed
1577
      HDF5_LIB="$DEFAULT_HDF5_LIB/libhdf5.$H5_LIBEXT $HDF5_LIB"
hrchilds's avatar
hrchilds committed
1578 1579 1580 1581 1582 1583
   fi
fi
if test "$HDF5_LIB" != "" ; then
   if test "$HDF5_INCLUDE" != "" ; then
      HDF5="$""(HDF5)"
      AC_MSG_RESULT(yes)
hrchilds's avatar
hrchilds committed
1584 1585
      AC_DEFINE(HAVE_HDF5_H)
      AC_DEFINE(HAVE_LIBHDF5)
hrchilds's avatar
hrchilds committed
1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615
   else
      AC_MSG_RESULT(no)
   fi
else
   AC_MSG_RESULT(no)
fi
AC_SUBST(HDF5)
AC_SUBST(HDF5_INCLUDE)
AC_SUBST(HDF5_LIB)

dnl
dnl  Are the VBT and DSL libraries present?
dnl
dnl  It's needed for the SAF driver. Normally check for dsl.h, vbt.h, libdsl.a,
dnl  and libvbt.a but skip the test if `--without-vbt' is specified. Alternate
dnl  directories can be specified for dsl.h, vbt.h and/or libdsl.a, libhdf5.a by
dnl  giving the names like this: `--with-hdf5=INC,LIB' (note that if only the
dnl  LIB directory is specified then it must still be preceded by a comma).
dnl  Both DSL and VBT always come as a pair so it's only necessary to specify
dnl  the vbt locations.
dnl
dnl  Note that testing for VBT/DSL requires the use of HDF and ZLIB.
dnl

saved_CPPFLAGS="$CPPFLAGS"
saved_CFLAGS="$CFLAGS"
saved_LDFLAGS="$LDFLAGS"
saved_LIBS="$LIBS"

AC_ARG_WITH(vbt,
hrchilds's avatar
hrchilds committed
1616
	    [  --with-vbt=INC-DIR,LIB-DIR      Location of VBT/DSL headers and libraries],
hrchilds's avatar
hrchilds committed
1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757
	    ,withval=yes)
case $withval in
    yes)
	#
	# Header
	#

	CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE"
	AC_CHECK_HEADERS(dsl.h)
	AC_CHECK_HEADERS(vbt.h)
	CPPFLAGS="$saved_CPPFLAGS"

	#
	# Library
	#

	CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE"
	AC_CHECK_LIB(dsl, DSL_open_file,
					 VBT_LIB="-ldsl $VBT_LIB"
					 AC_DEFINE(HAVE_LIBDSL)
				       ,
		    , $HDF5_LIB $ZLIB_LIB
		    )
	CPPFLAGS="$saved_CPPFLAGS"
	CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE"
	AC_CHECK_LIB(vbt, VBT_Open,
				    VBT_LIB="-lvbt $VBT_LIB"
				    AC_DEFINE(HAVE_LIBVBT)
				  ,
		    , $VBT_LIB $HDF5_LIB $ZLIB_LIB
		    )
	CPPFLAGS="$saved_CPPFLAGS"
	LIBS="$saved_LIBS"
	;;
    no)
	AC_MSG_CHECKING(for vbt/dsl)
	AC_MSG_RESULT(suppressed)
	;;
    *)
	#
	# Header
	#

	vbt_inc="`echo $withval |cut -f1 -d,`"
	if test "X" != "$vbt_inc"; then
	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE -I$vbt_inc"
	    AC_CHECK_HEADERS(dsl.h,found_dsl=true,found_dsl=false)
	    AC_CHECK_HEADERS(vbt.h,found_vbt=true,found_vbt=false)
	    if test $found_dsl = true; then
		if test $found_dsl = true; then
		    VBT_INCLUDE="-I$vbt_inc $VBT_INCLUDE"
		fi
	    fi
	    CPPFLAGS="$saved_CPPFLAGS"
	else
	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE"
	    AC_CHECK_HEADERS(dsl.h)
	    AC_CHECK_HEADERS(vbt.h)
	    CPPFLAGS="$saved_CPPFLAGS"
	fi

	#
	# Library
	#

	vbt_lib="`echo $withval |cut -f2 -d, -s`"
	if test "X" != "$vbt_lib"; then
	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE $VBT_INCLUDE"
	    LDFLAGS="$LDFLAGS -L$vbt_lib"
	    AC_CHECK_LIB(dsl,DSL_open_file,found_dsl=true,found_dsl=false,$HDF5_LIB $ZLIB_LIB)
	    if test $found_dsl = true; then
	       VBT_TMP_LIB="-ldsl"
	    fi
	    LIBS="$saved_LIBS"
	    LDFLAGS="$saved_LDFLAGS"
	    CPPFLAGS="$saved_CPPFLAGS"

	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE $VBT_INCLUDE"
	    LDFLAGS="$LDFLAGS -L$vbt_lib"
	    AC_CHECK_LIB(vbt,VBT_Open,found_vbt=true,found_vbt=false,$VBT_TMP_LIB $HDF5_LIB $ZLIB_LIB)
	    LIBS="$saved_LIBS"
	    LDFLAGS="$saved_LDFLAGS"
	    CPPFLAGS="$saved_CPPFLAGS"
	    if test $found_vbt = true; then
		AC_DEFINE(HAVE_LIBVBT)
		if test $found_dsl = true; then
		    VBT_LIB="-L$vbt_lib -lvbt -ldsl"
		    AC_DEFINE(HAVE_LIBDSL)
		else
		    VBT_LIB="-L$vbt_lib -lvbt"
		fi
	    else
		if test $found_dsl = true; then
		    VBT_LIB="-L$vbt_lib -ldsl"
		    AC_DEFINE(HAVE_LIBDSL)
		else
		    VBT_LIB=""
		fi
	    fi
	else
	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE $VBT_INCLUDE"
	    AC_CHECK_LIB(dsl,DSL_open_file,found_dsl=true,$HDF5_LIB $ZLIB_LIB)
	    CPPFLAGS="$saved_CPPFLAGS"
	    LIBS="$saved_LIBS"
	    if test $found_dsl = true; then
		VBT_LIB="-ldsl $VBT_LIB"
		AC_DEFINE(HAVE_LIBDSL)
	    fi
	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE $VBT_INCLUDE"
	    AC_CHECK_LIB(vbt,VBT_Open,found_vbt=true,,$VBT_LIB $HDF5_LIB $ZLIB_LIB)
	    if test $found_vbt = true; then
		VBT_LIB="-lvbt $VBT_LIB"
		AC_DEFINE(HAVE_LIBVBT)
	    fi
	    CPPFLAGS="$saved_CPPFLAGS"
	    LIBS="$saved_LIBS"
	fi
	;;
esac
AC_SUBST(VBT_INCLUDE)
AC_SUBST(VBT_LIB)

dnl
dnl  Is the SAF library present?
dnl
dnl  It's needed for the SAF driver. Normally check for saf.h and libsafapi.a
dnl  but skip the test if `--without-saf' is specified. Alternate directories
dnl  can be specified for saf.h and/or libsafapi.a by giving the names like
dnl  this: `--with-saf=INC,LIB' (note that if only the LIB directory is
dnl  specified then it must still be preceded by a comma).
dnl
dnl  Note that testing for SAF requires the use of VBT/DSL, HDF, and ZLIB.
dnl

saved_CPPFLAGS="$CPPFLAGS"
saved_CFLAGS="$CFLAGS"
saved_LDFLAGS="$LDFLAGS"
saved_LIBS="$LIBS"

SAF=""
AC_ARG_WITH(saf,
hrchilds's avatar
hrchilds committed
1758
	    [  --with-saf=INC-DIR,LIB-DIR      Location of SAF headers and libraries],
hrchilds's avatar
hrchilds committed
1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843
	    ,withval=yes)
case $withval in
    yes)
	#
	# Header
	#

	CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE $VBT_INCLUDE"
	AC_CHECK_HEADERS(saf.h)
	CPPFLAGS="$saved_CPPFLAGS"

	#
	# Library
	#

	CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE $VBT_INCLUDE"
	AC_CHECK_LIB(safapi, saf_open_database,
						SAF_LIB="-lsafapi $SAF_LIB"
                                                SAF="$""(SAF)"
					      ,
		    ,$VBT_LIB $HDF5_LIB $ZLIB_LIB
		    )
	LIBS="$saved_LIBS"
	CPPFLAGS="$saved_CPPFLAGS"
	;;
    no)
	AC_MSG_CHECKING(for safapi)
	AC_MSG_RESULT(suppressed)
	;;
    *)
	#
	# Header
	#

	saf_inc="`echo $withval |cut -f1 -d,`"
	if test "X" != "$saf_inc"; then
	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE $VBT_INCLUDE -I$saf_inc"
	    AC_CHECK_HEADERS(saf.h,SAF_INCLUDE="-I$saf_inc $SAF_INCLUDE")
	    CPPFLAGS="$saved_CPPFLAGS"
	else
	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE $VBT_INCLUDE"
	    AC_CHECK_HEADERS(saf.h)
	    CPPFLAGS="$saved_CPPFLAGS"
	fi

	#
	# Library
	#

	saf_lib="`echo $withval |cut -f2 -d, -s`"
	if test "X" != "$saf_lib"; then
	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE $VBT_INCLUDE $SAF_INCLUDE"
	    LDFLAGS="-L$saf_lib $LDFLAGS"
	    AC_CHECK_LIB(safapi, saf_open_database,
						    SAF_LIB="-L$saf_lib -lsafapi $SAF_LIB"
                                                    SAF="$""(SAF)"
						  ,
			,$VBT_LIB $HDF5_LIB $ZLIB_LIB
			)
	    LIBS="$saved_LIBS"
	    LDFLAGS="$saved_LDFLAGS"
	    CPPFLAGS="$saved_CPPFLAGS"
	else
	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE $HDF5_INCLUDE $VBT_INCLUDE $SAF_INCLUDE"
	    AC_CHECK_LIB(safapi, saf_open_database,
						    SAF_LIB="-lsafapi $SAF_LIB"
                                                    SAF="$""(SAF)"
						  ,
			,$VBT_LIB $HDF5_LIB $ZLIB_LIB
			)
	    LIBS="$saved_LIBS"
	    LDFLAGS="$saved_LDFLAGS"
	    CPPFLAGS="$saved_CPPFLAGS"
	fi
	;;
esac
AC_SUBST(SAF)
AC_SUBST(SAF_INCLUDE)
AC_SUBST(SAF_LIB)

dnl
#
# Check for the public SILO includes since that's what we'll use.
#
AC_ARG_WITH(silo_include,
hrchilds's avatar
hrchilds committed
1844
	[  --with-silo_include=<INC-DIR>     User-specified SILO include directory],
hrchilds's avatar
hrchilds committed
1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890
	silo_include=$withval,
	silo_include="")
AC_MSG_CHECKING(for SILO include files)
if test -n "$silo_include"; then
    SILO_INCLUDE="-I`echo $silo_include|sed 's/ 	*/ -I/g'`"
    AC_MSG_RESULT(user specified ("$SILO_INCLUDE"))
else
    dnl
    dnl Look for the SILO includes. First check to see if the DEFAULT_SILO_INCLUDES
    dnl environment variable is set. If it is then try to use those SILO includes.
    dnl
    silo_keep_checking="yes"
    if test -n "$DEFAULT_SILO_INCLUDES"; then
        if test -r "$DEFAULT_SILO_INCLUDES/silo.h"; then
            SILO_INCLUDE="-I$DEFAULT_SILO_INCLUDES"
            AC_MSG_RESULT(user specified ("$SILO_INCLUDE"))
            silo_keep_checking="no"
        fi
    fi

    dnl
    dnl The DEFAULT_SILO_INCLUDES variable was not set or it was not valid.
    dnl Check for SILO includes in some of the usual places.
    dnl
    if test "$silo_keep_checking" = "yes"; then
        if test -r "/usr/local/apps/include/silo.h"; then
            SILO_INCLUDE="-I/usr/local/apps/include"
            AC_MSG_RESULT(using /usr/local/apps/include)
        elif test -r "/usr/local/meshtv/include/silo.h"; then
            SILO_INCLUDE="-I/usr/local/meshtv/include"
            AC_MSG_RESULT(using /usr/local/meshtv/include)
        elif test -r "/usr/local/apps/meshtv/include/silo.h"; then
            SILO_INCLUDE="-I/usr/local/apps/meshtv/include"
            AC_MSG_RESULT(using /usr/local/apps/meshtv/include)
        else
            AC_MSG_ERROR([The SILO include files could not be found. Please provide
    --with-silo-include=directory and rerun 'configure'.])
        fi
    fi
fi
AC_SUBST(SILO_INCLUDE)

#
# Check for the public SILO library since that's what we'll use.
#
AC_ARG_WITH(silo_library,
hrchilds's avatar
hrchilds committed
1891
	[  --with-silo_library=<LIB-DIR>     User-specified SILO library directory],
hrchilds's avatar
hrchilds committed
1892 1893 1894 1895 1896
	silo_library=$withval,
	silo_library="")
AC_MSG_CHECKING(for SILO library)
if test -n "$silo_library"; then
    SILO_LIB="-L`echo $silo_library|sed 's/  */ -L/g'` -lsilo"
hrchilds's avatar
hrchilds committed
1897
    SILO_LIBDIR="$silo_library"
hrchilds's avatar
hrchilds committed
1898 1899
    AC_MSG_RESULT(user specified ("$SILO_LIB"))
else
hrchilds's avatar
hrchilds committed
1900 1901 1902 1903 1904 1905 1906
    dnl On Darwin, we build Silo as a shared library.
    if test "$SHORT_UNAME" = "darwin"; then
        LIBSILO="libsilo.dylib"
    else
        LIBSILO="libsilo.a"
    fi

hrchilds's avatar
hrchilds committed
1907 1908 1909 1910 1911 1912
    dnl
    dnl Look for the SILO library. First chech to see if the DEFAULT_SILO_LIBRARY
    dnl environment variable is set. If it is then try to use that SILO lib.
    dnl
    silo_keep_checking="yes"
    if test -n "$DEFAULT_SILO_LIBRARY"; then
hrchilds's avatar
hrchilds committed
1913 1914 1915
        if test -r "$DEFAULT_SILO_LIBRARY/$LIBSILO"; then
            SILO_LIBDIR="$DEFAULT_SILO_LIBRARY"
            AC_MSG_RESULT(user specified ("$SILO_LIBDIR"))
hrchilds's avatar
hrchilds committed
1916 1917 1918 1919 1920 1921 1922 1923 1924
            silo_keep_checking="no"
        fi
    fi

    dnl
    dnl The DEFAULT_SILO_LIBRARY was not set or it was not valid. Check for SILO
    dnl in some of the usual places.
    dnl
    if test "$silo_keep_checking" = "yes"; then
hrchilds's avatar
hrchilds committed
1925 1926 1927 1928 1929 1930 1931 1932 1933
        if test -r "/usr/local/apps/lib/$LIBSILO"; then
            SILO_LIBDIR="/usr/local/apps/lib"
            AC_MSG_RESULT(using /usr/local/apps/lib/$LIBSILO)
        elif test -r "/usr/local/meshtv/lib/$LIBSILO"; then
            SILO_LIBDIR="/usr/local/meshtv/lib"
            AC_MSG_RESULT(using /usr/local/meshtv/lib/$LIBSILO)
        elif test -r "/usr/local/apps/meshtv/lib/$LIBSILO"; then
            SILO_LIBDIR="/usr/local/apps/meshtv/lib"
            AC_MSG_RESULT(using /usr/local/apps/meshtv/lib/$LIBSILO)
hrchilds's avatar
hrchilds committed
1934 1935 1936 1937 1938
        else
            AC_MSG_ERROR([The SILO library could not be found. Please provide
    --with-silo-library=directory and rerun 'configure'.])
        fi
    fi
hrchilds's avatar
hrchilds committed
1939 1940

    SILO_LIB="-L$SILO_LIBDIR -lsilo"
hrchilds's avatar
hrchilds committed
1941
fi
hrchilds's avatar
hrchilds committed
1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955

#
# Decide whether we should try to use libsiloh5 or just libsilo
# or whether libsilo in turn depends on HDF5
#
if test -n "$HDF5_LIB"; then
    if test -r "$SILO_LIBDIR/libsiloh5.a"; then

        AC_MSG_CHECKING(whether to use libsilo.a or libsiloh5.a)

        saved_CPPFLAGS="$CPPFLAGS"
        saved_LIBS="$LIBS"
	saved_SILO_LIB="$SILO_LIB"

hrchilds's avatar
hrchilds committed
1956
        SILO_LIB="-L$SILO_LIBDIR -lsiloh5 $HDF5_LIB $ZLIB_LIB"
hrchilds's avatar
hrchilds committed
1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990
        CPPFLAGS="$CPPFLAGS $SILO_INCLUDE $HDF5_INCLUDE $ZLIB_INCLUDE"
        LIBS="$SILO_LIB $LIBS"

        AC_TRY_RUN(
            [
	    #include <silo.h>
	    int main()
	    {
	        return DBCreate("junk.silo", DB_CLOBBER,
		           DB_LOCAL, 0, DB_HDF5) == 0;
	    }
            ]
	    ,  have_libsiloh=yes
	    ,  have_libsiloh=no 
        )

	if test "$have_libsiloh" = "yes"; then
            AC_MSG_RESULT(libsiloh5.a)
        else
            AC_MSG_RESULT(libsilo.a)
	    SILO_LIB="$saved_SILO_LIB"
	fi

        LIBS="$saved_LIBS"
        CPPFLAGS="$saved_CPPFLAGS"

    else

        AC_MSG_CHECKING(whether libsilo.a depends on hdf5)

        saved_CPPFLAGS="$CPPFLAGS"
        saved_LIBS="$LIBS"
	saved_SILO_LIB="$SILO_LIB"

hrchilds's avatar
hrchilds committed
1991
        SILO_LIB="$SILO_LIB $HDF5_LIB $ZLIB_LIB"
hrchilds's avatar
hrchilds committed
1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019
        CPPFLAGS="$CPPFLAGS $SILO_INCLUDE $HDF5_INCLUDE $ZLIB_INCLUDE"
        LIBS="$SILO_LIB $LIBS"

        AC_TRY_RUN(
            [
	    #include <silo.h>
	    int main()
	    {
	        return DBCreate("junk.silo", DB_CLOBBER,
		           DB_LOCAL, 0, DB_HDF5) == 0;
	    }
            ]
	    ,  silo_depends_on_hdf5=yes
	    ,  silo_depends_on_hdf5=no 
        )

	if test "$silo_depends_on_hdf5" = "yes"; then
            AC_MSG_RESULT(yes)
        else
            AC_MSG_RESULT(no)
	    SILO_LIB="$saved_SILO_LIB"
	fi

        LIBS="$saved_LIBS"
        CPPFLAGS="$saved_CPPFLAGS"

    fi
fi
hrchilds's avatar
hrchilds committed
2020
AC_SUBST(SILO_LIB)
hrchilds's avatar
hrchilds committed
2021
AC_SUBST(SILO_LIBDIR)
hrchilds's avatar
hrchilds committed
2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087

dnl
dnl Check for exodus libraries
dnl
AC_ARG_WITH(exodus,
            [  --with-exodus[=<DIR>]           enable Exodus driver],
            ,
            withval="unspecified")
AC_MSG_CHECKING(for Exodus support)

case $withval in
  no)
    exodus_enabled="no"
    ;;
  yes)
    exodus_enabled="yes"
    ;;
  unspecified)
    dnl don't do anything yet
    ;;
  *)
    dnl use include and lib directories under where they specified
    if test -d $withval/inc; then
        exodus_inc="$withval/inc"
    else
        exodus_inc="$withval/include"
    fi
    exodus_lib="$withval/lib"
    ;;
esac

dnl
dnl If the VTK exodus reader is not in the distribution then disable
dnl the exodus reader.
dnl
if test ! -d databases/Exodus && test ! -d databases/TimeVaryingExodus; then
    exodus_enabled=no
fi

if test "$exodus_enabled" != "no"; then
    dnl As long as they didn't say "--without-exodus", let them
    dnl manually specify the include and lib directories
    AC_ARG_WITH(exodus-include,
                [  --with-exodus-include[=<DIR>]   specify Exodus include path],
                exodus_inc=$withval)
    AC_ARG_WITH(exodus-lib,
                [  --with-exodus-lib[=<DIR>]       specify Exodus lib path],                    exodus_lib=$withval)

    dnl
    dnl Allow for it to be set by environment variables.
    dnl
    if test -n "$DEFAULT_EXODUS_INCLUDES" && test -z "$exodus_inc" ; then
        exodus_inc="$DEFAULT_EXODUS_INCLUDES"
    fi
    if test -n "$DEFAULT_EXODUS_LIBRARY" && test -z "$exodus_lib" ; then
        exodus_lib="$DEFAULT_EXODUS_LIBRARY"
    fi
    
    if test -n "$exodus_inc" || test -n "$exodus_lib"; then
        exodus_enabled="yes"
    fi
fi

EXODUS=""
EXODUS_FLAGS=""
EXODUS_LIBS=""
hrchilds's avatar
hrchilds committed
2088
EXODUS_LIB=""
hrchilds's avatar
hrchilds committed
2089 2090 2091 2092
if test "$exodus_enabled" = "yes"; then
    EXODUS="$""(EXODUS)"
    EXODUS_FLAGS="$EXODUS_FLAGS -I$exodus_inc"
    EXODUS_LIBS="-L$exodus_lib -lexoIIv2c -lnetcdf"
hrchilds's avatar
hrchilds committed
2093 2094 2095 2096 2097
    if test "$SHORT_UNAME" = "darwin"; then
        EXODUS_LIB="$exodus_lib/libexoIIv2c.dylib"
    else
        EXODUS_LIB="$exodus_lib/libexoIIv2c.a"
    fi
hrchilds's avatar
hrchilds committed
2098 2099 2100 2101 2102 2103
    AC_MSG_RESULT(yes)
else
    AC_MSG_RESULT(no)
fi

AC_SUBST(EXODUS)
hrchilds's avatar
hrchilds committed
2104
AC_SUBST(EXODUS_LIB)
hrchilds's avatar
hrchilds committed
2105 2106 2107 2108
AC_SUBST(EXODUS_LIBS)
AC_SUBST(EXODUS_FLAGS)

#
hrchilds's avatar
hrchilds committed
2109
# See of --with-pdb was specified. Use PDB lite otherwise.
hrchilds's avatar
hrchilds committed
2110 2111 2112 2113 2114
#
AC_MSG_CHECKING(for PDB)
PDB=""
PDB_FLAGS=""
PDB_LIBS=""
hrchilds's avatar
hrchilds committed
2115
PDB_EXEC=""
hrchilds's avatar
hrchilds committed
2116
AC_ARG_WITH(pdb,
hrchilds's avatar
hrchilds committed
2117
	    [  --with-pdb=INC-DIR,LIB-DIR      Location of PDB header and library],
hrchilds's avatar
hrchilds committed
2118 2119 2120 2121 2122 2123 2124 2125
           pdb_specified="yes",
           pdb_specified="no"
           )
if test "$pdb_specified" = "yes"; then
   if test "$withval" != "no"; then
      PDB_FLAGS="-I`echo $withval |cut -f1 -d,`"
      PDB_LIBS="-L`echo $withval |cut -f2 -d, -s` -lpdb -lscore -lpml"
      PDB="$""(PDB)"
hrchilds's avatar
hrchilds committed
2126
      PDB_EXEC="$""(PDBEXEC)"
hrchilds's avatar
hrchilds committed
2127 2128
      AC_DEFINE(HAVE_PDB_PROPER)
      AC_MSG_RESULT(using PDB proper)
hrchilds's avatar
hrchilds committed
2129 2130
   fi
else
hrchilds's avatar
hrchilds committed
2131 2132 2133
   PDB_FLAGS="$SILO_INCLUDE"
   PDB_LIBS="$SILO_LIB"
   PDB="$""(PDB)"
hrchilds's avatar
hrchilds committed
2134
   PDB_EXEC="$""(PDBEXEC)"
hrchilds's avatar
hrchilds committed
2135
   AC_MSG_RESULT(using PDB lite)
hrchilds's avatar
hrchilds committed
2136 2137 2138 2139
fi
AC_SUBST(PDB)
AC_SUBST(PDB_FLAGS)
AC_SUBST(PDB_LIBS)
hrchilds's avatar
hrchilds committed
2140
AC_SUBST(PDB_EXEC)
hrchilds's avatar
hrchilds committed
2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157

#
# Look for Mili.
#
AC_MSG_CHECKING(for Mili)
MILI=""
MILI_FLAGS=""
MILI_LIBS=""
AC_ARG_WITH(mili,
	    [  --with-mili=DIR      Location of Mili header and library],
           mili_specified="yes",
           mili_specified="no"
           )
if test "$mili_specified" = "yes"; then
   if test "$withval" != "no"; then
      MILI_DIR=`echo $withval | cut -f1 -d`
      MILI_FLAGS="-I$MILI_DIR"
hrchilds's avatar
hrchilds committed
2158
      MILI_LIBS="-L$MILI_DIR -lmili"
hrchilds's avatar
hrchilds committed
2159 2160 2161 2162
   fi
else
   if test "$MILI_DIR" != "" ; then
      MILI_FLAGS="-I$MILI_DIR $MILI_FLAGS"
hrchilds's avatar
hrchilds committed
2163
      MILI_LIBS="-L$MILI_DIR -lmili $MILI_LIBS"
hrchilds's avatar
hrchilds committed
2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178
   fi
fi
if test "$MILI_LIBS" != "" ; then
   if test "$MILI_FLAGS" != "" ; then
      MILI="$""(MILI)"
      AC_MSG_RESULT(yes)
   else
      AC_MSG_RESULT(no)
   fi
else
   AC_MSG_RESULT(no)
fi
AC_SUBST(MILI)
AC_SUBST(MILI_FLAGS)
AC_SUBST(MILI_LIBS)
hrchilds's avatar
hrchilds committed
2179
AC_SUBST(MILI_DIR)
hrchilds's avatar
hrchilds committed
2180 2181 2182 2183 2184 2185 2186 2187

#
# Look for HDF4.
#
AC_MSG_CHECKING(for HDF4)
HDF4=""
HDF4_FLAGS=""
HDF4_LIBS=""
hrchilds's avatar
hrchilds committed
2188
HDF4_LIBDIR=""
hrchilds's avatar
hrchilds committed
2189
AC_ARG_WITH(hdf4,
hrchilds's avatar
hrchilds committed
2190
	    [  --with-hdf4=INC-DIR,LIB-DIR      Location of HDF4 header and library],
hrchilds's avatar
hrchilds committed
2191 2192 2193 2194 2195
           hdf4_specified="yes",
           hdf4_specified="no"
           )
if test "$hdf4_specified" = "yes"; then
   if test "$withval" != "no"; then
hrchilds's avatar
hrchilds committed
2196 2197
      HDF4_FLAGS="-I`echo $withval |cut -f1 -d,`"
      HDF4_LIBS="-L`echo $withval |cut -f2 -d, -s`"
hrchilds's avatar
hrchilds committed
2198
      HDF4_LIBDIR="`echo $withval |cut -f2 -d, -s`"
hrchilds's avatar
hrchilds committed
2199 2200 2201 2202 2203 2204
   fi
else
   if test "$DEFAULT_HDF4_FLAGS" != "" ; then
      HDF4_FLAGS="-I$DEFAULT_HDF4_FLAGS $HDF4_FLAGS"
   fi
   if test "$DEFAULT_HDF4_LIBS" != "" ; then
hrchilds's avatar
hrchilds committed
2205 2206 2207 2208 2209
      if test "$SHORT_UNAME" = "darwin"; then
          HDF4_LIBS="-L$DEFAULT_HDF4_LIBS -lmfhdf -ldf -lvtkjpeg -lz $HDF4_LIBS"
      else
          HDF4_LIBS="-L$DEFAULT_HDF4_LIBS -lmfhdf -ldf -ljpeg -lz $HDF4_LIBS"
      fi
hrchilds's avatar
hrchilds committed
2210
      HDF4_LIBDIR="$DEFAULT_HDF4_LIBS"
hrchilds's avatar
hrchilds committed
2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225
   fi
fi
if test "$HDF4_LIBS" != "" ; then
   if test "$HDF4_FLAGS" != "" ; then
      HDF4="$""(HDF4)"
      AC_MSG_RESULT(yes)
   else
      AC_MSG_RESULT(no)
   fi
else
   AC_MSG_RESULT(no)
fi
AC_SUBST(HDF4)
AC_SUBST(HDF4_FLAGS)
AC_SUBST(HDF4_LIBS)
hrchilds's avatar
hrchilds committed
2226
AC_SUBST(HDF4_LIBDIR)
hrchilds's avatar
hrchilds committed
2227 2228 2229 2230 2231 2232 2233 2234 2235

#
# Look for Boxlib2D.
#
AC_MSG_CHECKING(for Boxlib2D)
BOXLIB2D=""
BOXLIB2D_INCLUDE=""
BOXLIB2D_LIBS=""
AC_ARG_WITH(boxlib2d,
hrchilds's avatar
hrchilds committed
2236
	    [  --with-boxlib2d=INC-DIR,LIB-DIR      Location of Boxlib2D header and library],
hrchilds's avatar
hrchilds committed
2237 2238 2239 2240 2241
           boxlib2d_specified="yes",
           boxlib2d_specified="no"
           )
if test "$boxlib2d_specified" = "yes"; then
   if test "$withval" != "no"; then
hrchilds's avatar
hrchilds committed
2242 2243
      BOXLIB2D_INCLUDE="-I`echo $withval |cut -f1 -d,`"
      BOXLIB2D_LIBS="-L`echo $withval |cut -f2 -d, -s`"
hrchilds's avatar
hrchilds committed
2244 2245 2246 2247 2248 2249
   fi
else
   if test "$DEFAULT_BOXLIB2D_INCLUDE" != "" ; then
      BOXLIB2D_INCLUDE="-I$DEFAULT_BOXLIB2D_INCLUDE $BOXLIB2D_INCLUDE"
   fi
   if test "$DEFAULT_BOXLIB2D_LIBS" != "" ; then
hrchilds's avatar
hrchilds committed
2250
      BOXLIB2D_LIBS="-L$DEFAULT_BOXLIB2D_LIBS -lbox2D"
hrchilds's avatar
hrchilds committed
2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275
   fi
fi
if test "$BOXLIB2D_LIBS" != "" ; then
   if test "$BOXLIB2D_INCLUDE" != "" ; then
      BOXLIB2D="$""(BOXLIB2D)"
      AC_MSG_RESULT(yes)
   else
      AC_MSG_RESULT(no)
   fi
else
   AC_MSG_RESULT(no)
fi
AC_SUBST(BOXLIB2D)
AC_SUBST(BOXLIB2D_INCLUDE)
AC_SUBST(BOXLIB2D_LIBS)


#
# Look for Boxlib3D.
#
AC_MSG_CHECKING(for Boxlib3D)
BOXLIB3D=""
BOXLIB3D_INCLUDE=""
BOXLIB3D_LIBS=""
AC_ARG_WITH(boxlib3d,
hrchilds's avatar
hrchilds committed
2276
	    [  --with-boxlib3d=INC-DIR,LIB-DIR      Location of Boxlib3D header and library],
hrchilds's avatar
hrchilds committed
2277 2278 2279 2280 2281
           boxlib3d_specified="yes",
           boxlib3d_specified="no"
           )
if test "$boxlib3d_specified" = "yes"; then
   if test "$withval" != "no"; then
hrchilds's avatar
hrchilds committed
2282 2283
      BOXLIB3D_INCLUDE="-I`echo $withval |cut -f1 -d,`"
      BOXLIB3D_LIBS="-L`echo $withval |cut -f2 -d, -s`"
hrchilds's avatar
hrchilds committed
2284 2285 2286 2287 2288 2289
   fi
else
   if test "$DEFAULT_BOXLIB3D_INCLUDE" != "" ; then
      BOXLIB3D_INCLUDE="-I$DEFAULT_BOXLIB3D_INCLUDE $BOXLIB3D_INCLUDE"
   fi
   if test "$DEFAULT_BOXLIB3D_LIBS" != "" ; then
hrchilds's avatar
hrchilds committed
2290
      BOXLIB3D_LIBS="-L$DEFAULT_BOXLIB3D_LIBS -lbox3D"
hrchilds's avatar
hrchilds committed
2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306
   fi
fi
if test "$BOXLIB3D_LIBS" != "" ; then
   if test "$BOXLIB3D_INCLUDE" != "" ; then
      BOXLIB3D="$""(BOXLIB3D)"
      AC_MSG_RESULT(yes)
   else
      AC_MSG_RESULT(no)
   fi
else
   AC_MSG_RESULT(no)
fi
AC_SUBST(BOXLIB3D)
AC_SUBST(BOXLIB3D_INCLUDE)
AC_SUBST(BOXLIB3D_LIBS)

hrchilds's avatar
hrchilds committed
2307 2308 2309 2310 2311 2312 2313 2314
#
# Look for ViSUS 
#
AC_MSG_CHECKING(for ViSUS)
VISUS=""
VISUS_INCLUDE=""
VISUS_LIB=""
AC_ARG_WITH(visus,
hrchilds's avatar
hrchilds committed
2315
            [  --with-visus=INC-DIR,LIB-DIR      Location of ViSUS header and library],
hrchilds's avatar
hrchilds committed
2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344
           visus_specified="yes",
           visus_specified="no"
           )
if test "$visus_specified" = "yes"; then
   if test "$withval" != "no"; then
      VISUS_INCLUDE="-I`echo $withval |cut -f1 -d,`"
      VISUS_LIB="-L`echo $withval |cut -f2 -d, -s` -lvisusidx -lvisus -lstreaming"
   fi
else
   if test "$DEFAULT_VISUS_INCLUDE" != "" ; then
      VISUS_INCLUDE="-I$DEFAULT_VISUS_INCLUDE"
   fi
   if test "$DEFAULT_VISUS_LIB" != "" ; then
      VISUS_LIB="-L$DEFAULT_VISUS_LIB -lvisusidx -lvisus -lstreaming"
   fi
fi
if test "$VISUS_LIB" != "" ; then
   if test "$VISUS_INCLUDE" != "" ; then
      VISUS="$""(VISUS)"
      AC_MSG_RESULT(yes)
   else
      AC_MSG_RESULT(no)
   fi
else
   AC_MSG_RESULT(no)
fi
AC_SUBST(VISUS)
AC_SUBST(VISUS_INCLUDE)
AC_SUBST(VISUS_LIB)
hrchilds's avatar
hrchilds committed
2345

hrchilds's avatar
hrchilds committed
2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362
#
# Look for netCDF
#
AC_MSG_CHECKING(for netCDF)
NETCDF=""
NETCDF_INCLUDE=""
NETCDF_LIB=""
AC_ARG_WITH(netcdf,
	    [  --with-netcdf=INC-DIR,LIB-DIR     Location of netCDF header and library],
           netcdf_specified="yes",
           netcdf_specified="no"
           )
if test "$SHORT_UNAME" = "darwin"; then
    NETCDF_LIBEXT="dylib"
else
    NETCDF_LIBEXT="a"
fi
hrchilds's avatar
hrchilds committed
2363
if test "$netcdf_specified" = "yes"; then
hrchilds's avatar
hrchilds committed
2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377
   if test "$withval" != "no"; then
      NETCDF_INCLUDE="-I`echo $withval |cut -f1 -d,`"
      NETCDF_LIB="`echo $withval |cut -f2 -d, -s`/libnetcdf.$NETCDF_LIBEXT"
   fi
else
   if test "$DEFAULT_NETCDF_INCLUDE" != "" ; then
      NETCDF_INCLUDE="-I$DEFAULT_NETCDF_INCLUDE $NETCDF_INCLUDE"
   fi
   if test "$DEFAULT_NETCDF_LIB" != "" ; then
      NETCDF_LIB="$DEFAULT_NETCDF_LIB/libnetcdf.$NETCDF_LIBEXT $NETCDF_LIB"
   fi
fi
if test "$NETCDF_LIB" != "" ; then
   if test "$NETCDF_INCLUDE" != "" ; then
hrchilds's avatar
hrchilds committed
2378
      NETCDF="$""(NETCDF)"
hrchilds's avatar
hrchilds committed
2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391
      AC_MSG_RESULT(yes)
      AC_DEFINE(HAVE_NETCDF_H)
      AC_DEFINE(HAVE_LIBNETCDF)
   else
      AC_MSG_RESULT(no)
   fi
else
   AC_MSG_RESULT(no)
fi
AC_SUBST(NETCDF)
AC_SUBST(NETCDF_INCLUDE)
AC_SUBST(NETCDF_LIB)

hrchilds's avatar
hrchilds committed
2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436
#
# Look for CGNS
#
AC_MSG_CHECKING(for CGNS)
CGNS=""
CGNS_INCLUDE=""
CGNS_LIB=""
AC_ARG_WITH(cgns,
	    [  --with-cgns=INC-DIR,LIB-DIR     Location of CGNS header and library],
           cgns_specified="yes",
           cgns_specified="no"
           )
if test "$SHORT_UNAME" = "darwin"; then
    CGNS_LIBEXT="dylib"
else
    CGNS_LIBEXT="a"
fi
if test "$cgns_specified" = "yes"; then
   if test "$withval" != "no"; then
      CGNS_INCLUDE="-I`echo $withval |cut -f1 -d,`"
      CGNS_LIB="`echo $withval |cut -f2 -d, -s`/libcgns.$CGNS_LIBEXT"
   fi
else
   if test "$DEFAULT_CGNS_INCLUDE" != "" ; then
      CGNS_INCLUDE="-I$DEFAULT_CGNS_INCLUDE $CGNS_INCLUDE"
   fi
   if test "$DEFAULT_CGNS_LIB" != "" ; then
      CGNS_LIB="$DEFAULT_CGNS_LIB/libcgns.$CGNS_LIBEXT $CGNS_LIB"
   fi
fi
if test "$CGNS_LIB" != "" ; then
   if test "$CGNS_INCLUDE" != "" ; then
      CGNS="$""(CGNS)"
      AC_MSG_RESULT(yes)
      AC_DEFINE(HAVE_CGNS_H)
      AC_DEFINE(HAVE_LIBCGNS)
   else
      AC_MSG_RESULT(no)
   fi
else
   AC_MSG_RESULT(no)
fi
AC_SUBST(CGNS)
AC_SUBST(CGNS_INCLUDE)
AC_SUBST(CGNS_LIB)
hrchilds's avatar
hrchilds committed
2437

hrchilds's avatar
hrchilds committed
2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471

#
# Look for GDAL
#
AC_MSG_CHECKING(for GDAL)
GDAL=""
GDAL_INCLUDE=""
GDAL_LIB=""
GDAL_LIBS=""
AC_ARG_WITH(GDAL,
	    [  --with-GDAL=INC-DIR,LIB-DIR     Location of GDAL header and library],
           GDAL_specified="yes",
           GDAL_specified="no"
           )
if test "$SHORT_UNAME" = "darwin"; then
    GDAL_LIBEXT="dylib"
else
    GDAL_LIBEXT="a"
fi
if test "$GDAL_specified" = "yes"; then
   if test "$withval" != "no"; then
      GDAL_INCLUDE="-I`echo $withval |cut -f1 -d,`"
      GDAL_LIB="`echo $withval |cut -f2 -d, -s`/libgdal.$GDAL_LIBEXT"
   fi
else
   if test "$DEFAULT_GDAL_INCLUDE" != "" ; then
      GDAL_INCLUDE="-I$DEFAULT_GDAL_INCLUDE $GDAL_INCLUDE"
   fi
   if test "$DEFAULT_GDAL_LIB" != "" ; then
      GDAL_LIB="$DEFAULT_GDAL_LIB/libgdal.$GDAL_LIBEXT $GDAL_LIB"
   fi
fi
if test "$GDAL_LIB" != "" ; then
   if test "$GDAL_INCLUDE" != "" ; then
hrchilds's avatar
hrchilds committed
2472 2473 2474 2475 2476
      if test "$GDAL_WITH_HDF5" == "yes"; then
          GDAL_LIBS="$GDAL_LIB $HDF5_LIB"
      else
          GDAL_LIBS="$GDAL_LIB"
      fi
hrchilds's avatar
hrchilds committed
2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491
      GDAL="$""(GDAL)"
      AC_MSG_RESULT(yes)
      AC_DEFINE(HAVE_GDAL_H)
      AC_DEFINE(HAVE_LIBGDAL)
   else
      AC_MSG_RESULT(no)
   fi
else
   AC_MSG_RESULT(no)
fi
AC_SUBST(GDAL)
AC_SUBST(GDAL_INCLUDE)
AC_SUBST(GDAL_LIB)
AC_SUBST(GDAL_LIBS)

hrchilds's avatar
hrchilds committed
2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519
#
# Add Some include paths to the engine's CPPFLAGS.
#
ENGINE_CPPFLAGS="$ENGINE_CPPFLAGS $VTK_INCLUDES"
AC_SUBST(ENGINE_CPPFLAGS)

#
# Add Some include paths to the SiloObjVtkDB's CPPFLAGS.
#
SILOOBJVTK_CPPFLAGS="$SILOOBJVTK_CPPFLAGS $VTK_INCLUDES"
SILOOBJVTK_CPPFLAGS="$SILOOBJVTK_CPPFLAGS -I$""(TOPDIR)/include/visit"
SILOOBJVTK_CPPFLAGS="$SILOOBJVTK_CPPFLAGS $SILO_INCLUDE"
AC_SUBST(SILOOBJVTK_CPPFLAGS)

#
# Add some include paths to the preprocessor's includes CPPFLAGS.
# Also add the parallel source files when building in parallel.
#
PREPROCESSOR_CPPFLAGS="$PREPROCESSOR_CPPFLAGS $SILO_INCLUDE "
PREPROCESSOR_CPPFLAGS="$PREPROCESSOR_CPPFLAGS -I$""(TOPDIR)/include/visit"
AC_SUBST(PREPROCESSOR_CPPFLAGS)
if test -n "$PARALLEL"; then
    PREPROCESSOR_PARALLEL_SRC="MPIResourceManager.C"
else
    PREPROCESSOR_PARALLEL_SRC=""
fi
AC_SUBST(PREPROCESSOR_PARALLEL_SRC)

hrchilds's avatar
hrchilds committed
2520
COMPONENT_CPPFLAGS="$COMPONENT_CPPFLAGS -I$""(TOPDIR)/include "
hrchilds's avatar
hrchilds committed
2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542
COMPONENT_CPPFLAGS="$COMPONENT_CPPFLAGS -I$""(TOPDIR)/include/visit "
COMPONENT_CPPFLAGS="$COMPONENT_CPPFLAGS $VTK_INCLUDES "
AC_SUBST(COMPONENT_CPPFLAGS)

VISIT_VTK_CPPFLAGS="$VISIT_VTK_CPPFLAGS $VTK_INCLUDES -I$""(TOPDIR)/include/visit"
AC_SUBST(VISIT_VTK_CPPFLAGS)

#
# Check to see if we can compile with Gui support. If we can't then
# make sure no windowing system stuff gets in.
#
if test "$enable_gui" = "yes"; then
    dnl
    dnl Add some include paths to the viewer includes.
    dnl
    VIEWER_CPPFLAGS="$VIEWER_CPPFLAGS $VTK_INCLUDES -I$""(TOPDIR)/common/siloobj"
    VIEWER_CPPFLAGS="$VIEWER_CPPFLAGS $SILO_INCLUDE"
    AC_SUBST(VIEWER_CPPFLAGS)

    dnl
    dnl Looking for a supported version of Qt.
    dnl
hrchilds's avatar
hrchilds committed
2543 2544
    if test -z "$QT_BIN" || test -z "$QT_INCLUDE" || test -z "$QT_LIB"; then
       AC_MSG_ERROR([The QT_BIN, QT_INCLUDE and QT_LIB environment variables must be set in order to find Qt])
hrchilds's avatar
hrchilds committed
2545 2546 2547
    fi
    AC_MSG_CHECKING(for supported Qt version)
    QtVersion=""
hrchilds's avatar
hrchilds committed
2548
    QtGlobalInc="$QT_INCLUDE/qglobal.h"
hrchilds's avatar
hrchilds committed
2549 2550

    if test -f $QtGlobalInc; then
hrchilds's avatar
hrchilds committed
2551
        ## Check for supported versions of Qt.
hrchilds's avatar
hrchilds committed
2552
	for ver in  3.3.0  3.3.1  3.3.2  3.3.3  3.3.4\
hrchilds's avatar
hrchilds committed
2553
                    3.2.0  3.2.1  3.2.2  3.2.3 \
hrchilds's avatar
hrchilds committed
2554 2555
                    3.1.2  3.1.1  3.1.0 \
                    3.0.4  3.0.3  3.0.2  3.0.1  3.0.0 \
hrchilds's avatar
hrchilds committed
2556
                    2.3.2  2.3.1  2.3.0 ; do
hrchilds's avatar
hrchilds committed
2557
            QtVer=`grep \"$ver\" $QtGlobalInc`
hrchilds's avatar
hrchilds committed
2558 2559 2560 2561 2562 2563 2564 2565 2566 2567
            if test -n "$QtVer"; then
                QtVersion=$ver
                break
            fi
        done
    fi

    if test -z "$QtVersion"; then
        AC_MSG_ERROR([  Sorry, but you need Qt version 2.3.0 or higher to compile VisIt. ])
    else
hrchilds's avatar
hrchilds committed
2568
        AC_MSG_RESULT(Qt $QtVersion in $QT_INCLUDE)
hrchilds's avatar
hrchilds committed
2569
    fi
hrchilds's avatar
hrchilds committed
2570 2571 2572
    AC_SUBST(QT_BIN)
    AC_SUBST(QT_INCLUDE)
    AC_SUBST(QT_LIB)
hrchilds's avatar
hrchilds committed
2573 2574
    QT_LIBS=-lqt
    AC_SUBST(QT_LIBS)
hrchilds's avatar
hrchilds committed
2575 2576
    QUI_LIBS=-lqui
    AC_SUBST(QUI_LIBS)
hrchilds's avatar
hrchilds committed
2577 2578
    QT_LDFLAGS=""
    AC_SUBST(QT_LDFLAGS)
hrchilds's avatar
hrchilds committed
2579
    QT_STATICLDFLAGS=-L$QT_LIB
hrchilds's avatar
hrchilds committed
2580
    AC_SUBST(QT_STATICLDFLAGS)
hrchilds's avatar
hrchilds committed
2581 2582 2583 2584
    if test "$SHORT_UNAME" = "darwin"; then
        QTMAC_FLAGS="-DMACOSX_102"
    fi
    QT_CXXFLAGS="-I$""(TOPDIR)/include/qt $QT_CXXFLAGS $QTMAC_FLAGS"
hrchilds's avatar
hrchilds committed
2585 2586 2587 2588 2589 2590 2591 2592
    AC_SUBST(QT_CXXFLAGS)
    QT_MOC="$""(TOPDIR)/bin/moc"
    AC_SUBST(QT_MOC)
else
    dnl We are building with ONLY off-screen graphics support. That
    dnl means no X.
    X_LIBS=""
    AC_SUBST(X_LIBS)
hrchilds's avatar
hrchilds committed
2593 2594 2595 2596 2597 2598
    QT_BIN=""
    AC_SUBST(QT_BIN)
    QT_INCLUDE=""
    AC_SUBST(QT_INCLUDE)
    QT_LIB=""
    AC_SUBST(QT_LIB)
hrchilds's avatar
hrchilds committed
2599 2600
    QT_LIBS=""
    AC_SUBST(QT_LIBS)
hrchilds's avatar
hrchilds committed
2601 2602
    QUI_LIBS=""
    AC_SUBST(QUI_LIBS)
hrchilds's avatar
hrchilds committed
2603 2604 2605 2606 2607 2608 2609 2610
    QT_LDFLAGS=""
    AC_SUBST(QT_LDFLAGS)
    QT_CXXFLAGS=""
    AC_SUBST(QT_CXXFLAGS)
    QT_MOC=""
    AC_SUBST(QT_MOC)
fi

hrchilds's avatar
hrchilds committed
2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633
#
# Only enable VTKQT if we're building the viewer. 
#
if test -n "$VIEWER"; then
   VTKQT_CPPFLAGS="-I$""(TOPDIR)/vtkqt"
   VTKQT="vtkqt"
   #
   # TEMP HACK FOR BUILDING ON MacOS X.
   #
   if test "$UNAME" = "Darwin"; then
      VTKQT_LIBS="-lvtkqt $QT_LIBS"
   else
      VTKQT_LIBS=""
   fi
else
   VTKQT_CPPFLAGS=""
   VTKQT=""
   VTKQT_LIBS=""
fi
AC_SUBST(VTKQT_CPPFLAGS)
AC_SUBST(VTKQT)
AC_SUBST(VTKQT_LIBS)

hrchilds's avatar
hrchilds committed
2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668
#
# Do we need to tell the compiler about the location of the X 
# include files?  We're trying to keep the compiler command line
# as short and readable as possible.  We must tell the compiler
# about the include directory if the user explicitly gave one with
# `--x-includes=DIR'.
#
user_specified_x_includes="$x_includes"
user_specified_x_libraries="$x_libraries"
AC_PATH_X

if test "$no_x" != "yes" && test "$user_specified_x_includes" = NONE; then
   AC_MSG_CHECKING(if compiler knows about X11 header files)
   AC_TRY_CPP([#include <X11/Xlib.h>],
   AC_MSG_RESULT(yes),
       AC_MSG_RESULT(no)
         if test -n "$x_includes"; then
            CPPFLAGS="$CPPFLAGS -I`echo $x_includes|sed 's/ 	*/ -I/g'`"
         fi)
elif test "$x_includes" != NONE; then
   CPPFLAGS="$CPPFLAGS -I`echo $x_includes|sed 's/  */ -I/g'`"
fi

#
# Do we need to tell the linker about the location of the libraries?
# Watch out, because on some systems (like Linux) where more than
# one output file format can be created the libraries found by
# AC_PATH_X might be wrong!  Use that directory only if the compiler
# can't find the appropriate library for -lX11.  The search
# directory is added to the end of LDFLAGS.  If the user specified a
# library directory with `--x-libraries=DIR' then we must supply it to
# the linker!
#
if test "$no_x" != "yes" && test "$user_specified_x_libraries" = NONE; then
    oldlibs="$LIBS"
hrchilds's avatar
hrchilds committed
2669
    LIBS="-lX11 -lXt $LIBS"
hrchilds's avatar
hrchilds committed
2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683

    AC_MSG_CHECKING(if linker knows about X11 libraries)
    AC_TRY_LINK([#include <X11/Xlib.h>],[XOpenDisplay((char*)0)],
                AC_MSG_RESULT(yes),
                AC_MSG_RESULT(no)
                if test -n "$x_libraries"; then
                    LDFLAGS="$LDFLAGS -L`echo $x_libraries|sed 's/  */ -L/g'`"
                fi)
    LIBS="$oldlibs"
elif test "$x_libraries" != NONE; then
    LDFLAGS="$LDFLAGS -L`echo $x_libraries|sed 's/  */ -L/g'`"
fi

#
hrchilds's avatar
hrchilds committed
2684
# Is the X library available if we need it?
hrchilds's avatar
hrchilds committed
2685
#
hrchilds's avatar
hrchilds committed
2686
if test "$no_x" != "yes"; then
hrchilds's avatar
hrchilds committed
2687
    AC_CHECK_LIB(X11,  main, X_LIBS="-lX11 -lXt $X_LIBS"         ,,$X_LIBS)
hrchilds's avatar
hrchilds committed
2688 2689 2690
else
    X_LIBS=""
fi
hrchilds's avatar
hrchilds committed
2691 2692