Merge remote-tracking branch 'hdf5/develop' into add-werror-and-squash-some

to pick up the NetBSD-compatibility changes that I recently merged.
This commit is contained in:
David Young 2019-11-08 12:19:31 -06:00
commit 4981e83740
29 changed files with 275 additions and 41 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
@ -13,6 +13,8 @@
#
require 5.003;
use warnings;
# Purpose: insures that API functions aren't called internally.
# Usage: checkapi H5*.c
my $filename = "";

View File

@ -1,5 +1,6 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl
require 5.003;
use warnings;
#
# Copyright by The HDF Group.

View File

@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.

View File

@ -1,4 +1,4 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
@ -11,6 +11,8 @@
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
use warnings;
my $depend_file;
my $new_depend_file;
my $srcdir;

View File

@ -1,4 +1,7 @@
#!/usr/bin/perl -p
#!/bin/sh
#! -*-perl-*-
eval 'exec perl -p -x -S $0 ${1+"$@"}'
if 0;
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.

View File

@ -1,5 +1,6 @@
#!/usr/local/bin/perl -w
#!/usr/bin/env perl
require 5.003;
use warnings;
use Text::Tabs;
# NOTE: THE FORMAT OF HRETURN_ERROR AND HGOTO_ERROR MACROS HAS

View File

@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/env perl
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.

View File

@ -1,6 +1,7 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl
require 5.003;
$indent=4;
use warnings;
#
# Copyright by The HDF Group.

View File

@ -1,6 +1,7 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl
require 5.003;
use strict;
use warnings;
# Global settings

View File

@ -1,5 +1,6 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl
require 5.003;
use warnings;
# Global settings
# (The max_idx parameter is the only thing that needs to be changed when adding

View File

@ -1,5 +1,6 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl
require 5.003;
use warnings;
$indent=4;
#

View File

@ -1,4 +1,4 @@
#!/usr/bin/perl -w
#!/usr/bin/env perl
##
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
@ -12,6 +12,7 @@
# help@hdfgroup.org.
##
require 5.003;
use warnings;
$Source = "";
##############################################################################

View File

@ -49,8 +49,8 @@ CXX_API=yes
# Where to install examples
# Note: no '/' after DESTDIR. Explanation in commence.am
EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/c++
EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples
EXAMPLEDIR=$(examplesdir)/c++
EXAMPLETOPDIR=$(examplesdir)
# How to build programs using h5c++
$(EXTRA_PROG): $(H5CPP)

View File

@ -18,7 +18,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# This script will compile and run the c++ examples from source files #
# installed in .../share/hdf5_examples/c++ using h5c++. The #
# installed in @examplesdir@/c++ using h5c++. The #
# order for running programs with RunTest in the MAIN section below is taken #
# from the Makefile. The order is important since some of the test programs #
# use data files created by earlier test programs. Any future additions should #
@ -30,9 +30,32 @@
EXIT_SUCCESS=0
EXIT_FAILURE=1
#
# Try to derive the path to the installation $prefix established
# by ./configure relative to the examples directory established by
# ./configure. If successful, set `prefix_relto_examplesdir` to the
# relative path. Otherwise, set `prefix_relto_examplesdir` to the
# absolute installation $prefix.
#
# This script uses the value of `prefix` in the user's environment, if
# it is set, below. The content of $() is evaluated in a sub-shell, so
# if `prefix` is set in the user's environment, the shell statements in
# $() won't clobbered it.
#
prefix_relto_examplesdir=$(
prefix=@prefix@
examplesdir=@examplesdir@
if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then
echo $(echo ${examplesdir##${prefix}/} | \
sed -E 's,[^/]+,..,g')
else
echo $prefix
fi
)
# Where the tool is installed.
# default is relative path to installed location of the tools
prefix="${prefix:-../../..}"
prefix="${prefix:-../${prefix_relto_examplesdir}}"
AR="@AR@"
RANLIB="@RANLIB@"
H5TOOL="h5c++" # The tool name

56
config/netbsd Normal file
View File

@ -0,0 +1,56 @@
# -*- shell-script -*-
#
# Copyright by The HDF Group.
# Copyright by the Board of Trustees of the University of Illinois.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 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, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
# This file is part of the HDF5 build script. It is processed shortly
# after configure starts and defines, among other things, flags for
# the various compile modes.
#
# See BlankForm in this directory for details.
# The default compiler is `gcc'
if test "X-" = "X-$CC"; then
CC=gcc
CC_BASENAME=gcc
fi
# Figure out C compiler flags
. $srcdir/config/gnu-flags
# Figure out Intel C compiler flags
. $srcdir/config/intel-flags
# The default Fortran 90 compiler
if test "X-" = "X-$FC"; then
case $CC_BASENAME in
gcc*|pgcc*)
FC=gfortran
FC_BASENAME=gfortran
;;
icc*)
FC=ifort
FC_BASENAME=ifort
;;
mpicc*)
FC=mpif90
FC_BASENAME=mpif90
;;
esac
fi
# Figure out FORTRAN compiler flags
. $srcdir/config/gnu-fflags
# Figure out Intel F90 compiler flags
. $srcdir/config/intel-fflags

View File

@ -236,6 +236,9 @@ case $host_os in
freebsd*)
host_os_novers=freebsd
;;
netbsd*)
host_os_novers=netbsd
;;
solaris*)
host_os_novers=solaris
;;
@ -2967,6 +2970,28 @@ fi
## Checkpoint the cache
AC_CACHE_SAVE
## ----------------------------------------------------------------------
## Use custom examples path.
##
AC_MSG_CHECKING([for custom examples path definition])
AC_ARG_WITH([examplesdir],
[AS_HELP_STRING([--with-examplesdir=location],
[Specify path for examples
[default="DATAROOTDIR/hdf5_examples"]])],,
withval="${datarootdir}/hdf5_examples")
if test "X$withval" = "X"; then
AC_MSG_RESULT([default])
examplesdir="${datarootdir}/hdf5_examples"
else
AC_MSG_RESULT([$withval])
examplesdir=$withval
fi
AC_SUBST([examplesdir])
AC_DEFINE_UNQUOTED([EXAMPLESDIR], ["$examplesdir"],
[Define the examples directory])
## ----------------------------------------------------------------------
## Enable custom plugin default path for library. It requires SHARED support.
##

View File

@ -86,8 +86,8 @@ CHECK_CLEANFILES+=$(EXTLINK_DIRS)
# Example directory
# Note: no '/' after DESTDIR. Explanation in commence.am
EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/c
EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples
EXAMPLEDIR=$(examplesdir)/c
EXAMPLETOPDIR=$(examplesdir)
# List dependencies for each program. Normally, automake would take
# care of this for us, but if we tell automake about the programs it

View File

@ -18,7 +18,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# This script will compile and run the c examples from source files installed #
# in .../share/hdf5_examples/c using h5cc or h5pc. The order for running #
# in @examplesdir@/c using h5cc or h5pc. The order for running #
# programs with RunTest in the MAIN section below is taken from the Makefile. #
# The order is important since some of the test programs use data files created #
# by earlier test programs. Any future additions should be placed accordingly. #
@ -28,10 +28,33 @@
# Initializations
EXIT_SUCCESS=0
EXIT_FAILURE=1
#
# Try to derive the path to the installation $prefix established
# by ./configure relative to the examples directory established by
# ./configure. If successful, set `prefix_relto_examplesdir` to the
# relative path. Otherwise, set `prefix_relto_examplesdir` to the
# absolute installation $prefix.
#
# This script uses the value of `prefix` in the user's environment, if
# it is set, below. The content of $() is evaluated in a sub-shell, so
# if `prefix` is set in the user's environment, the shell statements in
# $() won't clobbered it.
#
prefix_relto_examplesdir=$(
prefix=@prefix@
examplesdir=@examplesdir@
if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then
echo $(echo ${examplesdir##${prefix}/} | \
sed -E 's,[^/]+,..,g')
else
echo $prefix
fi
)
# Where the tool is installed.
# default is relative path to installed location of the tools
prefix="${prefix:-../../..}"
prefix="${prefix:-../${prefix_relto_examplesdir}}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
AR="@AR@"
RANLIB="@RANLIB@"

View File

@ -74,8 +74,8 @@ endif
# Tell automake how to install examples
# Note: no '/' after DESTDIR. Explanation in commence.am
EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/fortran
EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples
EXAMPLEDIR=$(examplesdir)/fortran
EXAMPLETOPDIR=$(examplesdir)
# List dependencies for each example. Normally, automake would take
# care of this for us, but if we tell automake about the programs it

View File

@ -18,7 +18,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# This script will compile and run the fortran examples from source files #
# installed in .../share/hdf5_examples/fortran using h5fc or h5pfc. The #
# installed in @examplesdir@/fortran using h5fc or h5pfc. The #
# order for running programs with RunTest in the MAIN section below is taken #
# from the Makefile. The order is important since some of the test programs #
# use data files created by earlier test programs. Any future additions should #
@ -30,9 +30,32 @@
EXIT_SUCCESS=0
EXIT_FAILURE=1
#
# Try to derive the path to the installation $prefix established
# by ./configure relative to the examples directory established by
# ./configure. If successful, set `prefix_relto_examplesdir` to the
# relative path. Otherwise, set `prefix_relto_examplesdir` to the
# absolute installation $prefix.
#
# This script uses the value of `prefix` in the user's environment, if
# it is set, below. The content of $() is evaluated in a sub-shell, so
# if `prefix` is set in the user's environment, the shell statements in
# $() won't clobbered it.
#
prefix_relto_examplesdir=$(
prefix=@prefix@
examplesdir=@examplesdir@
if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then
echo $(echo ${examplesdir##${prefix}/} | \
sed -E 's,[^/]+,..,g')
else
echo $prefix
fi
)
# Where the tool is installed.
# default is relative path to installed location of the tools
prefix="${prefix:-../../..}"
prefix="${prefix:-../${prefix_relto_examplesdir}}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
AR="@AR@"
RANLIB="@RANLIB@"

View File

@ -33,8 +33,8 @@ CXX_API=yes
# Where to install examples
# Note: no '/' after DESTDIR. Explanation in commence.am
EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c++
EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl
EXAMPLEDIR=$(examplesdir)/hl/c++
EXAMPLETOPDIR=$(examplesdir)/hl
# How to build programs using h5c++
$(EXTRA_PROG): $(H5CPP)

View File

@ -18,7 +18,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# This script will compile and run the c++ examples from source files #
# installed in .../share/hdf5_examples/hl/c++ using h5c++. The #
# installed in @examplesdir@/hl/c++ using h5c++. The #
# order for running programs with RunTest in the MAIN section below is taken #
# from the Makefile. The order is important since some of the test programs #
# use data files created by earlier test programs. Any future additions should #
@ -29,9 +29,33 @@
# Initializations
EXIT_SUCCESS=0
EXIT_FAILURE=1
#
# Try to derive the path to the installation $prefix established
# by ./configure relative to the examples directory established by
# ./configure. If successful, set `prefix_relto_examplesdir` to the
# relative path. Otherwise, set `prefix_relto_examplesdir` to the
# absolute installation $prefix.
#
# This script uses the value of `prefix` in the user's environment, if
# it is set, below. The content of $() is evaluated in a sub-shell, so
# if `prefix` is set in the user's environment, the shell statements in
# $() won't clobbered it.
#
prefix_relto_examplesdir=$(
prefix=@prefix@
examplesdir=@examplesdir@
if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then
echo $(echo ${examplesdir##${prefix}/} | \
sed -E 's,[^/]+,..,g')
else
echo $prefix
fi
)
# Where the tool is installed.
# default is relative path to installed location of the tools
prefix="${prefix:-../../../..}"
prefix="${prefix:-../../${prefix_relto_examplesdir}}"
AR="@AR@"
RANLIB="@RANLIB@"
H5TOOL="h5c++" # The tool name

View File

@ -25,8 +25,8 @@ endif
# Example directory
# Note: no '/' after DESTDIR. Explanation in commence.am
EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/c
EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl
EXAMPLEDIR=$(examplesdir)/hl/c
EXAMPLETOPDIR=$(examplesdir)/hl
INSTALL_SCRIPT_FILES = run-hlc-ex.sh
INSTALL_TOP_SCRIPT_FILES = run-hl-ex.sh

View File

@ -18,7 +18,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# This script will compile and run the c examples from source files installed #
# in .../share/hdf5_examples/hl/c using h5cc or h5pc. The order for running #
# in @examplesdir@/hl/c using h5cc or h5pc. The order for running #
# programs with RunTest in the MAIN section below is taken from the Makefile. #
# The order is important since some of the test programs use data files created #
# by earlier test programs. Any future additions should be placed accordingly. #
@ -29,9 +29,32 @@
EXIT_SUCCESS=0
EXIT_FAILURE=1
#
# Try to derive the path to the installation $prefix established
# by ./configure relative to the examples directory established by
# ./configure. If successful, set `prefix_relto_examplesdir` to the
# relative path. Otherwise, set `prefix_relto_examplesdir` to the
# absolute installation $prefix.
#
# This script uses the value of `prefix` in the user's environment, if
# it is set, below. The content of $() is evaluated in a sub-shell, so
# if `prefix` is set in the user's environment, the shell statements in
# $() won't clobbered it.
#
prefix_relto_examplesdir=$(
prefix=@prefix@
examplesdir=@examplesdir@
if [ ${examplesdir##${prefix}/} != ${examplesdir} ]; then
echo $(echo ${examplesdir##${prefix}/} | \
sed -E 's,[^/]+,..,g')
else
echo $prefix
fi
)
# Where the tool is installed.
# default is relative path to installed location of the tools
prefix="${prefix:-../../../..}"
prefix="${prefix:-../../${prefix_relto_examplesdir}}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
AR="@AR@"
RANLIB="@RANLIB@"

View File

@ -51,8 +51,8 @@ endif
# Tell automake how to install examples
# Note: no '/' after DESTDIR. Explanation in commence.am
EXAMPLEDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl/fortran
EXAMPLETOPDIR=${DESTDIR}$(exec_prefix)/share/hdf5_examples/hl
EXAMPLEDIR=$(examplesdir)/hl/fortran
EXAMPLETOPDIR=$(examplesdir)/hl
# List dependencies for each example. Normally, automake would take
# care of this for us, but if we tell automake about the programs it

View File

@ -18,7 +18,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# #
# This script will compile and run the fortran examples from source files #
# installed in .../share/hdf5_examples/hl/fortran using h5fc or h5pfc. The #
# installed in @examplesdir@/hl/fortran using h5fc or h5pfc. The #
# order for running programs with RunTest in the MAIN section below is taken #
# from the Makefile. The order is important since some of the test programs #
# use data files created by earlier test programs. Any future additions should #
@ -32,7 +32,7 @@ EXIT_FAILURE=1
# Where the tool is installed.
# default is relative path to installed location of the tools
prefix="${prefix:-../../../..}"
prefix="${prefix:-@prefix@}"
PARALLEL=@PARALLEL@ # Am I in parallel mode?
AR="@AR@"
RANLIB="@RANLIB@"

View File

@ -345,6 +345,14 @@
#define FAIL (-1)
#define UFAIL (unsigned)(-1)
/* The HDF5 library uses the symbol `ERR` frequently. So do
* header files for libraries such as curses(3), terminfo(3), etc.
* Remove its definition here to avoid clashes with HDF5.
*/
#ifdef ERR
#undef ERR
#endif
/* number of members in an array */
#ifndef NELMTS
# define NELMTS(X) (sizeof(X)/sizeof(X[0]))
@ -1645,9 +1653,18 @@ extern char *strdup(const char *s);
/* Assign a variable to one of a different size (think safer dst = (dsttype)src").
* The code generated by the macro checks for overflows.
*
* Use w##x##y##z instead of H5_GLUE4(w, x, y, z) because srctype
* or dsttype on some systems (e.g., NetBSD 8 and earlier) may
* supply some standard types using a macro---e.g.,
* #define uint8_t __uint8_t. The preprocessor will expand the
* macros before it evaluates H5_GLUE4(), and that will generate
* an unexpected name such as ASSIGN___uint8_t_TO___uint16_t.
* The preprocessor does not expand macros in w##x##y##z, so
* that will always generate the expected name.
*/
#define H5_CHECKED_ASSIGN(dst, dsttype, src, srctype) \
H5_GLUE4(ASSIGN_,srctype,_TO_,dsttype)(dst,dsttype,src,srctype)\
ASSIGN_##srctype##_TO_##dsttype(dst,dsttype,src,srctype)\
#else /* NDEBUG */
#define H5_CHECKED_ASSIGN(dst, dsttype, src, srctype) \

View File

@ -1838,7 +1838,6 @@ test_swmr_write_big(hbool_t newest_format)
pid_t pid; /* Process ID */
#endif /* H5_HAVE_UNISTD_H */
int status; /* Status returned from child process */
char *new_argv[] = {NULL};
char *driver = NULL; /* VFD string (from env variable) */
hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */
@ -1968,6 +1967,13 @@ test_swmr_write_big(hbool_t newest_format)
FAIL_STACK_ERROR;
}
else if(0 == pid) { /* Child process */
/* By convention, argv[0] tells the name of program invoked.
*
* execv on NetBSD 8 will actually return EFAULT if there is a
* NULL at argv[0], so we follow the convention unconditionally.
*/
char swmr_reader[] = SWMR_READER;
char * const new_argv[] = {swmr_reader, NULL};
/* Run the reader */
status = HDexecv(SWMR_READER, new_argv);
HDprintf("errno from execv = %s\n", strerror(errno));

View File

@ -474,9 +474,9 @@ UNJAMTEST () {
#
TOOLTEST_OUTPUT() {
if [ "$1" == "JAM" ]; then
if [ "$1" = "JAM" ]; then
TOOLCMD=$JAM_BIN/$JAM
elif [ "$1" == "UNJAM" ]; then
elif [ "$1" = "UNJAM" ]; then
TOOLCMD=$JAM_BIN/$UNJAM
fi
shift