blob: defed2fc84d047c1ade9c67b4dfdbba89c95107c (
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
$NetBSD: patch-aa,v 1.1.1.1 2002/05/03 23:45:15 jtb Exp $
--- configure.in.orig Wed Apr 3 20:09:30 2002
+++ configure.in Wed May 1 21:20:19 2002
@@ -229,60 +229,13 @@
AC_CHECK_HEADERS(unistd.h)
-dnl Check for netcdf library. It might be
-dnl in one of several places, so check
-dnl several locations, reporting location
-dnl if found.
-AC_MSG_CHECKING(for netcdf library)
-define(CHECK_FOR_NETCDF, [
- if test -d /opt/netcdf/include ; then
- #
- # Solaris often has it here
- CXXFLAGS="$CXXFLAGS -I/opt/netcdf/include"
- LIBS="$LIBS -L/opt/netcdf/lib -lnetcdf"
- if test $gri_cv_is_sun = yes ; then
- LIBS="$LIBS -lnsl"
- fi
- AC_DEFINE(HAVE_LIBNETCDF)
- echo "yes (in /opt/netcdf/include/netcdf.h and /opt/netcdf/lib/libnetcdf.a)"
- else
- if test -f /usr/local/include/netcdf.h ; then
- CXXFLAGS="$CPPFLAGS -I/usr/local/include"
- LIBS="$LIBS -L/usr/local/lib -lnetcdf"
- if test $gri_cv_is_sun = yes ; then
- LIBS="$LIBS -lnsl"
- fi
- AC_DEFINE(HAVE_LIBNETCDF)
- echo "yes (in /usr/local/include/netcdf.h and /usr/local/lib/libnetcdf.a)"
- else
- #
- # Linux/debian often has it here.
- if test -f /usr/include/netcdf.h ; then
- CXXFLAGS="$CPPFLAGS -I/usr/include/netcdf"
- LIBS="$LIBS -L/usr/lib/netcdf -lnetcdf"
- if test $gri_cv_is_sun = yes ; then
- LIBS="$LIBS -lnsl"
- fi
- AC_DEFINE(HAVE_LIBNETCDF)
- echo "yes (in /usr/include/netcdf.h and /usr/lib/libnetcdf.a)"
- else
- if test -f /boot/home/lib/netcdf ; then
- CXXFLAGS="$CPPFLAGS -I/boot/home/include/netcdf"
- LIBS="$LIBS -L/boot/home/lib/netcdf -lnetcdf"
- if test $gri_cv_is_sun = yes ; then
- LIBS="$LIBS -lnsl"
- fi
- echo "yes (in /boot/home/netcdf)"
- AC_DEFINE(HAVE_LIBNETCDF)
- else
- echo "no"
- fi
- fi
- fi
- fi
-])dnl
-dnl
-CHECK_FOR_NETCDF
+AC_CHECK_LIB(netcdf, ncvarid, HAVE_LIBNETCDF="YES", HAVE_LIBNETCDF="")
+[
+if test -n "$HAVE_LIBNETCDF" ; then
+ ] AC_DEFINE(HAVE_LIBNETCDF) [
+ LIBS="-lnetcdf $LIBS"
+fi
+]
AC_CHECK_LIB(m,sin)
AC_SUBST(EXTRA_CXXFLAGS)
|