rpms/grads/devel grads.spec,1.12,1.13 libnc-dap.m4,1.1,1.2

Patrice Dumas (pertusus) fedora-extras-commits at redhat.com
Sat Jul 22 15:51:43 UTC 2006


Author: pertusus

Update of /cvs/extras/rpms/grads/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4476

Modified Files:
	grads.spec libnc-dap.m4 
Log Message:
* Sat Jul 22 2006 Patrice Dumas <pertusus at free.fr> 1.9b4-13
- Update for newer libnc-dap



Index: grads.spec
===================================================================
RCS file: /cvs/extras/rpms/grads/devel/grads.spec,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- grads.spec	7 Jul 2006 15:34:05 -0000	1.12
+++ grads.spec	22 Jul 2006 15:51:43 -0000	1.13
@@ -1,6 +1,6 @@
 Name:           grads
 Version:        1.9b4
-Release:        12%{?dist}
+Release:        13%{?dist}
 Summary:        Tool for easy acces, manipulation, and visualization of data
 
 Group:          Applications/Engineering
@@ -10,6 +10,7 @@
 # opendap/DODS detection
 Source3:        libdap.m4
 Source4:        libnc-dap.m4
+Source8:        libnc-dap_header.m4
 # the copyright notice for wgrib
 Source2:        NOTICE.wgrib
 # Copyrights explanation
@@ -58,7 +59,7 @@
 # copy hdf include wrapper file
 cp %{SOURCE7} src
 # concatenate autoconf m4 files
-cat %{SOURCE3} %{SOURCE4} acinclude.m4 > acinclude.m4.new
+cat %{SOURCE3} %{SOURCE4} %{SOURCE8} acinclude.m4 > acinclude.m4.new
 cp acinclude.m4.new acinclude.m4
 # README for use with xorg
 cp %{SOURCE5} README.xorg
@@ -106,6 +107,9 @@
 %doc COPYRIGHT NOTICE.wgrib html README.xorg grads-copyright_summary
 
 %changelog
+* Sat Jul 22 2006 Patrice Dumas <pertusus at free.fr> 1.9b4-13
+- Update for newer libnc-dap
+
 * Fri Jul  7 2006 Patrice Dumas <dumas at centre-cired.fr> 1.9b4-12
 - Added BR automake, fix #197942 
 


Index: libnc-dap.m4
===================================================================
RCS file: /cvs/extras/rpms/grads/devel/libnc-dap.m4,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- libnc-dap.m4	20 Dec 2005 12:16:26 -0000	1.1
+++ libnc-dap.m4	22 Jul 2006 15:51:43 -0000	1.2
@@ -1,19 +1,59 @@
+# -*- mode: autoconf -*-
 # Configure macro for Libnc-dap
-# Patrice Dumas 2005 based on freetype2.m4 from Marcelo Magallon 2001-10-26, 
-# based on gtk.m4 by Owen Taylor
+#
+# Code for version detection and comparison comes from freetype2.m4
+# Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
+#
+# Copyright 2001, 2003 by
+# David Turner, Robert Wilhelm, and Werner Lemberg.
+#
+# This file is part of the FreeType project, and may only be used, modified,
+# and distributed under the terms of the FreeType project license,
+# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
+# indicate that you have read the license and understand and accept it
+# fully.
+#
+# As a special exception to the FreeType project license, this file may be
+# distributed as part of a program that contains a configuration script
+# generated by Autoconf, under the same distribution terms as the rest of
+# that program.
+#
+# Patrice Dumas 2005 Libnc-dap specific code
 
 # AC_CHECK_LIBNC_DAP([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
 # Test for Libnc-dap and define NC_DAP_CFLAGS and NC_DAP_LIBS.
 # Check that the version is above MINIMUM-VERSION 
-
+# Check for the inclusion of a netcdf.h header file with netcdf 3 interface
 AC_DEFUN([AC_CHECK_LIBNC_DAP],
 [
+  ncdap_header_ok='no'
+  ncdap_lib_ok='no'
+  AC_CHECK_LIBNC_DAP_LIB([$1],[ncdap_lib_ok='yes'],
+     [ncdap_lib_ok='no'])
+  ncdap_save_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS $NC_DAP_CFLAGS"
+  AC_CHECK_NETCDF_DAP_HEADER([],[ncdap_header_ok='yes'],
+    [ncdap_header_ok='no'],[3])
+  CPPFLAGS=$ncdap_save_CPPFLAGS
+
+  if test "$ncdap_lib_ok" = 'yes' -a "$ncdap_header_ok" = 'yes' ; then
+    m4_if([$2], [], [:], [$2])
+  else
+    m4_if([$3], [], [:], [$3])
+  fi
+])
+
+# AC_CHECK_LIBNC_DAP_LIB([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+# Test for Libnc-dap and define NC_DAP_CFLAGS and NC_DAP_LIBS.
+# Check that the version is above MINIMUM-VERSION
+AC_DEFUN([AC_CHECK_LIBNC_DAP_LIB],
+[
   AC_PATH_PROG([NC_DAP_CONFIG], [ncdap-config], [no])
   ncdap_min_version=m4_if([$1], [], [3.5.0], [$1])
   AC_MSG_CHECKING([for libnc-dap version >= $ncdap_min_version])
-  ncdap_no=""
+  ncdap_ok='no'
   if test "$NC_DAP_CONFIG" = "no" ; then
-     ncdap_no=yes
+     ncdap_ok='no'
   else
      ncdap_config_major_version=`$NC_DAP_CONFIG --version | sed 's/^libnc-dap \([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$/\1/'`
      ncdap_config_minor_version=`$NC_DAP_CONFIG --version | sed 's/^libnc-dap \([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$/\2/'`
@@ -22,30 +62,30 @@
      ncdap_min_minor_version=`echo $ncdap_min_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
      ncdap_min_micro_version=`echo $ncdap_min_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
 
-     ncdap_config_is_lt=""
+     ncdap_config_is_lt='no'
      if test $ncdap_config_major_version -lt $ncdap_min_major_version ; then
-       ncdap_config_is_lt=yes
+       ncdap_config_is_lt='yes'
      else
        if test $ncdap_config_major_version -eq $ncdap_min_major_version ; then
          if test $ncdap_config_minor_version -lt $ncdap_min_minor_version ; then
-           ncdap_config_is_lt=yes
+           ncdap_config_is_lt='yes'
          else
            if test $ncdap_config_minor_version -eq $ncdap_min_minor_version ; then
              if test $ncdap_config_micro_version -lt $ncdap_min_micro_version ; then
-               ncdap_config_is_lt=yes
+               ncdap_config_is_lt='yes'
              fi
            fi
          fi
        fi
      fi
-     if test x$ncdap_config_is_lt = xyes ; then
-       ncdap_no=yes
+     if test "x$ncdap_config_is_lt" = "xyes" ; then
+       ncdap_ok='no'
      else
        NC_DAP_LIBS="`$NC_DAP_CONFIG --libs`"
        NC_DAP_CFLAGS="`$NC_DAP_CONFIG --cflags`"
      fi
    fi
-   if test x$ncdap_no = x ; then
+   if test "x$ncdap_ok" = 'xyes' ; then
      AC_MSG_RESULT([yes])
      m4_if([$2], [], [:], [$2])
    else
@@ -54,7 +94,7 @@
      AC_MSG_NOTICE([The ncdap-config script could not be found.])
      else
        if test x$ncdap_config_is_lt = xyes ; then
-         AC_MSG_NOTICE([the installed libnc-dap library is too old.])
+         AC_MSG_NOTICE([The installed libnc-dap library is too old.])
        fi
      fi
      NC_DAP_LIBS=""
@@ -75,7 +115,7 @@
 AC_DEFUN([AC_FC_CHECK_LIBNC_DAP],
 [
   libnc_fc_dap_ok="no"
-  AC_CHECK_LIBNC_DAP([$1],[libnc_fc_dap_ok="yes"],[libnc_fc_dap_ok="no"])
+  AC_CHECK_LIBNC_DAP_LIB([$1],[libnc_fc_dap_ok="yes"],[libnc_fc_dap_ok="no"])
   if test $libnc_fc_dap_ok = "yes"; then
      NC_DAP_FLIBS="`$NC_DAP_CONFIG --flibs`"
      NC_DAP_FFLAGS="$NC_DAP_CFLAGS"
@@ -89,51 +129,98 @@
   AC_SUBST([NC_DAP_FLIBS])
 ])
 
-
 # AC_CHECK_NC_DODS([ ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
 # Test for Libnc-dap or older versions. Define NC_DAP_CFLAGS and NC_DAP_LIBS.
-# use AC_CHECK_DODS if the flags cannot be found easily
-
+# check for the netcdf.h file inclusion
 AC_DEFUN([AC_CHECK_NC_DODS],
 [
+  ncdods_header_ok='no'
+  ncdods_lib_ok='no'
+  AC_CHECK_NC_DODS_LIB([ncdods_lib_ok='yes'],
+     [ncdods_lib_ok='no'])
+  ncdods_save_CPPFLAGS=$CPPFLAGS
+  CPPFLAGS="$CPPFLAGS $NC_DAP_CFLAGS"
+  AC_CHECK_NETCDF_DAP_HEADER([],[ncdods_header_ok='yes'],
+    [ncdods_header_ok='no'])
+  CPPFLAGS=$ncdods_save_CPPFLAGS
+
+  if test "$ncdods_lib_ok" = 'yes' -a "$ncdods_header_ok" = 'yes' ; then
+    m4_if([$1], [], [:], [$1])
+  else
+    m4_if([$2], [], [:], [$2])
+  fi
+])
+
+# AC_CHECK_NC_DODS_LIB([ ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+# Test for Libnc-dap or older versions. Define NC_DAP_CFLAGS and NC_DAP_LIBS.
+# use AC_CHECK_DODS first
+AC_DEFUN([AC_CHECK_NC_DODS_LIB],
+[
   ac_ncdods_ok='no'
-  AC_CHECK_LIBNC_DAP([],[ac_ncdods_ok='yes'],[ac_ncdods_ok='no'])
-  if test "z$ac_ncdods_ok" = "zno" ; then
-     AC_PATH_PROG([OPENNC_DAP_CONFIG], [opendap-config], [no])
-     AC_MSG_CHECKING([for libnc-dap with opendap-config])
-     if test "$OPENNC_DAP_CONFIG" = "no" ; then
-       ac_ncdods_ok='no'
-       AC_MSG_RESULT([no])
-     else
-       NC_DAP_LIBS="`$OPENNC_DAP_CONFIG --libs-nc`"
-       NC_DAP_CFLAGS="`$OPENNC_DAP_CONFIG --cflags`"
-       ac_ncdods_ok='yes'
-       AC_MSG_RESULT([yes])
+  ac_ncdods_dap_ok='no'
+  NC_DAP_LIBS=
+  NC_DAP_CFLAGS=
+  dnl it may happen that the cflags are not the ones associated 
+  dnl with -L and -l flags, however even in that case the most recent 
+  dnl netcdf.h should be picked up and things should go smoothly
+  AC_PATH_PROG([OPENNC_DAP_CONFIG], [opendap-config], [no])
+  if test "$OPENNC_DAP_CONFIG" != "no" ; then
+     NC_DAP_CFLAGS="`$OPENNC_DAP_CONFIG --cflags`"
+  fi
+  AC_PATH_PROG([NC_DAP_CONFIG], [ncdap-config], [no])
+  if test "$NC_DAP_CONFIG" != "no" ; then
+     NC_DAP_CFLAGS="`$NC_DAP_CONFIG --cflags`"
+  fi
+  AC_CHECK_DODS([ac_ncdods_dap_ok='yes'],[ac_ncdods_dap_ok='no'])
+  if test "z$ac_ncdods_dap_ok" = 'zyes'; then
+     if test "z$DAP_ROOT" != "z" ; then
+        NC_DAP_CFLAGS=$DAP_ROOT/include
      fi
-  fi 
-  if test "z$ac_ncdods_ok" = "zno" ; then
-     ac_ncdods_dap_ok='no'
-     AC_CHECK_DODS([ac_ncdods_dap_ok='yes'],[ac_ncdods_dap_ok='no'])
-     if test "z$ac_ncdods_dap_ok" = 'zyes'; then
-        NC_DAP_LIBS="$DAP_LIBS -lnc-dods -ldap++"
-        NC_DAP_CFLAGS="$DAP_CFLAGS"
-        AC_LANG_PUSH([C++])
-        dnl We check that linking is succesfull
-        ac_save_LIBS="$LIBS"
-        ac_save_CFLAGS="$CFLAGS"
-        LIBS="$LIBS $NC_DAP_LIBS"
-        CFLAGS="$CFLAGS $NC_DAP_CFLAGS"
-        AC_CHECK_FUNC([nc_open],[ac_ncdods_ok='yes'],[ac_ncdods_ok='no'])
-        LIBS=$ac_save_LIBS
-        CFLAGS=$ac_save_CFLAGS
-        AC_LANG_POP
+     dnl We check that linking is succesfull
+     dnl instead of using a C++ compiler we add -lstdc++
+     dnl AC_LANG_PUSH([C++])
+     NC_DAP_LIBS="-lnc-dap $DAP_LIBS -ldap"
+     ac_save_LIBS=$LIBS
+     LIBS="$LIBS $NC_DAP_LIBS -lstdc++"
+     AC_MSG_CHECKING([for nc_open with -lnc-dap -ldap])
+     AC_LINK_IFELSE([AC_LANG_CALL([],[nc_open])],
+       [ ac_ncdods_ok='yes'
+         AC_MSG_RESULT([yes])
+       ],[ ac_ncdods_ok='no'
+         AC_MSG_RESULT([no])
+       ])
+     LIBS=$ac_save_LIBS
+     if test $ac_ncdods_ok = 'no' ; then
+       NC_DAP_LIBS="-lnc-dods $DAP_LIBS -ldap++"
+       LIBS="$LIBS $NC_DAP_LIBS -lstdc++"
+       AC_MSG_CHECKING([for nc_open with -lnc-dods -ldap++])
+       AC_LINK_IFELSE([AC_LANG_CALL([],[nc_open])],
+         [ ac_ncdods_ok='yes'
+           AC_MSG_RESULT([yes])
+         ],[ ac_ncdods_ok='no'
+           AC_MSG_RESULT([no])
+         ])
+       LIBS=$ac_save_LIBS
      fi
+     dnl AC_LANG_POP
   fi
+  if test $ac_ncdods_ok = no ; then
+    AC_CHECK_LIBNC_DAP_LIB([],[ac_ncdods_ok='yes'],[ac_ncdods_ok='no'])
+    if test "z$ac_ncdods_ok" = "zno" ; then
+      AC_MSG_CHECKING([for libnc-dap with opendap-config])
+      if test "$OPENNC_DAP_CONFIG" = "no" ; then
+        ac_ncdods_ok='no'
+        AC_MSG_RESULT([no])
+      else
+        NC_DAP_LIBS="`$OPENNC_DAP_CONFIG --libs-nc`"
+        ac_ncdods_ok='yes'
+        AC_MSG_RESULT([yes])
+      fi
+    fi
+  fi 
   if test "x$ac_ncdods_ok" = "xyes" ; then
      m4_if([$1], [], [:], [$1])
   else
-     NC_DAP_LIBS=""
-     NC_DAP_CFLAGS=""
      m4_if([$2], [], [:], [$2])
   fi
   AC_SUBST([NC_DAP_CFLAGS])




More information about the fedora-extras-commits mailing list