-
Notifications
You must be signed in to change notification settings - Fork 24
/
configure.ac
1249 lines (1183 loc) · 43.7 KB
/
configure.ac
1
2
3
4
5
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
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
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
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
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
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
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
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl Copyright (C) 1994-2016 Lawrence Livermore National Security, LLC.
dnl LLNL-CODE-425250.
dnl All rights reserved.
dnl
dnl This file is part of Silo. For details, see silo.llnl.gov.
dnl
dnl Redistribution and use in source and binary forms, with or without
dnl modification, are permitted provided that the following conditions
dnl are met:
dnl
dnl * Redistributions of source code must retain the above copyright
dnl notice, this list of conditions and the disclaimer below.
dnl * Redistributions in binary form must reproduce the above copyright
dnl notice, this list of conditions and the disclaimer (as noted
dnl below) in the documentation and/or other materials provided with
dnl the distribution.
dnl * Neither the name of the LLNS/LLNL nor the names of its
dnl contributors may be used to endorse or promote products derived
dnl from this software without specific prior written permission.
dnl
dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
dnl "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
dnl LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
dnl A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LAWRENCE
dnl LIVERMORE NATIONAL SECURITY, LLC, THE U.S. DEPARTMENT OF ENERGY OR
dnl CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
dnl
dnl This work was produced at Lawrence Livermore National Laboratory under
dnl Contract No. DE-AC52-07NA27344 with the DOE.
dnl
dnl Neither the United States Government nor Lawrence Livermore National
dnl Security, LLC nor any of their employees, makes any warranty, express
dnl or implied, or assumes any liability or responsibility for the
dnl accuracy, completeness, or usefulness of any information, apparatus,
dnl product, or process disclosed, or represents that its use would not
dnl infringe privately-owned rights.
dnl
dnl Any reference herein to any specific commercial products, process, or
dnl services by trade name, trademark, manufacturer or otherwise does not
dnl necessarily constitute or imply its endorsement, recommendation, or
dnl favoring by the United States Government or Lawrence Livermore
dnl National Security, LLC. The views and opinions of authors expressed
dnl herein do not necessarily state or reflect those of the United States
dnl Government or Lawrence Livermore National Security, LLC, and shall not
dnl
dnl This is the autoconf configuration file for MeshTV and company.
dnl Robb Matzke <[email protected]>
dnl Mar 18, 1996
dnl
dnl Modifications:
dnl
dnl Eric Brugger, Tue Mar 2 12:41:32 PST 2004
dnl I modified the hdf5 library logic to statically link the hdf5
dnl library to avoid LD_LIBRARY_PATH problems and having to distribute
dnl the shared hdf5 library with binary distributions.
dnl
dnl Jeremy Meredith, Tue Jul 12 16:34:00 PDT 2005
dnl Added a Python wrapper for Silo. This required adding
dnl checks for the Python include files, adding support
dnl for shared libraries, and adding support for C++ builds.
dnl
dnl Eric Brugger, Thu Mar 9 08:49:31 PST 2006
dnl I added AC_PROG_EGREP to avoid some problems handling uid and gid
dnl on some platforms.
dnl
dnl Thomas Treadway, Mon May 22 11:30:52 PDT 2006
dnl Initial configuration file for Silo, after MeshTV split.
dnl Based on Mark Miller's "meshtv_mark_silo_451_enhancments" view.
dnl Reformated to support recent versions autoconf, and automake.
dnl
dnl Thomas Treadway, Mon Jun 1 13:11:00 PDT 2006
dnl Bugs go to [email protected]
dnl
dnl Thomas Treadway, Mon Jun 12 10:24:53 PDT 2006
dnl Conversion to libtool seems to be working pretty well.
dnl Currently using autoreconfig via config/bootstrap to use
dnl autoheaders, libtoolize, aclocal, automake, autoconf, and
dnl autotest.
dnl
dnl Thomas Treadway, Mon Jun 26 13:06:39 PDT 2006
dnl The building of tools/python is conditional and performed only on
dnl explicit request.
dnl
dnl Thomas Treadway, Wed Sep 13 12:45:01 PDT 2006
dnl Changed defaults: fortran compiler, optimization, and largefiles.
dnl
dnl Thomas Treadway, Fri Oct 6 13:50:01 PDT 2006
dnl re-enabled config-site files, added version information file
dnl src/libsilo.settings or src/libsiloh5.settings, changed version
dnl back to 4.6 (expect 5.0 after re-factoring of the driver code into
dnl an abstract I/O layer.
dnl
dnl Mark C. Miller, Wed Oct 18 17:36:59 PDT 2006
dnl Added AC_DEFINE_UNQUOTED calls to create compile-time symbols for
dnl Silo's version information. Added code at end to put this into
dnl a separate 'config_vers.h' file
dnl
dnl Thomas R. Treadway, Thu Mar 15 12:19:56 PDT 2007
dnl Added hooks for building Macintosh application bundle
dnl Added szlib support
dnl
dnl Thomas R. Treadway, Mon Jul 23 10:32:06 PDT 2007
dnl Added support for Peter Lindstrom's compression algorthims.
dnl
dnl Thomas R. Treadway, Tue Oct 23 11:47:22 PDT 2007
dnl Corrected HDF5 checking when szip present.
dnl New pre-release.
dnl
dnl Thomas R. Treadway, Thu Oct 25 16:32:40 PDT 2007
dnl Using environment variable to over SZLIB, HDF5, SILEX, QT,
dnl Fortran, and readline.
dnl
dnl Thomas R. Treadway, Thu Oct 25 16:32:40 PDT 2007
dnl Changed release, and auspices statement
dnl
dnl Thomas R. Treadway, Wed Nov 28 14:17:56 PST 2007
dnl Changed release to 4.6.1
dnl Added check for sys/stat.h
dnl Removed src/swat directory
dnl
dnl Mark C. Miller, Wed Jul 2 09:08:13 PDT 2008
dnl Isolated version information to VERSION file, though configure
dnl still needs to get re-generated with each new version.
dnl Removed slew of extraneous refs to 'UsingXXX' variables.
dnl
dnl Mark C. Miller, Mon Mar 30 13:29:57 PDT 2009
dnl Fixed uname="`uname`" to UNAME="`uname`" so Darwin check would work.
dnl
dnl Mark C. Miller, Wed Sep 2 15:21:52 PDT 2009
dnl Making it work with '--with-hdf5' where HDF5 locations are specified
dnl in the config-site file. Fixed problem where READLINE_LIBS was
dnl getting populated with ALL libs not just those necessary to support
dnl readline. Fixed problem where browser would REQUIRE readline. Still
dnl can't handle case where user wants to specify different readline
dnl include/lib dirs.
dnl
dnl Mark C. Miller, Sat Dec 5 15:20:30 PST 2009
dnl Added logic to inspect size of long and long long datatypes and, if
dnl they are different sizes, ensuring Silo's DB_LONG_LONG enum value
dnl is unique. Otherwise, ensuring it is the same as DB_LONG enum value.
dnl
dnl Mark C. Miller, Wed Jul 21 09:31:24 PDT 2010
dnl Adjusted logic to support BSD releases which will NOT include
dnl hzip/fpzip compression features or source dirs.
dnl --------------------------------------------------------------------------
dnl
dnl The esyscmd macro invokation allows us to keep version number in
dnl VERSION file and just re-generate configure instead of having to
dnl also checkout and edit configure.ac
dnl
m4_define(SILO_VERSION, m4_esyscmd([cat SILO_VERSION | tr -d '\n']))
m4_define(SILO_NAME, silo)
m4_define(SILO_BUGS,[email protected])
m4_define(SILO_TOP_SRC_DIR, `pwd`)
AC_PREREQ(2.60)
AC_REVISION($Id$)dnl
AC_INIT(SILO_NAME, SILO_VERSION, SILO_BUGS, SILO_NAME)
AC_CONFIG_SRCDIR([src/silo/silo.h.in])
AC_CONFIG_AUX_DIR(config)
dnl AM_INIT_AUTOMAKE takes a list of options that should be applied to
dnl every Makefile.am when automake is run.
AM_INIT_AUTOMAKE([1.9 foreign no-installinfo no-installman no-texinfo.tex])
AC_CONFIG_HEADER([config.h:config/config.h.in])
dnl AM_MAINTAINER_MODE turns off "rebuild rules" that contain dependencies
dnl for Makefiles, configure, src/H5config.h, etc. If AM_MAINTAINER_MODE
dnl is *not* included here, these files will be rebuilt if out of date.
dnl This is a problem because if users try to build on a machine with
dnl the wrong versions of autoconf and automake, these files will be
dnl rebuilt with the wrong versions and bad things can happen.
dnl Also, Clearcase doesn't preserve dependencies between timestamps
dnl when doing (group) checkin's, so extra care is needed to manually
dnl verify timestamps (see, FAQ) so that Makefiles doesn't think rebuilding
dnl needs to occur when it doesn't.
dnl Developers should './configure --enable-maintainer-mode' to turn on
dnl rebuild rules.
AM_MAINTAINER_MODE
AC_COPYRIGHT([This work was performed under the auspices of the
U.S. Department of Energy by Lawrence Livermore National Laboratory
in part under Contract W-7405-Eng-48 and in part under
Contract DE-AC52-07NA27344.])
# using autotest
AC_CONFIG_TESTDIR(tests)
dnl Change the default prefix (/usr/local) to `pwd`
dnl Set prefix default (install directory) to a directory in the build area.
dnl This allows multiple src-dir builds within one host.
AC_PREFIX_DEFAULT("SILO_TOP_SRC_DIR")
dnl
dnl macOS has deprecated the use of the stat64 structure defined in sys/stat.h.
dnl Thus, we check whether stat64 is present before considering to use it.
dnl On macOS, the stat structure may refer to the 32 or 64 bit version of the
dnl structure.
dnl
AC_CHECK_MEMBER([struct stat64.st_dev], [AC_DEFINE(HAVE_STAT64)], [], [[#include <sys/stat.h>]])
AC_CHECK_MEMBER([struct stat.st_dev], [AC_DEFINE(HAVE_STAT)], [], [[#include <sys/stat.h>]])
AC_DEFINE([HAVE_STAT64], [], [Whether struct stat64 is present in sys/stat.h])
AC_DEFINE([HAVE_STAT], [], [Whether struct stat is present in sys/stat.h])
dnl
dnl Handle the python module right away to determine if we need shared libs.
dnl Ordinarily, we default to static libs
dnl
PYTHONMODULE=$DEFAULT_PYTHONMODULE
AC_ARG_ENABLE(pythonmodule,
AS_HELP_STRING([--enable-pythonmodule],[build python module @<:@default=no@:>@]),
if test "$enable_pythonmodule" = "yes"; then
PYTHONMODULE="python"
fi)
AC_SUBST(PYTHONMODULE)
if test -n "$PYTHONMODULE"; then
AC_ENABLE_SHARED
else
AC_DISABLE_SHARED
fi
dnl Determine the host type
AC_CANONICAL_HOST
# Grab the version number
AC_MSG_CHECKING(what version the package is)
AC_MSG_RESULT(SILO_VERSION)
AC_SUBST([SILO_VERS_MAJ]) SILO_VERS_MAJ="`echo SILO_VERSION | cut -d'.' -f1`"
AC_SUBST([SILO_VERS_MIN]) SILO_VERS_MIN="`echo SILO_VERSION | cut -d'.' -f2 | cut -d'-' -f1`"
AC_SUBST([SILO_VERS_PAT]) SILO_VERS_PAT="`echo SILO_VERSION | cut -d'.' -f3 | cut -d'-' -f1`"
AC_SUBST([SILO_VERS_PRE]) SILO_VERS_PRE="`echo SILO_VERSION | grep pre | cut -d'-' -f2 | cut -d'e' -f2`"
AC_SUBST([SILO_VERS_TAG]) SILO_VERS_TAG="`echo Silo_version SILO_VERSION | sed -e 's/ /_/' -e 's/\./_/g' -e 's/-/_/g'`"
dnl Configuration command invocation
AC_SUBST([CONFIG_CMD]) CONFIG_CMD="`echo $0 $ac_configure_args`"
dnl Configuration date
AC_SUBST([CONFIG_DATE]) CONFIG_DATE="`date`"
dnl User doing the configuration
AC_SUBST([CONFIG_USER]) CONFIG_USER="`whoami`@`hostname`"
if test -n "$ORGANIZATION"; then
CONFIG_USER="$CONFIG_USER at $ORGANIZATION"
fi
dnl ----------------------------------------------------------------------
dnl
dnl Specify default settings for various options. These may be overridden
dnl in site-specific config files. Empty string means feature is disabled
dnl while non-empty string means it is enabled.
dnl
DEFAULT_PYTHONMODULE=""
DEFAULT_BROWSER="browser"
DEFAULT_SILEX=""
DEFAULT_HZIP="hzip"
DEFAULT_FPZIP="fpzip"
DEFAULT_ZFP="zfp-0.5.5"
DEFAULT_FORTRAN="fortran"
DEFAULT_JSON=""
default_detect_readline="yes"
dnl Source any special site-specific file
hname="`hostname`"
file=$srcdir/config-site/$hname.conf
AC_MSG_CHECKING([for site config host file])
if test -f "$file"; then
. $file
AC_MSG_RESULT(found [$file])
else
hname="`hostname | cut -f1 -d.`"
file=$srcdir/config-site/$hname.conf
if test -f "$file"; then
. $file
AC_MSG_RESULT(found [$file])
else
AC_MSG_RESULT([no])
fi
fi
dnl Source any special files that we need. These files normally aren't
dnl present but can be used by the maintainers to fine tune things like
dnl turning on debug or profiling flags for the compiler. The search order
dnl is:
dnl
dnl CPU-VENDOR-OS
dnl VENDOR-OS
dnl CPU-OS
dnl CPU-VENDOR
dnl OS
dnl VENDOR
dnl CPU
dnl uname
dnl
dnl If the `OS' ends with a version number then remove it. For instance,
dnl `freebsd3.1' would become `freebsd'
case $host_os in
aix4.*)
host_os_novers=aix4.x
;;
aix5.*)
host_os_novers=aix5.x
;;
freebsd*)
host_os_novers=freebsd
;;
irix5.*)
host_os_novers=irix5.x
;;
irix6.*)
host_os_novers=irix6.x
;;
osf4.*)
host_os_novers=osf4.x
;;
osf5.*)
host_os_novers=osf5.x
;;
solaris2.*)
host_os_novers=solaris2.x
;;
*)
host_os_novers=$host_os
;;
esac
UNAME="`uname`"
host_config="none"
for f in $host_cpu-$host_vendor-$host_os \
$host_cpu-$host_vendor-$host_os_novers \
$host_vendor-$host_os \
$host_vendor-$host_os_novers \
$host_cpu-$host_os \
$host_cpu-$host_os_novers \
$host_cpu-$host_vendor \
$host_os \
$host_os_novers \
$host_vendor \
$host_cpu \
$UNAME; do
AC_MSG_CHECKING([for config-site $f])
if test -f "$srcdir/config-site/$f.conf"; then
host_config=$srcdir/config-site/$f.conf
AC_MSG_RESULT([found])
break
fi
AC_MSG_RESULT([no])
done
if test "X$host_config" != "Xnone"; then
. $host_config
fi
#
# MCM -- 22Jul08. I don't know why we're mixing FC and F77 stuf here.
# According to autoconf web pages, we should probably use one or the
# other but not both. Also, given that silo_f.h uses FC_FUNC macro,
# I don't see how we can get by using F77. So, it is removed and we're
# using only FC.
#
dnl handle fortran compiler.
FORTRAN=$DEFAULT_FORTRAN
AC_ARG_ENABLE(fortran,
AC_HELP_STRING([--enable-fortran],
[compile Fortran interface to Silo @<:@default=yes@:>@]),
if test "$enable_fortran" = "no" ; then
FORTRAN=""
fi)
AC_SUBST(FORTRAN)
# Check for programs.
# We shouldn't depend on too many!
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
if test -n "$FORTRAN"; then
AC_PROG_FC
AC_PROG_F77
AC_FC_LIBRARY_LDFLAGS
AC_FC_WRAPPERS
fi
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_ISC_POSIX
# save the cache so far
AC_CACHE_SAVE
dnl C optimization flags
AC_ARG_ENABLE(optimization,
AC_HELP_STRING([--enable-optimization],
[compile with optimization @<:@default=no@:>@]),
[case "${enableval}" in
yes) USING_DEBUG="no";;
no) USING_DEBUG="yes";;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-optimization) ;;
esac],
[USING_DEBUG="yes"])
dnl Switch to disable score lite memory header optimizations
AC_ARG_ENABLE(normal-sclite-mem-headers,
AC_HELP_STRING([--enable-normal-sclite-mem-headers],
[compile with normal score lite memory headers @<:@default=no@:>@]),
if test "$enableval" = "yes" ; then
AC_DEFINE(NORMAL_SCLITE_HEADERS,1,[SCORE lite memory header optimizations])
fi,
AC_DEFINE(NORMAL_SCLITE_HEADERS,0,[SCORE lite memory header optimizations]))
dnl Switch to have 'make install' install score/pdb lite header files
AC_ARG_ENABLE(install-lite-headers,
AC_HELP_STRING([--enable-install-lite-headers],
[Install SCORE/PDB lite header files @<:@default=no@:>@]),
INSTLITE="$enableval")
dnl we don't need to check for netcdf driver. It is always there.
NETCDF="netcdf"
AC_DEFINE(HAVE_NETCDF_DRIVER,1,[Support for NetCDF])
AC_SUBST(NETCDF)
dnl we don't need to check for pdb driver. It is always there.
PDB_DRV="pdb_drv"
AC_DEFINE(HAVE_PDB_DRIVER,1,[Support for PDB])
AC_SUBST(PDB_DRV)
dnl we don't need to check for taurus driver. It is always there.
TAURUS="taurus"
AC_DEFINE(HAVE_TAURUS_DRIVER,1,[Support for Taurus])
AC_SUBST(TAURUS)
dnl we don't need to check for hdf5 driver. It is always there.
HDF5_DRV="hdf5_drv"
AC_SUBST(HDF5_DRV)
# Some sites have the GNU readline header files and libraries installed
# incorrectly which causes programs that use them to not link or possibly
# not run. This configure doesn't check for misconfigured systems, but
# it does allow the user to prevent the GNU readline files from being
# detected.
AC_ARG_WITH(readline,
AC_HELP_STRING([--with-readline],
[enable detection of GNU readline @<:@default=yes@:>@]),
detect_readline=$withval,
detect_readline=$default_detect_readline)
dnl
dnl handle browser.
dnl
BROWSER=$DEFAULT_BROWSER
AC_ARG_ENABLE(browser,
AC_HELP_STRING([--enable-browser],
[build browser @<:@default=yes@:>@]),
if test "$enable_browser" = "no"; then
BROWSER=""
fi)
AC_SUBST(BROWSER)
dnl handle silex
SILEX=$DEFAULT_SILEX
AC_ARG_ENABLE(silex,
AC_HELP_STRING([--enable-silex],
[build the silex browser @<:@default=no@:>@]),
if test "$enable_silex" = "yes"; then
SILEX="silex"
fi)
AC_SUBST(SILEX)
dnl Handle explicit request for libz
AC_ARG_WITH(zlib, [ --with-zlib=INC,DIR Use the GNU zlib compression @<:@default=yes@:>@])
if test "$with_zlib" = no; then
AC_DEFINE(HAVE_ZLIB_H,0)
AC_DEFINE(HAVE_LIBZ,0)
ZLIB=""
elif test -n "$with_zlib" && test "$with_zlib" != yes; then
ZLIB_INCDIR="`echo $with_zlib |cut -f1 -d,`"
if test ! -f $ZLIB_INCDIR/zlib.h; then
AC_MSG_ERROR(problem with directory specified for zlib includes)
fi
ZLIB_LIBDIR="`echo $with_zlib | cut -f2 -d, -s`"
if test ! -f $ZLIB_LIBDIR/libz.a && test ! -f $ZLIB_LIBDIR/libz.so; then
AC_MSG_ERROR(problem with directory specified for zlib libs)
fi
CPPFLAGS="$CPPFLAGS -I$ZLIB_INCDIR"
LDFLAGS="$LDFLAGS -L$ZLIB_LIBDIR"
LIBS="$LIBS -lz"
AC_DEFINE(HAVE_ZLIB_H,1)
AC_DEFINE(HAVE_LIBZ,1)
ZLIB="zlib"
fi
dnl handle Peter Lindstrom's hzip compression stuff
AC_MSG_CHECKING(for hzip)
if test -d $srcdir/src/hzip; then
AC_MSG_RESULT(found)
HZIP=$DEFAULT_HZIP
else
AC_MSG_RESULT(hzip compression not available in BSD version)
HZIP=""
fi
AC_ARG_ENABLE(hzip,
AC_HELP_STRING([--enable-hzip],
[enable Lindstrom hex/quad mesh compression @<:@default=yes@:>@]),
if test "$enable_hzip" = "no"; then
HZIP=""
fi)
AC_SUBST(HZIP)
dnl hzip does better with zlib if available. It may have been
dnl explicitly turned off, above. If not, Assume we have both
dnl header & lib. Turn it off if not.
if test -n "$HZIP" && test "$with_zlib" != no; then
AC_DEFINE(HAVE_HZIP,1,[Support for Lindstrom hex/quad mesh compression])
ZLIB="zlib"
AC_CHECK_HEADERS(zlib.h,have_zlib_h="yes")
if test -n "$have_zlib_h"; then
AC_CHECK_LIB(z, inflateEnd)
if test -z "`echo $LIBS | tr ' ' '\n' | grep -x -e '-lz'`"; then
AC_DEFINE(HAVE_ZLIB_H,0)
AC_DEFINE(HAVE_LIBZ,0)
ZLIB=""
fi
fi
AC_SUBST(ZLIB)
fi
dnl enable Peter Lindstrom's fpzip compression stuff
AC_MSG_CHECKING(for fpzip)
if test -d $srcdir/src/fpzip; then
AC_MSG_RESULT(found)
FPZIP=$DEFAULT_FPZIP
else
AC_MSG_RESULT(fpzip compression not available in BSD version)
FPZIP=""
fi
AC_ARG_ENABLE(fpzip,
AC_HELP_STRING([--enable-fpzip],
[enable Lindstrom float 1,2,3D array compression @<:@default=yes@:>@]),
if test "$enable_fpzip" = "no"; then
FPZIP=""
fi)
AC_SUBST(FPZIP)
if test -n "$FPZIP"; then
AC_DEFINE(HAVE_FPZIP,1,[Support for Lindstrom float array compression])
fi
dnl enable Peter Lindstrom's ZFP compression stuff
AC_MSG_CHECKING(for zfp)
if test -d $srcdir/src/zfp-0.5.5; then
AC_MSG_RESULT(found)
ZFP=$DEFAULT_ZFP
else
AC_MSG_RESULT(zfp compression not available)
ZFP=""
fi
AC_ARG_ENABLE(zfp,
AC_HELP_STRING([--enable-zfp],
[enable Lindstrom array compression @<:@default=yes@:>@]),
if test "$enable_zfp" = "no"; then
ZFP=""
fi)
AC_SUBST(ZFP)
if test -n "$ZFP"; then
AC_DEFINE(HAVE_ZFP,1,[Support for Lindstrom array compression])
fi
dnl enable experimental JSON support
AC_ARG_ENABLE(json,
AC_HELP_STRING([--enable-json],
[enable experimental JSON features@<:@default=no@:>@]),
if test "$enable_json" = "yes"; then
AC_MSG_CHECKING(Enabling json...)
if test -e ${ac_abs_confdir}/tools/json/json-c-0.10.tar.gz; then
if test -z "$(find tools/json/json-c-0.10 -name libjson.so -o -name libjson.a -o -name libjson.dylib)"; then
if test ! -e ./tools/json; then
mkdir tools 1>/dev/null 2>&1
mkdir tools/json 1>/dev/null 2>&1
fi
pushd tools/json 1>/dev/null 2>&1
rm -rf json-c-0.10
gunzip < ${ac_abs_confdir}/tools/json/json-c-0.10.tar.gz | tar xf -
cd json-c-0.10
if test ! "${prefix}" = "NONE"; then
./configure --prefix=${prefix}/json
make install
else
./configure
make
fi
if test $? -eq 0; then
AC_MSG_RESULT(json-c compiled and installed)
JSON="json"
else
AC_MSG_RESULT(JSON support disabled due to failure to install)
JSON=""
fi
popd 1>/dev/null 2>&1
else
AC_MSG_RESULT(json-c compiled and installed)
JSON="json"
fi
else
AC_MSG_RESULT(JSON support not available because json-c distribution is not in this tarball)
JSON=""
fi
fi)
AC_SUBST(JSON)
if test -n "$JSON"; then
AC_DEFINE(HAVE_JSON,1,[Support for experimental JSON features])
fi
# Turn on C optimization flags
AC_MSG_CHECKING(compiler optimization)
if test "X$USING_DEBUG" = Xno; then
# use contributed GNU m4 macro library provided see:
# autoconf-archive-2006-06-04/htmldoc/ax_cc_maxopt.html
AX_CC_MAXOPT
AC_MSG_RESULT(enabled)
else
AC_MSG_RESULT(disabled)
fi
dnl
#
# MCM: I have no idea what good the following line does. I think
# all compilers accept the -D argument and any string following
# it is an argument to the -D argument. So, I think this is
# just totally bogus!
# Default to large file support
AX_CHECK_COMPILER_FLAGS("-D_LARGEFILE_SOURCE", [CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE"])
AX_CHECK_COMPILER_FLAGS("-D_LARGEFILE64_SOURCE", [CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"])
AX_CHECK_COMPILER_FLAGS("-D_FILE_OFFSET_BITS=64", [CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64"])
AX_CHECK_COMPILER_FLAGS("-Wdeclaration-after-statement", [CFLAGS="$CFLAGS -Wdeclaration-after-statement"])
#
# Note: regardless of what the stuff above regarding large file support
# appears to do, the following test is the one that affects Silo's
# knowledge and support for large files. It may be that the result of
# the sizeof check is dependent on whether -D_LARGEFILE64_SOURCE is
# defined on the command line to the compiler though.
# Use size of off64_t to determine which form of stat() calls to make
#
AC_CHECK_SIZEOF(off64_t)
dnl We always use the install-sh script, so don't uncomment the following line.
AC_PROG_INSTALL
dnl
dnl Checks for header files.
dnl
dnl If we don't have these header files, we can't continue.
dnl
AC_CHECK_HEADERS([sys/time.h stdarg.h sys/stat.h], [],
AC_MSG_ERROR([$0 wasn't able to find a necessary header file
(see above). Please rectify this and rerun configure.
See the file INSTALL_FAQ in this directory for possible reasons
this might have happened.]))
AC_CHECK_HEADERS([fcntl.h])
AC_CHECK_HEADERS([sys/fcntl.h])
if test ! "$ac_cv_header_fcntl_h"="yes" && test ! "$ac_cv_header_sys_fcntl_h"="yes" ; then
AC_MSG_ERROR([$0 wasn't able to find a necessary fcntl.h or
sys/fcntl.h header file.
Please rectify this and rerun configure.
See the file INSTALL_FAQ in this directory for possible reasons
this might have happened.])
fi
dnl
dnl Check for header files that we can do without.
dnl Only needed by browser
AC_CHECK_HEADERS([fnmatch.h])
dnl Only needed by silock
AC_CHECK_HEADERS([ieeefp.h])
dnl a few systems define O_RDONLY here
AC_CHECK_HEADERS([sys/types.h unistd.h])
dnl
AC_HEADER_STDC
dnl
dnl Check for various functions in the STDIO header files.
dnl
dnl Note that we are calling two "changequote" macros. This is because the
dnl default quoting mechanism is to use `[' and `]'. Since we have to use
dnl these in the "tr" call, we need to change them to something else
dnl temporarily.
dnl
dnl The following `if false' statement is *only* so autoheader can pick up
dnl the names of the constants and insert them into the config.h.in file. If
dnl the AC_DEFINE statements are removed then autoheader never sees the
dnl constants.
if false; then
AC_DEFINE(HAVE_FCLOSE_POINTER,1,[System provides fclose prototypes])
AC_DEFINE(HAVE_FFLUSH_POINTER,1,[System provides fflush prototypes])
AC_DEFINE(HAVE_FOPEN_POINTER,1,[System provides fopen prototypes])
AC_DEFINE(HAVE_FPRINTF_POINTER,1,[System provides fprintf prototypes])
AC_DEFINE(HAVE_FREAD_POINTER,1,[System provides fread prototypes])
AC_DEFINE(HAVE_FSEEK_POINTER,1,[System provides fseek prototypes])
AC_DEFINE(HAVE_SETVBUF_POINTER,1,[System provides setvbuf prototypes])
AC_DEFINE(HAVE_FTELL_POINTER,1,[System provides ftell prototypes])
AC_DEFINE(HAVE_FWRITE_POINTER,1,[System provides fwrite prototypes])
fi
for function in fclose fflush fopen fprintf fread fseek setvbuf ftell fwrite
do
changequote(<<,>>)
cap_func="`echo ${function}|tr [a-z] [A-Z]`"
changequote([,])
cache_name="`echo vc_cv_${function}_pointer`"
have_name="`echo HAVE_${cap_func}_POINTER`"
AC_MSG_CHECKING(for $function function pointer)
AC_CACHE_VAL($cache_name,
AC_TRY_COMPILE([#include <stdio.h>],
[ int (*f)() = (int(*)())$function; ],
[eval $cache_name=yes ],
[eval $cache_name=no ]
)
)
if eval "test \"`echo '$''{'$cache_name'}'`\" = no"; then
AC_MSG_RESULT(no, using a replacement.)
else
AC_DEFINE_UNQUOTED(${have_name},1,[System provides prototype])
AC_MSG_RESULT(yes)
fi
done
dnl
dnl Check for library functions that can work around, or that we have
dnl replacements for.
dnl
AC_CHECK_FUNCS([memmove fnmatch isnan fpclass strerror])
dnl
dnl On Paragon/TeraFLOP systems there are "buggy" versions of
dnl `setjmp' and `longjmp' that print an error message to use
dnl `_setjmp' and `_longjmp' instead and exit with a non-zero
dnl status.
dnl
AC_MSG_CHECKING(if setjmp and longjmp work)
if test -n "$SETJMP_OVERRIDE"; then
AC_MSG_RESULT(no. Replacing with _setjmp and _longjmp.)
AC_DEFINE(setjmp,_setjmp,[Override setjmp])
AC_DEFINE(longjmp,_longjmp,[Override longjmp])
else
AC_MSG_RESULT(yes)
fi
dnl
dnl save the cache
dnl
AC_CACHE_SAVE
dnl Check for Qt library
if test -n "$SILEX"; then
AX_HAVE_QT
fi dnl if test -n "$SILEX"; then
dnl the hdf5 library checks (to follow) will require the -lm if its required
AC_CHECK_LIBM
LIBS="$LIBS $LIBM"
dnl ----------------------------------------------------------------------
dnl Is the szlib present? It has a library
dnl `-lsz' and their locations might be specified with the `--with-szlib'
dnl command-line switch. The value is a root directory contain the lib
dnl directory.
dnl
AC_ARG_WITH([szlib],
[AC_HELP_STRING([--with-szlib=DIR],
[Use szlib library for external szlib I/O
filter [default=no]])],,
withval=default)
case $withval in
default)
HAVE_SZLIB="no"
if test "$DEFAULT_SZIP" != "" ; then
LDFLAGS="$LDFLAGS -L$DEFAULT_SZIP/lib"
LIBS="$LIBS -lsz"
HAVE_SZLIB="yes"
szlib_lib="$DEFAULT_SZIP/lib"
fi
if test "$DEFAULT_SZIP_LIB" != "" ; then
LDFLAGS="$LDFLAGS -L$DEFAULT_SZIP_LIB"
LIBS="$LIBS -lsz"
HAVE_SZLIB="yes"
szlib_lib="$DEFAULT_SZIP_LIB"
fi
if test "$DEFAULT_SZIP_LIBDIR" != "" ; then
LDFLAGS="$LDFLAGS -L$DEFAULT_SZIP_LIBDIR"
LIBS="$LIBS -lsz"
HAVE_SZLIB="yes"
szlib_lib="$DEFAULT_SZIP_LIBDIR"
fi
if test "$HAVE_SZLIB" = "yes" ; then
AC_MSG_CHECKING([default szlib path provided])
AC_MSG_RESULT([$szlib_lib])
AC_DEFINE(HAVE_LIBSZ,1,[szip library])
else
AC_MSG_CHECKING([for szlib])
AC_MSG_RESULT([suppressed])
AC_DEFINE(HAVE_LIBSZ,0,[szip library])
fi
;;
yes)
HAVE_SZLIB="no"
if test "$DEFAULT_SZIP" != "" ; then
LDFLAGS="$LDFLAGS -L$DEFAULT_SZIP/lib"
LIBS="$LIBS -lsz"
HAVE_SZLIB="yes"
szlib_lib="$DEFAULT_SZIP/lib"
fi
if test "$DEFAULT_SZIP_LIB" != "" ; then
LDFLAGS="$LDFLAGS -L$DEFAULT_SZIP_LIB"
LIBS="$LIBS -lsz"
HAVE_SZLIB="yes"
szlib_lib="$DEFAULT_SZIP_LIB"
fi
if test "$DEFAULT_SZIP_LIBDIR" != "" ; then
LDFLAGS="$LDFLAGS -L$DEFAULT_SZIP_LIBDIR"
LIBS="$LIBS -lsz"
HAVE_SZLIB="yes"
szlib_lib="$DEFAULT_SZIP_LIBDIR"
fi
if test "$HAVE_SZLIB" = "yes" ; then
AC_MSG_CHECKING([using szlib path provided])
AC_MSG_RESULT([$szlib_lib])
AC_DEFINE(HAVE_LIBSZ,1,[szip library])
else
AC_MSG_ERROR([expect to find szlib environment variables])
AC_MSG_CHECKING([for szlib])
AC_MSG_RESULT([suppressed])
AC_DEFINE(HAVE_LIBSZ,0,[szip library])
fi
;;
no)
HAVE_SZLIB="no"
AC_MSG_CHECKING([for szlib])
AC_MSG_RESULT([suppressed])
AC_DEFINE(HAVE_LIBSZ,0,[szip library])
;;
*)
HAVE_SZLIB="yes"
case "$withval" in
*)
if test -n "$withval"; then
szlib_lib="$withval/lib"
fi
;;
esac
if test -n "$szlib_lib"; then
LDFLAGS="$LDFLAGS -L$szlib_lib"
fi
AC_CHECK_LIB([sz], [SZ_BufftoBuffCompress],,
[LDFLAGS="$saved_LDFLAGS"; unset HAVE_SZLIB])
if test -z "$HAVE_SZLIB" -a -n "$HDF5_CONFIG_ABORT"; then
AC_MSG_ERROR([couldn't find szlib library])
AC_DEFINE(HAVE_LIBSZ,0,[szip library])
else
AC_DEFINE(HAVE_LIBSZ,1,[szip library])
fi
;;
esac
# Is HDF5 present (it's needed for the silo/hdf5 driver for pmesh/alec SAMI
# files larger than 2GB until SAF is in place)? Normally check for
# hdf5.h and libhdf5.a but skip the test if `--without-hdf5' is specified.
# Alternate directories can be specified for hdf5.h and/or libhdf5.a by giving
# the names like this `--with-hdf5=INC,LIB' (if only the LIB directory is
# given then it must still be preceded by a comma).
#
# Checking for hdf5 is complicated by the fact that hdf5 may or may not
# in turn depend on zlib compression lib. In and of itself, Silo does NOT
# depend on zlib. So, we don't want -lz on the link line if zlib is either
# not needed or, worse, not present as this generates warning messages
# or fatal errors. So, we first test for hdf5 without -lz on the link line.
# If this succeeds, we conclude hdf5 is present and we can build the hdf5
# driver. If hdf5 fails, it may be that hdf5 was compiled with zlib. So, next
# we make an independent test for zlib. If zlib fails, we conclude that the
# failure on the hdf5 test was due to something other than lack of zlib and
# decide libhdf5.a is NOT present and we cannot build the hdf5 driver. If
# zlib succeeds, we re-try the hdf5 test with -lz on the link line. If that
# succeeds, we conclude we need -lz on the link line and we can build the
# hdf5 driver. Again, if it fails, we neither put -lz on the link line nor
# build the hdf5 driver. One other possibility that could be tested for
# and configure could make a reasonable comment on is to see if only the
# binaries for hdf5 were installed AND they have zlib dependences which
# are NOT resolvable on the platform they are installed on. This would be
# a boneheaded thing to do, but nonetheless something that configure could
# inform the user has gone wrong and what to do.
#
if test -n "$HDF5_DRV"; then
AC_MSG_CHECKING(for hdf5)
saved_CPPFLAGS="$CPPFLAGS"
saved_LDFLAGS="$LDFLAGS"
saved_LIBS="$LIBS"
AC_ARG_WITH([hdf5],
[ --with-hdf5=INC,LIB Location of HDF5 header and library],
,
withval="default")
if test "$withval" = "no" ; then
AC_MSG_RESULT(suppressed)
HDF5_DRV=""
elif test "$withval" = "default" ; then
if test "$DEFAULT_HDF5_LIBDIR" != "" ; then
LDFLAGS="$LDFLAGS -L$DEFAULT_HDF5_LIBDIR"
LIBS="$LIBS -lhdf5 -lz"
hdf5_lib=$DEFAULT_HDF5_LIBDIR
hdf5_explicit=true
fi
if test "$DEFAULT_HDF5_INCLUDE" != "" ; then
CPPFLAGS="$CPPFLAGS -I$DEFAULT_HDF5_INCLUDE"
hdf5_inc=$DEFAULT_HDF5_INCLUDE
hdf5_explicit=true
fi
if test -d "$hdf5_lib"; then
AC_MSG_RESULT([$hdf5_lib])
AC_DEFINE(HAVE_HDF5_H,1,[hdf5 header file])
AC_DEFINE(HAVE_LIBHDF5,1,[hdf5 library])
else
AC_MSG_RESULT(no)
HDF5_DRV=""
fi
elif test "$withval" = "yes" ; then
if test "$DEFAULT_HDF5_LIBDIR" != "" ; then
LDFLAGS="$LDFLAGS -L$DEFAULT_HDF5_LIBDIR"
LIBS="$LIBS -lhdf5 -lz"
hdf5_lib=$DEFAULT_HDF5_LIBDIR
hdf5_explicit=true
fi
if test "$DEFAULT_HDF5_INCLUDE" != "" ; then
CPPFLAGS="$CPPFLAGS -I$DEFAULT_HDF5_INCLUDE"
hdf5_inc=$DEFAULT_HDF5_INCLUDE
hdf5_explicit=true
fi
if test -d "$hdf5_lib"; then
AC_MSG_RESULT([$hdf5_lib])
AC_DEFINE(HAVE_HDF5_H,1,[hdf5 header file])
AC_DEFINE(HAVE_LIBHDF5,1,[hdf5 library])
else
AC_MSG_ERROR([expected to find hdf5 environment variables])
AC_MSG_RESULT(no)
HDF5_DRV=""
fi
else
AC_CHECKING(for hdf5 and supporting libraries)
hdf5_inc="`echo $withval |cut -f1 -d,`"
if test "$withval" != "yes" && test -n "$hdf5_inc"; then
hdf5_explicit=true
if test -d "$hdf5_inc"; then
CPPFLAGS="-I$hdf5_inc $CPPFLAGS"
else
AC_MSG_ERROR(problem with directory specified for hdf5 includes)
fi
fi
hdf5_lib="`echo $withval |cut -f2 -d, -s`"
if test "$withval" != "yes" && test -n "$hdf5_lib"; then
hdf5_explicit=true
if test -d "$hdf5_lib"; then
if test -n "$szlib_lib"; then
LDFLAGS="-L$hdf5_lib -L$szlib_lib $LDFLAGS"
else
LDFLAGS="-L$hdf5_lib $LDFLAGS"
fi
else
AC_MSG_ERROR(problem with directory specified for hdf5 library)
fi
fi
notfound=""
AC_CHECK_HEADERS(hdf5.h,,notfound="hdf5.h")
tmp_LIBS="$LIBS"
if test -n "$szlib_lib"; then
### LIBS="$hdf5_lib/libhdf5.a $LIBS"
LIBS="-lhdf5 -lsz $LIBS"
else
LIBS="-lhdf5 $LIBS"
fi
AC_CHECK_FUNC(H5open,[AC_DEFINE(HAVE_LIBHDF5,1,[using HDF5])],notfound="$notfound libhdf5.a")
if test -n "$notfound"; then
LIBS="$tmp_LIBS"
fi
#
# If the above tests did NOT find headers and lib for
# hdf5, it could be due to zlib, so now test for zlib
# MCM -- July, 2008: This code now looks completely useless
# It is supposed to attempt to check if '-lz' is needed to
# link with HDF5. However, it doesn't appear to do any of
# that and had a useless embedded AC_ARG_WITH in it which
# I removed and replaced all instances of 'withval' to the
# with variable the code needs, with_zlib
#
if test -n "$notfound"; then
# reset the compile and link flags