-
Notifications
You must be signed in to change notification settings - Fork 8
/
configure.ac
1187 lines (1026 loc) · 36.4 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
## Process this file with autoconf to produce configure.
##
## Copyright by The HDF Group.
## All rights reserved.
##
## This file is part of the HDF5 REST VOL connector. The full copyright
## notice, including terms governing use, modification, and redistribution,
## is contained in the COPYING file, which can be found at the root of the
## source code distribution tree.
##
## ----------------------------------------------------------------------
## Initialize configure.
##
AC_REVISION($Id: configure.ac 4d173db 2018-01-29 15:18:47Z jhenderson $)
AC_PREREQ([2.69])
## AC_INIT takes the name of the package, the version number, and an
## email address to report bugs. AC_CONFIG_SRCDIR takes a unique file
## as its argument.
##
## NOTE: Do not forget to change the version number here when we do a
## release!!!
##
AC_INIT([REST VOL], [1.0.0], [[email protected]])
AC_CONFIG_SRCDIR([src/rest_vol.c])
AC_CONFIG_HEADERS([src/rest_vol_config.h])
AC_CONFIG_AUX_DIR([bin])
AC_CONFIG_MACRO_DIR([m4])
## AM_INIT_AUTOMAKE takes a list of options that should be applied to
## every Makefile.am when automake is run.
AM_INIT_AUTOMAKE([foreign subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # use silent rules where available - automake 1.11
## AM_MAINTAINER_MODE turns off "rebuild rules" that contain dependencies
## for Makefiles, configure, src/H5config.h, etc. If AM_MAINTAINER_MODE
## is enabled, these files will be rebuilt if out of date. This is a
## problem because if users try to build on a machine with
## the wrong versions of autoconf and automake, these files will be
## rebuilt with the wrong versions and bad things can happen.
## Also, CVS doesn't preserve dependencies between timestamps, so
## Makefiles will often think rebuilding needs to occur when it doesn't.
##
## By default, it is enabled. Users can configure with
## --disable-maintainer-mode to prevent running the autotools.
AM_MAINTAINER_MODE([disable])
## ----------------------------------------------------------------------
## Set prefix default (install directory) to a directory in the build
## area. This allows multiple src-dir builds within one host.
AC_PREFIX_DEFAULT([`pwd`/rest_vol_build])
if test "${prefix}" = NONE; then
prefix=$ac_default_prefix
fi
## Run post processing on files created by configure.
## rest_vol_config.h:
## Re-generate rest_vol_config.h by prepending RV_ to all macro names in
## order to avoid name conflicts between the REST VOL macro names and the
## macro names possibly generated by software that uses the REST VOL.
## src/libhdf5_vol_rest.settings:
## Remove all lines begun with "#" which are generated by CONDITIONALs of
## configure.
AC_CONFIG_COMMANDS([pubconf], [
echo "editing src/rest_vol_config.h"
sed 's/#define /#define RV_/' < src/rest_vol_config.h |\
sed 's/#undef /#undef RV_/' > src/pubconf
if (diff src/pubconf src/rest_vol_config.h); then
rm -f src/pubconf
echo "src/rest_vol_config.h is unchanged"
else
/bin/mv -f src/pubconf src/rest_vol_config.h
fi
echo "Post processing src/libhdf5_vol_rest.settings"
sed '/^#/d' < src/libhdf5_vol_rest.settings > libhdf5_vol_rest.settings.TMP
cp libhdf5_vol_rest.settings.TMP src/libhdf5_vol_rest.settings
rm -f libhdf5_vol_rest.settings.TMP
])
if test "${libdir}" = NONE; then
libdir=$ac_default_libdir
fi
## -----------------------------------------------------------------------
## Set lib dir suffix. By default, search for required libraries in 'lib'
## on 32-bit machines and 'lib64' on 64-bit machines
if test `getconf LONG_BIT` = 64; then
LIB_SUFFIX="64"
else
LIB_SUFFIX="32"
fi
AC_SUBST([LIB_SUFFIX])
## -----------------------------------------------------------------------
## Check to make sure cURL and YAJL are available
AC_SEARCH_LIBS(curl_easy_setopt, curl, [], [AC_ERROR([A working libcurl is required])])
AC_SEARCH_LIBS(yajl_tree_get, yajl, [], [AC_ERROR([A working libyajl is required])])
AC_CANONICAL_HOST
AC_SUBST([CPPFLAGS])
AC_SUBST([AR_FLAGS])
## H5_CFLAGS (and company) are for CFLAGS that should be used on HDF5, but
## not exported to h5cc (or h5fc, etc.)
AC_SUBST([H5_CFLAGS])
AC_SUBST([H5_CPPFLAGS])
AC_SUBST([H5_LDFLAGS])
## RV_CFLAGS are used for building the REST VOL and the test suite
AC_SUBST([RV_CFLAGS])
AC_SUBST([RV_CPPFLAGS])
AC_SUBST([RV_LDFLAGS])
## AM_CFLAGS (and company) are for CFLAGS that should be used on HDF5,
## and WILL be exported to h5cc (or h5fc, etc) if set by configure.
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_LDFLAGS])
## Make sure flags are initialized.
AM_CFLAGS="${AM_CFLAGS}"
AM_CPPFLAGS="${AM_CPPFLAGS}"
AM_LDFLAGS="${AM_LDFLAGS}"
CFLAGS="${CFLAGS}"
CPPFLAGS="${CPPFLAGS}"
LDFLAGS="${LDFLAGS}"
AR_FLAGS="${AR_FLAGS}"
## Configure may need to alter any of the *FLAGS variables in order for
## various checks to work correctly. Save the user's value here so it
## can be restored once all configure checks are complete.
saved_user_CFLAGS="$CFLAGS"
saved_user_LDFLAGS="$LDFLAGS"
saved_user_CPPFLAGS="$CPPFLAGS"
## ----------------------------------------------------------------------
## Dump all shell variables values.
##
AC_MSG_CHECKING([shell variables initial values])
set >&AS_MESSAGE_LOG_FD
AC_MSG_RESULT([done])
## ----------------------------------------------------------------------
## Save system information for the library settings file.
##
AC_SUBST([UNAME_INFO])
UNAME_INFO=`uname -a`
## ----------------------------------------------------------------------
## Some platforms have broken basename, and/or xargs programs. Check
## that it actually does what it's supposed to do. Catch this early
## since configure and scripts relies upon them heavily and there's
## no use continuing if it's broken.
##
AC_MSG_CHECKING([if basename works])
BASENAME_TEST="`basename /foo/bar/baz/qux/basename_works`"
if test $BASENAME_TEST != "basename_works"; then
AC_MSG_ERROR([basename program doesn't work])
else
AC_MSG_RESULT([yes])
fi
## xargs basename used in configure to get the CC_BASENAME value
AC_MSG_CHECKING([if xargs works])
XARGS_TEST="`echo /foo/bar/baz/qux/xargs_works | xargs basename`"
if test $XARGS_TEST != "xargs_works"; then
AC_MSG_ERROR([xargs program doesn't work])
else
AC_MSG_RESULT([yes])
fi
## ----------------------------------------------------------------------
## Check that the cache file was build on the same host as what we're
## running on now.
##
AC_CACHE_CHECK([for cached host], [hdf5_cv_host], [hdf5_cv_host="none"]);
if test $hdf5_cv_host = "none"; then
hdf5_cv_host=$host
elif test $hdf5_cv_host != $host; then
echo "The config.cache file was generated on $hdf5_cv_host but"
echo "this is $host. Please remove that file and try again."
AC_MSG_ERROR([config.cache file is invalid])
fi
## ----------------------------------------------------------------------
## Source any special files that we need. These files normally aren't
## present but can be used by the maintainers to fine tune things like
## turning on debug or profiling flags for the compiler. The search order
## is:
##
## CPU-VENDOR-OS
## VENDOR-OS
## CPU-OS
## CPU-VENDOR
## OS
## VENDOR
## CPU
##
## If the `OS' ends with a version number then remove it. For instance,
## `freebsd3.1' would become `freebsd'
case $host_os in
aix*)
host_os_novers=aix
;;
freebsd*)
host_os_novers=freebsd
;;
solaris*)
host_os_novers=solaris
;;
*)
host_os_novers=$host_os
;;
esac
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 ; do
AC_MSG_CHECKING([for config $f])
if test -f "$srcdir/config/$f"; then
host_config=$srcdir/config/$f
AC_MSG_RESULT([found])
break
fi
AC_MSG_RESULT([no])
done
if test "X$host_config" != "Xnone"; then
CC_BASENAME="`echo $CC | cut -f1 -d' ' | xargs basename 2>/dev/null`"
. $host_config
fi
## Source any special site-specific file
hname="`hostname`"
while test -n "$hname"; do
file=$srcdir/config/site-specific/host-$hname
AC_MSG_CHECKING([for config $file])
if test -f "$file"; then
. $file
AC_MSG_RESULT([found])
break
fi
AC_MSG_RESULT([no])
hname_tmp=$hname
hname="`echo $hname | cut -d. -f2-99`"
test "$hname_tmp" = "$hname" && break
done
## ----------------------------------------------------------------------
## Determine build mode (debug, production, clean).
## This has to be done early since the build mode is referred to
## frequently.
##
AC_MSG_CHECKING([build mode])
AC_ARG_ENABLE([build-mode],
[AS_HELP_STRING([--enable-build-mode=(debug|production)],
[Sets the build mode. Debug turns on debug
output printing.
Production turns high optimizations on.
All these settings can be overridden by using
specific configure flags.
[default=production]
])],
[BUILD_MODE=$enableval])
## Set the default
## Depends on branch, set via script at branch creation time
if test "X-$BUILD_MODE" = X- ; then
BUILD_MODE=production
fi
# Add in conditional for whether debug mode is enabled
AM_CONDITIONAL([DEBUG_ENABLED], [test "X-$BUILD_MODE" = "X-debug"])
## Allow this variable to be substituted in
## other files (src/libhdf5.settings.in, etc.)
AC_SUBST([BUILD_MODE])
case "X-$BUILD_MODE" in
X-debug)
AC_DEFINE([CONNECTOR_DEBUG], , [Define to have the REST VOL print out debugging information.])
H5_CFLAGS="$H5_CFLAGS $DEBUG_CFLAGS"
H5_CPPFLAGS="$H5_CPPFLAGS $DEBUG_CPPFLAGS"
AC_MSG_RESULT([debug])
;;
X-production)
H5_CFLAGS="$H5_CFLAGS $PROD_CFLAGS"
H5_CPPFLAGS="$H5_CPPFLAGS $PROD_CPPFLAGS"
AC_MSG_RESULT([production])
;;
*)
AC_MSG_ERROR([Unrecognized build mode: $BUILD_MODE. Use debug or production.])
esac
## ----------------------------------------------------------------------
## Some built-in configure checks can only see CFLAGS (not AM_CFLAGS), so
## we need to add this in so configure works as intended. We will need to
## reset this value at the end of configure, to preserve the user's settings.
CFLAGS="${AM_CFLAGS} ${CFLAGS}"
CPPFLAGS="${AM_CPPFLAGS} ${CPPFLAGS}"
LDFLAGS="${AM_LDFLAGS} ${LDFLAGS}"
## ----------------------------------------------------------------------
## Enable dependency tracking unless the configure options or a
## site-specific file told us not to. This prevents configure from
## silently disabling dependencies for some compilers.
##
if test -z "${enable_dependency_tracking}"; then
enable_dependency_tracking="yes"
fi
## ----------------------------------------------------------------------
## Check for programs.
##
AC_PROG_CC
CC_BASENAME="`echo $CC | cut -f1 -d' ' | xargs basename 2>/dev/null`"
## ----------------------------------------------------------------------
## Data types and their sizes.
##
AC_TYPE_OFF_T
AC_CHECK_TYPE([size_t], [],
[AC_DEFINE_UNQUOTED([size_t], [unsigned long],
[Define to `unsigned long' if <sys/types.h> does not define.])])
AC_CHECK_TYPE([ssize_t], [],
[AC_DEFINE_UNQUOTED([ssize_t], [long],
[Define to `long' if <sys/types.h> does not define.])])
AC_CHECK_TYPE([ptrdiff_t], [],
[AC_DEFINE_UNQUOTED([ptrdiff_t], [long],
[Define to `long' if <sys/types.h> does not define.])])
AC_C_BIGENDIAN
## ----------------------------------------------------------------------
## Check which archiving tool to use. This needs to be done before
## the AM_PROG_LIBTOOL macro.
##
if test -z "$AR"; then
AC_CHECK_PROGS([AR], [ar xar], [:], [$PATH])
fi
AC_SUBST([AR])
# Set the default ar flags to cr
# The Automake default is to use cru and the 'u' causes ar
# to emit warnings on some platforms.
AR_FLAGS=cr
## Export the AR macro so that it will be placed in the libtool file
## correctly.
export AR
AC_PROG_MAKE_SET
AC_PROG_INSTALL
## ----------------------------------------------------------------------
## Set up ${TR} which is used to process the package list for extra
## debugging output in the C library.
AC_PATH_PROG([TR], [tr])
## ----------------------------------------------------------------------
## Disable shared libraries on CYGWIN. (LK - 04/16/15)
## A number of tests run by "make check" fail on CYGWIN, so for HDF5 v1.8.15
## we will change the default for shared libraries to disabled.
case "`uname`" in
CYGWIN*)
enable_shared="no"
CHECK_WARN="Shared libraries are not currently supported on CYGWIN."
;;
esac
## ----------------------------------------------------------------------
## Create libtool. If shared/static libraries are going to be enabled
## or disabled, it should happen before these macros.
LT_PREREQ([2.2])
## ----------------------------------------------------------------------
## dlopen - This will use an improved version of libtool
## win32-dll - This will build clean dlls on win32 platforms.
LT_INIT([dlopen,win32-dll])
## ----------------------------------------------------------------------
## Check if we should install only statically linked executables.
## This check needs to occur after libtool is initialized because
## we check a libtool cache value and may issue a warning based
## on its result.
AC_SUBST([STATIC_EXEC])
## Default is no
STATIC_EXEC=no
AC_MSG_CHECKING([if we should install only statically linked executables])
AC_ARG_ENABLE([static_exec],
[AS_HELP_STRING([--enable-static-exec],
[Install only statically linked executables
[default=no]])],
[STATIC_EXEC=$enableval])
if test "X$STATIC_EXEC" = "Xyes"; then
echo "yes"
## Issue a warning if -static flag is not supported.
if test "X$lt_cv_prog_compiler_static_works" = "Xno"; then
echo " warning: -static flag not supported on this system; executable won't statically link shared system libraries."
LT_STATIC_EXEC=""
else
LT_STATIC_EXEC="-all-static"
fi
else
echo "no"
LT_STATIC_EXEC=""
fi
AM_CONDITIONAL([USE_PLUGINS_CONDITIONAL], [test "X$LT_STATIC_EXEC" = X])
AC_SUBST([LT_STATIC_EXEC])
## Fix up the INSTALL macro if it's a relative path. We want the
## full-path to the binary instead.
case "$INSTALL" in
*install-sh*)
INSTALL='\${top_srcdir}/bin/install-sh -c'
;;
esac
## ----------------------------------------------------------------------
## Some users have reported problems with libtool's use of '-Wl,-rpath' to
## link shared libraries in nondefault directories. Allow users to
## disable embedding the rpath information in the executables and to
## instead solely rely on the information in LD_LIBRARY_PATH.
AC_MSG_CHECKING([if -Wl,-rpath should be used to link shared libs in nondefault directories])
AC_ARG_ENABLE([sharedlib-rpath],
[AS_HELP_STRING([--disable-sharedlib-rpath],
[Disable use of the '=Wl,-rpath' linker option])],
[RPATH=$enableval])
case "X-$RPATH" in
X-no)
AC_MSG_RESULT([no])
runpath_var=
hardcode_libdir_flag_spec=
hardcode_libdir_flag_spec_ld=
hardcode_into_libs=no
;;
X-|X-yes)
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([error])
AC_MSG_ERROR([\'$enableval\' is not a valid rpath type])
;;
esac
## ----------------------------------------------------------------------
## Check for system libraries. "dl" stands for dynamically loaded library
##
AC_CHECK_LIB([m], [ceil])
AC_CHECK_LIB([dl], [dlopen])
## ----------------------------------------------------------------------
## Check for system header files.
##
AC_HEADER_STDC
AC_HEADER_TIME
## Unix
AC_CHECK_HEADERS([sys/resource.h sys/time.h unistd.h sys/ioctl.h sys/stat.h])
AC_CHECK_HEADERS([sys/socket.h sys/types.h sys/file.h])
AC_CHECK_HEADERS([stddef.h setjmp.h features.h])
AC_CHECK_HEADERS([dirent.h])
AC_CHECK_HEADERS([stdint.h], [C9x=yes])
AC_CHECK_HEADERS([stdbool.h])
## Darwin
AC_CHECK_HEADERS([mach/mach_time.h])
## Also need to detect Darwin for pubconf
##case $host_os in
## darwin*)
## AC_DEFINE([HAVE_DARWIN], [1], [Define if Darwin or Mac OS X])
## ;;
##esac
## Windows
##case "`uname`" in
## CYGWIN*)
## AC_CHECK_HEADERS([io.h sys/timeb.h])
## UNAME_CYGWIN="yes"
## ;;
## MINGW*)
## AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h])
## AC_HAVE_LIBRARY([ws2_32])
## ;;
## *)
## AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h])
## ;;
##esac
## ----------------------------------------------------------------------
## Some platforms require that all symbols are resolved when a library
## is linked. We can use the -no-undefined flag to tell libtool that
## it will be able to build shared libraries on these architectures,
## as it will not do so by default.
##
if test "X${enable_shared}" = "Xyes"; then
AC_MSG_CHECKING([if libtool needs -no-undefined flag to build shared libraries])
case "`uname`" in
CYGWIN*|MINGW*|AIX*)
## Add in the -no-undefined flag to LDFLAGS for libtool.
AC_MSG_RESULT([yes])
H5_LDFLAGS="$H5_LDFLAGS -no-undefined"
;;
*)
## Don't add in anything.
AC_MSG_RESULT([no])
;;
esac
fi
## ----------------------------------------------------------------------
## Add necessary defines for Linux Systems.
##
case "$host_cpu-$host_vendor-$host_os" in
*linux*)
## Add POSIX support on Linux systems, so <features.h> defines
## __USE_POSIX, which is required to get the prototype for fdopen
## defined correctly in <stdio.h>.
##
## This flag was removed from h5cc as of 2009-10-17 when it was found
## that the flag broke compiling netCDF-4 code with h5cc, but kept in
## H5_CPPFLAGS because fdopen and HDfdopen fail without it. HDfdopen
## is used only by H5_debug_mask which is used only when debugging in
## H5_init_library (all in H5.c). When the flag was removed this was
## the only compile failure noted.
##
## This was originally defined as _POSIX_SOURCE which was updated to
## _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX
## functionality so clock_gettime and CLOCK_MONOTONIC are defined
## correctly. This was later updated to 200112L so that
## posix_memalign() is visible for the direct VFD code on Linux
## systems.
##
## POSIX feature information can be found in the gcc manual at:
## http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html
H5_CPPFLAGS="-D_POSIX_C_SOURCE=200112L $H5_CPPFLAGS"
## Need to add this so that O_DIRECT is visible for the direct
## VFD on Linux systems.
H5_CPPFLAGS="-D_GNU_SOURCE $H5_CPPFLAGS"
;;
esac
## Need to add the AM_ and H5_ into CFLAGS/CPPFLAGS to make them visible
## for configure checks.
## Note: Both will be restored by the end of configure.
CPPFLAGS="$H5_CPPFLAGS $AM_CPPFLAGS $CPPFLAGS"
CFLAGS="$H5_CFLAGS $AM_CFLAGS $CFLAGS"
## Checkpoint the cache
AC_CACHE_SAVE
## Posix.1g types (C9x)
cat >>confdefs.h <<\EOF
#include <sys/types.h>
EOF
if test "X$C9x" = "Xyes"; then
cat >>confdefs.h <<\EOF
#include <stdint.h>
EOF
fi
cat >>confdefs.h <<\EOF
#include <sys/types.h> /*for off_t definition*/
EOF
AC_CHECK_SIZEOF([off_t])
if test "X$C9x" = "Xyes"; then
cat >>confdefs.h <<\EOF
#ifdef HAVE_STDBOOL_H
#include <stdbool.h> /* for bool definition */
#else
#define bool _Bool
#endif
EOF
AC_CHECK_SIZEOF([bool])
fi
## Checkpoint the cache
AC_CACHE_SAVE
## ----------------------------------------------------------------------
## Check for functions.
AC_CHECK_FUNCS([snprintf])
## ----------------------------------------------------------------------
## Check compiler characteristics
##
AC_C_CONST
## ----------------------------------------------------------------------
## Check if cURL debugging output should be enabled
##
AC_MSG_CHECKING([enable cURL debugging])
AC_ARG_ENABLE([curl-debug],
[AS_HELP_STRING([--enable-curl-debug],
[Enable cURL debugging output.
[default=no]
])],
[CURL_DEBUG=$enableval])
## Set default
if test "X-$CURL_DEBUG" = X- ; then
CURL_DEBUG=no
fi
## Allow this variable to be substituted in other files
AC_SUBST([CURL_DEBUG])
case "X-$CURL_DEBUG" in
X-yes)
AC_DEFINE([CURL_DEBUG], , [Define to have cURL output debugging information.])
AC_MSG_RESULT([yes])
;;
X-no)
AC_MSG_RESULT([no])
;;
*)
AC_MSG_ERROR([Unrecognized curl debug option: $CURL_DEBUG.])
;;
esac
## ----------------------------------------------------------------------
## Check if REST VOL memory tracking should be enabled
##
AC_MSG_CHECKING([enable memory tracking])
AC_ARG_ENABLE([mem-tracking],
[AS_HELP_STRING([--enable-mem-tracking],
[Enable REST VOL memory tracking. This helps to
find memory leaks and other memory errors within
the connector itself. If this option is enabled,
the connector will throw an error upon termination
if memory is still allocated.
[default=no]
])],
[TRACK_MEM_USAGE=$enableval])
## Set default
if test "X-$TRACK_MEM_USAGE" = X- ; then
TRACK_MEM_USAGE=no
fi
## Allow this variable to be substituted in other files
AC_SUBST([TRACK_MEM_USAGE])
case "X-$TRACK_MEM_USAGE" in
X-yes)
AC_DEFINE([TRACK_MEM_USAGE], , [Define to have the REST VOL track memory usage.])
AC_MSG_RESULT([yes])
;;
X-no)
AC_MSG_RESULT([no])
;;
*)
AC_MSG_ERROR([Unrecognized track mem usage option: $TRACK_MEM_USAGE.])
;;
esac
## ----------------------------------------------------------------------
## Check if the install directory for the included HDF5 source
## distribution has been modified
##
AC_MSG_CHECKING([HDF5 source distribution install directory])
AC_ARG_WITH([hdf5],
[AS_HELP_STRING([--with-hdf5[=DIR]],
[To specify the location of a pre-built HDF5
to use when building the REST VOL.])],
[RV_HDF5_INSTALL_DIR=$withval])
## Set default
if test "X-$RV_HDF5_INSTALL_DIR" = X- ; then
RV_HDF5_INSTALL_DIR="${prefix}"
fi
## Allow this variable to be substituted in other files
AC_SUBST([RV_HDF5_INSTALL_DIR])
AC_MSG_RESULT([$RV_HDF5_INSTALL_DIR])
## ----------------------------------------------------------------------
## Check if the install directory for cURL should be modified
##
AC_MSG_CHECKING([cURL install directory])
AC_ARG_WITH([curl],
[AS_HELP_STRING([--with-curl[=DIR]],
[To specify the top-level directory where cURL is
installed, if cURL was not installed to a system
path.])],
[RV_CURL_INSTALL_DIR=$withval])
## Set default
if test "X-$RV_CURL_INSTALL_DIR" = X- ; then
RV_CURL_INSTALL_DIR=""
fi
AM_CONDITIONAL([CURL_DEFAULT_DIR], [test -z "$RV_CURL_INSTALL_DIR"])
## Allow this variable to be substituted in other files
AC_SUBST([RV_CURL_INSTALL_DIR])
AC_MSG_RESULT([$RV_CURL_INSTALL_DIR])
## ----------------------------------------------------------------------
## Check if the install directory for YAJL should be modified
##
AC_MSG_CHECKING([YAJL install directory])
AC_ARG_WITH([yajl],
[AS_HELP_STRING([--with-yajl[=DIR]],
[To specify the top-level directory where YAJL is
installed, if YAJL was not installed to a system
path.])],
[RV_YAJL_INSTALL_DIR=$withval])
## Set default
if test "X-$RV_YAJL_INSTALL_DIR" = X- ; then
RV_YAJL_INSTALL_DIR=""
fi
AM_CONDITIONAL([YAJL_DEFAULT_DIR], [test -z "$RV_YAJL_INSTALL_DIR"])
## Allow this variable to be substituted in other files
AC_SUBST([RV_YAJL_INSTALL_DIR])
AC_MSG_RESULT([$RV_YAJL_INSTALL_DIR])
## ----------------------------------------------------------------------
## Check if the REST VOL tests should be built
##
AC_MSG_CHECKING([enable tests])
AC_ARG_ENABLE([tests],
[AS_HELP_STRING([--enable-tests=(yes|no|<custom>)],
[Enable building of the REST VOL HDF5 tests.
[default=yes]
])],
[BUILD_TESTS=$enableval])
## Set default
if test "X-$BUILD_TESTS" = X- ; then
BUILD_TESTS=yes
fi
## Allow this variable to be substituted in other files
AC_SUBST([BUILD_TESTS])
AM_CONDITIONAL([BUILD_TESTS], [test "$BUILD_TESTS" = yes])
case "X-$BUILD_TESTS" in
X-yes)
AC_MSG_RESULT([yes])
;;
X-no)
AC_MSG_RESULT([no])
;;
*)
AC_MSG_RESULT([$BUILD_TESTS])
;;
esac
## ----------------------------------------------------------------------
## Check if the REST VOL examples should be built
##
AC_MSG_CHECKING([enable examples])
AC_ARG_ENABLE([examples],
[AS_HELP_STRING([--enable-examples=(yes|no|<custom>)],
[Enable building of the REST VOL HDF5 examples.
[default=yes]
])],
[BUILD_EXAMPLES=$enableval])
## Set default
if test "X-$BUILD_EXAMPLES" = X- ; then
BUILD_EXAMPLES=yes
fi
## Allow this variable to be substituted in other files
AC_SUBST([BUILD_EXAMPLES])
AM_CONDITIONAL([BUILD_EXAMPLES], [test "$BUILD_EXAMPLES" = yes])
case "X-$BUILD_EXAMPLES" in
X-yes)
AC_MSG_RESULT([yes])
;;
X-no)
AC_MSG_RESULT([no])
;;
*)
AC_MSG_RESULT([$BUILD_EXAMPLES])
;;
esac
## ----------------------------------------------------------------------
## Check if the HDF5 tools should be built with REST VOL support
##
AC_MSG_CHECKING([enable tools])
AC_ARG_ENABLE([tools],
[AS_HELP_STRING([--enable-tools=(yes|no|<custom>)],
[Enable building of the HDF5 tools with REST VOL support. (highly experimental)
[default=no]
])],
[BUILD_TOOLS=$enableval])
## Set default
if test "X-$BUILD_TOOLS" = X- ; then
BUILD_TOOLS=no
fi
## Allow this variable to be substituted in other files
AC_SUBST([BUILD_TOOLS])
AM_CONDITIONAL([BUILD_TOOLS], [test "$BUILD_TOOLS" = yes])
case "X-$BUILD_TOOLS" in
X-yes)
AC_MSG_RESULT([yes])
;;
X-no)
AC_MSG_RESULT([no])
;;
*)
AC_MSG_RESULT([$BUILD_TOOLS])
;;
esac
## ----------------------------------------------------------------------
## Check if the compiler should include symbols
##
AC_MSG_CHECKING([enable debugging symbols])
AC_ARG_ENABLE([symbols],
[AS_HELP_STRING([--enable-symbols=(yes|no|<custom>)],
[Add debug symbols to the library (e.g.: build with -g).
This is independent of the build mode and optimization
level. The custom string allows special settings like
-ggdb, etc. to be used.
[default=yes if debug build, otherwise no]
])],
[SYMBOLS=$enableval])
## Set default
if test "X-$SYMBOLS" = X- ; then
if test "X-$BUILD_MODE" = "X-debug" ; then
SYMBOLS=yes
else
SYMBOLS=no
fi
fi
## Allow this variable to be substituted in other files
AC_SUBST([SYMBOLS])
case "X-$SYMBOLS" in
X-yes)
H5_CFLAGS="$H5_CFLAGS $SYMBOLS_CFLAGS"
AC_MSG_RESULT([yes])
;;
X-no)
H5_CFLAGS="$H5_CFLAGS $NO_SYMBOLS_CFLAGS"
AC_MSG_RESULT([no])
;;
*)
H5_CFLAGS="$H5_CFLAGS $SYMBOLS"
SYMBOLS="custom ($SYMBOLS)"
AC_MSG_RESULT([$SYMBOLS])
;;
esac
## ----------------------------------------------------------------------
## Check if the assert macro should be enabled
##
AC_MSG_CHECKING([enable asserts])
AC_ARG_ENABLE([asserts],
[AS_HELP_STRING([--enable-asserts],
[Determines whether NDEBUG is defined or not, which
controls assertions.
This is independent of the build mode and presence
of debugging symbols.
[default=yes if debug build, otherwise no]
])],
[ASSERTS=$enableval])
## Set default
if test "X-$ASSERTS" = X- ; then
if test "X-$BUILD_MODE" = "X-debug" ; then
ASSERTS=yes
else
ASSERTS=no
fi
fi
## Allow this variable to be substituted in other files
AC_SUBST([ASSERTS])
case "X-$ASSERTS" in
X-yes)
H5_CPPFLAGS="$H5_CPPFLAGS -UNDEBUG"
AC_MSG_RESULT([yes])
;;
X-no)
H5_CPPFLAGS="$H5_CPPFLAGS -DNDEBUG"
AC_MSG_RESULT([no])
;;
*)
AC_MSG_ERROR([Unrecognized value: $ASSERTS])
;;
esac
## ----------------------------------------------------------------------
## Check if the compiler should use profiling flags/settings
##
AC_MSG_CHECKING([profiling])
AC_ARG_ENABLE([profiling],
[AS_HELP_STRING([--enable-profiling=(yes|no|<custom>)],
[Enable profiling flags (e.g.: -pg).
This can be set independently from the build mode.
The custom setting can be used to pass alternative
profiling flags (e.g.: -P for using Prof with gcc).
[default=no]
])],
[PROFILING=$enableval])
## Default is no profiling
if test "X-$PROFILING" = X- ; then
PROFILING=no
fi
## Allow this variable to be substituted in other files
AC_SUBST([PROFILING])
case "X-$PROFILING" in
X-yes)
H5_CFLAGS="$H5_CFLAGS $PROFILE_CFLAGS"
AC_MSG_RESULT([yes])
;;
X-no)
AC_MSG_RESULT([no])
;;
*)
H5_CFLAGS="$H5_CFLAGS $PROFILING"
PROFILING="custom ($PROFILING)"
AC_MSG_RESULT([$PROFILING])
;;
esac
## ----------------------------------------------------------------------
## Check if the compiler should use a particular optimization setting
##
AC_MSG_CHECKING([optimization level])
AC_ARG_ENABLE([optimization],
[AS_HELP_STRING([--enable-optimization=(high|debug|none|<custom>)],
[Enable optimization flags/settings (e.g.: -O3).
This can be set independently from the build mode.
Optimizations for a given compiler can be specified
at several levels: High, with aggressive optimizations
turned on; debug, with optimizations that are
unlikely to interfere with debugging or profiling;
and none, with no optimizations at all.
See the compiler-specific config/*-flags file for more
details.
Alternatively, optimization options can
be specified directly by specifying them as a
string value. These custom optimization flags will
completely replace all other optimization flags.
[default depends on build mode: debug=debug,
production=high, clean=none]
])],
[OPTIMIZATION=$enableval])
## Set the default optimization level. This depends on the compiler mode.
if test "X-$OPTIMIZATION" = X- ; then
case "X-$BUILD_MODE" in
X-debug)
OPTIMIZATION=debug
;;
X-production)