Mercurial > mxe-octave
annotate src/of-netcdf-1-cross-fixes.patch @ 3901:5f92c505c86a
of-netcdf: update patch for native compile
* src/of-netcdf-1-cross-fixes.patch: update
author | John Donoghue <john.donoghue@ieee.org> |
---|---|
date | Mon, 13 Apr 2015 21:36:27 -0400 |
parents | abf9c5216a21 |
children |
rev | line source |
---|---|
3898 | 1 diff -ur netcdf.orig/src/configure netcdf/src/configure |
3901
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
2 --- netcdf.orig/src/configure 2015-04-13 21:29:33.000000000 -0400 |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
3 +++ netcdf/src/configure 2015-04-13 21:31:02.000000000 -0400 |
3898 | 4 @@ -601,6 +601,7 @@ |
5 mpath | |
6 subver | |
7 ver | |
8 +OCTAVE_CONFIG | |
9 MKOCTFILE | |
10 OBJEXT | |
11 EXEEXT | |
12 @@ -2610,6 +2611,46 @@ | |
13 test -z "$MKOCTFILE" && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no mkoctfile found on path" >&5 | |
14 $as_echo "$as_me: WARNING: no mkoctfile found on path" >&2;} | |
15 | |
16 +# Extract the first word of "octave-config", so it can be a program name with args. | |
17 +set dummy octave-config; ac_word=$2 | |
18 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
19 +$as_echo_n "checking for $ac_word... " >&6; } | |
20 +if ${ac_cv_prog_OCTAVE_CONFIG+:} false; then : | |
21 + $as_echo_n "(cached) " >&6 | |
22 +else | |
23 + if test -n "$OCTAVE_CONFIG"; then | |
24 + ac_cv_prog_OCTAVE_CONFIG="$OCTAVE_CONFIG" # Let the user override the test. | |
25 +else | |
26 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
27 +for as_dir in $PATH | |
28 +do | |
29 + IFS=$as_save_IFS | |
30 + test -z "$as_dir" && as_dir=. | |
31 + for ac_exec_ext in '' $ac_executable_extensions; do | |
32 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
33 + ac_cv_prog_OCTAVE_CONFIG="octave-config" | |
34 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
35 + break 2 | |
36 + fi | |
37 +done | |
38 + done | |
39 +IFS=$as_save_IFS | |
40 + | |
41 +fi | |
42 +fi | |
43 +OCTAVE_CONFIG=$ac_cv_prog_OCTAVE_CONFIG | |
44 +if test -n "$OCTAVE_CONFIG"; then | |
45 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCTAVE_CONFIG" >&5 | |
46 +$as_echo "$OCTAVE_CONFIG" >&6; } | |
47 +else | |
48 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
49 +$as_echo "no" >&6; } | |
50 +fi | |
51 + | |
52 + | |
53 +test -z "$OCTAVE_CONFIG" && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no octave-config found on path" >&5 | |
54 +$as_echo "$as_me: WARNING: no octave-config found on path" >&2;} | |
55 + | |
56 | |
57 | |
58 | |
59 @@ -2796,6 +2837,8 @@ | |
60 | |
61 | |
62 | |
63 + | |
64 + | |
65 # Extract the first word of "octave", so it can be a program name with args. | |
66 set dummy octave; ac_word=$2 | |
67 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
68 @@ -2833,25 +2876,25 @@ | |
69 fi | |
70 | |
71 | |
72 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OCTAVE_VERSION in Octave" >&5 | |
73 -$as_echo_n "checking for OCTAVE_VERSION in Octave... " >&6; } | |
74 -OCTAVE_VERSION=`echo "disp(OCTAVE_VERSION)" | $OCTAVE -qf` | |
75 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for VERSION in octave-config" >&5 | |
76 +$as_echo_n "checking for VERSION in octave-config... " >&6; } | |
77 +OCTAVE_VERSION=`$OCTAVE_CONFIG -p VERSION` | |
78 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OCTAVE_VERSION" >&5 | |
79 $as_echo "$OCTAVE_VERSION" >&6; } | |
80 | |
81 | |
82 | |
83 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for octave_config_info('canonical_host_type') in Octave" >&5 | |
84 -$as_echo_n "checking for octave_config_info('canonical_host_type') in Octave... " >&6; } | |
85 -canonical_host_type=`echo "disp(octave_config_info('canonical_host_type'))" | $OCTAVE -qf` | |
86 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CANONICAL_HOST_TYPE in octave-config" >&5 | |
87 +$as_echo_n "checking for CANONICAL_HOST_TYPE in octave-config... " >&6; } | |
88 +canonical_host_type=`$OCTAVE_CONFIG -p CANONICAL_HOST_TYPE` | |
89 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $canonical_host_type" >&5 | |
90 $as_echo "$canonical_host_type" >&6; } | |
91 | |
92 | |
93 | |
94 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for octave_config_info('SHLEXT') in Octave" >&5 | |
95 -$as_echo_n "checking for octave_config_info('SHLEXT') in Octave... " >&6; } | |
96 -SHLEXT=`echo "disp(octave_config_info('SHLEXT'))" | $OCTAVE -qf` | |
97 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHLEXT in octave-config" >&5 | |
98 +$as_echo_n "checking for SHLEXT in octave-config... " >&6; } | |
99 +SHLEXT=`$OCTAVE_CONFIG -p SHLEXT` | |
100 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SHLEXT" >&5 | |
101 $as_echo "$SHLEXT" >&6; } | |
102 | |
3901
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
103 @@ -3020,8 +3063,9 @@ |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
104 esac |
3898 | 105 |
106 | |
3901
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
107 -# Extract the first word of "nc-config", so it can be a program name with args. |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
108 -set dummy nc-config; ac_word=$2 |
3898 | 109 +if test -n "$ac_tool_prefix"; then |
110 + # Extract the first word of "${ac_tool_prefix}nc-config", so it can be a program name with args. | |
111 +set dummy ${ac_tool_prefix}nc-config; ac_word=$2 | |
3901
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
112 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
113 $as_echo_n "checking for $ac_word... " >&6; } |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
114 if ${ac_cv_prog_NC_CONFIG+:} false; then : |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
115 @@ -3037,7 +3081,7 @@ |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
116 test -z "$as_dir" && as_dir=. |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
117 for ac_exec_ext in '' $ac_executable_extensions; do |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
118 if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
119 - ac_cv_prog_NC_CONFIG="nc-config" |
3898 | 120 + ac_cv_prog_NC_CONFIG="${ac_tool_prefix}nc-config" |
3901
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
121 $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
122 break 2 |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
123 fi |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
124 @@ -3057,12 +3101,66 @@ |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
125 fi |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
126 |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
127 |
3898 | 128 +fi |
129 +if test -z "$ac_cv_prog_NC_CONFIG"; then | |
130 + ac_ct_NC_CONFIG=$NC_CONFIG | |
131 + # Extract the first word of "nc-config", so it can be a program name with args. | |
132 +set dummy nc-config; ac_word=$2 | |
133 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | |
134 +$as_echo_n "checking for $ac_word... " >&6; } | |
135 +if ${ac_cv_prog_ac_ct_NC_CONFIG+:} false; then : | |
136 + $as_echo_n "(cached) " >&6 | |
137 +else | |
138 + if test -n "$ac_ct_NC_CONFIG"; then | |
139 + ac_cv_prog_ac_ct_NC_CONFIG="$ac_ct_NC_CONFIG" # Let the user override the test. | |
140 +else | |
141 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | |
142 +for as_dir in $PATH | |
143 +do | |
144 + IFS=$as_save_IFS | |
145 + test -z "$as_dir" && as_dir=. | |
146 + for ac_exec_ext in '' $ac_executable_extensions; do | |
147 + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | |
148 + ac_cv_prog_ac_ct_NC_CONFIG="nc-config" | |
149 + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 | |
150 + break 2 | |
151 + fi | |
152 +done | |
153 + done | |
154 +IFS=$as_save_IFS | |
155 + | |
156 +fi | |
157 +fi | |
158 +ac_ct_NC_CONFIG=$ac_cv_prog_ac_ct_NC_CONFIG | |
159 +if test -n "$ac_ct_NC_CONFIG"; then | |
160 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NC_CONFIG" >&5 | |
161 +$as_echo "$ac_ct_NC_CONFIG" >&6; } | |
162 +else | |
163 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | |
164 +$as_echo "no" >&6; } | |
165 +fi | |
166 + | |
167 + if test "x$ac_ct_NC_CONFIG" = x; then | |
168 + NC_CONFIG="nc-config" | |
169 + else | |
170 + case $cross_compiling:$ac_tool_warned in | |
171 +yes:) | |
172 +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 | |
173 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} | |
174 +ac_tool_warned=yes ;; | |
175 +esac | |
176 + NC_CONFIG=$ac_ct_NC_CONFIG | |
177 + fi | |
178 +else | |
179 + NC_CONFIG="$ac_cv_prog_NC_CONFIG" | |
180 +fi | |
181 + | |
3901
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
182 if test -z "$NC_CONFIG"; then |
3898 | 183 as_fn_error 1 "nc-config not found" "$LINENO" 5; |
184 fi | |
185 | |
186 -NETCDF_LIBS="$NETCDF_LIBS `nc-config --libs`" | |
187 -NETCDF_CFLAGS="$NETCDF_CFLAGS `nc-config --cflags`" | |
188 +NETCDF_LIBS="$NETCDF_LIBS `$NC_CONFIG --libs`" | |
189 +NETCDF_CFLAGS="$NETCDF_CFLAGS `$NC_CONFIG --cflags`" | |
190 | |
191 | |
192 CONFIGURE_OUTPUTS="Makeconf" | |
3901
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
193 @@ -3082,8 +3180,9 @@ |
3898 | 194 headers: $includedir |
195 | |
196 octave-forge is configured with | |
197 - octave: $OCTAVE (version $OCTAVE_VERSION) | |
198 - mkoctfile: $MKOCTFILE for Octave $subver | |
199 + octave: $OCTAVE (version $OCTAVE_VERSION) | |
200 + mkoctfile: $MKOCTFILE for Octave $subver | |
201 + octave-config: $OCTAVE_CONFIG for Octave $subver | |
202 netCDF compiler flags: $NETCDF_CFLAGS | |
203 netCDF libraries: $NETCDF_LIBS" | |
204 ac_config_files="$ac_config_files $CONFIGURE_OUTPUTS" | |
205 diff -ur netcdf.orig/src/configure.base netcdf/src/configure.base | |
3901
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
206 --- netcdf.orig/src/configure.base 2015-04-13 21:29:33.000000000 -0400 |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
207 +++ netcdf/src/configure.base 2015-04-13 21:30:41.000000000 -0400 |
3898 | 208 @@ -50,6 +50,9 @@ |
209 AC_CHECK_PROG(MKOCTFILE,mkoctfile,mkoctfile) | |
210 test -z "$MKOCTFILE" && AC_MSG_WARN([no mkoctfile found on path]) | |
211 | |
212 +AC_CHECK_PROG(OCTAVE_CONFIG,octave-config,octave-config) | |
213 +test -z "$OCTAVE_CONFIG" && AC_MSG_WARN([no octave-config found on path]) | |
214 + | |
215 AC_SUBST(ver) | |
216 AC_SUBST(subver) | |
217 AC_SUBST(mpath) | |
218 @@ -252,6 +255,13 @@ | |
219 AC_SUBST($2) | |
220 ]) | |
221 | |
222 +AC_DEFUN(OCTAVE_CONFIG_EVAL, | |
223 +[AC_MSG_CHECKING([for $1 in octave-config]) | |
224 +$2=`$OCTAVE_CONFIG -p $1` | |
225 +AC_MSG_RESULT($$2) | |
226 +AC_SUBST($2) | |
227 +]) | |
228 + | |
229 dnl Check status of an octave variable | |
230 dnl | |
231 dnl OCTAVE_CHECK_EXIST(variable,action_if_true,action_if_false) | |
232 @@ -269,13 +279,13 @@ | |
233 | |
234 dnl should check that $(OCTAVE) --version matches $(MKOCTFILE) --version | |
235 AC_CHECK_PROG(OCTAVE,octave,octave) | |
236 -OCTAVE_EVAL(OCTAVE_VERSION,OCTAVE_VERSION) | |
237 +OCTAVE_CONFIG_EVAL(VERSION,OCTAVE_VERSION) | |
238 | |
239 dnl grab canonical host type so we can write system specific install stuff | |
240 -OCTAVE_EVAL(octave_config_info('canonical_host_type'),canonical_host_type) | |
241 +OCTAVE_CONFIG_EVAL(CANONICAL_HOST_TYPE,canonical_host_type) | |
242 | |
243 dnl grab SHLEXT from octave config | |
244 -OCTAVE_EVAL(octave_config_info('SHLEXT'),SHLEXT) | |
245 +OCTAVE_CONFIG_EVAL(SHLEXT,SHLEXT) | |
246 | |
247 AC_PROG_LN_S | |
248 | |
3901
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
249 @@ -310,13 +320,14 @@ |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
250 |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
251 dnl checking for nc-config |
3898 | 252 |
3901
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
253 -AC_CHECK_PROG(NC_CONFIG, nc-config, nc-config) |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
254 +dnl AC_CHECK_PROG(NC_CONFIG, nc-config, nc-config) |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
255 +AC_CHECK_TOOL(NC_CONFIG, nc-config, nc-config) |
3898 | 256 if test -z "$NC_CONFIG"; then |
257 AC_MSG_ERROR([nc-config not found], 1); | |
258 fi | |
259 | |
260 -NETCDF_LIBS="$NETCDF_LIBS `nc-config --libs`" | |
261 -NETCDF_CFLAGS="$NETCDF_CFLAGS `nc-config --cflags`" | |
262 +NETCDF_LIBS="$NETCDF_LIBS `$NC_CONFIG --libs`" | |
263 +NETCDF_CFLAGS="$NETCDF_CFLAGS `$NC_CONFIG --cflags`" | |
264 | |
265 | |
266 CONFIGURE_OUTPUTS="Makeconf" | |
3901
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
267 @@ -336,7 +347,8 @@ |
3898 | 268 headers: $includedir |
269 | |
270 octave-forge is configured with | |
271 - octave: $OCTAVE (version $OCTAVE_VERSION) | |
272 - mkoctfile: $MKOCTFILE for Octave $subver | |
273 + octave: $OCTAVE (version $OCTAVE_VERSION) | |
274 + mkoctfile: $MKOCTFILE for Octave $subver | |
275 + octave-config: $OCTAVE_CONFIG for Octave $subver | |
276 netCDF compiler flags: $NETCDF_CFLAGS | |
277 netCDF libraries: $NETCDF_LIBS" | |
278 diff -ur netcdf.orig/src/Makeconf.in netcdf/src/Makeconf.in | |
3901
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
279 --- netcdf.orig/src/Makeconf.in 2015-04-13 21:29:33.000000000 -0400 |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
280 +++ netcdf/src/Makeconf.in 2015-04-13 21:29:55.000000000 -0400 |
3898 | 281 @@ -53,6 +53,8 @@ |
282 OCTAVE_VERSION = @OCTAVE_VERSION@ | |
283 MKOCTFILE = @MKOCTFILE@ -DHAVE_OCTAVE_$(ver) -v | |
284 SHLEXT = @SHLEXT@ | |
285 +NC_CONFIG = @NC_CONFIG@ | |
286 +OCTAVE_CONFIG = @OCTAVE_CONFIG@ | |
287 | |
288 %.o: %.c ; $(MKOCTFILE) -c $< | |
289 %.o: %.f ; $(MKOCTFILE) -c $< | |
290 diff -ur netcdf.orig/src/Makefile netcdf/src/Makefile | |
3901
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
291 --- netcdf.orig/src/Makefile 2015-04-13 21:29:33.000000000 -0400 |
5f92c505c86a
of-netcdf: update patch for native compile
John Donoghue <john.donoghue@ieee.org>
parents:
3898
diff
changeset
|
292 +++ netcdf/src/Makefile 2015-04-13 21:29:55.000000000 -0400 |
3898 | 293 @@ -1,10 +1,13 @@ |
294 -LIBS=$(shell nc-config --libs) | |
295 -AWK=awk | |
296 -MKOCTFILE=mkoctfile | |
297 -OCTAVE=octave | |
298 -NCHEADER=$(shell nc-config --includedir)/netcdf.h | |
299 +sinclude Makeconf | |
300 + | |
301 +AWK ?= awk | |
302 +MKOCTFILE ?= mkoctfile | |
303 +OCTAVE ?= octave | |
304 +NC_CONFIG ?= nc-config | |
305 +NCHEADER=$(shell $(NC_CONFIG) --includedir)/netcdf.h | |
306 SRC=__netcdf__.cc | |
307 -CFLAGS=$(shell nc-config --cflags) | |
308 +CFLAGS=$(shell $(NC_CONFIG) --cflags) | |
309 +LIBS=$(shell $(NC_CONFIG) --libs) | |
310 | |
311 all: __netcdf__.oct | |
312 |