suggestion for the autoconf configuration

Patrice Dumas pertusus at FREE.FR
Thu Sep 15 03:46:00 EDT 2005


On Wed, Sep 14, 2005 at 02:58:06PM -0600, Richard A. Ryan wrote:
> Hello,
>
>    libwww-config --libs
>
> instead.  Similarly, you're going to want to get the
> include files for libwww from
>
>    libwww-config --cflags

This is only needed if you want to build with opendap support? Regarding
opendap support and detection in configure.in, I send patches and .m4
files to the list you should want to have a look at. I would be pleased
if somebody could enhance those files to cope with older releases of
opendap/DODS, especially the pre opendap-3.4 releases that required libwww
and librx. I canot do that myself as I only have new versions and therefore
cannot test.

> I am thinking of trying to simplify the grads build
> configuration myself.  If I can set up another configure for
> the grads client, is anyone out there interested in getting
> the new configuration files, and in particular, maintaining
> it?  To be honest, I'm not sure I'm going to be able to do
> this.

I made an autoconf macro for the detection of netcdf. I attach it to
that mail. At the beginning there is an example of use in comments. It
could be enhanced with use of ac_cache...

Overall I agree that the configure.in of grads could be improved a lot,
by doing more elaborate macros for the detection of features with the
ability to detect more than one configuration, instead of rewriting the
tests in each GA_ macros. This is especially true for udunits, libz and
netcdf. For example I posted a patch for libsx detection but it is
a bit convoluted due to this lack of separation.

I could also contribute to that, but I can't really understand how the
development of grads proceeds. I don't see where development is discussed,
where the development sources are, how to submit changes nor who approve
them and how and I couldn't find such information on the web (maybe I
didn't searched at the right place?). So far all my mails regarding
development seem to have been ignored (at least on the mailing list).

--
Pat
-------------- next part --------------
dnl example of use
dnl AC_CHECK_NETCDF(
dnl   [
dnl       LIBS="$LIBS $NC_LIBS"
dnl       LDFLAGS="$LDFLAGS $NC_LDFLAGS"
dnl       CPPFLAGS="$CPPFLAGS $NC_CPPFLAGS"
dnl   ],
dnl   [
dnl       echo "*** Use --with-netcdf for the root netcdf directory."
dnl       echo "*** Otherwise use --with-netcdf-include switch for includes directory"
dnl       echo "*** and --with-netcdf-libdir switch for libraries directory."
dnl       AC_MSG_ERROR([netcdf library and netcdf headers are required.])
dnl   ]
dnl )

dnl Check for the netcdf library.
AC_DEFUN([AC_CHECK_NETCDF],
[
AC_ARG_WITH([netcdf],
            [AS_HELP_STRING([--with-netcdf=ARG],[netcdf directory])],
            [NC_PATH=${withval}],
            [NC_PATH="/usr/local/netcdf"])

AC_ARG_WITH([netcdf_inc],
            [AS_HELP_STRING([--with-netcdf-include=ARG],[netcdf include directory])],
            [NC_PATH_INC=${withval}],
            [NC_PATH_INC=""])

AC_ARG_WITH([netcdf_libdir],
            [AS_HELP_STRING([--with-netcdf-libdir=ARG],[netcdf library directory])],
            [NC_PATH_LIBDIR=${withval}],
            [NC_PATH_LIBDIR=""])



AS_IF([test "z$NC_PATH_LIBDIR" = "z"],[NC_PATH_LIBDIR="$NC_PATH/lib"])

AS_IF([test "z$NC_PATH_INC" = "z"],[NC_PATH_INC="$NC_PATH/include"])

ac_netcdf_ok='no'

NC_LIBS=
NC_LDFLAGS=
ac_nc_save_LDFLAGS="$LDFLAGS"
ac_nc_save_LIBS="$LIBS"
LIBS="$LIBS -lnetcdf"
LDFLAGS="$LDFLAGS -L${NC_PATH_LIBDIR}"
AC_CHECK_LIB([netcdf],[nc_open],
   [
     ac_netcdf_ok='yes'
     NC_LIBS="-lnetcdf"
     NC_LDFLAGS="-L${NC_PATH_LIBDIR}"
   ],
   [ac_netcdf_ok='no']
)
LIBS="$ac_nc_save_LIBS"
LDFLAGS="$ac_nc_save_LDFLAGS"

AC_SUBST([NC_LDFLAGS])
AC_SUBST([NC_LIBS])

NC_CPPFLAGS=
ac_netcdf_h='no'
ac_nc_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$NC_PATH_INC"
AC_CHECK_HEADERS([netcdf.h],
  [ac_netcdf_h='yes'],
  [ac_netcdf_h='no']
)
CPPFLAGS=$ac_nc_save_CPPFLAGS

AS_IF([test "$ac_netcdf_h" = 'yes' ],
  [NC_CPPFLAGS="-I$NC_PATH_INC"]
)
AC_SUBST([NC_CPPFLAGS])

AS_IF([test "$ac_netcdf_ok" = 'no' -o "$ac_netcdf_h" = 'no'],
  [m4_if([$2], [], [:], [$2])],
  [m4_if([$1], [], [:], [$1])]
)

])



More information about the gradsusr mailing list