annotate src/hdf5.mk @ 3734:cde7e614b3e2

hdf5: allow compile under native mingw * src/hdf5.mk: copy w32 init file on native mingw compile (i686-pc-mingw32)
author John Donoghue
date Wed, 12 Nov 2014 09:48:00 -0500
parents c611a634efec
children 5159c01c3c26
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2929
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 # This file is part of MXE.
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2 # See index.html for further information.
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 PKG := hdf5
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 $(PKG)_IGNORE :=
3480
13be64f9f16d move version info from index.html to src/*.mk files
John W. Eaton <jwe@octave.org>
parents: 3293
diff changeset
6 $(PKG)_VERSION := 1.8.10
2929
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 $(PKG)_CHECKSUM := 867a91b75ee0bbd1f1b13aecd52e883be1507a2c
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 $(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION)
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 $(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.bz2
3706
c611a634efec hdf5: update pkg url.
John Donoghue
parents: 3704
diff changeset
10 $(PKG)_URL := http://www.hdfgroup.org/ftp/HDF5/releases/$(PKG)-$($(PKG)_VERSION)/src/$($(PKG)_FILE)
3048
5ef49fb3299d treat gcc and binutils as build tools
John W. Eaton <jwe@octave.org>
parents: 3013
diff changeset
11 $(PKG)_DEPS :=
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
12 ifeq ($(MXE_SYSTEM),mingw)
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
13 ifneq ($(MXE_NATIVE_BUILD),yes)
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
14 $(PKG)_CROSS_CONFIG_OPTIONS := \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
15 --disable-largefile \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
16 LIBS=-lws2_32 \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
17 hdf5_cv_gettimeofday_tz=no \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
18 hdf5_cv_vsnprintf_works=yes \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
19 hdf5_cv_ldouble_to_integer_works=yes \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
20 hdf5_cv_ulong_to_float_accurate=yes \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
21 hdf5_cv_fp_to_ullong_accurate=yes \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
22 hdf5_cv_fp_to_ullong_right_maximum=no \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
23 hdf5_cv_ldouble_to_uint_accurate=yes \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
24 hdf5_cv_ullong_to_ldouble_precision=yes \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
25 hdf5_cv_fp_to_integer_overflow_works=yes \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
26 hdf5_cv_ldouble_to_long_special=no \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
27 hdf5_cv_long_to_ldouble_special=no \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
28 hdf5_cv_ldouble_to_llong_accurate=yes \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
29 hdf5_cv_llong_to_ldouble_correct=yes
3704
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
30 ifeq ($(TARGET),x86_64-w64-mingw32)
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
31 $(PKG)_CROSS_CONFIG_OPTIONS += \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
32 hdf5_cv_printf_ll=ll \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
33 hdf5_cv_system_scope_threads=no \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
34 hdf5_cv_ldouble_to_integer_accurate=yes \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
35 hdf5_cv_ulong_to_fp_bottom_bit_accurate=yes \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
36 ac_cv_sizeof_long=4 \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
37 ac_cv_sizeof_long_double=16 \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
38 ac_cv_sizeof_long_long=8 \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
39 ac_cv_sizeof_off_t=8 \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
40 ac_cv_sys_file_offset_bits=64
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
41 else
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
42 $(PKG)_CROSS_CONFIG_OPTIONS += \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
43 hdf5_cv_printf_ll=l \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
44 hdf5_cv_system_scope_threads=yes \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
45 hdf5_cv_ulong_to_fp_bottom_bit_accurate=no
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
46 endif
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
47 endif
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
48 endif
2929
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49
3222
5072829ce458 hdf5.mk: set configure environment for native builds
John W. Eaton <jwe@octave.org>
parents: 3095
diff changeset
50 ifeq ($(MXE_NATIVE_BUILD),yes)
5072829ce458 hdf5.mk: set configure environment for native builds
John W. Eaton <jwe@octave.org>
parents: 3095
diff changeset
51 $(PKG)_CONFIGURE_ENV := LD_LIBRARY_PATH=$(LD_LIBRARY_PATH)
5072829ce458 hdf5.mk: set configure environment for native builds
John W. Eaton <jwe@octave.org>
parents: 3095
diff changeset
52 endif
5072829ce458 hdf5.mk: set configure environment for native builds
John W. Eaton <jwe@octave.org>
parents: 3095
diff changeset
53
2929
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 define $(PKG)_UPDATE
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
55 echo 'Warning: Updates are temporarily disabled for package hdf5.' >&2;
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 echo $(hdf5_VERSION)
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 endef
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
58
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59 define $(PKG)_BUILD
3704
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
60 case '$(TARGET)' in \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
61 x86_64-w64-mingw32) \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
62 cp '$(1)/src/H5Tinit.c.mingw64' '$(1)/src/H5Tinit.c.mingw' \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
63 ;; \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
64 i686-w64-mingw32) \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
65 cp '$(1)/src/H5Tinit.c.mingw32' '$(1)/src/H5Tinit.c.mingw' \
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
66 ;; \
3734
cde7e614b3e2 hdf5: allow compile under native mingw
John Donoghue
parents: 3706
diff changeset
67 i686-pc-mingw32) \
cde7e614b3e2 hdf5: allow compile under native mingw
John Donoghue
parents: 3706
diff changeset
68 cp '$(1)/src/H5Tinit.c.mingw32' '$(1)/src/H5Tinit.c.mingw' \
cde7e614b3e2 hdf5: allow compile under native mingw
John Donoghue
parents: 3706
diff changeset
69 ;; \
3704
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
70 esac
6ac813175f6f fix hdf5 builds for 64-bit Windows
John W. Eaton <jwe@octave.org>
parents: 3557
diff changeset
71
2929
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 # build GCC and support libraries
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 cd '$(1)' && autoreconf
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 mkdir '$(1)/.build'
3222
5072829ce458 hdf5.mk: set configure environment for native builds
John W. Eaton <jwe@octave.org>
parents: 3095
diff changeset
75 cd '$(1)/.build' && $($(PKG)_CONFIGURE_ENV) '$(1)/configure' \
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
76 $(CONFIGURE_CPPFLAGS) $(CONFIGURE_LDFLAGS) \
3013
bcc26ffe9a0f use variable for --host and --build configure arguments
John W. Eaton <jwe@octave.org>
parents: 3012
diff changeset
77 $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
2929
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 $(ENABLE_SHARED_OR_STATIC) \
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 2997
diff changeset
79 --prefix='$(HOST_PREFIX)' \
2929
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 --disable-direct-vfd \
3095
f2bbfa69647e [MSVC] enable HDF5 compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3048
diff changeset
81 $($(PKG)_CROSS_CONFIG_OPTIONS) && $(CONFIGURE_POST_HOOK)
2929
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
83 case '$(MXE_SYSTEM)' in \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
84 *mingw*) \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
85 echo "#define H5_HAVE_WIN32_API 1" >> $(1)/.build/src/H5pubconf.h; \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
86 echo "#define H5_HAVE_MINGW 1" >> $(1)/.build/src/H5pubconf.h; \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
87 echo "#define HAVE_WINDOWS_PATH 1" >> $(1)/.build/src/H5pubconf.h; \
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
88 ;; \
3095
f2bbfa69647e [MSVC] enable HDF5 compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3048
diff changeset
89 *msvc*) \
f2bbfa69647e [MSVC] enable HDF5 compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3048
diff changeset
90 sed -i -e 's/^\(#define H5_SIZEOF_SSIZE_T\) .*/\1 0/' \
f2bbfa69647e [MSVC] enable HDF5 compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3048
diff changeset
91 '$(1)/.build/src/H5pubconf.h'; \
f2bbfa69647e [MSVC] enable HDF5 compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3048
diff changeset
92 echo "#define H5_HAVE_WIN32_API 1" >> $(1)/.build/src/H5pubconf.h; \
f2bbfa69647e [MSVC] enable HDF5 compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3048
diff changeset
93 echo "#define H5_HAVE_VISUAL_STUDIO 1" >> $(1)/.build/src/H5pubconf.h; \
f2bbfa69647e [MSVC] enable HDF5 compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3048
diff changeset
94 echo "#define HAVE_WINDOWS_PATH 1" >> $(1)/.build/src/H5pubconf.h; \
f2bbfa69647e [MSVC] enable HDF5 compilation
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3048
diff changeset
95 ;; \
2997
4f9b72cf7ee7 allow native builds too
John W. Eaton <jwe@octave.org>
parents: 2929
diff changeset
96 esac
2929
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
97
3557
b1a7cff2d2a9 Add octave forge of-netcdf package (and support files)
John Donoghue <john.donoghue@ieee.org>
parents: 3480
diff changeset
98 # libtool is somehow created to effectively disallow shared builds
b1a7cff2d2a9 Add octave forge of-netcdf package (and support files)
John Donoghue <john.donoghue@ieee.org>
parents: 3480
diff changeset
99 $(SED) -i 's,allow_undefined_flag="unsupported",allow_undefined_flag="",g' '$(1)/.build/libtool'
b1a7cff2d2a9 Add octave forge of-netcdf package (and support files)
John Donoghue <john.donoghue@ieee.org>
parents: 3480
diff changeset
100
b1a7cff2d2a9 Add octave forge of-netcdf package (and support files)
John Donoghue <john.donoghue@ieee.org>
parents: 3480
diff changeset
101 $(MAKE) -C '$(1)/.build' -j '$(JOBS)'
b1a7cff2d2a9 Add octave forge of-netcdf package (and support files)
John Donoghue <john.donoghue@ieee.org>
parents: 3480
diff changeset
102 $(MAKE) -C '$(1)/.build' -j 1 install DESTDIR='$(3)'
2929
4b72e7cf4f30 shared libraries and cross build for hdf5
John W. Eaton <jwe@octave.org>
parents:
diff changeset
103 endef