comparison src/msvc-netcdf-1.patch @ 3157:591b3d68b43e

Add netcdf module (and MSVC-specific patch)
author Michael Goffioul <michael.goffioul@gmail.com>
date Sat, 20 Jul 2013 22:41:16 -0400
parents
children
comparison
equal deleted inserted replaced
3156:36ac78f420b4 3157:591b3d68b43e
1 diff -ur netcdf-4.3.0-orig/Makefile.am netcdf-4.3.0-new/Makefile.am
2 --- netcdf-4.3.0-orig/Makefile.am 2013-05-09 12:15:22 -0400
3 +++ netcdf-4.3.0-new/Makefile.am 2013-07-20 15:18:07 -0400
4 @@ -139,7 +139,9 @@
5
6 install-data-hook:
7 if BUILD_DLL
8 - cp liblib/netcdfdll.def ${prefix}/lib
9 + if test -f liblib/netcdfdll.def; then \
10 + cp liblib/netcdfdll.def ${prefix}/lib; \
11 + fi
12 endif # BUILD_DLL
13 @echo ''
14 @echo '+-------------------------------------------------------------+'
15 diff -ur netcdf-4.3.0-orig/configure.ac netcdf-4.3.0-new/configure.ac
16 --- netcdf-4.3.0-orig/configure.ac 2013-05-09 12:15:14 -0400
17 +++ netcdf-4.3.0-new/configure.ac 2013-07-20 13:38:00 -0400
18 @@ -652,9 +652,9 @@
19 opendap with --disable-netcdf-4 --disable-dap, or see config.log for errors.])])
20 fi
21
22 -# We need the math library
23 -AC_CHECK_LIB([m], [floor], [],
24 -[AC_MSG_ERROR([Can't find or link to the math library.])])
25 +## We need the math library
26 +#AC_CHECK_LIB([m], [floor], [],
27 +#[AC_MSG_ERROR([Can't find or link to the math library.])])
28
29 if test "x$enable_netcdf_4" = xyes; then
30
31 diff -ur netcdf-4.3.0-orig/lib_flags.am netcdf-4.3.0-new/lib_flags.am
32 --- netcdf-4.3.0-orig/lib_flags.am 2013-05-09 12:15:24 -0400
33 +++ netcdf-4.3.0-new/lib_flags.am 2013-07-20 13:38:47 -0400
34 @@ -15,7 +15,7 @@
35
36 # This turns on declspec magic in netcdf.h for windows DLLs.
37 if BUILD_DLL
38 -AM_CPPFLAGS += -DDLL_NETCDF
39 +AM_CPPFLAGS += -DDLL_NETCDF -D_HDF5USEDLL_
40 endif
41
42
43 diff -ur netcdf-4.3.0-orig/libdap2/dcelex.c netcdf-4.3.0-new/libdap2/dcelex.c
44 --- netcdf-4.3.0-orig/libdap2/dcelex.c 2013-05-09 12:15:24 -0400
45 +++ netcdf-4.3.0-new/libdap2/dcelex.c 2013-07-20 14:25:14 -0400
46 @@ -14,6 +14,10 @@
47 #include "dceconstraints.h"
48 #include "dceparselex.h"
49
50 +#ifdef _MSC_VER
51 +#define strtoll _strtoi64
52 +#endif
53 +
54 /* Forward */
55 static void dumptoken(DCElexstate* lexstate);
56 static int tohex(int c);
57 diff -ur netcdf-4.3.0-orig/libdap2/dceparse.c netcdf-4.3.0-new/libdap2/dceparse.c
58 --- netcdf-4.3.0-orig/libdap2/dceparse.c 2013-05-09 12:15:24 -0400
59 +++ netcdf-4.3.0-new/libdap2/dceparse.c 2013-07-20 14:25:35 -0400
60 @@ -20,6 +20,10 @@
61 #include "dceconstraints.h"
62 #include "dceparselex.h"
63
64 +#ifdef _MSC_VER
65 +#define strtoll _strtoi64
66 +#endif
67 +
68 static Object collectlist(Object list0, Object decl);
69
70 void
71 diff -ur netcdf-4.3.0-orig/ncdump/Makefile.am netcdf-4.3.0-new/ncdump/Makefile.am
72 --- netcdf-4.3.0-orig/ncdump/Makefile.am 2013-05-09 12:15:21 -0400
73 +++ netcdf-4.3.0-new/ncdump/Makefile.am 2013-07-20 15:04:56 -0400
74 @@ -6,7 +6,7 @@
75
76 # Put together AM_CPPFLAGS and AM_LDFLAGS.
77 include $(top_srcdir)/lib_flags.am
78 -LDADD = ${top_builddir}/liblib/libnetcdf.la
79 +LDADD = ${top_builddir}/liblib/libnetcdf.la -lgetopt
80
81 TESTS_ENVIRONMENT=CC=${CC}
82
83 diff -ur netcdf-4.3.0-orig/ncdump/nccopy.c netcdf-4.3.0-new/ncdump/nccopy.c
84 --- netcdf-4.3.0-orig/ncdump/nccopy.c 2013-05-09 12:15:21 -0400
85 +++ netcdf-4.3.0-new/ncdump/nccopy.c 2013-07-20 15:06:36 -0400
86 @@ -23,11 +23,13 @@
87 #include "nccomps.h"
88
89 #ifdef _MSC_VER
90 +#ifndef HAVE_GETOPT_H
91 #include "XGetopt.h"
92 -#define snprintf _snprintf
93 int opterr;
94 int optind;
95 #endif
96 +#define snprintf _snprintf
97 +#endif
98
99 /* default bytes of memory we are willing to allocate for variable
100 * values during copy */
101 diff -ur netcdf-4.3.0-orig/ncdump/ncdump.c netcdf-4.3.0-new/ncdump/ncdump.c
102 --- netcdf-4.3.0-orig/ncdump/ncdump.c 2013-05-09 12:15:21 -0400
103 +++ netcdf-4.3.0-new/ncdump/ncdump.c 2013-07-20 15:04:28 -0400
104 @@ -13,11 +13,13 @@
105 #endif
106
107 #ifdef _MSC_VER
108 -#define snprintf _snprintf
109 +#ifndef HAVE_GETOPT_H
110 #include "XGetopt.h"
111 int opterr;
112 int optind;
113 #endif
114 +#define snprintf _snprintf
115 +#endif
116
117 #include <stdlib.h>
118 #include <string.h>
119 diff -ur netcdf-4.3.0-orig/ncgen/Makefile.am netcdf-4.3.0-new/ncgen/Makefile.am
120 --- netcdf-4.3.0-orig/ncgen/Makefile.am 2013-05-09 12:15:07 -0400
121 +++ netcdf-4.3.0-new/ncgen/Makefile.am 2013-07-20 15:01:43 -0400
122 @@ -4,7 +4,7 @@
123
124 # Put together AM_CPPFLAGS and AM_LDFLAGS.
125 include $(top_srcdir)/lib_flags.am
126 -LDADD = ${top_builddir}/liblib/libnetcdf.la
127 +LDADD = ${top_builddir}/liblib/libnetcdf.la -lgetopt
128
129 # Build ncgen from the listed sources.
130 bin_PROGRAMS = ncgen
131 diff -ur netcdf-4.3.0-orig/ncgen/main.c netcdf-4.3.0-new/ncgen/main.c
132 --- netcdf-4.3.0-orig/ncgen/main.c 2013-05-09 12:15:07 -0400
133 +++ netcdf-4.3.0-new/ncgen/main.c 2013-07-20 15:02:12 -0400
134 @@ -12,11 +12,13 @@
135 #endif
136
137 #ifdef _MSC_VER
138 +#ifndef HAVE_GETOPT_H
139 #include "XGetopt.h"
140 -#define snprintf _snprintf
141 int opterr;
142 int optind;
143 #endif
144 +#define snprintf _snprintf
145 +#endif
146
147 /* Default is netcdf-3 mode 1 */
148 #define DFALTCMODE 0
149 diff -ur netcdf-4.3.0-orig/ncgen3/Makefile.am netcdf-4.3.0-new/ncgen3/Makefile.am
150 --- netcdf-4.3.0-orig/ncgen3/Makefile.am 2013-05-09 12:15:15 -0400
151 +++ netcdf-4.3.0-new/ncgen3/Makefile.am 2013-07-20 15:00:09 -0400
152 @@ -6,7 +6,7 @@
153 include $(top_srcdir)/lib_flags.am
154
155 # Link to the netCDF library.
156 -ncgen3_LDADD = ${top_builddir}/liblib/libnetcdf.la
157 +ncgen3_LDADD = ${top_builddir}/liblib/libnetcdf.la -lgetopt
158
159 # Build ncgen from the listed sources.
160 bin_PROGRAMS = ncgen3
161 diff -ur netcdf-4.3.0-orig/ncgen3/main.c netcdf-4.3.0-new/ncgen3/main.c
162 --- netcdf-4.3.0-orig/ncgen3/main.c 2013-05-09 12:15:15 -0400
163 +++ netcdf-4.3.0-new/ncgen3/main.c 2013-07-20 14:59:25 -0400
164 @@ -15,11 +15,13 @@
165 #endif
166
167 #ifdef _MSC_VER
168 +#ifndef HAVE_GETOPT_H
169 #include "XGetopt.h"
170 -#define snprintf _snprintf
171 int opterr;
172 int optind;
173 #endif
174 +#define snprintf _snprintf
175 +#endif
176
177 #ifdef __hpux
178 #include <locale.h>