jna fixes

This commit is contained in:
dmh 2014-04-09 15:20:16 -06:00
parent 49fc091f23
commit 211004898f
5 changed files with 28 additions and 0 deletions

View File

@ -831,6 +831,12 @@ IF(ENABLE_FSYNC)
SET(USE_FSYNC ON)
ENDIF()
# Temporary
OPTION (ENABLE_JNA "Enable jna bug fix code." OFF)
IF(ENABLE_JNA)
SET(JNA ON)
ENDIF()
# Linux specific large file support flags.
# Modelled after check in CMakeLists.txt for hdf5.
OPTION(ENABLE_LARGE_FILE_SUPPORT "Enable large file support." ON)

View File

@ -950,6 +950,19 @@ AC_SUBST(HAS_PNETCDF,[$enable_pnetcdf])
AC_SUBST(HAS_HDF5,[$enable_netcdf_4])
AC_SUBST(HAS_SZLIB,[$nc_has_szlib])
# temporary to deal with a JNA problem
AC_MSG_CHECKING([If compilation is for use with JNA])
AC_ARG_ENABLE([jna],
[AS_HELP_STRING([--enable-jna],
[enable jna bug fix])],
[],
[enable_jna=no])
test "x$enable_jna" = xno || enable_jna=yes
AC_MSG_RESULT($enable_jna)
if test "x$enable_jna" = xyes ; then
AC_DEFINE([JNA], [1], [if true, include JNA bug fix])
fi
# Include some specifics for netcdf on windows.
#AH_VERBATIM([_WIN32_STRICMP],
AH_BOTTOM(

View File

@ -1187,6 +1187,13 @@ read_type(NC_GRP_INFO_T *grp, hid_t hdf_typeid, char *type_name)
member_name = H5Tget_member_name(type->native_hdf_typeid, m);
if (!member_name || strlen(member_name) > NC_MAX_NAME)
return NC_EBADNAME;
#ifdef JNA
/* There appears to be a bug that is
causing malloc error. */
member_name = strdup(member_name);
if(member_name == NULL)
return NC_ENOMEM;
#endif /*JNA*/
/* Offset in bytes on *this* platform. */
member_offset = H5Tget_member_offset(type->native_hdf_typeid, m);

1
ljna
View File

@ -16,6 +16,7 @@ FLAGS="--prefix ${PREFIX}"
FLAGS="$FLAGS --disable-examples"
FLAGS="$FLAGS --disable-utilities"
FLAGS="$FLAGS --enable-shared"
#FLAGS="$FLAGS --enable-jna"
export PATH
export CC

1
wjna
View File

@ -16,6 +16,7 @@ FLAGS="-DHDF5_DIR=${CPP}/cmake/hdf5 ${FLAGS}"
FLAGS="-DENABLE_CONVERSION_WARNINGS=OFF ${FLAGS}"
FLAGS="-DBUILD_UTILITIES=OFF ${FLAGS}"
FLAGS="-DENABLE_EXAMPLES=OFF ${FLAGS}"
FLAGS="-DENABLE_JNA=ON ${FLAGS}"
rm -fr ./build
mkdir build