build system patches and files
Patrice Dumas
pertusus at FREE.FR
Sun Sep 25 20:53:26 EDT 2005
Hi,
Here is a set of patches and files for the buildsystem. I allready sent
some of these files or patches, but I resend everything here, it
is in a much cleaner state.
The idea behind the changes in configure.in is that it isn't practical to
use the same macros when checking for things in supplib (without
--enable-dyn-supplibs) and when checking for system libraries (with
--enable-dyn-supplibs). Indeed when checking for system libraries there
may be different library versions, at different places and whenever
scripts like gdlib-config or dap-config exist, they should be used.
The added benefit is that the macros may be used in other projects and
files may also be borrowed from other projects. The drawback is that there
is some code duplication.
* grads-gcc4.diff: build fixes for gcc4/fedora core
* grads-configure.in-special_macros_dyn.diff: use different macros when
configuring with --enable-dyn-supplibs and without.
* grads-libsx_no_freq.diff: use 2 possible interfaces for libsx.
* ga_lib_readline.m4, gd.m4, hdf.m4, libdap.m4, libnc-dap.m4, libsx.m4,
netcdf.m4, udunits.m4: files containing the macros used for detection
and configuration of libraries, when --enable-dyn-supplibs is set.
If used with the 2 following patches they should go to ./etc.
ga_lib_readline.m4 is a slightly modified version of vl_lib_readline.m4
found in the ac_archive. libdap.m4 and libnc-dap.m4 come from opendap.
* grads-Makefile.am-AUTOMAKE_ACLOCAL_flags.diff: add flags for autoreconf.
They assume that additional m4 files are in ./etc or .
* grads-bootstrap-aclocal_flags.diff: add flags for aclocal. They assume
that additional m4 files are in ./etc or .
grads-libsx_no_freq.diff and grads-configure.in-special_macros_dyn.diff
depends on each others.
grads-configure.in-special_macros_dyn.diff depends on the .m4 files.
2 things remain to be done. 1) use AC_*CACHE*. 2) modify the include lines
for files including readline as explained in the comments in
ga_lib_readline.m4.
I didn't try to change things related with the wi command as it is
deprecated.
--
Pat
-------------- next part --------------
diff -u --recursive -x Makefile.in -x configure -x aclocal.m4 grads-1.9b4-configure/src/gauser.c grads-1.9b4/src/gauser.c
--- grads-1.9b4-configure/src/gauser.c 2005-05-18 20:51:01.000000000 +0200
+++ grads-1.9b4/src/gauser.c 2005-08-11 23:25:56.000000000 +0200
@@ -42,6 +42,7 @@
#endif
/* int gxhpng (char *, int, int, int, int); */
+int gxhpng (char *, int, int, int, int, char *, char *, int) ;
/*mf 971022 --- expose Mike Fiorino's global struct to these routines for warning level setting mf*/
extern struct gamfcmn mfcmn;
Seulement dans grads-1.9b4/src: gauser-c.o
Seulement dans grads-1.9b4/src: gauser-dods.o
Seulement dans grads-1.9b4/src: gauser-hdf.o
Seulement dans grads-1.9b4/src: gauser-nc.o
Seulement dans grads-1.9b4/src: gautil.o
Seulement dans grads-1.9b4/src: gautil.sa.o
Seulement dans grads-1.9b4/src: gd13gif.o
Seulement dans grads-1.9b4/src: gradsc
Seulement dans grads-1.9b4/src: gradsdods
Seulement dans grads-1.9b4/src: gradshdf
Seulement dans grads-1.9b4/src: gradsnc
Seulement dans grads-1.9b4/src: grads.o
Seulement dans grads-1.9b4/src: gribmap
Seulement dans grads-1.9b4/src: gribmap.o
Seulement dans grads-1.9b4/src: gribscan
Seulement dans grads-1.9b4/src: gribscan.o
Seulement dans grads-1.9b4/src: gscrpt.o
Seulement dans grads-1.9b4/src: gsgui.o
Seulement dans grads-1.9b4/src: gxchpl.o
Seulement dans grads-1.9b4/src: gxcntr.o
diff -u --recursive -x Makefile.in -x configure -x aclocal.m4 grads-1.9b4-configure/src/gxdxwd.c grads-1.9b4/src/gxdxwd.c
--- grads-1.9b4-configure/src/gxdxwd.c 2002-10-28 20:08:33.000000000 +0100
+++ grads-1.9b4/src/gxdxwd.c 2005-08-11 15:55:33.000000000 +0200
@@ -6,6 +6,7 @@
#include <config.h>
#endif
+#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
@@ -22,7 +23,7 @@
* writting.
*/
-char *calloc();
+/* char *calloc(); */
#include "X11/XWDFile.h"
Seulement dans grads-1.9b4/src: gxdxwd.o
Seulement dans grads-1.9b4/src: gxeps
Seulement dans grads-1.9b4/src: gxeps.o
diff -u --recursive -x Makefile.in -x configure -x aclocal.m4 grads-1.9b4-configure/src/gxhpng.c grads-1.9b4/src/gxhpng.c
--- grads-1.9b4-configure/src/gxhpng.c 2004-03-12 17:14:04.000000000 +0100
+++ grads-1.9b4/src/gxhpng.c 2005-08-12 08:35:10.000000000 +0200
@@ -379,6 +379,11 @@
int gdCompareInt(const void *a, const void *b);
+int gdCompareInt(const void *a, const void *b)
+{
+ return (*(const int *)a) - (*(const int *)b);
+}
+
/* Version of gdImageFilledPolygon to invoke my local
version of gdImageLne. Nothing else changed... B.Doty 5/31/01 */
-------------- next part --------------
--- grads-1.9b4-orig/configure.in 2005-05-23 17:04:40.000000000 +0200
+++ grads-1.9b4/configure.in 2005-09-26 02:12:55.000000000 +0200
@@ -66,6 +66,8 @@
[Use pre-1.9 non-canonical names for supplib directories]),
[old_supplibs="yes"])
+ga_dyn_supplibs=no
+
AC_ARG_ENABLE(dyn-supplibs, AC_HELP_STRING([--enable-dyn-supplibs],
[Use dynamic (shared object) system libraries, if present, for optional features. This will produce smaller, but possibly less portable, binaries. By default, only static libraries from a GrADS supplibs distribution will be used for optional feature support to maximize binary portability.]),
[ GA_ENABLE_DYNAMIC() ])
@@ -258,11 +260,21 @@
use_readline=no
if test "$with_readline" != "no" ; then
echo "Check GrADS command line editing support..."
- GA_CHECK_READLINE([use_readline=yes])
+ if test "$ga_dyn_supplibs" = "yes" ; then
+ # GA_LIB_READLINE adds the required -l to LIBS
+ GA_LIB_READLINE([
+ use_readline=yes
+ readline_libs=""
+ ])
+ else
+ GA_CHECK_READLINE([use_readline=yes])
+ fi
fi
if test $use_readline = "yes" ; then
echo "+ Command line editing enabled"
- GA_SET_LIB_VAR(readline_libs, readline)
+ if test "$ga_dyn_supplibs" = "no" ; then
+ GA_SET_LIB_VAR(readline_libs, readline)
+ fi
AC_SUBST(readline_libs)
AC_DEFINE(READLINE, 1, [Enable command line editing])
AC_DEFINE(MM_READLINE,,[Enhanced readline with history])
@@ -274,15 +286,29 @@
use_gui=no
+use_freq=yes
if test "$with_gui" != "no" ; then
echo "Check GrADS GUI support..."
- GA_CHECK_GUI([use_gui=yes])
+ if test "$ga_dyn_supplibs" = "yes" ; then
+ GA_CHECK_LIBSX([use_gui=yes;use_freq=yes],[use_gui=yes;use_freq=no])
+ else
+ GA_CHECK_GUI([use_gui=yes])
+ fi
fi
if test $use_gui = "yes" ; then
AC_DEFINE(USEGUI, 1, [Enable GUI widgets])
echo "+ GUI enabled"
- GA_SET_LIB_VAR(gui_libs, [sx freq])
- gui_libs="$gui_libs -lXaw -lXmu -lXt $guilibadd"
+ if test "$ga_dyn_supplibs" = "yes" ; then
+ gui_libs="$GA_LIBSX_LIBS $guilibadd"
+ else
+ GA_SET_LIB_VAR(gui_libs, [sx freq])
+ gui_libs="$gui_libs -lXaw -lXmu -lXt $guilibadd"
+ fi
+ if test $use_freq = yes; then
+ AC_DEFINE(USEFREQ, 1, [Use GetFile from freq])
+ else
+ AC_DEFINE(USEFREQ, 0, [Use GetFile from freq])
+ fi
AC_SUBST(gui_libs)
else
AC_DEFINE(USEGUI, 0, [Enable GUI widgets])
@@ -294,13 +320,24 @@
use_printim=no
if test "$with_printim" != "no" ; then
echo "Check GrADS printim support..."
- GA_CHECK_GD([use_printim=yes], [])
+ if test "$ga_dyn_supplibs" = "yes" ; then
+ GA_SUPP_CHECK_GD([
+ use_printim=yes
+ printim_libs="$GA_GD_LIBS"
+ LDFLAGS="$LDFLAGS $GA_GD_LDFLAGS"
+ CPPFLAGS="$CPPFLAGS $GA_GD_CPPFLAGS"
+ ])
+ else
+ GA_CHECK_GD([use_printim=yes], [])
+ fi
fi
if test $use_printim = "yes" ; then
AC_DEFINE(GXPNG, 1, [Enable printim using GD library \
(http://www.boutell.com/gd) for PNG/GIF images])
- GA_SET_LIB_VAR(printim_libs, [gd png z])
+ if test "$ga_dyn_supplibs" = "no" ; then
+ GA_SET_LIB_VAR(printim_libs, [gd png z])
+ fi
AC_SUBST(printim_libs)
extra_utils="$extra_utils gxtran"
echo "+ printim enabled"
@@ -354,10 +391,23 @@
use_nc=no
if test "$with_nc" != "no" ; then
- GA_CHECK_NC([use_nc=yes])
+ if test "$ga_dyn_supplibs" = "yes" ; then
+ GA_CHECK_UDUNITS([
+ AC_CHECK_NETCDF([
+ LDFLAGS="$LDFLAGS $NC_LDFLAGS"
+ CPPFLAGS="$CPPFLAGS $NC_CPPFLAGS"
+ use_nc=yes
+ nc_libs="$NC_LIBS $GA_UDUNITS_LIBS"
+ ])
+ ])
+ else
+ GA_CHECK_NC([use_nc=yes])
+ fi
fi
if test $use_nc = "yes" ; then
- GA_SET_LIB_VAR(nc_libs, [netcdf udunits])
+ if test "$ga_dyn_supplibs" = "no" ; then
+ GA_SET_LIB_VAR(nc_libs, [netcdf udunits])
+ fi
AC_SUBST(nc_libs)
extra_bins="$extra_bins gradsnc"
echo "+ gradsnc (plain netCDF) build enabled"
@@ -369,13 +419,26 @@
use_hdf=no
if test "$with_hdf" != "no" ; then
- GA_CHECK_HDF([use_hdf=yes])
+ if test "$ga_dyn_supplibs" = "yes" ; then
+ GA_CHECK_UDUNITS([
+ GA_SUPP_CHECK_HDF([
+ LDFLAGS="$LDFLAGS $GA_HDF_LDFLAGS"
+ CPPFLAGS="$CPPFLAGS $GA_HDF_CPPFLAGS"
+ use_hdf=yes
+ hdf_libs="$GA_HDF_LIBS $GA_UDUNITS_LIBS"
+ ])
+ ])
+ else
+ GA_CHECK_HDF([use_hdf=yes])
+ fi
fi
if test $use_hdf = "yes" ; then
+ if test "$ga_dyn_supplibs" = "no" ; then
GA_SET_LIB_VAR(hdf_libs, [mfhdf df jpeg udunits z])
- AC_SUBST(hdf_libs)
- extra_bins="$extra_bins gradshdf"
- echo "+ gradshdf (HDF-SDS/netCDF) build enabled"
+ fi
+ AC_SUBST(hdf_libs)
+ extra_bins="$extra_bins gradshdf"
+ echo "+ gradshdf (HDF-SDS/netCDF) build enabled"
else
echo "- gradshdf (HDF-SDS/netCDF) build disabled"
fi
@@ -384,22 +447,41 @@
use_dods=no
if test "$with_dods" != "no" ; then
- GA_CHECK_DODS([use_dods=yes])
+ if test "$ga_dyn_supplibs" = "yes" ; then
+ GA_CHECK_UDUNITS([
+ AC_CHECK_NC_DODS([
+ CPPFLAGS="$CPPFLAGS $NC_DAP_CFLAGS"
+ AC_CHECK_HEADERS([netcdf.h],
+ [
+ dods_libs="$GA_UDUNITS_LIBS $NC_DAP_LIBS"
+ use_dods=yes
+ ])
+ ])
+ ])
+ else
+ GA_CHECK_DODS([use_dods=yes])
+ fi
fi
if test $use_dods = "yes" ; then
-
extra_bins="$extra_bins gradsdods"
- GA_SET_LIB_VAR(dods_libs, [udunits www rx z])
-
+ if test "$ga_dyn_supplibs" = "no" ; then
+ GA_SET_LIB_VAR(dods_libs, [udunits www rx z])
+ fi
GA_CHECK_LIB(gadods, main, [use_gadods=yes], [use_gadods=no])
if test $use_gadods = "yes" ; then
- dods_rep_libs="-lgadods -lnc-dods -ldap++"
+ if test "$ga_dyn_supplibs" = "no" ; then
+ dods_rep_libs="-lgadods -lnc-dods -ldap++"
+ else
+ dods_rep_libs="-lgadods"
+ fi
gadods_def="-DUSEGADODS=1"
echo "+ gradsdods (OPeNDAP/netCDF) build enabled - gridded and station interfaces"
else
- dods_rep_libs="-lnc-dods -ldap++"
+ if test "$ga_dyn_supplibs" = "no" ; then
+ dods_rep_libs="-lnc-dods -ldap++"
+ fi
gadods_def="-DUSEGADODS=0"
echo "+ gradsdods (OPeNDAP/netCDF) build enabled - gridded interface only"
fi
-------------- next part --------------
Seulement dans grads-1.9b4/src: bufrscan.o
Seulement dans grads-1.9b4/src: bufrstn.o
Seulement dans grads-1.9b4/src: buildinfo.h
Seulement dans grads-1.9b4/src: config.h
diff -u --recursive --exclude aclocal.m4 --exclude configure --exclude Makefile.in --exclude bootstrap grads-1.9b4-orig/src/config.h.in grads-1.9b4/src/config.h.in
--- grads-1.9b4-orig/src/config.h.in 2004-12-15 22:00:03.000000000 +0100
+++ grads-1.9b4/src/config.h.in 2005-08-16 12:05:39.000000000 +0200
@@ -88,6 +88,9 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Use GetFile from freq */
+#undef USEFREQ
+
/* Enable GUI widgets */
#undef USEGUI
Seulement dans grads-1.9b4/src: config.h.in~
Seulement dans grads-1.9b4/src: fgbds.o
Seulement dans grads-1.9b4/src: fgutil.o
Seulement dans grads-1.9b4/src: gabufr.o
Seulement dans grads-1.9b4/src: gabufrtbl.o
Seulement dans grads-1.9b4/src: gacfg-c.o
Seulement dans grads-1.9b4/src: gacfg-dods.o
Seulement dans grads-1.9b4/src: gacfg-hdf.o
Seulement dans grads-1.9b4/src: gacfg-nc.o
Seulement dans grads-1.9b4/src: gaddes-c.o
Seulement dans grads-1.9b4/src: gaddes-dods.o
Seulement dans grads-1.9b4/src: gaddes-hdf.o
Seulement dans grads-1.9b4/src: gaddes-nc.o
Seulement dans grads-1.9b4/src: gaddes.sa.o
Seulement dans grads-1.9b4/src: gaexpr.o
Seulement dans grads-1.9b4/src: gafunc.o
Seulement dans grads-1.9b4/src: gagmap.o
diff -u --recursive --exclude aclocal.m4 --exclude configure --exclude Makefile.in --exclude bootstrap grads-1.9b4-orig/src/gagui.c grads-1.9b4/src/gagui.c
--- grads-1.9b4-orig/src/gagui.c 2002-10-28 20:08:33.000000000 +0100
+++ grads-1.9b4/src/gagui.c 2005-08-16 12:15:04.000000000 +0200
@@ -38,7 +38,9 @@
#include <time.h>
#include "libsx.h"
-#include "freq.h"
+#if USEFREQ == 1
+#include "freq.h"
+#endif
#include "grads.h"
#include "gx.h"
@@ -341,8 +343,20 @@
}
/*
+ * define SimpleGetFile, it is not part of libsx.
+ */
+char *SimpleGetFile(char *path)
+{
+#if USEFREQ == 0
+ return GetFile("Simple file requestor", path, NULL, NULL);
+#else
+ return GetFile(path);
+#endif
+}
+
+/*
* CB_Load() - Callback function for the load button. This just calls
- * GetFile() to get a file name. In case of "open" or "sdfopen",
+ * SimpleGetFile() to get a file name. In case of "open" or "sdfopen",
* the file becomes the default and the user is asked to select a
* variable from this file.
*/
@@ -356,7 +370,7 @@
else if(strstr(data,"exec")) last_path = last_path_exec;
else if(strstr(data,"run")) last_path = last_path_run;
else last_path = NULL;
- fname = GetFile(last_path);
+ fname = SimpleGetFile(last_path);
if(fname)
{
@@ -979,7 +993,7 @@
WinInfo *wi=(WinInfo *)arg;
char *fname;
- fname = GetFile(wi->cur_path);
+ fname = SimpleGetFile(wi->cur_path);
if (fname)
{
SetTextWidgetText(wi->text_widget, fname, TRUE);
@@ -1126,7 +1140,7 @@
fname = (char *) data;
- if ( !strcmp(fname,"NULL") ) fname = GetFile(NULL);
+ if ( !strcmp(fname,"NULL") ) fname = SimpleGetFile(NULL);
if ( !fname ) return;
this = MakeWindow("GrADS Text Viewer", SAME_DISPLAY, NONEXCLUSIVE_WINDOW);
@@ -1151,7 +1165,7 @@
WinInfo *wi;
fname = (char *)data;
- if ( !strcmp(fname,"NULL") ) fname = GetFile(NULL);
+ if ( !strcmp(fname,"NULL") ) fname = SimpleGetFile(NULL);
if ( !fname ) return;
this = MakeWindow("GrADS Text Editor", SAME_DISPLAY, NONEXCLUSIVE_WINDOW);
Seulement dans grads-1.9b4/src: gagui.o
Seulement dans grads-1.9b4/src: gagx.o
Seulement dans grads-1.9b4/src: gaio-c.o
Seulement dans grads-1.9b4/src: gaio-dods.o
Seulement dans grads-1.9b4/src: gaio-hdf.o
Seulement dans grads-1.9b4/src: gaio-nc.o
Seulement dans grads-1.9b4/src: galats.o
Seulement dans grads-1.9b4/src: gamach.o
Seulement dans grads-1.9b4/src: gasdf-dods.o
Seulement dans grads-1.9b4/src: gasdf-hdf.o
Seulement dans grads-1.9b4/src: gasdf-nc.o
Seulement dans grads-1.9b4/src: gauser-hdf.o
Seulement dans grads-1.9b4/src: gauser-nc.o
Seulement dans grads-1.9b4/src: gautil.o
Seulement dans grads-1.9b4/src: gautil.sa.o
Seulement dans grads-1.9b4/src: gd13gif.o
Seulement dans grads-1.9b4/src: gradsc
Seulement dans grads-1.9b4/src: gradsdods
Seulement dans grads-1.9b4/src: gradshdf
Seulement dans grads-1.9b4/src: gradsnc
Seulement dans grads-1.9b4/src: grads.o
Seulement dans grads-1.9b4/src: gribmap
Seulement dans grads-1.9b4/src: gribmap.o
Seulement dans grads-1.9b4/src: gribscan
Seulement dans grads-1.9b4/src: gribscan.o
Seulement dans grads-1.9b4/src: gscrpt.o
diff -u --recursive --exclude aclocal.m4 --exclude configure --exclude Makefile.in --exclude bootstrap grads-1.9b4-orig/src/gsgui.c grads-1.9b4/src/gsgui.c
--- grads-1.9b4-orig/src/gsgui.c 2002-10-28 20:08:33.000000000 +0100
+++ grads-1.9b4/src/gsgui.c 2005-08-16 12:15:42.000000000 +0200
@@ -29,7 +29,9 @@
#include <stdlib.h>
#include "libsx.h"
+#if USEFREQ == 1
#include "freq.h"
+#endif
#include "gagui.h"
/* Supported widget types */
Seulement dans grads-1.9b4/src: gsgui.o
Seulement dans grads-1.9b4/src: gxchpl.o
Seulement dans grads-1.9b4/src: gxcntr.o
Seulement dans grads-1.9b4/src: gxmeta.sa.o
Seulement dans grads-1.9b4/src: gxps
Seulement dans grads-1.9b4/src: gxps.o
Seulement dans grads-1.9b4/src: gxshad.o
Seulement dans grads-1.9b4/src: gxstrm.o
Seulement dans grads-1.9b4/src: gxsubs.o
Seulement dans grads-1.9b4/src: gxtran
Seulement dans grads-1.9b4/src: gxtran.o
Seulement dans grads-1.9b4/src: gxwmap.o
Seulement dans grads-1.9b4/src: gxX.o
Seulement dans grads-1.9b4/src: latsgribmap.o
Seulement dans grads-1.9b4/src: latsgrib.o
Seulement dans grads-1.9b4/src: latsint.o
Seulement dans grads-1.9b4/src: latsnc-nc.o
Seulement dans grads-1.9b4/src: latsnc.o
Seulement dans grads-1.9b4/src: lats.o
Seulement dans grads-1.9b4/src: latsstat.o
Seulement dans grads-1.9b4/src: latstime.o
Seulement dans grads-1.9b4/src: Makefile
Seulement dans grads-1.9b4/src: stamp-h
Seulement dans grads-1.9b4/src: stamp-h1
Seulement dans grads-1.9b4/src: stnmap
Seulement dans grads-1.9b4/src: stnmap.o
Seulement dans grads-1.9b4/src: wgrib
Seulement dans grads-1.9b4/src: wgrib.o
-------------- next part --------------
--- grads-1.9b4-orig/Makefile.am 2003-10-02 16:01:15.000000000 +0200
+++ grads-1.9b4/Makefile.am 2005-09-25 18:25:24.000000000 +0200
@@ -6,6 +6,8 @@
SUBDIRS=src
EXTRA_DIST=COPYRIGHT INSTALL
+AUTOMAKE_OPTIONS = foreign
+ACLOCAL_AMFLAGS= -I etc
BINDISTFILES=COPYRIGHT INSTALL
-------------- next part --------------
--- grads-1.9b4-orig/bootstrap 2003-07-04 22:25:54.000000000 +0200
+++ grads-1.9b4/bootstrap 2005-09-26 02:36:14.000000000 +0200
@@ -1,6 +1,6 @@
#!/bin/sh
mkdir -p etc
-aclocal
+aclocal -I etc
autoheader
touch config.h.in
touch src/stamp-h
-------------- next part --------------
dnl @synopsis GA_LIB_READLINE
dnl args : action-if-found, action-if-not-found
dnl it is found if readline is found and has
dnl history
dnl
dnl Searches for a readline compatible library. If found, defines
dnl `HAVE_LIBREADLINE'. If the found library has the `add_history'
dnl function, sets also `HAVE_READLINE_HISTORY'. Also checks for the
dnl locations of the necessary include files and sets `HAVE_READLINE_H'
dnl or `HAVE_READLINE_READLINE_H' and `HAVE_READLINE_HISTORY_H' or
dnl 'HAVE_HISTORY_H' if the corresponding include files exists.
dnl
dnl The libraries that may be readline compatible are `libedit',
dnl `libeditline' and `libreadline'. Sometimes we need to link a termcap
dnl library for readline to work, this macro tests these cases too by
dnl trying to link with `libtermcap', `libcurses' or `libncurses' before
dnl giving up.
dnl
dnl Here is an example of how to use the information provided by this
dnl macro to perform the necessary includes or declarations in a C file:
dnl
dnl #ifdef HAVE_LIBREADLINE
dnl # if defined(HAVE_READLINE_READLINE_H)
dnl # include <readline/readline.h>
dnl # elif defined(HAVE_READLINE_H)
dnl # include <readline.h>
dnl # else /* !defined(HAVE_READLINE_H) */
dnl extern char *readline ();
dnl # endif /* !defined(HAVE_READLINE_H) */
dnl char *cmdline = NULL;
dnl #else /* !defined(HAVE_READLINE_READLINE_H) */
dnl /* no readline */
dnl #endif /* HAVE_LIBREADLINE */
dnl
dnl #ifdef HAVE_READLINE_HISTORY
dnl # if defined(HAVE_READLINE_HISTORY_H)
dnl # include <readline/history.h>
dnl # elif defined(HAVE_HISTORY_H)
dnl # include <history.h>
dnl # else /* !defined(HAVE_HISTORY_H) */
dnl extern void add_history ();
dnl extern int write_history ();
dnl extern int read_history ();
dnl # endif /* defined(HAVE_READLINE_HISTORY_H) */
dnl /* no history */
dnl #endif /* HAVE_READLINE_HISTORY */
dnl
dnl
dnl @version 1.1
dnl @author Ville Laurikari <vl at iki.fi>
dnl
dnl Pat: add args, rename to GA_LIB_READLINE
AC_DEFUN([GA_LIB_READLINE], [
AC_CACHE_CHECK([for a readline compatible library],
vl_cv_lib_readline, [
ORIG_LIBS="$LIBS"
for readline_lib in readline edit editline; do
for termcap_lib in "" termcap curses ncurses; do
if test -z "$termcap_lib"; then
TRY_LIB="-l$readline_lib"
else
TRY_LIB="-l$readline_lib -l$termcap_lib"
fi
LIBS="$ORIG_LIBS $TRY_LIB"
AC_TRY_LINK_FUNC(readline, vl_cv_lib_readline="$TRY_LIB")
if test -n "$vl_cv_lib_readline"; then
break
fi
done
if test -n "$vl_cv_lib_readline"; then
break
fi
done
if test -z "$vl_cv_lib_readline"; then
vl_cv_lib_readline="no"
LIBS="$ORIG_LIBS"
fi
])
if test "$vl_cv_lib_readline" != "no"; then
AC_DEFINE(HAVE_LIBREADLINE, 1,
[Define if you have a readline compatible library])
AC_CHECK_HEADERS(readline.h readline/readline.h)
AC_CACHE_CHECK([whether readline supports history],
vl_cv_lib_readline_history, [
vl_cv_lib_readline_history="no"
AC_TRY_LINK_FUNC(add_history, vl_cv_lib_readline_history="yes")
])
if test "$vl_cv_lib_readline_history" = "yes"; then
AC_DEFINE(HAVE_READLINE_HISTORY, 1,
[Define if your readline library has \`add_history'])
AC_CHECK_HEADERS(history.h readline/history.h)
m4_if([$1], [], [:], [$1])
else
m4_if([$2], [], [:], [$2])
fi
fi
])dnl
-------------- next part --------------
dnl GA_SUPP_CHECK_GD : check for gd library
dnl args : action-if-yes, action-if-no
AC_DEFUN([GA_SUPP_CHECK_GD],
[
ga_check_gd="no"
GA_GD_LIBS=
GA_GD_CPPFLAGS=
GA_GD_LDFLAGS=
ac_save_LIBS="$LIBS"
ac_save_CFPPLAGS="$CPPFLAGS"
ac_save_LDFLAGS="$LDFLAGS"
AC_PATH_PROG([GD_CONFIG],[gdlib-config],[no])
if test "$GD_CONFIG" != "no"; then
GA_GD_LIBS=`$GD_CONFIG --libs`
GA_GD_CPPFLAGS=`$GD_CONFIG --cflags`
GA_GD_LDFLAGS=`$GD_CONFIG --ldflags`
LDFLAGS="$LDFLAGS $GA_GD_LDFLAGS"
LIBS="$LIBS $GA_GD_LIBS"
AC_CHECK_HEADER([gd.h],
[ AC_CHECK_LIB([gd], [gdImageCreate],
[ ga_check_gd=yes
GA_GD_LIBS="-lgd $GA_GD_LIBS"
],
[
GA_GD_LDFLAGS=
GA_GD_LIBS=
LIBS="$ac_save_LIBS"
LDFLAGS="$ac_save_LDFLAGS"
])
],
[
GA_GD_CPPFLAGS=
CPPFLAGS="$ac_save_CPPFLAGS"
])
fi
if test $ga_check_gd = 'no'; then
AC_CHECK_HEADER([gd.h],
[ AC_SEARCH_LIBS([tgetstr], [termcap ncurses],
[ AC_CHECK_LIB([z], [compress],
[ AC_CHECK_LIB([png], [main],
[ AC_CHECK_LIB([gd], [gdImageCreate],
[ ga_check_gd=yes
GA_GD_LIBS='-lgd -lpng -lz'
])
])
])
])
])
fi
if test $ga_check_gd = 'yes'; then
m4_if([$1], [], [:], [$1])
else
m4_if([$2], [], [:], [$2])
fi
LIBS="$ac_save_LIBS"
CPPFLAGS="$ac_save_CPPFLAGS"
LDFLAGS="$ac_save_LDFLAGS"
AC_SUBST([GA_GD_LIBS])
AC_SUBST([GA_GD_LDFLAGs])
AC_SUBST([GA_GD_CPPFLAGS])
])
-------------- next part --------------
dnl GA_SUPP_CHECK_HDF : Check for hdf
dnl args : action-if-yes, action-if-no
AC_DEFUN([GA_SUPP_CHECK_HDF],
[
AC_ARG_WITH([hdf_include],
[AS_HELP_STRING([--with-hdf-include=ARG],[hdf include directory])],
[HDF_PATH_INC="${withval}"],
[HDF_PATH_INC=""])
AC_ARG_WITH([hdf_libdir],
[AS_HELP_STRING([--with-hdf-libdir=ARG],[hdf library directory])],
[HDF_PATH_LIBDIR="${withval}"],
[HDF_PATH_LIBDIR=""])
ga_check_hdf="no"
ga_hdf_save_LDFLAGS="$LDFLAGS"
GA_HDF_LDFLAGS=
if test "z$HDF_PATH_LIBDIR" != "z"; then
LDFLAGS="$LDFLAGS -L${HDF_PATH_LIBDIR}"
fi
AC_CHECK_LIB([z],[compress],
[ AC_CHECK_LIB([jpeg],[main],
[ AC_CHECK_LIB([df],[main],
[ AC_CHECK_LIB([mfhdf],[main],
[ ga_check_hdf="yes"
GA_HDF_LIBS='-lmfhdf -ldf -ljpeg -lz'
if test "z$HDF_PATH_LIBDIR" != "z"; then
GA_HDF_LDFLAGS="-L${HDF_PATH_LIBDIR}"
fi
])
])
])
])
LDFLAGS="$ga_hdf_save_LDFLAGS"
ga_hdf_h='no'
ga_hdf_save_CPPFLAGS="$CPPFLAGS"
if test "z$HDF_PATH_INC" != "z"; then
CPPFLAGS="$CPPFLAGS -I$HDF_PATH_INC"
fi
AC_CHECK_HEADERS([netcdf.h],
[ AC_CHECK_HEADER([mfhdf.h],
[ga_hdf_h='yes'],
[ga_hdf_h='no']
)
])
CPPFLAGS="$ga_hdf_save_CPPFLAGS"
GA_HDF_CPPFLAGS=
AS_IF([test "$ga_hdf_h" = 'yes' ],
[AS_IF([test "z$HDF_PATH_INC" != "z"], [GA_HDF_CPPFLAGS="-I$HDF_PATH_INC"])
])
if test "$ga_hdf_h" = "yes" -a "$ga_check_hdf" = "yes" ; then
m4_if([$1], [], [:], [$1])
else
m4_if([$2], [], [:], [$2])
fi
AC_SUBST([GA_HDF_LIBS])
AC_SUBST([GA_HDF_CPPFLAGS])
AC_SUBST([GA_HDF_LDFLAGS])
])
-------------- next part --------------
# Configure macros for Libdap
# Patrice Dumas 2005 based on freetype2.m4 from Marcelo Magallon 2001-10-26,
# based on gtk.m4 by Owen Taylor
# AC_CHECK_DODS is also based on code from gdal configure.in
# AC_CHECK_LIBDAP([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
# Test for Libdap and define DAP_CFLAGS and DAP_LIBS.
# Check that the version is above MINIMUM-VERSION
# use when linking with a c++ aware linker, with a c linker you may also
# need -lstdc++
AC_DEFUN([AC_CHECK_LIBDAP],
[
AC_PATH_PROG([DAP_CONFIG], [dap-config], [no])
dap_min_version=m4_if([$1], [], [3.5.0], [$1])
AC_MSG_CHECKING([for libdap version >= $dap_min_version])
dap_no=""
if test "$DAP_CONFIG" = "no" ; then
dap_no=yes
else
dap_config_major_version=`$DAP_CONFIG --version | sed 's/^libdap \([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$/\1/'`
dap_config_minor_version=`$DAP_CONFIG --version | sed 's/^libdap \([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$/\2/'`
dap_config_micro_version=`$DAP_CONFIG --version | sed 's/^libdap \([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$/\2/'`
dap_min_major_version=`echo $dap_min_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
dap_min_minor_version=`echo $dap_min_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
dap_min_micro_version=`echo $dap_min_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
dap_config_is_lt=""
if test $dap_config_major_version -lt $dap_min_major_version ; then
dap_config_is_lt=yes
else
if test $dap_config_major_version -eq $dap_min_major_version ; then
if test $dap_config_minor_version -lt $dap_min_minor_version ; then
dap_config_is_lt=yes
else
if test $dap_config_minor_version -eq $dap_min_minor_version ; then
if test $dap_config_micro_version -lt $dap_min_micro_version ; then
dap_config_is_lt=yes
fi
fi
fi
fi
fi
if test x$dap_config_is_lt = xyes ; then
dap_no=yes
else
DAP_LIBS="`$DAP_CONFIG --libs`"
DAP_CFLAGS="`$DAP_CONFIG --cflags`"
fi
fi
if test x$dap_no = x ; then
AC_MSG_RESULT([yes])
m4_if([$2], [], [:], [$2])
else
AC_MSG_RESULT([no])
if test "$DAP_CONFIG" = "no" ; then
AC_MSG_NOTICE([The dap-config script could not be found.])
else
if test x$dap_config_is_lt = xyes ; then
AC_MSG_NOTICE([the installed libdap library is too old.])
fi
fi
DAP_LIBS=""
DAP_CFLAGS=""
m4_if([$3], [], [:], [$3])
fi
AC_SUBST([DAP_CFLAGS])
AC_SUBST([DAP_LIBS])
])
# AC_CHECK_DODS([ ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
# Test for Libdap or older versions. Define DAP_CFLAGS and DAP_LIBS and
# optionnaly DAP_ROOT
AC_DEFUN([AC_CHECK_DODS],
[
AC_ARG_WITH(dods_root,
[ --with-dods-root[=ARG] DODS root fallback ],
,,)
ac_dods_ok='no'
AC_CHECK_LIBDAP([],[ac_dods_ok='yes'],[ac_dods_ok='no'])
if test "z$ac_dods_ok" = "zno" ; then
AC_PATH_PROG([OPENDAP_CONFIG], [opendap-config], [no])
AC_MSG_CHECKING([for libdap with opendap-config])
if test "$OPENDAP_CONFIG" = "no" ; then
ac_dods_ok='no'
AC_MSG_RESULT([no])
else
DAP_LIBS="`$OPENDAP_CONFIG --libs`"
DAP_CFLAGS="`$OPENDAP_CONFIG --cflags`"
ac_dods_ok='yes'
AC_MSG_RESULT([yes])
fi
fi
DAP_ROOT=
if test "z$ac_dods_ok" = "zno" ; then
AC_MSG_CHECKING(DODS specific root)
if test -z "$with_dods_root" -o "$with_dods_root" = "no"; then
AC_MSG_RESULT(disabled)
else
AC_MSG_RESULT([$with_dods_root])
DODS_ROOT=$with_dods_root
DODS_LIB=$with_dods_root/lib
DODS_INC=$with_dods_root/include
DODS_BIN=$with_dods_root/bin
dnl Add the DODS libraries to LIBS
if test -x $DODS_BIN/opendap-config ; then
dnl OPeNDAP 3.4 and earlier lack opendap-config, but use it if avail.
DAP_LIBS="`$DODS_BIN/opendap-config --libs`"
DAP_CFLAGS="`$DODS_BIN/opendap-config --cflags`"
ac_dods_ok='yes'
else
dnl Otherwise try to put things together in a more primitive way.
DAP_LIBS="-L$DODS_LIB -ldap++ -lpthread"
DAP_CFLAGS="-I$DODS_INC"
ac_dods_curl='yes'
dnl Add curl to LIBS; it might be local to DODS or generally installed
AC_MSG_CHECKING([For curl and libxml2])
if test -x $DODS_BIN/curl-config; then
DAP_LIBS="$DAP_LIBS `$DODS_BIN/curl-config --libs`"
elif which curl-config > /dev/null 2>&1; then
DAP_LIBS="$DAP_LIBS `curl-config --libs`"
else
AC_MSG_WARN([You gave a dods root, but I can't find curl!])
ac_dods_curl='no'
fi
ac_dods_xml2='yes'
if test -x $DODS_BIN/xml2-config; then
DAP_LIBS="$DAP_LIBS `$DODS_BIN/xml2-config --libs`"
elif which xml2-config > /dev/null 2>&1; then
DAP_LIBS="$DAP_LIBS `xml2-config --libs`"
else
AC_MSG_WARN([You gave a dods root, but I can't find xml2!])
ac_dods_xml2='no'
fi
AC_LANG_PUSH([C++])
if test $ac_dods_xml2 = 'yes' -a $ac_dods_curl = 'yes'; then
AC_MSG_RESULT([yes])
dnl We check that linking is succesfull
ac_save_LIBS="$LIBS"
ac_save_CFLAGS="$CFLAGS"
LIBS="$LIBS $DAP_LIBS"
CFLAGS="$CFLAGS $DAP_CFLAGS"
AC_MSG_NOTICE([Checking for DODS with curl and libxml2])
AC_CHECK_LIB([dap++],[main],[ac_dods_ok='yes'],[ac_dods_ok='no'])
LIBS=$ac_save_LIBS
CFLAGS=$ac_save_CFLAGS
if test "z$ac_dods_ok" = "zno"; then
DAP_LIBS="$DAP_LIBS -lrx"
ac_save_LIBS="$LIBS"
ac_save_CFLAGS="$CFLAGS"
LIBS="$LIBS $DAP_LIBS"
CFLAGS="$CFLAGS $DAP_CFLAGS"
AC_MSG_NOTICE([Checking for DODS with curl, libxml2 and librx])
AC_CHECK_LIB([dap++],[main],[ac_dods_ok='yes'],[ac_dods_ok='no'])
LIBS=$ac_save_LIBS
CFLAGS=$ac_save_CFLAGS
fi
else
AC_MSG_RESULT([no])
fi
if test $ac_dods_ok = 'no'; then
dnl assume it is an old version of DODS
AC_MSG_NOTICE([Checking for DODS with libwww and librx])
DAP_LIBS="-L$DODS_LIB -ldap++ -lwww -lpthread -lrx"
DAP_CFLAGS="-I$DODS_INC"
ac_save_LIBS="$LIBS"
ac_save_CFLAGS="$CFLAGS"
LIBS="$LIBS $DAP_LIBS"
CFLAGS="$CFLAGS $DAP_CFLAGS"
AC_CHECK_LIB([dap++],[main],[ac_dods_ok='yes'],[ac_dods_ok='no'])
LIBS=$ac_save_LIBS
CFLAGS=$ac_save_CFLAGS
fi
AC_LANG_POP
fi
AC_MSG_CHECKING([for DODS in a specific root])
if test "z$ac_dods_ok" = "zyes"; then
AC_MSG_RESULT([yes])
AC_MSG_NOTICE([setting DAP_ROOT directory to $DODS_ROOT])
DAP_ROOT="$DODS_ROOT"
else
AC_MSG_RESULT([no])
fi
fi
fi
if test "x$ac_dods_ok" = "xyes" ; then
m4_if([$1], [], [:], [$1])
else
DAP_LIBS=""
DAP_CFLAGS=""
m4_if([$2], [], [:], [$2])
fi
AC_SUBST([DAP_CFLAGS])
AC_SUBST([DAP_LIBS])
AC_SUBST([DAP_ROOT])
])
-------------- next part --------------
# 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
# 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
AC_DEFUN([AC_CHECK_LIBNC_DAP],
[
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=""
if test "$NC_DAP_CONFIG" = "no" ; then
ncdap_no=yes
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/'`
ncdap_config_micro_version=`$NC_DAP_CONFIG --version | sed 's/^libnc-dap \([[0-9]]\)*\.\([[0-9]]*\)\.\([[0-9]]*\)$/\2/'`
ncdap_min_major_version=`echo $ncdap_min_version | sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
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=""
if test $ncdap_config_major_version -lt $ncdap_min_major_version ; then
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
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
fi
fi
fi
fi
fi
if test x$ncdap_config_is_lt = xyes ; then
ncdap_no=yes
else
NC_DAP_LIBS="`$NC_DAP_CONFIG --libs`"
NC_DAP_CFLAGS="`$NC_DAP_CONFIG --cflags`"
fi
fi
if test x$ncdap_no = x ; then
AC_MSG_RESULT([yes])
m4_if([$2], [], [:], [$2])
else
AC_MSG_RESULT([no])
if test "$NC_DAP_CONFIG" = "no" ; then
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.])
fi
fi
NC_DAP_LIBS=""
NC_DAP_CFLAGS=""
m4_if([$3], [], [:], [$3])
fi
AC_SUBST([NC_DAP_CFLAGS])
AC_SUBST([NC_DAP_LIBS])
])
# AC_FC_CHECK_LIBNC_DAP([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
# Test for Libnc-dap and define NC_DAP_FFLAGS and NC_DAP_FLIBS with flags
# for fortran.
# Check that the version is above MINIMUM-VERSION
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"])
if test $libnc_fc_dap_ok = "yes"; then
NC_DAP_FLIBS="`$NC_DAP_CONFIG --flibs`"
NC_DAP_FFLAGS="$NC_DAP_CFLAGS"
m4_if([$2], [], [:], [$2])
else
m4_if([$3], [], [:], [$3])
NC_DAP_FLIBS=""
NC_DAP_FFLAGS=""
fi
AC_SUBST([NC_DAP_FFLAGS])
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
AC_DEFUN([AC_CHECK_NC_DODS],
[
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])
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="-lnc-dods $DAP_LIBS -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
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])
AC_SUBST([NC_DAP_LIBS])
])
-------------- next part --------------
dnl GA_CHECK_XAW : Check for Xaw
dnl args : action-if-yes, action-if-no
AC_DEFUN([GA_CHECK_XAW],
[
AC_REQUIRE([AC_PATH_XTRA])
GA_XAW_LIBS=
ac_save_LIBS="$LIBS"
ac_save_CFLAGS="$CFLAGS"
LIBS="$LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"
CFLAGS="$CFLAGS $X_CFLAGS"
ga_use_xaw='no'
AC_CHECK_LIB([Xt],[main],
[ AC_CHECK_LIB([Xaw],[main],
[ AC_CHECK_LIB([Xmu],[main],
[
ga_use_xaw='yes'
GA_XAW_LIBS="-lXaw -lXmu -lXt"
])
])
])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
if test "z$ga_use_xaw" = "zyes"; then
m4_if([$1], [], [:], [$1])
else
m4_if([$2], [], [:], [$2])
fi
AC_SUBST([GA_XAW_LIBS])
])
dnl GA_CHECK_LIBSX : Checks whether GrADS can be built with libsx
dnl enabled.
dnl args : action-if-yes, action-if-no
AC_DEFUN([GA_CHECK_LIBSX],
[
# Check libs and headers for GUI widgets
GA_LIBSX_LIBS=
ac_save_LIBS="$LIBS"
ac_save_CFLAGS="$CFLAGS"
LIBS="$LIBS $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS"
CFLAGS="$CFLAGS $X_CFLAGS"
ga_use_libsx='no'
ga_libsx_header='no'
ga_libsx_freq_header='no'
GA_CHECK_XAW([ga_xaw_found='yes'],[ga_xaw_found='no'])
if test "z$ga_xaw_found" = "zyes"; then
LIBS="$LIBS $GA_XAW_LIBS"
AC_CHECK_HEADER([libsx.h],
[ AC_CHECK_HEADER([freq.h],
[
ga_libsx_freq_header='yes'
])
ga_libsx_header='yes'
])
if test "z$ga_libsx_header" = "zyes"; then
if test "z$ga_libsx_freq_header" = "zyes"; then
AC_CHECK_LIB([freq],[main],
[ AC_CHECK_LIB([sx],[GetFile],
[ ga_use_libsx='freq'
GA_LIBSX_LIBS="-lsx -lfreq $GA_XAW_LIBS"
])
])
fi
if test "z$ga_use_libsx" = "zno"; then
AC_CHECK_LIB([sx],[GetFile],
[ ga_use_libsx='yes'
GA_LIBSX_LIBS="-lsx $GA_XAW_LIBS"
])
fi
fi
fi
if test "z$ga_use_libsx" = "zfreq" ; then
m4_if([$1], [], [:], [$1])
else
if test "z$ga_use_libsx" = "zyes" ; then
m4_if([$2], [], [:], [$2])
else
m4_if([$3], [], [:], [$3])
fi
fi
AC_SUBST([GA_LIBSX_LIBS])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
])
-------------- 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_include],
[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"
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']
)
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])]
)
])
-------------- next part --------------
dnl GA_CHECK_UDUNITS : Check for udunits
dnl args : action-if-yes, action-if-no
AC_DEFUN([GA_CHECK_UDUNITS],
[
ga_use_udunits='no'
AC_CHECK_HEADER([udunits.h],
[ AC_CHECK_LIB([udunits],[utInit],
[ ga_use_udunits='yes'
GA_UDUNITS_LIBS='-ludunits'
])
])
if test "z$ga_use_udunits" = "zyes" ; then
m4_if([$1], [], [:], [$1])
else
m4_if([$2], [], [:], [$2])
fi
AC_SUBST([GA_UDUNITS_LIBS])
])
More information about the gradsusr
mailing list