summaryrefslogtreecommitdiff
path: root/graphics/gri/patches/patch-aa
blob: a23bf27fd88ac2f72ac53abc324e77a049579bf9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
$NetBSD: patch-aa,v 1.4 2012/03/07 16:29:45 adam Exp $

--- configure.ac.orig	2008-03-16 10:18:52.000000000 -0400
+++ configure.ac	2008-09-04 01:45:01.000000000 -0400
@@ -302,28 +302,13 @@ GRI_DETERMINE_ENDIAN
 
 AC_CHECK_HEADERS(unistd.h)
 
-
-dnl Check for netcdf library.  It might be in one of several places,
-dnl so check several locations, reporting the location if found.
-define(CHECK_FOR_NETCDF, [
-  AC_MSG_CHECKING(for netcdf library)
-  for d in /opt/netcdf /usr/local /usr; do
-      if test -f $d/include/netcdf.h; then
-	 AM_CXXFLAGS="$AM_CXXFLAGS -I$d/include"
-	 EXTRA_CFLAGS_TEMPLATE="$EXTRA_CFLAGS_TEMPLATE -I$d/include"
-	 DEFS="$DEFS -I$d/include"
-	 LIBS="$LIBS -L$d/lib -lnetcdf"
-	 if test $gri_cv_is_sun = yes ; then
-	    LIBS="$LIBS -lnsl"
-	 fi
-	 AC_DEFINE(HAVE_LIBNETCDF)
-	 AC_MSG_RESULT(yes, in $d/include/netcdf.h and $d/lib/libnetcdf.a)
-      fi
-  done
-  AC_MSG_RESULT(done)
-])dnl
-dnl
-CHECK_FOR_NETCDF
+AC_CHECK_LIB(netcdf, nc_open, HAVE_LIBNETCDF="YES", HAVE_LIBNETCDF="")
+[
+if test -n "$HAVE_LIBNETCDF" ; then
+   ] AC_DEFINE(HAVE_LIBNETCDF) [
+   LIBS="-lnetcdf $LIBS"
+fi
+]
 
 dnl use this??
 dnl AC_SUBST(EXTRA_CXXFLAGS)