configure.in 116 KB
Newer Older
hrchilds's avatar
hrchilds committed
1 2 3 4
dnl Process this file with autoconf to produce configure.
dnl 
dnl 
dnl 
whitlocb's avatar
whitlocb committed
5
dnl                            Copyright 2000 - 2007
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 97
dnl    Eric Brugger, Thu Mar 15 17:13:09 PST 2001
dnl    Modify the script to not generate viewer/cli/Makefile since the cli
hrchilds's avatar
hrchilds committed
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 313
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
314
dnl    Unified the include file locations to the root /include tree.
hrchilds's avatar
hrchilds committed
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 357
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
358 359 360
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
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 414
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
415 416 417 418
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
419 420 421
dnl    Sean Ahern, Wed Jun 11 16:36:52 PDT 2003
dnl    Fixed pthreads test.
dnl
hrchilds's avatar
hrchilds committed
422 423 424
dnl    Akira Haddox, Thu Jun 12 08:56:16 PDT 2003
dnl    Added support for HDF4.
dnl
hrchilds's avatar
hrchilds committed
425 426 427
dnl    Akira Haddox, Tue Jul  1 12:36:01 PDT 2003
dnl    Added tools/makemili.
dnl
hrchilds's avatar
hrchilds committed
428 429 430
dnl    Hank Childs, Wed Jul  2 09:50:00 PDT 2003
dnl    Added tools/surfcomp.
dnl
hrchilds's avatar
hrchilds committed
431 432 433
dnl    Brad Whitlock, Thu Jun 19 13:10:18 PST 2003
dnl    I removed the splashscreen.
dnl
hrchilds's avatar
hrchilds committed
434 435 436 437 438 439
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
440 441 442 443 444 445
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
446 447 448
dnl    Hank Childs, Tue Sep  9 07:36:21 PDT 2003
dnl    Added tools/convert.
dnl
hrchilds's avatar
hrchilds committed
449 450 451
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
452 453 454
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
455 456 457
dnl    Kathleen Bonnell, Wed Nov 12 17:20:03 PST 2003 
dnl    Add new vtk lib vtkDICOMParser. 
dnl
hrchilds's avatar
hrchilds committed
458 459 460
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
461 462 463
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
464 465 466
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
467 468 469 470
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
471 472 473
dnl    Hank Childs, Thu Mar  4 08:32:01 PST 2004
dnl    Added new Qt VisWindow library.
dnl
hrchilds's avatar
hrchilds committed
474 475 476
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
477 478 479
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
480 481 482 483
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
484 485 486
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
487 488 489 490
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
491 492 493 494
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
495 496 497
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
498 499 500 501
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
502 503 504
dnl    Eric Brugger, Mon Jul 26 15:44:24 PDT 2004
dnl    Replaced fstream.h with fstream.
dnl
hrchilds's avatar
hrchilds committed
505 506 507 508 509 510
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
511 512 513
dnl    Mark C. Miller, Tue Sep 28 19:32:50 PDT 2004
dnl    Added ViSUS
dnl
hrchilds's avatar
hrchilds committed
514 515 516 517
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
518 519 520
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
521 522 523 524
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
525 526 527
dnl    Jeremy Meredith, Mon Aug 30 16:55:36 PDT 2004
dnl    Added parallel directory to visit_vtk.
dnl
hrchilds's avatar
hrchilds committed
528 529 530
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
531 532 533 534 535 536 537
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
538 539 540
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
541 542 543
dnl    Jeremy Meredith, Tue Feb 22 18:48:19 PST 2005
dnl    Renamed "convert" to "visitconvert".
dnl
hrchilds's avatar
hrchilds committed
544 545 546
dnl    Hank Childs, Wed Apr  6 13:13:10 PDT 2005
dnl    Added tools/writer.
dnl
hrchilds's avatar
hrchilds committed
547 548 549
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
550 551 552
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
553 554 555
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
556 557 558
dnl    Brad Whitlock, Tue Aug 9 17:31:30 PST 2005
dnl    I added checks for netCDF.
dnl
hrchilds's avatar
hrchilds committed
559 560 561 562 563 564
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
565 566 567
dnl    Brad Whitlock, Tue Sep 6 11:24:53 PDT 2005
dnl    I added checks for GDAL.
dnl
hrchilds's avatar
hrchilds committed
568 569 570 571
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
572 573 574 575
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
576 577 578 579 580
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
581 582 583
dnl    Eric Brugger, Mon Nov 14 11:25:18 PST 2005
dnl    I removed VTK_CAMERA_SRC.
dnl
hrchilds's avatar
hrchilds committed
584 585 586
dnl    Kathleen Bonnell, Wed Nov 16 08:51:43 PST 2005 
dnl    Added -lXt to X_LIBS. 
dnl
hrchilds's avatar
hrchilds committed
587 588 589 590 591
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
592 593 594
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
595 596 597
dnl    Brad Whitlock, Fri Dec 16 17:03:10 PST 2005
dnl    Improved glTexImage3D detection on MacOS X.
dnl
hrchilds's avatar
hrchilds committed
598 599 600 601
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
602 603 604
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
605 606 607
dnl    Hank Childs, Mon Feb 13 20:58:37 PST 2006
dnl    Added subdirectory /components/DDF.
dnl
hrchilds's avatar
hrchilds committed
608 609 610
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
611 612 613
dnl    Brad Whitlock, Thu Jul 20 11:55:51 PDT 2006
dnl    Added CFITSIO support.
dnl
hrchilds's avatar
hrchilds committed
614 615 616 617 618 619
dnl    Jeremy Meredith, Mon Aug 28 17:35:44 EDT 2006
dnl    Forced test for glTexImage3D to occur in C++ mode; the library
dnl    may have it, but without a correct prototype it will fail to
dnl    compile in the main code.  Sometimes to pick it up we need to
dnl    define GL_GLEXT_PROTOTYPES, so I added a check for that as well.
dnl
hrchilds's avatar
hrchilds committed
620 621 622 623
dnl    Brad Whitlock, Fri Sep 15 10:31:23 PDT 2006
dnl    Added support for GLEW library and removed GL_GLEXT_PROTOTYPES. Also
dnl    fixed a problem with building beta versions on the Mac.
dnl
hrchilds's avatar
hrchilds committed
624 625 626 627 628
dnl    Mark C. Miller, Wed Oct 18 08:21:44 PDT 2006
dnl    Made it handle situation where there was a libsiloh5.a but not also
dnl    a libsilo.a in the DEFAULT_SILO_LIBRARY directory. Previously, it
dnl    would attempt to find there a libsilo.a and if not, fail to correctly
dnl    set SILO_LIB variable.
hrchilds's avatar
hrchilds committed
629 630 631 632 633 634
dnl
dnl    Eric Brugger, Mon Oct 23 13:26:26 PDT 2006
dnl    Modified the test that determines wether to use BSD or SYSV pseudo
dnl    terminals to use the normal test instead of assuming it is BSD on
dnl    Linux.
dnl
hrchilds's avatar
hrchilds committed
635 636 637
dnl    Brad Whitlock, Thu Nov 9 14:27:00 PST 2006
dnl    Made sure data manual examples get their Makefiles created.
dnl
hrchilds's avatar
hrchilds committed
638 639 640
dnl    Brad Whitlock, Tue Sep 19 17:04:41 PST 2006
dnl    Added mpeg2encode support.
dnl
hrchilds's avatar
hrchilds committed
641 642 643 644 645 646 647 648 649 650 651 652
dnl    Thomas R. Treadway, Tue Feb  6 13:45:49 PST 2007
dnl    Removed the Mac prebinding stuff, added better universal binary
dnl    support.
dnl
dnl    Thomas R. Treadway, Wed Feb  7 15:32:27 PST 2007
dnl    Added CREATE_BOXLIB2D_LINK, CREATE_BOXLIB3D_LINK,
dnl    and CREATE_CFITSIO_LINK (and friends).
dnl
dnl    Thomas R. Treadway, Thu Feb  8 14:22:10 PST 2007
dnl    Removed checking for HDF5 for the MacOS X, assumed silo always
dnl    links with hdf5 (Never worked right anyway).
dnl
hrchilds's avatar
hrchilds committed
653 654 655
dnl    Eric Brugger, Fri Mar  9 10:56:59 PST 2007
dnl    Removed the exodus and netcdf libraries from the list of vtk libraries.
dnl
hrchilds's avatar
hrchilds committed
656 657 658
dnl    Brad Whitlock, Tue Mar 13 18:20:38 PST 2007
dnl    Changed how Python is used in CLI.
dnl
hrchilds's avatar
hrchilds committed
659 660 661 662 663 664
dnl    Eric Brugger, Tue Mar 20 11:27:01 PDT 2007
dnl    Removed MESA_LIBS and GL_LIBS from the definition of VTK_LIBS.
dnl
dnl    Eric Brugger, Wed Mar 21 14:51:01 PDT 2007
dnl    Added support for building mesa_stub.
dnl
hrchilds's avatar
hrchilds committed
665 666 667 668
dnl    Eric Brugger, Tue Mar 27 12:01:37 PDT 2007
dnl    Added --enable-viewer-mesa-stub, which controls if the viewer uses
dnl    the mesa library or the mesa stub library.
dnl
hrchilds's avatar
hrchilds committed
669 670 671 672 673 674 675
dnl    Eric Brugger, Fri Apr  6 08:53:18 PDT 2007
dnl    Added NETCDF_CXX_LIB, which contains the netcdf c++ library, for
dnl    use with the S3D database plugin.
dnl
dnl    Thomas R. Treadway, Fri Apr  6 13:18:53 PDT 2007
dnl    Filled in PREBIND_LIBS (for mdserver linking).
dnl
hrchilds's avatar
hrchilds committed
676 677 678 679 680
dnl    Hank Childs, Sat Apr  7 18:31:21 PDT 2007
dnl    Adaptively find data directory.  Its location is dependent on whether
dnl    you are in ClearCase or Subversion.  And for Subversion, it might not
dnl    be available at all.
dnl
hrchilds's avatar
hrchilds committed
681 682 683
dnl    Gunther H. Weber, Thu Apr 19 18:22:49 PDT 2007
dnl    Adaptively replace relative visit path in data directory
dnl
684 685 686
dnl    Gunther H. Weber, Mon May 21 15:55:12 PDT 2007
dnl    Added check for H5Part
dnl
687 688 689 690
dnl    Jeremy Meredith, Tue May 22 11:43:30 EDT 2007
dnl    Added --enable-minimal-plugins to only build the few most common
dnl    plugins, like the Pseudocolor plot and Slice operator.   
dnl 
691 692 693
dnl    Gunther H. Weber, Tue May 22 10:20:31 PDT 2007
dnl    Merged Jeremy's last change (Tue May 22 11:43:30 EDT 2007) and my
dnl    last change (Mon May 21 15:55:12 PDT 2007).
694
dnl
695 696 697
dnl    Thomas R. Treadway, Wed May 23 17:04:07 PDT 2007
dnl    FreeBSD patches from Nathan Lay <nlay@scs.fsu.edu>
dnl
698 699 700
dnl    Mark C. Miller, Thu May 24 22:54:35 PDT 2007
dnl    Removed use of rpath options from iTaps lib symbols. Made it build
dnl    symbolic link in lib dir for iTaps libs
701 702 703 704 705 706
dnl
dnl    Jeremy Meredith, Tue Jun  5 17:32:39 EDT 2007
dnl    Added the "PARDEP" substitution that expands to $(PARDEP) when parallel
dnl    builds are enabled.  This lets us avoid building dependencies for
dnl    parallel object files if we're not building parallel objects.
dnl
707 708 709
dnl    Jeremy Meredith, Thu Jun 14 11:22:29 EDT 2007
dnl    Added the tools/clidriver directory.
dnl
710 711 712
dnl    Thomas R. Treadway, Wed Jul 11 16:08:40 PDT 2007
dnl    Added CREATE_H5PART_LINK for H5Part support.
dnl
713 714 715
dnl    Cyrus Harrison, Tue Jul 24 14:36:54 PDT 2007
dnl    Added support to skip compile of mesa stub if not needed.
dnl
whitlocb's avatar
whitlocb committed
716 717 718
dnl    Brad Whitlock, Thu Aug 2 14:45:17 PST 2007
dnl    Added support for libccmio for the GNEP Star-CD reader.
dnl
719 720 721 722
dnl    Thomas R. Treadway, Tue Sep 18 15:48:47 PDT 2007
dnl    Added szip library.
dnl    Created a HDF5_LIBDIR variable
dnl
723 724 725
dnl    Hank Childs, Mon Oct 15 08:24:44 PDT 2007
dnl    Make change to 'tr' syntax pointed out by Matt Wheeler.
dnl
726 727 728 729
dnl    Jeremy Meredith, Wed Oct 17 16:26:13 EDT 2007
dnl    Added runtime check for disabling the simulation plugins.
dnl    This is currently triggered by a check for OS X.
dnl
js9's avatar
js9 committed
730 731 732 733
dnl    Jeremy Meredith, Thu Oct 18 09:50:46 EDT 2007
dnl    Removed all sleep's.  They're slowing down the build and are probably
dnl    no longer needed.
dnl
734 735
dnl    Thomas R. Treadway, Tue Oct 30 14:14:47 PDT 2007
dnl    Replacing #if define with PANTHERHACK define.
736
dnl
737 738 739
dnl    Jeremy Meredith, Thu Nov  1 16:41:12 EDT 2007
dnl    Stop allowing Qt versions prior to 3.0.
dnl
js9's avatar
js9 committed
740 741 742 743
dnl    Jeremy Meredith, Fri Nov  2 17:57:52 EDT 2007
dnl    Re-enable simulation apis for darwin.
dnl    Check for --export-dynamic support (we want it for the sim examples).
dnl
744 745 746
dnl    Hank Childs, Mon Nov  5 11:35:30 PST 2007
dnl    Fix typo with export-dynamic where existing LDFLAGS were ignored.
dnl
747 748 749 750
dnl    Hank Childs, Thu Nov  8 15:09:28 PST 2007
dnl    Add a configure flag to get around a bug with threads getting hangup
dnl    signals.
dnl
hrchilds's avatar
hrchilds committed
751 752 753
dnl    Hank Childs, Fri Dec  7 16:52:10 PST 2007
dnl    Put the SVN version of the /src directory into visit-config.h.
dnl
754 755 756
dnl    Cyrus Harrison, Tue Dec 18 11:53:59 PST 2007
dnl    Added subdirectory components/Shapelets.
dnl
hrchilds's avatar
hrchilds committed
757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777
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
778 779 780 781 782 783 784 785 786
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
787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806
### 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`
hrchilds's avatar
hrchilds committed
807
AC_DEFINE_UNQUOTED(VERSION,"$VERSION",[VisIt version])
hrchilds's avatar
hrchilds committed
808 809
AC_MSG_RESULT($VERSION)

hrchilds's avatar
hrchilds committed
810 811 812 813 814 815 816 817 818 819
# Get the SVN version number.
AC_MSG_CHECKING(what subversion revision is)
if test -r SVN_REVISION; then
   SVN_REVISION=`cat SVN_REVISION`
else
   SVN_REVISION=`svn info . | grep "Revision:" | cut -d' ' -f2`
fi
AC_DEFINE_UNQUOTED(SVN_REVISION,"$SVN_REVISION",[Subversion revision])
AC_MSG_RESULT($SVN_REVISION)

hrchilds's avatar
hrchilds committed
820
# Set the slash characters used in filenames.
hrchilds's avatar
hrchilds committed
821 822
AC_DEFINE_UNQUOTED(SLASH_CHAR,'/',[Define the slash character])
AC_DEFINE_UNQUOTED(SLASH_STRING,"/",[Define the slash string])
hrchilds's avatar
hrchilds committed
823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865

# 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
866 867
# Load the OS configuration file if present.
UNAME="`uname 2>/dev/null`"
868
SHORT_UNAME=`uname -s | tr '[A-Z]' '[a-z]' | tr -d '[0-9]'`
hrchilds's avatar
hrchilds committed
869 870 871 872 873 874 875 876 877
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
878 879 880 881 882
#
# Check for platform specific flags.
#
AC_SUBST(PLATFORM_CPPFLAGS)

hrchilds's avatar
hrchilds committed
883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907
#
# 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)

908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934
#
# Allow for hangup signals to be ignored, which gets around an OS bug.
# (Bug is that for xterm -e <prog>, if prog uses threads, then when one of
# the child threads exits, the master thread gets a HUP.)
#
AC_ARG_ENABLE(ignore-hangups,
   [  --enable-ignore-hangups        ignore hangup signals (this avoids RHEL3 bug) ],
   UseIgnoreHups=$enableval, UseIgnoreHups=not_specified)
doIgnoreHups="no"
if test "$UseIgnoreHups" = "yes" ; then
  doIgnoreHups="yes"
fi
AC_MSG_CHECKING([whether or not to use ignore hangup signals])
IGNORE_HUPS="xx$IGNORE_HUPS"
if test "$IGNORE_HUPS" = "xxyes" ; then
  if test "$UseIgnoreHups" = "not_specified" ; then
     doIgnoreHups="yes"
  fi
fi
if test "$doIgnoreHups" = "yes" ; then
  AC_MSG_RESULT([yes])
  CXXFLAGS="$CXXFLAGS -DIGNORE_HUPS"
else
  AC_MSG_RESULT([no])
fi
AC_SUBST(CXXFLAGS)

hrchilds's avatar
hrchilds committed
935 936 937 938 939 940
#
# Get the simple C++ tests out of the way
#
AC_LANG_CPLUSPLUS
AC_TRY_LINK[]
AC_LANG_C
hrchilds's avatar
hrchilds committed
941

hrchilds's avatar
hrchilds committed
942 943 944 945 946 947 948 949 950 951 952 953 954 955 956
#
# 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"
957
   PARDEP="$""(PARDEP)"
hrchilds's avatar
hrchilds committed
958

hrchilds's avatar
hrchilds committed
959
   if test "$UNAME" != "AIX"; then
hrchilds's avatar
hrchilds committed
960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984
       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=""
985
   PARDEP=""
hrchilds's avatar
hrchilds committed
986 987 988 989 990 991 992 993 994
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)
995
AC_SUBST(PARDEP)
hrchilds's avatar
hrchilds committed
996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015

#
# 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
1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027
#
# Check to see if we should use the mesa stub library in the viewer.
#
AC_MSG_CHECKING(for use of the mesa stub library in the viewer)
AC_ARG_ENABLE(viewer-mesa-stub,
   [  --enable-viewer-mesa-stub     use the mesa stub library in the viewer],
   UseViewerMesaStub=$enableval, UseViewerMesaStub=yes)

if test "$UseViewerMesaStub" = "yes"; then
   AC_MSG_RESULT(enabled)
   VIEWER_MESA_STUB_CPPFLAGS="-DMESA_STUB"
   VIEWER_MESA_LIBS="-lMesaStub"
1028
   BUILD_MESA_STUB="mesa_stub"
hrchilds's avatar
hrchilds committed
1029 1030 1031 1032
else
   AC_MSG_RESULT(disabled)
   VIEWER_MESA_STUB_CPPFLAGS=""
   VIEWER_MESA_LIBS=$MESA_LIBS
1033
   BUILD_MESA_STUB=""
hrchilds's avatar
hrchilds committed
1034 1035 1036
fi
AC_SUBST(VIEWER_MESA_STUB_CPPFLAGS)
AC_SUBST(VIEWER_MESA_LIBS)
1037
AC_SUBST(BUILD_MESA_STUB)
hrchilds's avatar
hrchilds committed
1038

hrchilds's avatar
hrchilds committed
1039
#
hrchilds's avatar
hrchilds committed
1040
# The check for OpenGL can be disabled with `--disable-ogl'.
hrchilds's avatar
hrchilds committed
1041 1042 1043 1044 1045 1046
#
AC_ARG_ENABLE(ogl,
   [  --disable-ogl           do not check for the SGI ogl library],
   UseOGL="$enable_ogl", UseOGL=yes)

#
hrchilds's avatar
hrchilds committed
1047
# Try to find the OpenGL libraries
hrchilds's avatar
hrchilds committed
1048 1049 1050 1051 1052
#
GL_LIBS=""
if test "$UseOGL" = "yes"; then
    AC_CHECK_LIB(GL, main,   GL_LIBS="-lGL")
fi
hrchilds's avatar
hrchilds committed
1053 1054 1055 1056 1057 1058
# 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)
1059 1060 1061 1062 1063 1064
# Turn off ssh tunnleing if on Panther
    VERS=`uname -r`
    case $VERS in
       7*) AC_DEFINE(PANTHERHACK, [1], [Disable ssh tunneling on Panther.]);;
       *);;
    esac
hrchilds's avatar
hrchilds committed
1065
fi
1066

hrchilds's avatar
hrchilds committed
1067
AC_SUBST(GL_LIBS)
hrchilds's avatar
hrchilds committed
1068

hrchilds's avatar
hrchilds committed
1069 1070
AC_LANG_C

hrchilds's avatar
hrchilds committed
1071 1072 1073 1074 1075 1076 1077 1078
#
# 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"
hrchilds's avatar
hrchilds committed
1079
    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 -I$VTK_INCROOT/Utilities"
hrchilds's avatar
hrchilds committed
1080
    VTK_LIBS="-lvtkCommon -lvtkDICOMParser -lvtkFiltering -lvtkGraphics -lvtkHybrid -lvtkIO -lvtkImaging -lvtkRendering -lvtkzlib -lvtkexpat -lvtkjpeg -lvtkpng -lvtktiff -lvtkftgl -lvtkfreetype -lvtksys -lvtkMPEG2Encode "
hrchilds's avatar
hrchilds committed
1081 1082 1083
    if test "$SHORT_UNAME" = "darwin"; then
        VTK_LIGHTWEIGHT_LIBS=$VTK_LIBS
    else
hrchilds's avatar
hrchilds committed
1084
        VTK_LIGHTWEIGHT_LIBS="-lvtkCommon -lvtkFiltering -lvtkzlib -lvtkexpat -lvtksys"
hrchilds's avatar
hrchilds committed
1085
    fi
hrchilds's avatar
hrchilds committed
1086 1087 1088 1089 1090
else
    AC_MSG_RESULT(not found)
    VTK_DIR=""
    VTK_INCLUDES=""
    VTK_LIBS=""
hrchilds's avatar
hrchilds committed
1091
    VTK_LIGHTWEIGHT_LIBS=""
hrchilds's avatar
hrchilds committed
1092 1093 1094 1095
fi
AC_SUBST(VTK_DIR)
AC_SUBST(VTK_INCLUDES)
AC_SUBST(VTK_LIBS)
hrchilds's avatar
hrchilds committed
1096
AC_SUBST(VTK_LIGHTWEIGHT_LIBS)
hrchilds's avatar
hrchilds committed
1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129

#
# 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
1130 1131 1132 1133 1134 1135
#
# 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
1136
    CONVERT_SER="$""(tmpbin)/visitconvert_ser"
hrchilds's avatar
hrchilds committed
1137
    if test -n "$PARALLEL"; then
hrchilds's avatar
hrchilds committed
1138
        CONVERT_PAR="$""(tmpbin)/visitconvert_par"
hrchilds's avatar
hrchilds committed
1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150
    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
1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170
#
# 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
1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185
#
# 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
1186
        ENGINEWRAPPAR=""
hrchilds's avatar
hrchilds committed
1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 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
    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,
hrchilds's avatar
hrchilds committed
1241
              [  --disable-scripting     build without CLI Python scripting capability],
hrchilds's avatar
hrchilds committed
1242 1243 1244 1245 1246 1247 1248 1249
              UseScripting="$enable_scripting", UseScripting=yes)
if test "X$UseScripting" = "Xyes"; then
    AC_MSG_RESULT(yes)
    enable_scripting=yes

    VISITPY="visitpy"
    SCRIPTINGLIB="$""(SDSO)"
    SCRIPTINGOBJ="$""(SOBJ)"
hrchilds's avatar
hrchilds committed
1250 1251 1252 1253 1254 1255

    #
    # Check to see if VisIt module should be built.
    #
    AC_MSG_CHECKING(if VisIt Python module will be built)
    AC_ARG_ENABLE(visitmodule,
1256
                  [  --enable-visitmodule    build a VisIt Python module],
hrchilds's avatar
hrchilds committed
1257 1258 1259 1260 1261 1262 1263 1264
                  [UsePythonModule=yes])
    if test "X$UsePythonModule" = "Xyes"; then
        AC_MSG_RESULT(yes)
        PY_BUILD_VISITMODULE="visitmodule"
    else
        AC_MSG_RESULT(no)
        PY_BUILD_VISITMODULE=""
    fi
hrchilds's avatar
hrchilds committed
1265 1266 1267 1268 1269 1270 1271
else
    AC_MSG_RESULT(no)
    enable_scripting=no

    VISITPY=""
    SCRIPTINGLIB=""
    SCRIPTINGOBJ=""
hrchilds's avatar
hrchilds committed
1272
    PY_BUILD_VISITMODULE=""
hrchilds's avatar
hrchilds committed
1273 1274 1275 1276
fi
AC_SUBST(VISITPY)
AC_SUBST(SCRIPTINGLIB)
AC_SUBST(SCRIPTINGOBJ)
hrchilds's avatar
hrchilds committed
1277 1278
AC_SUBST(PY_BUILD_VISITMODULE)

hrchilds's avatar
hrchilds committed
1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303

# 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
1304 1305
        # The private source can go into the executable on all UNIX versions
        # except for MacOS X.
hrchilds's avatar
hrchilds committed
1306
        if test "$SHORT_UNAME" = "darwin" ; then
hrchilds's avatar
hrchilds committed
1307 1308 1309 1310 1311 1312 1313
            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
1314 1315 1316 1317 1318 1319 1320 1321 1322
        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
1323 1324
        VIEWERLIB_SRC=""
        VIEWEREXE_SRC=""
hrchilds's avatar
hrchilds committed
1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335
    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
1336 1337 1338 1339 1340
        if test "$SHORT_UNAME" = "darwin"; then
            GUIFRAMEWORKS="-framework Carbon"
        else
            GUIFRAMEWORKS=""
        fi
hrchilds's avatar
hrchilds committed
1341 1342 1343 1344 1345 1346 1347 1348 1349
        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
1350
        GUIFRAMEWORKS=""
hrchilds's avatar
hrchilds committed
1351 1352 1353 1354 1355 1356 1357
    fi

    ENGINEPROXYDIR="proxy"
else
    AC_MSG_RESULT(no)
    enable_gui=no
    ENGINEPROXYDIR=""
hrchilds's avatar
hrchilds committed
1358
    GUI_CXXFLAGS=""
hrchilds's avatar
hrchilds committed
1359 1360 1361 1362
fi
AC_SUBST(GUI)
AC_SUBST(GUILIB)
AC_SUBST(GUIOBJ)
hrchilds's avatar
hrchilds committed
1363
AC_SUBST(GUIFRAMEWORKS)
hrchilds's avatar
hrchilds committed
1364 1365 1366 1367
AC_SUBST(VIEWER)
AC_SUBST(VISWINDOW)
AC_SUBST(VIEWERLIB)
AC_SUBST(VIEWEROBJ)
hrchilds's avatar
hrchilds committed
1368 1369
AC_SUBST(VIEWERLIB_SRC)
AC_SUBST(VIEWEREXE_SRC)
hrchilds's avatar
hrchilds committed
1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398
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"
whitlocb's avatar
whitlocb committed
1399
    JAVAFLAGS="-source 1.4"
hrchilds's avatar
hrchilds committed
1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414
    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
1415 1416 1417 1418 1419 1420 1421 1422 1423 1424
#
# 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
1425 1426 1427 1428 1429 1430 1431
#
# Check to see if we should build all of the plugins.
#
AC_ARG_ENABLE(buildall,
  [  --enable-buildall       build all plugins],
  buildall="all", buildall=base)

1432
AC_ARG_ENABLE(minimal-plugins,
1433
  [  --enable-minimal-plugins   build only a few of the most common plugins],
1434 1435
  buildall="minimal")

hrchilds's avatar
hrchilds committed
1436 1437 1438 1439 1440 1441 1442
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)
1443
        PLOT_BUILD_DIRS="$""(REQUIRED) $""(OPTIONAL)"
hrchilds's avatar
hrchilds committed
1444 1445 1446
        AC_MSG_RESULT([all])
        ;;
    base)
1447
        PLOT_BUILD_DIRS="$""(REQUIRED)"
hrchilds's avatar
hrchilds committed
1448 1449
        AC_MSG_RESULT([base only])
        ;;
1450 1451 1452 1453
    minimal)
        PLOT_BUILD_DIRS="$""(MINIMAL)"
        AC_MSG_RESULT([minimal only])
        ;;
hrchilds's avatar
hrchilds committed
1454 1455 1456
    *)
        AC_MSG_ERROR([Please specify one of "all" or "base" for --with-plots.])
esac
1457
AC_SUBST(PLOT_BUILD_DIRS)
hrchilds's avatar
hrchilds committed
1458 1459 1460 1461 1462 1463 1464 1465

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)
1466
        OPERATOR_BUILD_DIRS="$""(REQUIRED) $""(OPTIONAL)"
hrchilds's avatar
hrchilds committed
1467 1468 1469
        AC_MSG_RESULT([all])
        ;;
    base)
1470
        OPERATOR_BUILD_DIRS="$""(REQUIRED)"
hrchilds's avatar
hrchilds committed
1471 1472
        AC_MSG_RESULT([base only])
        ;;
1473 1474 1475 1476
    minimal)
        OPERATOR_BUILD_DIRS="$""(MINIMAL)"
        AC_MSG_RESULT([minimal only])
        ;;
hrchilds's avatar
hrchilds committed
1477 1478 1479
    *)
        AC_MSG_ERROR([Please specify one of "all" or "base" for --with-operators.])
esac
1480
AC_SUBST(OPERATOR_BUILD_DIRS)
hrchilds's avatar
hrchilds committed
1481 1482 1483 1484 1485 1486 1487 1488

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)
1489
        DB_BUILD_DIRS="$""(REQUIRED) $""(THIRDPARTY_DEPENDENT) $""(OPTIONAL)"
hrchilds's avatar
hrchilds committed
1490 1491 1492
        AC_MSG_RESULT([all])
        ;;
    base)
1493
        DB_BUILD_DIRS="$""(REQUIRED) $""(THIRDPARTY_DEPENDENT)"
hrchilds's avatar
hrchilds committed
1494 1495
        AC_MSG_RESULT([base only])
        ;;
1496 1497 1498 1499
    minimal)
        DB_BUILD_DIRS="$""(MINIMAL)"
        AC_MSG_RESULT([minimal only])
        ;;
hrchilds's avatar
hrchilds committed
1500 1501 1502
    *)
        AC_MSG_ERROR([Please specify one of "all" or "base" for --with-dbs.])
esac
1503
AC_SUBST(DB_BUILD_DIRS)
hrchilds's avatar
hrchilds committed
1504

hrchilds's avatar
hrchilds committed
1505
dnl
1506
dnl Disable building bzip2. Only necessary if bzip2 won't buid somewhere
hrchilds's avatar
hrchilds committed
1507 1508 1509 1510 1511
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
1512
BZIP2_LIBS=""
hrchilds's avatar
hrchilds committed
1513 1514
if test "$Usebzip2" = "yes"; then
    BUILD_BZIP2="bzip2"
hrchilds's avatar
hrchilds committed
1515
    AC_DEFINE(HAVE_LIBBZ2, [1], [Define if you have the bz2 library.])
hrchilds's avatar
hrchilds committed
1516
    BZIP2_LIBS="-lbz2"
hrchilds's avatar
hrchilds committed
1517 1518
fi
AC_SUBST(BUILD_BZIP2)
hrchilds's avatar
hrchilds committed
1519
AC_SUBST(BZIP2_LIBS)
hrchilds's avatar
hrchilds committed
1520

hrchilds's avatar
hrchilds committed
1521 1522 1523 1524
dnl
dnl Disable building glew. Only necessary if glew won't build somewhere 
dnl
AC_ARG_ENABLE(glew,
hrchilds's avatar
hrchilds committed
1525
   [  --disable-glew          do not build or use glew library -- disables detection of OpenGL extensions],
hrchilds's avatar
hrchilds committed
1526 1527 1528 1529 1530 1531
   Useglew="$enable_glew", Useglew=yes)
BUILD_GLEW=""
GLEW_LIBS=""
GLEW_INCLUDE=""
if test "$Useglew" = "yes"; then
    BUILD_GLEW="glew"
hrchilds's avatar
hrchilds committed
1532
    AC_DEFINE(HAVE_LIBGLEW, [1], [Define if you have the GLEW library.])
hrchilds's avatar
hrchilds committed
1533 1534 1535 1536 1537 1538 1539
    GLEW_LIBS="-lGLEW"
    GLEW_INCLUDE="-I$""(TOPDIR)/include/glew"
fi
AC_SUBST(BUILD_GLEW)
AC_SUBST(GLEW_INCLUDE)
AC_SUBST(GLEW_LIBS)

hrchilds's avatar
hrchilds committed
1540
dnl
hrchilds's avatar
hrchilds committed
1541 1542
dnl Disable building boost interval library. Only necessary if boost-interval
dnl headers prevent VisIt from building somewhere
hrchilds's avatar
hrchilds committed
1543
dnl
hrchilds's avatar
hrchilds committed
1544 1545 1546 1547 1548 1549
AC_ARG_ENABLE(bilib,
   [  --disable-bilib         do not use boost interval template library -- disables adaptive CSG discretization],
   Usebilib="$enable_bilib", Usebilib=yes)
BUILD_BILIB=""
if test "$Usebilib" = "yes"; then
    BUILD_BILIB="bilib"
hrchilds's avatar
hrchilds committed
1550
    AC_DEFINE(HAVE_BILIB, [1], [Define if you have the boost interval template library.])
hrchilds's avatar
hrchilds committed
1551
fi
hrchilds's avatar
hrchilds committed
1552
AC_SUBST(BUILD_BILIB)
hrchilds's avatar
hrchilds committed
1553

hrchilds's avatar
hrchilds committed
1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564
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
1565 1566 1567 1568 1569 1570
# Check for programs.
# We shouldn't depend on too many!
AC_PROG_CXX
AC_PROG_CXXCPP
AC_PROG_CC
AC_PROG_CPP
hrchilds's avatar
hrchilds committed
1571
AC_PROG_F77
hrchilds's avatar
hrchilds committed
1572 1573 1574 1575 1576 1577 1578

# 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
1579 1580 1581 1582 1583 1584 1585 1586 1587
dnl
dnl Set BUILD_FORTRAN based on how F77 is defined
dnl
BUILD_FORTRAN=""
if test -n "$F77"; then
    BUILD_FORTRAN="\$(BUILD_FORTRAN)"
fi
AC_SUBST(BUILD_FORTRAN)

hrchilds's avatar
hrchilds committed
1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599
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
1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 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
# 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)
hrchilds's avatar
hrchilds committed
1646
               AC_DEFINE(HAVE_FTIME_PROTOTYPE, [1], [Define if you have the prototype for ftime in the <sys/timeb.h>.]),
hrchilds's avatar
hrchilds committed
1647 1648 1649 1650
               AC_MSG_RESULT(no))
               
dnl Check for setbuf in streambuf
AC_MSG_CHECKING(for setbuf)
hrchilds's avatar
hrchilds committed
1651 1652
AC_TRY_COMPILE([#include <fstream>],
                [fstream out("/dev/null",std::ios::out); out.rdbuf()->setbuf((char*)0,0);],
hrchilds's avatar
hrchilds committed
1653 1654
                AC_MSG_RESULT(yes),
                AC_MSG_RESULT(no)
hrchilds's avatar
hrchilds committed
1655
                AC_DEFINE(NO_SETBUF, [1], [Define NO_SETBUF if streambuf::setbuf is not public.]))
hrchilds's avatar
hrchilds committed
1656 1657 1658

dnl Check for ios::noreplace
AC_MSG_CHECKING(for ios::noreplace)
hrchilds's avatar
hrchilds committed
1659 1660
AC_TRY_COMPILE([#include <fstream>],
               [ofstream f("dummy",std::ios::out|std::ios::noreplace);],
hrchilds's avatar
hrchilds committed
1661
               AC_MSG_RESULT(yes)
hrchilds's avatar
hrchilds committed
1662
               AC_DEFINE(HAVE_IOS_NOREPLACE, [1], [Define if you have ios::noreplace.]),
hrchilds's avatar
hrchilds committed
1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678
               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
hrchilds's avatar
hrchilds committed
1679
    AC_DEFINE(USE_PTY, [1], [Define USE_PTY if we want to use PTYs.])
hrchilds's avatar
hrchilds committed
1680 1681 1682

    # Check for SYSV versus BSD style pseudo-ttys
    AC_MSG_CHECKING(for SYSV vs BSD style ptys)
1683
    if test "$UNAME" = "FreeBSD" || test "$UNAME" = "AIX" || test "$UNAME" = "Darwin"; then
hrchilds's avatar
hrchilds committed
1684 1685 1686 1687
        AC_MSG_RESULT(BSD)
    else
        AC_TRY_LINK([#include <stdlib.h>], grantpt(0),
            AC_MSG_RESULT(SYSV)
hrchilds's avatar
hrchilds committed
1688
            AC_DEFINE(PTY_SYSV, [1], [Define PTY_SYSV if we have System V style pty functions -- BSD otherwise.]),
hrchilds's avatar
hrchilds committed
1689 1690 1691 1692 1693 1694
            AC_MSG_RESULT(BSD))
    fi

fi

#
hrchilds's avatar
hrchilds committed
1695
# Check for -ldl if we're on SunOS or linux.
hrchilds's avatar
hrchilds committed
1696 1697
#
AC_MSG_CHECKING(for Linux and -ldl)
hrchilds's avatar
hrchilds committed
1698
if test "$UNAME" = "Linux" || test "$UNAME" = "SunOS"; then
hrchilds's avatar
hrchilds committed
1699 1700 1701 1702 1703 1704 1705 1706 1707
    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
1708
if test "$UNAME" = "SunOS"; then
hrchilds's avatar
hrchilds committed
1709 1710 1711 1712 1713
    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
1714
if test "$UNAME" = "SunOS"; then
hrchilds's avatar
hrchilds committed
1715 1716 1717 1718 1719
    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
1720
if test "$UNAME" = "SunOS"; then
hrchilds's avatar
hrchilds committed
1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733
    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)
hrchilds's avatar
hrchilds committed
1734
               AC_DEFINE(HAVE_SOCKLEN_T, [1], [Define if socklen_t is defined.]),
hrchilds's avatar
hrchilds committed
1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757
               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
1758
AC_ARG_WITH(zlib,[  --with-zlib=INC-DIR,LIB-DIR     Use the GNU zlib compression],
hrchilds's avatar
hrchilds committed
1759 1760 1761 1762 1763 1764 1765 1766 1767
            ,withval=yes)
case $withval in
    yes)
	#
	# Header
	#

        AC_CHECK_HEADERS(zlib.h)
        AC_CHECK_LIB(z, compress2,
hrchilds's avatar
hrchilds committed
1768 1769
		ZLIB_LIB="-lz $ZLIB_LIB"
		AC_DEFINE(HAVE_LIBZ, [1], [Define if you have the z library.]))
hrchilds's avatar
hrchilds committed
1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789
        ;;
    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
1790
        if test "X" != "$zlib_lib"; then
hrchilds's avatar
hrchilds committed
1791 1792 1793
	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE"
            LDFLAGS="$LDFLAGS -L$zlib_lib"
	    AC_CHECK_LIB(z, compress2,
hrchilds's avatar
hrchilds committed
1794 1795
			ZLIB_LIB="-L$zlib_lib -lz $ZLIB_LIB"
			AC_DEFINE(HAVE_LIBZ, [1], [Define if you have the z library.])
hrchilds's avatar
hrchilds committed
1796 1797 1798 1799 1800 1801 1802
			)
	    LIBS="$saved_LIBS"
	    LDFLAGS="$saved_LDFLAGS"
	    CPPFLAGS="$saved_CPPFLAGS"
        else
	    CPPFLAGS="$CPPFLAGS $ZLIB_INCLUDE"
            AC_CHECK_LIB(z, compress2,
hrchilds's avatar
hrchilds committed
1803 1804
			ZLIB_LIB="-lz $ZLIB_LIB"
			AC_DEFINE(HAVE_LIBZ, [1], [Define if you have the z library.])
hrchilds's avatar
hrchilds committed
1805 1806 1807 1808 1809 1810 1811 1812 1813
		        )
	    LIBS="$saved_LIBS"
	    CPPFLAGS="$saved_CPPFLAGS"
        fi
        ;;
esac
AC_SUBST(ZLIB_INCLUDE)
AC_SUBST(ZLIB_LIB)

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 1844 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
dnl  Is szip present?
dnl
dnl  It's required if hdf5 or hdf4 was compiled with szip support. 
dnl  Normally check for szlib.h and libisz.a but skip the test 
dnl  if `--without-zlib' is specified.
dnl  Alternate directories can be specified for the header and library by
dnl  giving names like this `--with-szip=INC,LIB' (if only the LIB directory
dnl  is supplied then it must still be preceded by a comma).
dnl

#
AC_MSG_CHECKING(for szip)
SZIP=""
SZIP_INCLUDE=""
SZIP_LIB=""
SZIP_LIBDIR=""
AC_ARG_WITH(szip,
            [  --with-szip=INC-DIR,LIB-DIR       Location of szip headers and library],
           szip_specified="yes",
           szip_specified="no",
           )
if test "$szip_specified" = "yes"; then
   if test "$withval" != "no"; then
      SZIP_INCLUDE="-I`echo $withval |cut -f1 -d,`"
      if test "$SHORT_UNAME" = "darwin"; then
         SZIP_LIB="-L`echo $withval |cut -f2 -d, -s` -lsz"
      else
         SZIP_LIB="`echo $withval |cut -f2 -d, -s`/libsz.a"
      fi
      SZIP_LIBDIR="`echo $withval |cut -f2 -d, -s`"
   fi
else
   if test "$DEFAULT_SZIP_INCLUDE" != "" ; then
      SZIP_INCLUDE="-I$DEFAULT_SZIP_INCLUDE $SZIP_INCLUDE"
   fi
   if test "$DEFAULT_SZIP_LIB" != "" ; then
      SZIP_LIBDIR="$DEFAULT_SZIP_LIB"
      if test "$SHORT_UNAME" = "darwin"; then
         SZIP_LIB="-L$DEFAULT_SZIP_LIB -lsz"
      else
         SZIP_LIB="$DEFAULT_SZIP_LIB/libsz.a"
      fi
   fi
fi
if test "$SZIP_LIB" != "" ; then
   if test "$SZIP_INCLUDE" != "" ; then
      SZIP="$""(SZIP)"
      AC_DEFINE(HAVE_SZLIB_H, [1], [Define if you have the <szlib.h> header file.])
      AC_DEFINE(HAVE_LIBSZ, [1], [Define if you have the sz library.])
      AC_MSG_RESULT(yes)
   else
      AC_MSG_RESULT(no)
   fi
else
   AC_MSG_RESULT(no)
fi
AC_SUBST(SZIP)
AC_SUBST(SZIP_INCLUDE)
AC_SUBST(SZIP_LIB)
AC_SUBST(SZIP_LIBDIR)

hrchilds's avatar
hrchilds committed
1875 1876 1877 1878 1879 1880 1881 1882
dnl
dnl  Is HDF5 present?
dnl
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
1883 1884 1885
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
1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897
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=""
1898
HDF5_LIBDIR=""
hrchilds's avatar
hrchilds committed
1899
AC_ARG_WITH(hdf5,
hrchilds's avatar
hrchilds committed
1900
	    [  --with-hdf5=INC-DIR,LIB-DIR     Location of HDF5 header and library],
hrchilds's avatar
hrchilds committed
1901 1902 1903
           hdf5_specified="yes",
           hdf5_specified="no"
           )
hrchilds's avatar
hrchilds committed
1904 1905 1906 1907 1908
if test "$SHORT_UNAME" = "darwin"; then
    H5_LIBEXT="dylib"
else
    H5_LIBEXT="a"
fi
hrchilds's avatar
hrchilds committed
1909 1910
if test "$hdf5_specified" = "yes"; then
   if test "$withval" != "no"; then
hrchilds's avatar
hrchilds committed
1911
      HDF5_INCLUDE="-I`echo $withval |cut -f1 -d,`"
1912 1913 1914 1915 1916 1917
      if test "$SHORT_UNAME" = "darwin"; then
         HDF5_LIB="-L`echo $withval |cut -f2 -d, -s` -lhdf5 $SZIP_LIB"
      else
         HDF5_LIB="`echo $withval |cut -f2 -d, -s`/libhdf5.$H5_LIBEXT $SZIP_LIB"
      fi
      HDF5_LIBDIR="`echo $withval |cut -f2 -d, -s`"
hrchilds's avatar
hrchilds committed
1918 1919 1920 1921 1922 1923
   fi
else
   if test "$DEFAULT_HDF5_INCLUDE" != "" ; then
      HDF5_INCLUDE="-I$DEFAULT_HDF5_INCLUDE $HDF5_INCLUDE"
   fi
   if test "$DEFAULT_HDF5_LIB" != "" ; then
1924 1925 1926 1927 1928 1929
      if test "$SHORT_UNAME" = "darwin"; then
         HDF5_LIB="-L$DEFAULT_HDF5_LIB -lhdf5 $SZIP_LIB $HDF5_LIB"
      else
         HDF5_LIB="$DEFAULT_HDF5_LIB/libhdf5.$H5_LIBEXT $SZIP_LIB $HDF5_LIB"
      fi
      HDF5_LIBDIR="$DEFAULT_HDF5_LIB"
hrchilds's avatar
hrchilds committed
1930 1931 1932 1933 1934 1935
   fi
fi
if test "$HDF5_LIB" != "" ; then
   if test "$HDF5_INCLUDE" != "" ; then
      HDF5="$""(HDF5)"
      AC_MSG_RESULT(yes)
hrchilds's avatar
hrchilds committed
1936 1937
      AC_DEFINE(HAVE_HDF5_H, [1], [Define if you have the <hdf5.h> header file.])
      AC_DEFINE(HAVE_LIBHDF5, [1], [Define if you have the hdf5 library.])
hrchilds's avatar
hrchilds committed
1938 1939 1940 1941 1942 1943 1944 1945 1946
   else
      AC_MSG_RESULT(no)
   fi
else
   AC_MSG_RESULT(no)
fi
AC_SUBST(HDF5)
AC_SUBST(HDF5_INCLUDE)
AC_SUBST(HDF5_LIB)
1947
AC_SUBST(HDF5_LIBDIR)
hrchilds's avatar
hrchilds committed
1948 1949 1950 1951 1952 1953

dnl
#
# Check for the public SILO includes since that's what we'll use.
#
AC_ARG_WITH(silo_include,
hrchilds's avatar
hrchilds committed
1954
	[  --with-silo_include=<INC-DIR>     User-specified SILO include directory],
hrchilds's avatar
hrchilds committed
1955 1956 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 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000
	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
2001
	[  --with-silo_library=<LIB-DIR>     User-specified SILO library directory],
hrchilds's avatar
hrchilds committed
2002 2003 2004 2005 2006
	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
2007
    SILO_LIBDIR="$silo_library"
hrchilds's avatar
hrchilds committed
2008 2009
    AC_MSG_RESULT(user specified ("$SILO_LIB"))
else
hrchilds's avatar
hrchilds committed
2010 2011 2012
    dnl On Darwin, we build Silo as a shared library.
    if test "$SHORT_UNAME" = "darwin"; then
        LIBSILO="libsilo.dylib"
hrchilds's avatar
hrchilds committed
2013
        LIBSILOH5="libsiloh5.dylib"
hrchilds's avatar
hrchilds committed
2014 2015
    else
        LIBSILO="libsilo.a"
hrchilds's avatar
hrchilds committed
2016
        LIBSILOH5="libsiloh5.a"
hrchilds's avatar
hrchilds committed
2017 2018
    fi

hrchilds's avatar
hrchilds committed
2019 2020 2021 2022 2023 2024
    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
2025 2026 2027
        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
2028
            silo_keep_checking="no"
hrchilds's avatar
hrchilds committed
2029
	elif test -r "$DEFAULT_SILO_LIBRARY/$LIBSILOH5"; then
hrchilds's avatar
hrchilds committed
2030 2031 2032
            SILO_LIBDIR="$DEFAULT_SILO_LIBRARY"
            AC_MSG_RESULT(user specified ("$SILO_LIBDIR"))
            silo_keep_checking="no"
hrchilds's avatar
hrchilds committed
2033
	    LIBSILO="$LIBSILOH5"
hrchilds's avatar
hrchilds committed
2034 2035 2036 2037 2038 2039 2040 2041
        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
2042 2043 2044 2045 2046 2047 2048 2049 2050
        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
2051 2052 2053 2054 2055
        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
2056 2057

    SILO_LIB="-L$SILO_LIBDIR -lsilo"
hrchilds's avatar
hrchilds committed
2058
fi
2059
AC_SUBST(LIBSILO)
hrchilds's avatar
hrchilds committed
2060 2061 2062 2063 2064 2065

#
# 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
hrchilds's avatar
hrchilds committed
2066
    if test -r "$SILO_LIBDIR/$LIBSILOH5"; then
hrchilds's avatar
hrchilds committed
2067 2068 2069

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

hrchilds's avatar
hrchilds committed
2070 2071 2072 2073
      if test "$SHORT_UNAME" = "darwin"; then
        SILO_LIB="-L$SILO_LIBDIR -lsiloh5 $HDF5_LIB $ZLIB_LIB"
        AC_MSG_RESULT(libsiloh5.dylib)
      else
hrchilds's avatar
hrchilds committed
2074 2075 2076 2077
        saved_CPPFLAGS="$CPPFLAGS"
        saved_LIBS="$LIBS"
	saved_SILO_LIB="$SILO_LIB"

hrchilds's avatar
hrchilds committed
2078
        SILO_LIB="-L$SILO_LIBDIR -lsiloh5 $HDF5_LIB $ZLIB_LIB"
hrchilds's avatar
hrchilds committed
2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103
        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"
hrchilds's avatar
hrchilds committed
2104
      fi
hrchilds's avatar
hrchilds committed
2105 2106 2107 2108

    else

        AC_MSG_CHECKING(whether libsilo.a depends on hdf5)
hrchilds's avatar
hrchilds committed
2109 2110 2111 2112
      if test "$SHORT_UNAME" = "darwin"; then
        SILO_LIB="$SILO_LIB $HDF5_LIB $ZLIB_LIB"
        AC_MSG_RESULT(libsilo.dylib)
      else
hrchilds's avatar
hrchilds committed
2113 2114 2115 2116 2117

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

hrchilds's avatar
hrchilds committed
2118
        SILO_LIB="$SILO_LIB $HDF5_LIB $ZLIB_LIB"
hrchilds's avatar
hrchilds committed
2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144
        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"

hrchilds's avatar
hrchilds committed
2145
      fi
hrchilds's avatar
hrchilds committed
2146 2147
    fi
fi
hrchilds's avatar
hrchilds committed
2148
AC_SUBST(SILO_LIB)
hrchilds's avatar
hrchilds committed
2149
AC_SUBST(SILO_LIBDIR)
hrchilds's avatar
hrchilds committed
2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215

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
2216
EXODUS_LIB=""
hrchilds's avatar
hrchilds committed
2217 2218 2219 2220
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
2221 2222 2223 2224 2225
    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
2226 2227 2228 2229 2230 2231
    AC_MSG_RESULT(yes)
else
    AC_MSG_RESULT(no)
fi

AC_SUBST(EXODUS)
hrchilds's avatar
hrchilds committed
2232
AC_SUBST(EXODUS_LIB)
hrchilds's avatar
hrchilds committed
2233 2234 2235 2236
AC_SUBST(EXODUS_LIBS)
AC_SUBST(EXODUS_FLAGS)

#
hrchilds's avatar
hrchilds committed
2237
# See of --with-pdb was specified. Use PDB lite otherwise.
hrchilds's avatar
hrchilds committed
2238 2239 2240 2241 2242
#
AC_MSG_CHECKING(for PDB)
PDB=""
PDB_FLAGS=""
PDB_LIBS=""
hrchilds's avatar
hrchilds committed
2243
PDB_EXEC=""
hrchilds's avatar
hrchilds committed
2244
AC_ARG_WITH(pdb,