From a36c93db651299dcdab5c7625e388b0ce7f78b02 Mon Sep 17 00:00:00 2001 From: Martin Lambers Date: Mon, 3 Dec 2012 19:04:19 +0100 Subject: Add package netcdf and its prerequisites hdf4, hdf5, and portablexdr. Also enable the HDF4, HDF5 and NetCDF drivers for GDAL. --- index.html | 20 + src/gdal.mk | 10 +- src/hdf4-1-portability-fixes.patch | 53 ++ src/hdf4.mk | 29 ++ src/hdf5-1-disable-configure-try-run.patch | 798 +++++++++++++++++++++++++++++ src/hdf5.mk | 34 ++ src/netcdf.mk | 34 ++ src/portablexdr.mk | 24 + 8 files changed, 997 insertions(+), 5 deletions(-) create mode 100644 src/hdf4-1-portability-fixes.patch create mode 100644 src/hdf4.mk create mode 100644 src/hdf5-1-disable-configure-try-run.patch create mode 100644 src/hdf5.mk create mode 100644 src/netcdf.mk create mode 100644 src/portablexdr.mk diff --git a/index.html b/index.html index 49eb715..4e062f2 100644 --- a/index.html +++ b/index.html @@ -1269,6 +1269,16 @@ USE_OSGPLUGIN(<plugin2>) HarfBuzz + hdf4 + 4.2.8 + HDF4 + + + hdf5 + 1.8.10 + HDF5 + + hunspell 1.3.2 Hunspell @@ -1639,6 +1649,11 @@ USE_OSGPLUGIN(<plugin2>) Ncurses + netcdf + 4.2.1.1 + NetCDF + + nettle 2.5 nettle @@ -1774,6 +1789,11 @@ USE_OSGPLUGIN(<plugin2>) popt + portablexdr + 4.0.11 + PortableXDR + + portaudio 19_20111121 portaudio diff --git a/src/gdal.mk b/src/gdal.mk index be8c508..871cd81 100644 --- a/src/gdal.mk +++ b/src/gdal.mk @@ -8,7 +8,7 @@ $(PKG)_SUBDIR := gdal-$($(PKG)_VERSION) $(PKG)_FILE := gdal-$($(PKG)_VERSION).tar.gz $(PKG)_URL := http://download.osgeo.org/gdal/$($(PKG)_FILE) $(PKG)_URL_2 := ftp://ftp.remotesensing.org/gdal/$($(PKG)_FILE) -$(PKG)_DEPS := gcc zlib libpng tiff libgeotiff jpeg jasper giflib expat sqlite curl geos postgresql gta +$(PKG)_DEPS := gcc zlib libpng tiff libgeotiff jpeg jasper giflib expat sqlite curl geos postgresql gta hdf4 hdf5 netcdf define $(PKG)_UPDATE $(WGET) -q -O- 'http://trac.osgeo.org/gdal/wiki/DownloadSource' | \ @@ -42,6 +42,9 @@ define $(PKG)_BUILD --with-geos='$(PREFIX)/$(TARGET)/bin/geos-config' \ --with-pg='$(PREFIX)/bin/$(TARGET)-pg_config' \ --with-gta='$(PREFIX)/$(TARGET)' \ + --with-hdf4='$(PREFIX)/$(TARGET)' \ + --with-hdf5='$(PREFIX)/$(TARGET)' \ + --with-netcdf='$(PREFIX)/$(TARGET)' \ --without-odbc \ --without-static-proj4 \ --without-xerces \ @@ -50,12 +53,9 @@ define $(PKG)_BUILD --without-spatialite \ --without-cfitsio \ --without-pcraster \ - --without-netcdf \ --without-pcidsk \ --without-ogdi \ --without-fme \ - --without-hdf4 \ - --without-hdf5 \ --without-ecw \ --without-kakadu \ --without-mrsid \ @@ -73,7 +73,7 @@ define $(PKG)_BUILD --without-php \ --without-ruby \ --without-python \ - LIBS="-ljpeg -lsecur32 `'$(TARGET)-pkg-config' --libs openssl libtiff-4`" + LIBS="-ljpeg -lsecur32 -lportablexdr -lmsvcr80 `'$(TARGET)-pkg-config' --libs openssl libtiff-4`" $(MAKE) -C '$(1)' -j 1 lib-target $(MAKE) -C '$(1)' -j 1 install-lib $(MAKE) -C '$(1)/port' -j 1 install diff --git a/src/hdf4-1-portability-fixes.patch b/src/hdf4-1-portability-fixes.patch new file mode 100644 index 0000000..29ef3d6 --- /dev/null +++ b/src/hdf4-1-portability-fixes.patch @@ -0,0 +1,53 @@ +This file is part of MXE. +See index.html for further information. + +--- a/configure.ac 2012-12-02 11:01:36.252405122 +0100 ++++ b/configure.ac 2012-12-02 11:00:05.580408916 +0100 +@@ -556,7 +556,6 @@ + dnl ====================================================================== + + dnl Always put the /usr/include/rpc directory first in the search list. +-CPPFLAGS="-I/usr/include/rpc $CPPFLAGS" + + dnl ---------------------------------------------------------------------- + dnl We're trying to link against the rpc library when building on Cygwin, +@@ -739,6 +739,7 @@ + *-mac-*) BAR="mac" ;; + *-apple*) BAR="apple" ;; + i686-pc-cygwin*) BAR="linux" ;; ++ i686-pc-mingw*) BAR="linux" ;; + *) echo "*** unknown host $host!"; exit 1 ;; + esac + src_files="mfhdf/libsrc/config/netcdf-FOO.h:mfhdf/libsrc/netcdf.h +--- a.hdf/src/hdfi.h 2012-12-02 11:05:59.140394129 +0100 ++++ b/hdf/src/hdfi.h 2012-12-02 11:05:32.528395313 +0100 +@@ -865,8 +865,8 @@ + #include + #include + #else /* !UNIX386 */ +-#include /* for unbuffered file I/O */ +-#include ++#include /* for unbuffered file I/O */ ++#include + #include + #include /* for debugging getch() calls */ + #include +--- a/mfhdf/ncgen/Makefile.am 2012-12-02 19:04:08.512697688 +0100 ++++ b/mfhdf/ncgen/Makefile.am 2012-12-02 19:14:01.636713531 +0100 +@@ -23,16 +23,6 @@ + + bin_PROGRAMS = ncgen + +-if HDF_BUILD_NETCDF +-if HDF_BUILD_FORTRAN +-noinst_PROGRAMS = ctest0 ftest0 +-else +-noinst_PROGRAMS = ctest0 +-endif +-else +-noinst_PROGRAMS = ctest0 +-endif +- + ## Information for building the "ncgen" program + ncgen_SOURCES = close.c escapes.c generate.c genlib.c getfill.c init.c \ + load.c main.c ncgentab.c diff --git a/src/hdf4.mk b/src/hdf4.mk new file mode 100644 index 0000000..904940b --- /dev/null +++ b/src/hdf4.mk @@ -0,0 +1,29 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := hdf4 +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := 9d4ab457ccb8e582c265ca3f5f2ec90614d89da4 +$(PKG)_SUBDIR := hdf-$($(PKG)_VERSION) +$(PKG)_FILE := hdf-$($(PKG)_VERSION).tar.bz2 +$(PKG)_URL := http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/$($(PKG)_FILE) +$(PKG)_DEPS := gcc zlib jpeg portablexdr + +define $(PKG)_UPDATE + /bin/false +endef + +define $(PKG)_BUILD + cd '$(1)' && autoreconf && ./configure \ + --host='$(TARGET)' \ + --build="`config.guess`" \ + --disable-shared \ + --disable-fortran \ + --disable-netcdf \ + --prefix='$(PREFIX)/$(TARGET)' \ + CPPFLAGS="-DH4_F77_FUNC\(name,NAME\)=NAME" + $(MAKE) -C '$(1)'/hdf/src -j '$(JOBS)' + $(MAKE) -C '$(1)'/hdf/src -j 1 install + $(MAKE) -C '$(1)'/mfhdf/libsrc -j '$(JOBS)' + $(MAKE) -C '$(1)'/mfhdf/libsrc -j 1 install +endef diff --git a/src/hdf5-1-disable-configure-try-run.patch b/src/hdf5-1-disable-configure-try-run.patch new file mode 100644 index 0000000..1a7c6a8 --- /dev/null +++ b/src/hdf5-1-disable-configure-try-run.patch @@ -0,0 +1,798 @@ +This file is part of MXE. +See index.html for further information. + +--- a/configure.ac 2012-12-03 08:59:14.540462389 +0100 ++++ b/configure.ac 2012-12-03 09:14:00.188485595 +0100 +@@ -586,70 +586,6 @@ + ## Change to the C++ language + AC_LANG_PUSH(C++) + +- AC_MSG_CHECKING([if $CXX needs old style header files in includes]) +- AC_TRY_RUN([ +-#include +- +-int main(void) { return 0; } +- ], [ +- echo no +- ], [ +- echo yes +- CXXFLAGS="${CXXFLAGS} -DOLD_HEADER_FILENAME" +- AM_CXXFLAGS="${AM_CXXFLAGS} -DOLD_HEADER_FILENAME" +- ]) +- +- AC_MSG_CHECKING([if $CXX can handle namespaces]) +- AC_TRY_RUN([ +-namespace H5 { +-int fnord; +-} +- +-int main(void) { +- using namespace H5; +- fnord = 37; +- return 0; +-} +- ], [ +- echo yes +- ], [ +- echo no +- CXXFLAGS="${CXXFLAGS} -DH5_NO_NAMESPACE" +- AM_CXXFLAGS="${AM_CXXFLAGS} -DH5_NO_NAMESPACE" +- ]) +- +- AC_MSG_CHECKING([if $CXX supports std]) +- AC_TRY_RUN([ +-#include +- +-using namespace std; +- +-int main(void) { +- string myString("testing namespace std"); +- return 0; +-} +- ], [ +- echo yes +- ], [ +- echo no +- CXXFLAGS="${CXXFLAGS} -DH5_NO_STD" +- AM_CXXFLAGS="${AM_CXXFLAGS} -DH5_NO_STD" +- ]) +- +- AC_MSG_CHECKING([if $CXX supports bool types]) +- AC_TRY_RUN([ +-int main(void) { +- bool flag; +- return 0; +-} +- ], [ +- echo yes +- ], [ +- echo no +- CXXFLAGS="${CXXFLAGS} -DBOOL_NOTDEFINED" +- AM_CXXFLAGS="${AM_CXXFLAGS} -DBOOL_NOTDEFINED" +- ]) +- + AC_MSG_CHECKING([if $CXX has offsetof extension]) + AC_TRY_COMPILE([ + #include +@@ -671,22 +607,6 @@ + AC_MSG_RESULT([yes]), + AC_MSG_RESULT([no])) + +- AC_MSG_CHECKING([if $CXX can handle static cast]) +- AC_TRY_RUN([ +-int main(void) { +- float test_float; +- int test_int; +- test_float = 37.0; +- test_int = static_cast (test_float); +- return 0; +-} +- ], [ +- echo yes +- ], [ +- echo no +- CXXFLAGS="${CXXFLAGS} -DNO_STATIC_CAST" +- AM_CXXFLAGS="${AM_CXXFLAGS} -DNO_STATIC_CAST" +- ]) + else + echo "no" + CXX="no" +@@ -1424,24 +1344,7 @@ + ## Now actually test to see if we can create large files after we've + ## checked for any needed defines. + AC_MSG_CHECKING([if large (64-bit) files are supported on this system.]) +- AC_CACHE_VAL([hdf5_cv_have_lfs], +- [AC_TRY_RUN([ +- #include +- #include +- #include +- #include +- #define BIG_FILE (off_t)0x80000000UL +- int main(void) { +- int fd; +- if ((fd=open("test.conf", O_RDWR|O_TRUNC|O_CREAT, 0666)) < 0) exit(1); +- if (lseek(fd, BIG_FILE, SEEK_SET)!=BIG_FILE) exit(1); +- if (5!=write(fd, "hello", (size_t)5)) exit(1); +- if (lseek(fd, 2*BIG_FILE, SEEK_SET) != 2*BIG_FILE) exit(1); +- if (5!=write(fd, "hello", (size_t)5)) exit(1); +- if (unlink("test.conf") < 0) exit(1); +- exit(0); +- } +- ],[hdf5_cv_have_lfs=yes],[hdf5_cv_have_lfs=no],)]) ++ AC_CACHE_VAL([hdf5_cv_have_lfs], [hdf5_cv_have_lfs=yes]) + + if test "X${hdf5_cv_have_lfs}" = "Xyes"; then + AC_MSG_RESULT([yes]) +@@ -2119,24 +2022,7 @@ + + if test "$have_gettime" = "yes" -a "$have_struct_tz" = "yes"; then + AC_MSG_CHECKING(whether gettimeofday() gives timezone) +- AC_CACHE_VAL([hdf5_cv_gettimeofday_tz], +- [AC_TRY_RUN([ +- #include +- #include +- int main(void) +- { +- struct timeval tv; +- struct timezone tz; +- tz.tz_minuteswest = 7777; /* Initialize to an unreasonable number */ +- tz.tz_dsttime = 7; +- gettimeofday(&tv, &tz); +- /* Check whether the function returned any value at all */ +- if(tz.tz_minuteswest == 7777 && tz.tz_dsttime == 7) +- exit(1); +- else exit (0); +- }], +- [hdf5_cv_gettimeofday_tz=yes], +- [hdf5_cv_gettimeofday_tz=no])]) ++ AC_CACHE_VAL([hdf5_cv_gettimeofday_tz], [hdf5_cv_gettimeofday_tz=no]) + + if test ${hdf5_cv_gettimeofday_tz} = "yes"; then + AC_MSG_RESULT([yes]) +@@ -2221,30 +2107,7 @@ + ## return (-1) + AC_MSG_CHECKING([if vsnprintf returns correct value]) + +- AC_CACHE_VAL([hdf5_cv_vsnprintf_works], +- AC_TRY_RUN([ +-#include +-#include +-#include +- +-int test_vsnprintf(const char *fmt,...) +-{ +- va_list ap; +- char *s = malloc(16); +- int ret; +- +- va_start(ap, fmt); +- ret=vsnprintf(s,16,"%s",ap); +- va_end(ap); +- +- return(ret!=42 ? 1 : 0); +-} +- +-int main(void) +-{ +- exit(test_vsnprintf("%s","A string that is longer than 16 characters")); +-} +- ],[hdf5_cv_vsnprintf_works=yes],[hdf5_cv_vsnprintf_works=no],)) ++ AC_CACHE_VAL([hdf5_cv_vsnprintf_works], [hdf5_cv_vsnprintf_works=yes]) + + if test ${hdf5_cv_vsnprintf_works} = "yes"; then + AC_MSG_RESULT([yes]) +@@ -2330,26 +2193,7 @@ + ## LD_LIBRARY_PATH along with LDFLAGS or do it with the AC_TRY_RUN macro. + ## + AC_MSG_CHECKING([how to print long long]) +-AC_CACHE_VAL([hdf5_cv_printf_ll], [ +-LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo $AM_LDFLAGS $LDFLAGS | sed -e 's/-L/:/g' -e 's/ //g'`" +-export LD_LIBRARY_PATH +- +-for hdf5_cv_printf_ll in l ll L q unknown; do +- AC_TRY_RUN([ +- #include +- #include +- #include +- +- int main(void) +- { +- char *s = malloc(128); +- long long x = (long long)1048576 * (long long)1048576; +- sprintf(s,"%${hdf5_cv_printf_ll}d",x); +- exit(strcmp(s,"1099511627776")); +- } +- ], [break],,[continue]) +-done]) +- ++AC_CACHE_VAL([hdf5_cv_printf_ll], [hdf5_cv_printf_ll=I64]) + AC_MSG_RESULT([%${hdf5_cv_printf_ll}d and %${hdf5_cv_printf_ll}u]) + AC_DEFINE_UNQUOTED([PRINTF_LL_WIDTH], ["$hdf5_cv_printf_ll"], + [Width for printf() for type `long long' or `__int64', use `ll']) +@@ -2359,24 +2203,7 @@ + ## is supported on this system + ## + AC_MSG_CHECKING([Threads support system scope]) +-AC_CACHE_VAL([hdf5_cv_system_scope_threads], +- [AC_TRY_RUN([ +- #if STDC_HEADERS +- #include +- #include +- #endif +- +- int main(void) +- { +- pthread_attr_t attribute; +- int ret; +- +- pthread_attr_init(&attribute); +- ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); +- exit(ret==0 ? 0 : 1); +- } +- ], [hdf5_cv_system_scope_threads=yes], [hdf5_cv_system_scope_threads=no],)]) +- ++AC_CACHE_VAL([hdf5_cv_system_scope_threads], [hdf5_cv_system_scope_threads=yes]) + if test ${hdf5_cv_system_scope_threads} = "yes"; then + AC_DEFINE([SYSTEM_SCOPE_THREADS], [1], + [Define if your system supports pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM) call.]) +@@ -3236,30 +3063,7 @@ + if test ${ac_cv_sizeof_long_double} = 0; then + hdf5_cv_ldouble_to_integer_works=${hdf5_cv_ldouble_to_integer_works=no} + else +- AC_CACHE_VAL([hdf5_cv_ldouble_to_integer_works], +- [AC_TRY_RUN([ +- int main(void) +- { +- void *align; +- long double ld= 9701917572145405952.00L; +- unsigned char v1; +- short v2; +- unsigned int v3; +- int ret = 0; +- +- align = (void*)malloc(sizeof(long double)); +- memcpy(align, &ld, sizeof(long double)); +- +- /*For HU-UX11.00, there's floating exception(core dump) when doing some of casting +- *from 'long double' to integers*/ +- v1=(unsigned char)(*((long double*)align)); +- v2=(short)(*((long double*)align)); +- v3=(unsigned int)(*((long double*)align)); +- +- done: +- exit(ret); +- } +- ], [hdf5_cv_ldouble_to_integer_works=yes], [hdf5_cv_ldouble_to_integer_works=no],)]) ++ AC_CACHE_VAL([hdf5_cv_ldouble_to_integer_works], [hdf5_cv_ldouble_to_integer_works=yes]) + fi + + if test ${hdf5_cv_ldouble_to_integer_works} = "yes"; then +@@ -3303,36 +3107,7 @@ + ## + AC_MSG_CHECKING([if accurately converting unsigned long to float values]) + +-AC_CACHE_VAL([hdf5_cv_ulong_to_float_accurate], +- [AC_TRY_RUN([ +- int main(void) +- { +- int ret = 0; +- unsigned long l1; +- unsigned long l2; +- unsigned long l3; +- float f1; +- float f2; +- float f3; +- +- +- if(sizeof(unsigned long)==8) { +- l1 = 0xffffffffffffffffUL; +- l2 = 0xffffffffffff0000UL; +- l3 = 0xf000000000000000UL; +- +- f1 = (float)l1; +- f2 = (float)l2; +- f3 = (float)l3; +- +- if((f1 < 0) || (f2 < 0) || (f3 < 0)) +- ret = 1; +- } +- +-done: +- exit(ret); +- } +- ], [hdf5_cv_ulong_to_float_accurate=yes], [hdf5_cv_ulong_to_float_accurate=no],)]) ++AC_CACHE_VAL([hdf5_cv_ulong_to_float_accurate], [hdf5_cv_ulong_to_float_accurate=yes]) + + if test ${hdf5_cv_ulong_to_float_accurate} = "yes"; then + AC_DEFINE([ULONG_TO_FLOAT_ACCURATE], [1], +@@ -3353,71 +3128,7 @@ + ## + AC_MSG_CHECKING([if accurately converting unsigned long long to floating-point values]) + +-if test ${host_os_novers} = "solaris2.x"; then +- AC_CACHE_VAL([hdf5_cv_ulong_to_fp_bottom_bit_accurate], +- [AC_TRY_RUN([ +- int main(void) +- { +- unsigned long l1; +- unsigned long l2; +- unsigned long l3; +- unsigned long l4; +- unsigned long long ld1; +- unsigned long long ld2; +- unsigned long long ld3; +- unsigned long long ld4; +- double d1, d2, d3, d4; +- unsigned char s[8]; +- int ret = 0; +- +- if(sizeof(unsigned long)==8) { +- l1 = 0xf000000000000b00UL; /*Round-down case*/ +- l2 = 0xf000000000000401UL; /*Round-up case*/ +- l3 = 0xf000000000000400UL; /*Round-down case*/ +- l4 = 0xf000000000000c00UL; /*Round-up case*/ +- +- d1 = (double)l1; +- d2 = (double)l2; +- d3 = (double)l3; +- d4 = (double)l4; +- } else if(sizeof(unsigned long long)==8) { +- ld1 = 0xf000000000000b00ULL; /*Round-down case*/ +- ld2 = 0xf000000000000401ULL; /*Round-up case*/ +- ld3 = 0xf000000000000400ULL; /*Round-down case*/ +- ld4 = 0xf000000000000c00ULL; /*Round-up case*/ +- +- d1 = (double)ld1; +- d2 = (double)ld2; +- d3 = (double)ld3; +- d4 = (double)ld4; +- } else { +- ret = 1; +- goto done; +- } +- +- memcpy(s, &d1, 8); +- if(s[7]!=1) +- ret = 1; +- +- memcpy(s, &d2, 8); +- if(s[7]!=1) +- ret = 1; +- +- memcpy(s, &d3, 8); +- if(s[7]!=0) +- ret = 1; +- +- memcpy(s, &d4, 8); +- if(s[7]!=2) +- ret = 1; +- +-done: +- exit(ret); +- } +- ], [hdf5_cv_ulong_to_fp_bottom_bit_accurate=yes], [hdf5_cv_ulong_to_fp_bottom_bit_accurate=no],)]) +-else +- AC_CACHE_VAL([hdf5_cv_ulong_to_fp_bottom_bit_accurate], [hdf5_cv_ulong_to_fp_bottom_bit_accurate=yes]) +-fi ++AC_CACHE_VAL([hdf5_cv_ulong_to_fp_bottom_bit_accurate], [hdf5_cv_ulong_to_fp_bottom_bit_accurate=yes]) + + if test ${hdf5_cv_ulong_to_fp_bottom_bit_accurate} = "yes"; then + AC_DEFINE([ULONG_TO_FP_BOTTOM_BIT_ACCURATE], [1], +@@ -3436,25 +3147,7 @@ + ## + AC_MSG_CHECKING([if accurately roundup converting floating-point to unsigned long long values]) + +-AC_CACHE_VAL([hdf5_cv_fp_to_ullong_accurate], +- [AC_TRY_RUN([ +- int main(void) +- { +- float f = 111.60f; +- double d = 222.55L; +- unsigned long long l1 = (unsigned long long)f; +- unsigned long long l2 = (unsigned long long)d; +- int ret = 0; +- +- if(l1 == 112) +- ret = 1; +- if(l2 == 223) +- ret = 1; +- +-done: +- exit(ret); +- } +- ], [hdf5_cv_fp_to_ullong_accurate=yes], [hdf5_cv_fp_to_ullong_accurate=no],)]) ++AC_CACHE_VAL([hdf5_cv_fp_to_ullong_accurate], [hdf5_cv_fp_to_ullong_accurate=yes]) + + if test ${hdf5_cv_fp_to_ullong_accurate} = "yes"; then + AC_DEFINE([FP_TO_ULLONG_ACCURATE], [1], +@@ -3473,32 +3166,7 @@ + ## + AC_MSG_CHECKING([if right maximum converting floating-point to unsigned long long values]) + +-AC_CACHE_VAL([hdf5_cv_fp_to_ullong_right_maximum], +- [AC_TRY_RUN([ +- int main(void) +- { +- float f = 9701917572145405952.00f; +- double d1 = 9701917572145405952.00L; +- long double d2 = 9701917572145405952.00L; +- double d3 = 2e40L; +- unsigned long long l1 = (unsigned long long)f; +- unsigned long long l2 = (unsigned long long)d1; +- unsigned long long l3 = (unsigned long long)d2; +- unsigned long long l4; +- unsigned long long l5 = 0x7fffffffffffffffULL; +- int ret = 0; +- +- if(l1 <= l5 || l2 <= l5 || l3 <= l5) +- ret = 1; +- +- l4 = (unsigned long long)d3; +- if(l4 <= l5) +- ret = 1; +- +-done: +- exit(ret); +- } +- ], [hdf5_cv_fp_to_ullong_right_maximum=yes], [hdf5_cv_fp_to_ullong_right_maximum=no],)]) ++AC_CACHE_VAL([hdf5_cv_fp_to_ullong_right_maximum], [hdf5_cv_fp_to_ullong_right_maximum=yes]) + + if test ${hdf5_cv_fp_to_ullong_right_maximum} = "yes"; then + AC_DEFINE([FP_TO_ULLONG_RIGHT_MAXIMUM], [1], +@@ -3518,22 +3186,7 @@ + if test ${ac_cv_sizeof_long_double} = 0; then + hdf5_cv_ldouble_to_uint_accurate=${hdf5_cv_ldouble_to_uint_accurate=no} + else +- AC_CACHE_VAL([hdf5_cv_ldouble_to_uint_accurate], +- [AC_TRY_RUN([ +- int main(void) +- { +- long double ld = 2733248032.9183987530L; +- unsigned int i; +- int ret = 0; +- +- i = (unsigned int)ld; +- if(i!=2733248032 && i!=2733248031 && i!=2733248033) +- ret = 1; +- +- done: +- exit(ret); +- } +- ], [hdf5_cv_ldouble_to_uint_accurate=yes], [hdf5_cv_ldouble_to_uint_accurate=no],)]) ++ AC_CACHE_VAL([hdf5_cv_ldouble_to_uint_accurate], [hdf5_cv_ldouble_to_uint_accurate=yes]) + fi + + if test ${hdf5_cv_ldouble_to_uint_accurate} = "yes"; then +@@ -3592,82 +3245,7 @@ + if test ${ac_cv_sizeof_long_double} = 0; then + hdf5_cv_ullong_to_ldouble_precision=${hdf5_cv_ullong_to_ldouble_precision=no} + else +- AC_CACHE_VAL([hdf5_cv_ullong_to_ldouble_precision], +- [AC_TRY_RUN([ +- #include +- #include +- +- int main(void) +- { +- /* General variables */ +- int endian; +- int tst_value = 1; +- int ret = 0; +- +- /* For FreeBSD */ +- unsigned long long l = 0xa601e80bda85fcefULL; +- long double ld; +- unsigned char *c1, *c2; +- size_t size; +- +- /* For Cygwin */ +- unsigned long long l_cyg = 0xfffffffffffffff0ULL; +- long double ld_cyg; +- unsigned char *c2_cyg; +- size_t size_cyg; +- +- +- /* Determine this system's endianess */ +- c1 = (unsigned char*)calloc(1, sizeof(int)); +- memcpy((void*)c1, &tst_value, sizeof(int)); +- if(c1[0]==1) +- endian = 0; /* little endian */ +- else +- endian = 1; /* big endian */ +- +- /* For FreeBSD */ +- size = sizeof(long double); +- memset(&ld, 0, size); +- ld = (long double)l; +- +- c2 = (unsigned char*)calloc(1, size); +- memcpy((void*)c2, &ld, size); +- +- /* Test if the last 2 bytes of mantissa are lost. Mainly for FreeBSD on Intel +- * architecture(sleipnir) where it happens. */ +- /*if(endian==0 && c2[0]==0 && c2[1]==0)*/ /*little endian*/ +- if(endian==0 && c2[0]==0) { /*little endian*/ +- ret = 1; +- goto done; +- } +- +- /* For Cygwin */ +- size_cyg = sizeof(long double); +- memset(&ld_cyg, 0, size); +- ld_cyg = (long double)l_cyg; +- +- c2_cyg = (unsigned char*)calloc(1, size_cyg); +- memcpy((void*)c2_cyg, &ld_cyg, size_cyg); +- +- /* Test if the last 4 bytes(roughly) of mantissa are rounded up. Mainly for Cygwin +- * where the values like 0xffffffffffffffff, 0xfffffffffffffffe, ..., +- * 0xfffffffffffff000 ... are rounded up as 0x0000403f8000000000000000 +- * instead of 0x0000403effffffffffffffff, 0x0000403efffffffffffffffe, ..., +- * 0x0000403efffffffffffff000 ... +- */ +- if(endian==0 && c2_cyg[0]==0 && c2_cyg[1]==0 && c2_cyg[2]==0 && c2_cyg[3]==0) +- ret = 1; +- +- done: +- if(c1) +- free(c1); +- if(c2) +- free(c2); +- if(c2_cyg) +- free(c2_cyg); +- exit(ret); +- } +- ], [hdf5_cv_ullong_to_ldouble_precision=yes], [hdf5_cv_ullong_to_ldouble_precision=no],)]) ++ AC_CACHE_VAL([hdf5_cv_ullong_to_ldouble_precision], [hdf5_cv_ullong_to_ldouble_precision=yes]) + fi + + if test ${hdf5_cv_ullong_to_ldouble_precision} = "yes"; then +@@ -3687,19 +3265,7 @@ + ## + AC_MSG_CHECKING([if overflows normally converting floating-point to integer values]) + +-AC_CACHE_VAL([hdf5_cv_fp_to_integer_overflow_works], +- [AC_TRY_RUN([ +- int main(void) +- { +- float f = 2147483648.0f; +- int i; +- +- i = (int)f; +- +-done: +- exit(0); +- } +- ], [hdf5_cv_fp_to_integer_overflow_works=yes], [hdf5_cv_fp_to_integer_overflow_works=no],)]) ++AC_CACHE_VAL([hdf5_cv_fp_to_integer_overflow_works], [hdf5_cv_fp_to_integer_overflow_works=yes]) + + if test ${hdf5_cv_fp_to_integer_overflow_works} = "yes"; then + AC_DEFINE([FP_TO_INTEGER_OVERFLOW_WORKS], [1], +@@ -3723,62 +3289,7 @@ + if test ${ac_cv_sizeof_long_double} = 0; then + hdf5_cv_ldouble_to_long_special=${hdf5_cv_ldouble_to_long_special=no} + else +- AC_CACHE_VAL([hdf5_cv_ldouble_to_long_special], +- [AC_TRY_RUN([ +- int main(void) +- { +- long double ld = 20041683600089727.779961L; +- long ll; +- unsigned long ull; +- unsigned char s[16]; +- unsigned char s2[8]; +- int ret = 1; +- +- if(sizeof(long double) == 16 && sizeof(long) == 8) { +- /*make sure the long double type has 16 bytes in size and +- * 11 bits of exponent. If it is, +- *the bit sequence should be like below. It's not +- *a decent way to check but this info isn't available. */ +- memcpy(s, &ld, 16); +- if(s[0]==0x43 && s[1]==0x51 && s[2]==0xcc && s[3]==0xf3 && +- s[4]==0x85 && s[5]==0xeb && s[6]==0xc8 && s[7]==0xa0 && +- s[8]==0xbf && s[9]==0xcc && s[10]==0x2a && s[11]==0x3c) { +- +- /* Assign the hexadecimal value of long double type. */ +- s[0]=0x43; s[1]=0x51; s[2]=0xcc; s[3]=0xf3; +- s[4]=0x85; s[5]=0xeb; s[6]=0xc8; s[7]=0xa0; +- s[8]=0xbf; s[9]=0xcc; s[10]=0x2a; s[11]=0x3c; +- s[12]=0x3d; s[13]=0x85; s[14]=0x56; s[15]=0x20; +- +- memcpy(&ld, s, 16); +- +- ll = (long)ld; +- memcpy(s2, &ll, 8); +- +- /* The library's algorithm converts it to 0x 00 47 33 ce 17 af 22 82 +- * and gets wrong value 20041683600089730 on the IBM Power6 Linux. +- * But the IBM Power6 Linux converts it to 0x00 47 33 ce 17 af 22 7f +- * and gets the correct value 20041683600089727. It uses some special +- * algorithm. We're going to define the macro and skip the test until +- * we can figure out how they do it. */ +- if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce && +- s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f) +- ret = 0; +- +- ull = (unsigned long)ld; +- memcpy(s2, &ull, 8); +- +- /* The unsigned long is the same as signed long. */ +- if(s2[0]==0x00 && s2[1]==0x47 && s2[2]==0x33 && s2[3]==0xce && +- s2[4]==0x17 && s2[5]==0xaf && s2[6]==0x22 && s2[7]==0x7f) +- ret = 0; +- } +- } +- +- done: +- exit(ret); +- } +- ], [hdf5_cv_ldouble_to_long_special=yes], [hdf5_cv_ldouble_to_long_special=no],)]) ++ AC_CACHE_VAL([hdf5_cv_ldouble_to_long_special], [hdf5_cv_ldouble_to_long_special=no]) + fi + + if test ${hdf5_cv_ldouble_to_long_special} = "yes"; then +@@ -3802,64 +3313,7 @@ + if test ${ac_cv_sizeof_long_double} = 0; then + hdf5_cv_long_to_ldouble_special=${hdf5_cv_long_to_ldouble_special=no} + else +- AC_CACHE_VAL([hdf5_cv_long_to_ldouble_special], +- [AC_TRY_RUN([ +- int main(void) +- { +- long double ld; +- long ll; +- unsigned long ull; +- unsigned char s[16]; +- int flag=0, ret=1; +- +- /*Determine if long double has 16 byte in size, 11 bit exponent, and +- *the bias is 0x3ff */ +- if(sizeof(long double) == 16) { +- ld = 1.0L; +- memcpy(s, &ld, 16); +- if(s[0]==0x3f && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && +- s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) +- flag = 1; +- } +- +- if(flag==1 && sizeof(long)==8) { +- ll = 0x003fffffffffffffL; +- ld = (long double)ll; +- memcpy(s, &ld, 16); +- /* The library converts the value to 0x434fffffffffffff8000000000000000. +- * In decimal it is 18014398509481982.000000, one value short of the original. +- * The IBM Power6 Linux converts it to 0x4350000000000000bff0000000000000. +- * The value is correct in decimal. It uses some special +- * algorithm. We're going to define the macro and skip the test until +- * we can figure out how they do it. */ +- if(s[0]==0x43 && s[1]==0x50 && s[2]==0x00 && s[3]==0x00 && +- s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 && +- s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && +- s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) +- ret = 0; +- } +- if(flag==1 && sizeof(unsigned long)==8) { +- ull = 0xffffffffffffffffUL; +- ld = (long double)ull; +- memcpy(s, &ld, 16); +- /* Use a different value from signed long to test. The problem is the same +- * for both long and unsigned long. The value is 18446744073709551615. +- * The library converts the value to 0x43effffffffffffffe000000000000000. +- * In decimal it's 18446744073709548544.000000, very different from the original. +- * The IBM Power6 Linux converts it to 0x43f0000000000000bff0000000000000. +- * The value is correct in decimal. It uses some special +- * algorithm. We're going to define the macro and skip the test until +- * we can figure out how they do it. */ +- if(s[0]==0x43 && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && +- s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00 && +- s[8]==0xbf && s[9]==0xf0 && s[10]==0x00 && s[11]==0x00 && +- s[12]==0x00 && s[13]==0x00 && s[14]==0x00 && s[15]==0x00) +- ret = 0; +- } +- done: +- exit(ret); +- } +- ], [hdf5_cv_long_to_ldouble_special=yes], [hdf5_cv_long_to_ldouble_special=no],)]) ++ AC_CACHE_VAL([hdf5_cv_long_to_ldouble_special], [hdf5_cv_long_to_ldouble_special=no]) + fi + + if test ${hdf5_cv_long_to_ldouble_special} = "yes"; then +@@ -3884,45 +3338,7 @@ + if test ${ac_cv_sizeof_long_double} = 0; then + hdf5_cv_ldouble_to_llong_accurate=${hdf5_cv_ldouble_to_llong_accurate=no} + else +- AC_CACHE_VAL([hdf5_cv_ldouble_to_llong_accurate], +- [AC_TRY_RUN([ +- int main(void) +- { +- long double ld = 20041683600089727.779961L; +- long long ll; +- unsigned long long ull; +- unsigned char s[16]; +- int ret = 0; +- +- if(sizeof(long double) == 16) { +- /*make sure the long double type is the same as the failing type +- *which has 16 bytes in size and 11 bits of exponent. If it is, +- *the bit sequence should be like below. It's not +- *a decent way to check but this info isn't available. */ +- memcpy(s, &ld, 16); +- if(s[0]==0x43 && s[1]==0x51 && s[2]==0xcc && s[3]==0xf3 && +- s[4]==0x85 && s[5]==0xeb && s[6]==0xc8 && s[7]==0xa0 && +- s[8]==0xbf && s[9]==0xcc && s[10]==0x2a && s[11]==0x3c) { +- +- /*slightly adjust the bit sequence (s[8]=0xdf). The converted +- *values will go wild on Mac OS 10.4 and IRIX64 6.5.*/ +- s[0]=0x43; s[1]=0x51; s[2]=0xcc; s[3]=0xf3; +- s[4]=0x85; s[5]=0xeb; s[6]=0xc8; s[7]=0xa0; +- s[8]=0xdf; s[9]=0xcc; s[10]=0x2a; s[11]=0x3c; +- s[12]=0x3d; s[13]=0x85; s[14]=0x56; s[15]=0x20; +- +- memcpy(&ld, s, 16); +- ll = (long long)ld; +- ull = (unsigned long long)ld; +- +- if(ll != 20041683600089728 || ull != 20041683600089728) +- ret = 1; +- } +- } +- done: +- exit(ret); +- } +- ], [hdf5_cv_ldouble_to_llong_accurate=yes], [hdf5_cv_ldouble_to_llong_accurate=no],)]) ++ AC_CACHE_VAL([hdf5_cv_ldouble_to_llong_accurate], [hdf5_cv_ldouble_to_llong_accurate=yes]) + fi + + if test ${hdf5_cv_ldouble_to_llong_accurate} = "yes"; then +@@ -3946,49 +3362,7 @@ + if test ${ac_cv_sizeof_long_double} = 0; then + hdf5_cv_llong_to_ldouble_correct=${hdf5_cv_llong_to_ldouble_correct=no} + else +- AC_CACHE_VAL([hdf5_cv_llong_to_ldouble_correct], +- [AC_TRY_RUN([ +- int main(void) +- { +- long double ld; +- long long ll; +- unsigned long long ull; +- unsigned char s[16]; +- int flag=0, ret=0; +- +- /*Determine if long double has 16 byte in size, 11 bit exponent, and +- *the bias is 0x3ff */ +- if(sizeof(long double) == 16) { +- ld = 1.0L; +- memcpy(s, &ld, 16); +- if(s[0]==0x3f && s[1]==0xf0 && s[2]==0x00 && s[3]==0x00 && +- s[4]==0x00 && s[5]==0x00 && s[6]==0x00 && s[7]==0x00) +- flag = 1; +- } +- +- if(flag==1 && sizeof(long long)==8) { +- ll = 0x01ffffffffffffffLL; +- ld = (long double)ll; +- memcpy(s, &ld, 16); +- /*Check if the bit sequence is as supposed to be*/ +- if(s[0]!=0x43 || s[1]!=0x7f || s[2]!=0xff || s[3]!=0xff || +- s[4]!=0xff || s[5]!=0xff || s[6]!=0xff || s[7]!=0xff || +- s[8]!=0xf0 || s[9]!=0x00 || s[10]!=0x00 || s[11]!=0x00) +- ret = 1; +- } +- if(flag==1 && sizeof(unsigned long long)==8) { +- ull = 0x01ffffffffffffffULL; +- ld = (long double)ull; +- memcpy(s, &ld, 16); +- if(s[0]!=0x43 || s[1]!=0x7f || s[2]!=0xff || s[3]!=0xff || +- s[4]!=0xff || s[5]!=0xff || s[6]!=0xff || s[7]!=0xff || +- s[8]!=0xf0 || s[9]!=0x00 || s[10]!=0x00 || s[11]!=0x00) +- ret = 1; +- } +- done: +- exit(ret); +- } +- ], [hdf5_cv_llong_to_ldouble_correct=yes], [hdf5_cv_llong_to_ldouble_correct=no],)]) ++ AC_CACHE_VAL([hdf5_cv_llong_to_ldouble_correct], [hdf5_cv_llong_to_ldouble_correct=yes]) + fi + + if test ${hdf5_cv_llong_to_ldouble_correct} = "yes"; then diff --git a/src/hdf5.mk b/src/hdf5.mk new file mode 100644 index 0000000..49333cf --- /dev/null +++ b/src/hdf5.mk @@ -0,0 +1,34 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := hdf5 +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := 867a91b75ee0bbd1f1b13aecd52e883be1507a2c +$(PKG)_SUBDIR := hdf5-$($(PKG)_VERSION) +$(PKG)_FILE := hdf5-$($(PKG)_VERSION).tar.bz2 +$(PKG)_URL := http://www.hdfgroup.org/ftp/HDF5/current/src/$($(PKG)_FILE) +$(PKG)_DEPS := gcc zlib pthreads + +define $(PKG)_UPDATE + /bin/false +endef + +define $(PKG)_BUILD + cd '$(1)' && autoreconf && ./configure \ + --host='$(TARGET)' \ + --build="`config.guess`" \ + --disable-shared \ + --enable-cxx \ + --disable-direct-vfd \ + --prefix='$(PREFIX)/$(TARGET)' \ + CPPFLAGS="-DH5_HAVE_WIN32_API -D__MSVCRT_VERSION__=0x0800" \ + LIBS="-lmsvcr80" + $(MAKE) -C '$(1)'/src -j '$(JOBS)' + $(MAKE) -C '$(1)'/src -j 1 install + $(MAKE) -C '$(1)'/c++/src -j '$(JOBS)' + $(MAKE) -C '$(1)'/c++/src -j 1 install + $(MAKE) -C '$(1)'/hl/src -j '$(JOBS)' + $(MAKE) -C '$(1)'/hl/src -j 1 install + $(MAKE) -C '$(1)'/hl/c++/src -j '$(JOBS)' + $(MAKE) -C '$(1)'/hl/c++/src -j 1 install +endef diff --git a/src/netcdf.mk b/src/netcdf.mk new file mode 100644 index 0000000..c1fd22a --- /dev/null +++ b/src/netcdf.mk @@ -0,0 +1,34 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := netcdf +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := 76631cb4e6b767c224338415cf6e5f5ff9bd1238 +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://www.unidata.ucar.edu/downloads/netcdf/ftp/$($(PKG)_FILE) +$(PKG)_DEPS := gcc curl zlib hdf4 hdf5 + +define $(PKG)_UPDATE + /bin/false +endef + +# NetCDF uses '#ifdef IGNORE' as a synonym to '#if 0' in several places. +# IGNORE is assumed to never be defined, but winbase.h defines it... +# We just replace '#ifdef IGNORE' with '#if 0' to work around this. + +define $(PKG)_BUILD + cd '$(1)' && \ + $(SED) -i -e 's/#ifdef IGNORE/#if 0/' libsrc4/nc4hdf.c libsrc4/ncfunc.c libsrc/attr.c ncgen/cvt.c && \ + ./configure \ + --host='$(TARGET)' \ + --build="`config.guess`" \ + --disable-shared \ + --enable-netcdf-4 \ + --enable-hdf4 \ + --prefix='$(PREFIX)/$(TARGET)' \ + CPPFLAGS="-D__MSVCRT_VERSION__=0x0800 -D_DLGS_H" \ + LIBS="-lmfhdf -ldf -lmsvcr80 -lportablexdr -lws2_32" + $(MAKE) -C '$(1)' -j '$(JOBS)' + $(MAKE) -C '$(1)' -j 1 install +endef diff --git a/src/portablexdr.mk b/src/portablexdr.mk new file mode 100644 index 0000000..86267c8 --- /dev/null +++ b/src/portablexdr.mk @@ -0,0 +1,24 @@ +# This file is part of MXE. +# See index.html for further information. + +PKG := portablexdr +$(PKG)_IGNORE := +$(PKG)_CHECKSUM := 1fb556185ca68d9ba07ad2be0576b166375a75bb +$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION) +$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz +$(PKG)_URL := http://people.redhat.com/~rjones/portablexdr/files/$($(PKG)_FILE) +$(PKG)_DEPS := gcc + +define $(PKG)_UPDATE + /bin/false +endef + +define $(PKG)_BUILD + cd '$(1)' && ./configure \ + --host='$(TARGET)' \ + --build="`config.guess`" \ + --disable-shared \ + --prefix='$(PREFIX)/$(TARGET)' + $(MAKE) -C '$(1)' -j '$(JOBS)' + $(MAKE) -C '$(1)' -j 1 install +endef -- cgit v0.12