comparison src/hdf5.mk @ 5430:98bcc037fad7

* src/hdf5.mk: Update version to 1.12.0. Use cmake for Windows cross targets. * src/hdf5-1-fixes.patch: Remove patch. * src/mingw-hdf5-1.patch: Update patch. * dist-files.mk: Remove file from list. * src/of-communictaions.mk: Use pkg-config for linking in hdf5.
author Markus Mützel <markus.muetzel@gmx.de>
date Mon, 25 May 2020 18:14:52 +0200
parents 5a6cc59b7186
children 71761e1b5e83
comparison
equal deleted inserted replaced
5429:a0c6433aca80 5430:98bcc037fad7
1 # This file is part of MXE. 1 # This file is part of MXE.
2 # See index.html for further information. 2 # See index.html for further information.
3 3
4 PKG := hdf5 4 PKG := hdf5
5 $(PKG)_IGNORE := 5 $(PKG)_IGNORE :=
6 $(PKG)_VERSION := 1.8.14 6 $(PKG)_VERSION := 1.12.0
7 $(PKG)_CHECKSUM := 3c48bcb0d5fb21a3aa425ed035c08d8da3d5483a 7 $(PKG)_CHECKSUM := 6020131b6e18e6866816b1fe68980512c696c2bf
8 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) 8 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
9 $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2 9 $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2
10 $(PKG)_URL := https://www.hdfgroup.org/ftp/HDF5/releases/$(PKG)-$(call SHORT_PKG_VERSION,$(PKG))/$(PKG)-$($(PKG)_VERSION)/src/$($(PKG)_FILE) 10 $(PKG)_URL := https://support.hdfgroup.org/ftp/HDF5/releases/$(PKG)-$(call SHORT_PKG_VERSION,$(PKG))/$(PKG)-$($(PKG)_VERSION)/src/$($(PKG)_FILE)
11 $(PKG)_DEPS := 11 $(PKG)_DEPS :=
12 ifeq ($(MXE_SYSTEM),mingw)
13 ifneq ($(MXE_NATIVE_BUILD),yes)
14 $(PKG)_CROSS_CONFIG_OPTIONS := \
15 --disable-largefile \
16 LIBS=-lws2_32 \
17 hdf5_cv_gettimeofday_tz=no \
18 hdf5_cv_vsnprintf_works=yes \
19 hdf5_cv_ldouble_to_integer_works=yes \
20 hdf5_cv_ulong_to_float_accurate=yes \
21 hdf5_cv_fp_to_ullong_accurate=yes \
22 hdf5_cv_fp_to_ullong_right_maximum=no \
23 hdf5_cv_ldouble_to_uint_accurate=yes \
24 hdf5_cv_ullong_to_ldouble_precision=yes \
25 hdf5_cv_fp_to_integer_overflow_works=yes \
26 hdf5_cv_ldouble_to_long_special=no \
27 hdf5_cv_long_to_ldouble_special=no \
28 hdf5_cv_ldouble_to_llong_accurate=yes \
29 hdf5_cv_llong_to_ldouble_correct=yes
30 ifeq ($(TARGET),x86_64-w64-mingw32)
31 $(PKG)_CROSS_CONFIG_OPTIONS += \
32 hdf5_cv_printf_ll=ll \
33 hdf5_cv_system_scope_threads=no \
34 hdf5_cv_ldouble_to_integer_accurate=yes \
35 hdf5_cv_ulong_to_fp_bottom_bit_accurate=yes \
36 ac_cv_sizeof_long=4 \
37 ac_cv_sizeof_long_double=16 \
38 ac_cv_sizeof_long_long=8 \
39 ac_cv_sizeof_off_t=8 \
40 ac_cv_sys_file_offset_bits=64
41 else
42 $(PKG)_CROSS_CONFIG_OPTIONS += \
43 hdf5_cv_printf_ll=l \
44 hdf5_cv_system_scope_threads=yes \
45 hdf5_cv_ulong_to_fp_bottom_bit_accurate=no
46 endif
47 endif
48 endif
49
50 ifeq ($(MXE_NATIVE_BUILD),yes)
51 $(PKG)_CONFIGURE_ENV := LD_LIBRARY_PATH=$(LD_LIBRARY_PATH)
52 endif
53 12
54 define $(PKG)_UPDATE 13 define $(PKG)_UPDATE
55 echo 'Warning: Updates are temporarily disabled for package hdf5.' >&2; 14 echo 'Warning: Updates are temporarily disabled for package hdf5.' >&2;
56 echo $(hdf5_VERSION) 15 echo $(hdf5_VERSION)
57 endef 16 endef
58 17
59 define $(PKG)_BUILD 18 ifeq ($(MXE_NATIVE_BUILD),yes)
60 case '$(TARGET)' in \ 19 define $(PKG)_BUILD
61 x86_64-w64-mingw32) \ 20 # build GCC and support libraries using autotools
62 cp '$(1)/src/H5Tinit.c.mingw64' '$(1)/src/H5Tinit.c.mingw' \
63 ;; \
64 i686-w64-mingw32) \
65 cp '$(1)/src/H5Tinit.c.mingw32' '$(1)/src/H5Tinit.c.mingw' \
66 ;; \
67 i686-pc-mingw32) \
68 cp '$(1)/src/H5Tinit.c.mingw32' '$(1)/src/H5Tinit.c.mingw' \
69 ;; \
70 esac
71
72 # build GCC and support libraries
73 cd '$(1)' && aclocal && libtoolize && autoreconf 21 cd '$(1)' && aclocal && libtoolize && autoreconf
74 mkdir '$(1)/.build' 22 mkdir '$(1)/.build'
75 cd '$(1)/.build' && $($(PKG)_CONFIGURE_ENV) '$(1)/configure' \ 23 cd '$(1)/.build' && LD_LIBRARY_PATH=$(LD_LIBRARY_PATH) '$(1)/configure' \
76 $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \ 24 $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \
77 $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \ 25 $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
78 $(ENABLE_SHARED_OR_STATIC) \ 26 $(ENABLE_SHARED_OR_STATIC) \
79 --prefix='$(HOST_PREFIX)' \ 27 --prefix='$(HOST_PREFIX)' \
80 --disable-direct-vfd \ 28 --disable-direct-vfd && $(CONFIGURE_POST_HOOK)
81 $($(PKG)_CROSS_CONFIG_OPTIONS) && $(CONFIGURE_POST_HOOK)
82
83 case '$(MXE_SYSTEM)' in \
84 *mingw*) \
85 echo "#define H5_HAVE_WIN32_API 1" >> $(1)/.build/src/H5pubconf.h; \
86 echo "#define H5_HAVE_MINGW 1" >> $(1)/.build/src/H5pubconf.h; \
87 echo "#define HAVE_WINDOWS_PATH 1" >> $(1)/.build/src/H5pubconf.h; \
88 ;; \
89 *msvc*) \
90 sed -i -e 's/^\(#define H5_SIZEOF_SSIZE_T\) .*/\1 0/' \
91 '$(1)/.build/src/H5pubconf.h'; \
92 echo "#define H5_HAVE_WIN32_API 1" >> $(1)/.build/src/H5pubconf.h; \
93 echo "#define H5_HAVE_VISUAL_STUDIO 1" >> $(1)/.build/src/H5pubconf.h; \
94 echo "#define HAVE_WINDOWS_PATH 1" >> $(1)/.build/src/H5pubconf.h; \
95 ;; \
96 esac
97 29
98 # libtool is somehow created to effectively disallow shared builds 30 # libtool is somehow created to effectively disallow shared builds
99 $(SED) -i 's,allow_undefined_flag="unsupported",allow_undefined_flag="",g' '$(1)/.build/libtool' 31 $(SED) -i 's,allow_undefined_flag="unsupported",allow_undefined_flag="",g' '$(1)/.build/libtool'
100 32
101 $(MAKE) -C '$(1)/.build' -j '$(JOBS)' 33 $(MAKE) -C '$(1)/.build' -j '$(JOBS)'
102 $(MAKE) -C '$(1)/.build' -j 1 install DESTDIR='$(3)' 34 $(MAKE) -C '$(1)/.build' -j 1 install DESTDIR='$(3)'
103 35
104 if [ "$(ENABLE_DEP_DOCS)" == "no" ]; then \ 36 if [ "$(ENABLE_DEP_DOCS)" == "no" ]; then \
105 rm -rf '$(3)$(HOST_PREFIX)/share/hdf5_examples'; \ 37 rm -rf '$(3)$(HOST_PREFIX)/share/hdf5_examples'; \
106 fi 38 fi
107 rm -f '$(3)$(HOST_BINPREFIX)/h5*.exe' 39 endef
108 endef 40 else
41 define $(PKG)_BUILD
42 # build rules for windows target using cmake
43
44 mkdir '$(1)/pregen'
45 case '$(TARGET)' in \
46 x86_64-w64-mingw32) \
47 cp '$(1)/src/H5Tinit.c.mingw64' '$(1)/pregen/H5Tinit.c' & \
48 cp '$(1)/src/H5lib_settings.c.mingw64' '$(1)/pregen/H5lib_settings.c' \
49 ;; \
50 i686-w64-mingw32) \
51 cp '$(1)/src/H5Tinit.c.mingw32' '$(1)/pregen/H5Tinit.c' & \
52 cp '$(1)/src/H5lib_settings.c.mingw32' '$(1)/pregen/H5lib_settings.c' \
53 ;; \
54 i686-pc-mingw32) \
55 cp '$(1)/src/H5Tinit.c.mingw32' '$(1)/pregen/H5Tinit.c' & \
56 cp '$(1)/src/H5lib_settings.c.mingw32' '$(1)/pregen/H5lib_settings.c' \
57 ;; \
58 esac
59
60 mkdir '$(1)/.build'
61
62 # platform specific settings using https://github.com/steven-varga/HDFGroup-mailinglist/tree/master/crosscompile-2020-mar-25
63 cd '$(1)/.build' && cmake .. -G "Unix Makefiles" \
64 -DCMAKE_INSTALL_PREFIX=${prefix} \
65 $($(PKG)_CMAKE_FLAGS) \
66 -DBUILD_SHARED_LIBS=$(if $(findstring yes,$(BUILD_SHARED)),ON,OFF) \
67 -DCMAKE_TOOLCHAIN_FILE='$(CMAKE_TOOLCHAIN_FILE)' \
68 -DHDF5_INSTALL_BIN_DIR='$(HOST_BINDIR)' \
69 -DHDF5_INSTALL_LIB_DIR='$(HOST_LIBDIR)' \
70 -DHDF5_INSTALL_INCLUDE_DIR='$(HOST_INCDIR)' \
71 -DHDF5_INSTALL_DATA_DIR='$(HOST_PREFIX)/share' \
72 -DHDF5_BUILD_CPP_LIB=OFF \
73 -DHDF5_BUILD_HL_LIB=ON \
74 -DHDF5_ENABLE_Z_LIB_SUPPORT=ON \
75 -DHDF5_ENABLE_SZIP_SUPPORT=OFF \
76 -DHDF5_ENABLE_SZIP_ENCODING=OFF \
77 -DBUILD_TESTING=OFF \
78 -DHDF5_USE_PREGEN=ON \
79 -DHDF5_USE_PREGEN_DIR='$(1)/pregen' \
80 $($(PKG)_CCACHE_OPTIONS) \
81 -DHAVE_IOEO_EXITCODE=0 \
82 -DH5_LDOUBLE_TO_LONG_SPECIAL_RUN=1 \
83 -DH5_LDOUBLE_TO_LONG_SPECIAL_RUN__TRYRUN_OUTPUT="" \
84 -DH5_LONG_TO_LDOUBLE_SPECIAL_RUN=1 \
85 -DH5_LONG_TO_LDOUBLE_SPECIAL_RUN__TRYRUN_OUTPUT="" \
86 -DH5_LDOUBLE_TO_LLONG_ACCURATE_RUN=0 \
87 -DH5_LDOUBLE_TO_LLONG_ACCURATE_RUN__TRYRUN_OUTPUT="" \
88 -DH5_LLONG_TO_LDOUBLE_CORRECT_RUN=0 \
89 -DH5_LLONG_TO_LDOUBLE_CORRECT_RUN__TRYRUN_OUTPUT="" \
90 -DH5_DISABLE_SOME_LDOUBLE_CONV_RUN=1 \
91 -DH5_DISABLE_SOME_LDOUBLE_CONV_RUN__TRYRUN_OUTPUT="" \
92 -DH5_NO_ALIGNMENT_RESTRICTIONS_RUN=0 \
93 -DH5_NO_ALIGNMENT_RESTRICTIONS_RUN__TRYRUN_OUTPUT="" \
94 -DH5_PRINTF_LL_TEST_RUN=1 \
95 -DH5_PRINTF_LL_TEST_RUN__TRYRUN_OUTPUT="" \
96 -DTEST_LFS_WORKS_RUN=0
97
98 $(MAKE) -C '$(1)/.build' -j '$(JOBS)'
99 $(MAKE) -C '$(1)/.build' -j 1 install DESTDIR=$(3)
100
101 # FIXME: Change the build rule to create the shared libs with the prefix
102 mv '$(3)/$(HOST_LIBDIR)/hdf5.lib' '$(3)/$(HOST_LIBDIR)/libhdf5.lib'
103 mv '$(3)/$(HOST_LIBDIR)/hdf5_tools.lib' '$(3)/$(HOST_LIBDIR)/libhdf5_tools.lib'
104 mv '$(3)/$(HOST_LIBDIR)/hdf5_hl.lib' '$(3)/$(HOST_LIBDIR)/libhdf5_hl.lib'
105 # Remove version suffix from pkg-config files
106 mv '$(3)/$(HOST_LIBDIR)/pkgconfig/hdf5-$($(PKG)_VERSION).pc' '$(3)/$(HOST_LIBDIR)/pkgconfig/hdf5.pc'
107 mv '$(3)/$(HOST_LIBDIR)/pkgconfig/hdf5_hl-$($(PKG)_VERSION).pc' '$(3)/$(HOST_LIBDIR)/pkgconfig/hdf5_hl.pc'
108
109 if [ "$(ENABLE_DEP_DOCS)" == "no" ]; then \
110 rm -rf '$(HOST_PREFIX)/share/hdf5_examples'; \
111 fi
112 endef
113 endif
114