comparison main/octcdf/src/configure.base @ 12632:4ba4dcdb5d82 octave-forge

fix bug #44837
author abarth93
date Wed, 10 Jun 2015 14:50:13 +0000
parents 6133c9191f29
children
comparison
equal deleted inserted replaced
12631:5818fde6abd8 12632:4ba4dcdb5d82
47 dnl but defines --oct-site-dir and --m-site-dir 47 dnl but defines --oct-site-dir and --m-site-dir
48 48
49 dnl Check for mkoctfile 49 dnl Check for mkoctfile
50 AC_CHECK_PROG(MKOCTFILE,mkoctfile,mkoctfile) 50 AC_CHECK_PROG(MKOCTFILE,mkoctfile,mkoctfile)
51 test -z "$MKOCTFILE" && AC_MSG_WARN([no mkoctfile found on path]) 51 test -z "$MKOCTFILE" && AC_MSG_WARN([no mkoctfile found on path])
52
53 AC_CHECK_PROG(OCTAVE_CONFIG,octave-config,octave-config)
54 test -z "$OCTAVE_CONFIG" && AC_MSG_WARN([no octave-config found on path])
55
56
52 57
53 AC_SUBST(ver) 58 AC_SUBST(ver)
54 AC_SUBST(subver) 59 AC_SUBST(subver)
55 AC_SUBST(mpath) 60 AC_SUBST(mpath)
56 AC_SUBST(opath) 61 AC_SUBST(opath)
250 $2=`echo "disp($1)" | $OCTAVE -qf` 255 $2=`echo "disp($1)" | $OCTAVE -qf`
251 AC_MSG_RESULT($$2) 256 AC_MSG_RESULT($$2)
252 AC_SUBST($2) 257 AC_SUBST($2)
253 ]) 258 ])
254 259
260 AC_DEFUN(OCTAVE_CONFIG_EVAL,
261 [AC_MSG_CHECKING([for $1 in octave-config])
262 $2=`$OCTAVE_CONFIG -p $1`
263 AC_MSG_RESULT($$2)
264 AC_SUBST($2)
265 ])
266
255 dnl Check status of an octave variable 267 dnl Check status of an octave variable
256 dnl 268 dnl
257 dnl OCTAVE_CHECK_EXIST(variable,action_if_true,action_if_false) 269 dnl OCTAVE_CHECK_EXIST(variable,action_if_true,action_if_false)
258 dnl 270 dnl
259 AC_DEFUN(OCTAVE_CHECK_EXIST, 271 AC_DEFUN(OCTAVE_CHECK_EXIST,
267 fi 279 fi
268 ]) 280 ])
269 281
270 dnl should check that $(OCTAVE) --version matches $(MKOCTFILE) --version 282 dnl should check that $(OCTAVE) --version matches $(MKOCTFILE) --version
271 AC_CHECK_PROG(OCTAVE,octave,octave) 283 AC_CHECK_PROG(OCTAVE,octave,octave)
272 OCTAVE_EVAL(OCTAVE_VERSION,OCTAVE_VERSION) 284 OCTAVE_CONFIG_EVAL(VERSION,OCTAVE_VERSION)
273 285
274 dnl grab canonical host type so we can write system specific install stuff 286 dnl grab canonical host type so we can write system specific install stuff
275 OCTAVE_EVAL(octave_config_info('canonical_host_type'),canonical_host_type) 287 OCTAVE_CONFIG_EVAL(CANONICAL_HOST_TYPE,canonical_host_type)
276 288
277 dnl grab SHLEXT from octave config 289 dnl grab SHLEXT from octave config
278 OCTAVE_EVAL(octave_config_info('SHLEXT'),SHLEXT) 290 OCTAVE_CONFIG_EVAL(SHLEXT,SHLEXT)
279 291
280 AC_PROG_LN_S 292 AC_PROG_LN_S
281 293
282 AC_PROG_RANLIB 294 AC_PROG_RANLIB
283 295
306 *-cygwin-*|*-mingw-*) 318 *-cygwin-*|*-mingw-*)
307 MKOCTFILE="$MKOCTFILE -s" 319 MKOCTFILE="$MKOCTFILE -s"
308 ;; 320 ;;
309 esac 321 esac
310 322
311 dnl first checking for nc-config, then nc-dap 323 dnl checking for nc-config
312 324 AC_CHECK_TOOL(NC_CONFIG, nc-config, nc-config)
313 AC_MSG_CHECKING([for nc-config]) 325 if test -z "$NC_CONFIG"; then
314 326 AC_MSG_ERROR([nc-config not found], 1);
315 if nc-config --version > /dev/null 2>&1; then 327 fi
316 AC_MSG_RESULT([yes]) 328
317 OCTCDF_LIBS="$OCTCDF_LIBS `nc-config --libs`" 329 OCTCDF_LIBS="$OCTCDF_LIBS `$NC_CONFIG --libs`"
318 OCTCDF_CFLAGS="$OCTCDF_CFLAGS `nc-config --cflags`" 330 OCTCDF_CFLAGS="$OCTCDF_CFLAGS `$NC_CONFIG --cflags`"
319 HAVE_NETCDF=yes 331
320 else
321 AC_MSG_RESULT([no])
322 AC_MSG_CHECKING([for nc-dap])
323
324 if ncdap-config --version > /dev/null 2>&1; then
325 AC_MSG_RESULT([yes])
326 OCTCDF_LIBS="$OCTCDF_LIBS `ncdap-config --libs`"
327 OCTCDF_CFLAGS="$OCTCDF_CFLAGS `ncdap-config --cflags`"
328
329 HAVE_NETCDF=yes
330 else
331 AC_MSG_RESULT([no])
332
333 dnl if no opendap, checking if the NetCDF library exists.
334 dnl AC_CHECK_LIB takes the value of LDFLAGS into account
335
336 AC_CHECK_LIB(netcdf,nc_open, HAVE_NETCDF=yes, HAVE_NETCDF=no,)
337
338 if test $HAVE_NETCDF = yes ; then
339 OCTCDF_LIBS="$OCTCDF_LIBS -lnetcdf"
340
341 dnl we have the libraries, no we have also the headers?
342 dnl AC_CHECK_HEADER takes the value of CPPFLAGS into account
343
344 AC_CHECK_HEADER(netcdf.h, HAVE_NETCDF=yes, HAVE_NETCDF=no)
345 fi
346 fi
347 fi
348
349 AC_SUBST(HAVE_NETCDF)
350 AC_SUBST(OCTCDF_LIBS) 332 AC_SUBST(OCTCDF_LIBS)
351 AC_SUBST(OCTCDF_CFLAGS) 333 AC_SUBST(OCTCDF_CFLAGS)
352 334
353 if test $HAVE_NETCDF = yes ; then
354 OCTCDFSTATUS=yes
355 else
356 OCTCDFSTATUS=no
357 fi
358 335
359 CONFIGURE_OUTPUTS="Makeconf" 336 CONFIGURE_OUTPUTS="Makeconf"
360 STATUS_MSG=" 337 STATUS_MSG="
361 octave commands will install into the following directories: 338 octave commands will install into the following directories:
362 m-files: $mpath 339 m-files: $mpath
371 man pages: $mandir 348 man pages: $mandir
372 libraries: $libdir 349 libraries: $libdir
373 headers: $includedir 350 headers: $includedir
374 351
375 octave-forge is configured with 352 octave-forge is configured with
376 octave: $OCTAVE (version $OCTAVE_VERSION) 353 octave: $OCTAVE (version $OCTAVE_VERSION)
377 mkoctfile: $MKOCTFILE for Octave $subver 354 mkoctfile: $MKOCTFILE for Octave $subver
378 octcdf toolbox: $OCTCDFSTATUS 355 octave-config: $OCTAVE_CONFIG for Octave $subver
379 netCDF compiler flags: $OCTCDF_CFLAGS 356 netCDF compiler flags: $OCTCDF_CFLAGS
380 netCDF libraries: $OCTCDF_LIBS" 357 netCDF libraries: $OCTCDF_LIBS"