GRIB-435: NETCDF should only be a dependency for grib_to_netcdf

This commit is contained in:
Shahram Najm 2013-09-24 11:13:50 +01:00
parent ab5b69a0b7
commit a3fe5297d3
2 changed files with 7 additions and 2 deletions

View File

@ -351,8 +351,11 @@ if test $netcdf_dir != 'none'
then
with_netcdf=1
CFLAGS="$CFLAGS -I${netcdf_dir}/include"
LDFLAGS="$LDFLAGS -L${netcdf_dir}/lib"
NETCDF_LDFLAGS="-L${netcdf_dir}/lib -lnetcdf"
ORIG_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $NETCDF_LDFLAGS"
AC_CHECK_LIB(netcdf,nc_open,netcdf_ok=1,netcdf_ok=0)
LDFLAGS=$ORIG_LDFLAGS
if test $netcdf_ok -eq 0
then
AC_MSG_NOTICE([
@ -365,7 +368,7 @@ then
test 0 -eq 1
exit
fi
LIBS="-lnetcdf $LIBS"
AC_SUBST(NETCDF_LDFLAGS)
AC_DEFINE(HAVE_NETCDF,1,NETCDF enabled)
fi

View File

@ -69,6 +69,8 @@ INCLUDES = -I$(top_builddir)/src
LDADD = libgrib_tools.la $(top_builddir)/src/libgrib_api.la
DEPENDENCIES = $(LDADD)
grib_to_netcdf_LDADD = $(LDADD) $(NETCDF_LDFLAGS)
## Make sure these will be cleaned even when they're not built by
## default.
CLEANFILES = libgrib_tools.la