aboutsummaryrefslogtreecommitdiff
blob: cf2d0fe35c92e25b57579d699df799d52a876c43 (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
73
74
75
76
--- configure.in	2005-10-27 00:25:05.000000000 -0300
+++ configure.in	2005-10-27 00:22:25.000000000 -0300
@@ -156,7 +156,7 @@
     AC_HELP_STRING([--with-cdf=DIR],[where the root of CDF is installed ]),
     [  ac_cdf_includes="-I$withval/include"
        ac_cdf_libraries="-L$withval/lib"
-    ])
+     ])
 
 all_includes_save="$all_includes"
 all_includes="$all_includes $ac_cdf_includes"
@@ -182,32 +182,43 @@
 # netCDF Test
 ac_netcdf_includes=""
 ac_netcdf_libraries=""
-AC_ARG_WITH(netcdf,
-    AC_HELP_STRING([--with-netcdf=DIR],[where the root of NetCDF is installed ]),
-    [  ac_netcdf_includes="-I$withval/include"
-       ac_netcdf_libraries="-L$withval/lib"
-    ])
-
-all_includes_save="$all_includes"
-all_includes="$all_includes $ac_netcdf_includes"
-KDE_CHECK_HEADER(netcdfcpp.h, AC_DEFINE(HAVE_NETCDFCPP_H, 1, [If we have NetCDF CPP headers]) have_netcdfcpp_h=yes NETCDFINCLUDES="$ac_netcdf_includes", , )
-all_includes="$all_includes_save"
+NETCDFLIBS=""
 
-ldflags_save="$LDFLAGS"
-LDFLAGS="$LDFLAGS $ac_netcdf_libraries"
-KDE_CHECK_LIB(netcdf, nc_open, NETCDFLIBS="$ac_netcdf_libraries -lnetcdf_c++ -lnetcdf $NETCDFLIBS", , )
-LDFLAGS="$ldflags_save"
-
-if test $ac_cv_lib_netcdf_nc_open = yes; then
-  if test $have_netcdfcpp_h = yes; then
-    AC_SUBST(NETCDFLIBS)
-    AC_SUBST(NETCDFINCLUDES)
-    AC_DEFINE(KST_HAVE_NETCDF, 1, [If we have the NetCDF libraries.])
-  fi
+AC_MSG_CHECKING([--enable-netcdf argument])
+AC_ARG_ENABLE(netcdf,
+    [  --enable-netcdf         enable netcdf support.],
+    [ enable_netcdf=$enableval ],
+    [ enable_netcdf="no" ])
+
+if test "$enable_netcdf" = "yes"; then
+    AC_ARG_WITH(netcdf,
+        AC_HELP_STRING([--with-netcdf=DIR],[where the root of NetCDF is installed ]),
+    	[  ac_netcdf_includes="-I$withval/include"
+       	   ac_netcdf_libraries="-L$withval/lib"
+    	])
+
+    all_includes_save="$all_includes"
+    all_includes="$all_includes $ac_netcdf_includes"
+    KDE_CHECK_HEADER(netcdfcpp.h, AC_DEFINE(HAVE_NETCDFCPP_H, 1, [If we have NetCDF CPP headers]) have_netcdfcpp_h=yes NETCDFINCLUDES="$ac_netcdf_includes", , )
+    all_includes="$all_includes_save"
+
+    ldflags_save="$LDFLAGS"
+    LDFLAGS="$LDFLAGS $ac_netcdf_libraries"
+    KDE_CHECK_LIB(netcdf, nc_open, NETCDFLIBS="$ac_netcdf_libraries -lnetcdf_c++ -lnetcdf $NETCDFLIBS", , )
+    LDFLAGS="$ldflags_save"
+
+    if test $ac_cv_lib_netcdf_nc_open = yes; then
+      if test $have_netcdfcpp_h = yes; then
+          AC_SUBST(NETCDFLIBS)
+          AC_SUBST(NETCDFINCLUDES)
+          AC_DEFINE(KST_HAVE_NETCDF, 1, [If we have the NetCDF libraries.])
+      fi
+    fi
 fi
 
 AM_CONDITIONAL(include_netcdf, test -n "$NETCDFLIBS")
 
+
 # Readline and ncurses check
 KDE_CHECK_HEADER(readline/readline.h, AC_DEFINE(HAVE_READLINE_H, 1, [If we have libreadline headers]) have_readline_h=yes, , )
 KDE_CHECK_LIB(readline, rl_cleanup_after_signal, LIBREADLINE="-lreadline -lncurses", , -lncurses)