Commit 5c1c8b46 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Check udunits2 before cmor.

parent 4c1a4db8
......@@ -640,8 +640,6 @@ XML2_LIBS
MAGICS_INCLUDE
MAGICS_ROOT
MAGICS_LIBS
UDUNITS_INCLUDE
UDUNITS_LDFLAGS
CURL_INCLUDE
CURL_LDFLAGS
PROJ_INCLUDE
......@@ -655,6 +653,8 @@ ENABLE_GRIBAPI
GRIB_API_LIBS
GRIB_API_INCLUDE
CMOR_LIBS
UDUNITS_INCLUDE
UDUNITS_LDFLAGS
NETCDF_LIBS
NETCDF_INCLUDE
NETCDF_ROOT
......@@ -823,6 +823,7 @@ with_threads
with_szlib
with_hdf5
with_netcdf
with_udunits2
with_cmor
with_grib_api
enable_grib
......@@ -833,7 +834,6 @@ enable_ieg
with_fftw3
with_proj
with_curl
with_udunits2
with_magics
with_libxml2
enable_cdi_lib
......@@ -1518,6 +1518,8 @@ Optional Packages:
location of HDF5 library
--with-netcdf=<yes|no|directory> (default=no)
location of NetCDF library (lib and include subdirs)
--with-udunits2=<directory>
Specify location of UDUNITS2 library.
--with-cmor=<directory> Specify location of CMOR library.
--with-grib_api=<yes|no|directory> (default=no)
location of GRIB_API library (lib and include
......@@ -1526,8 +1528,6 @@ Optional Packages:
--with-proj=<directory> Specify location of PROJ library for cartographic
projections.
--with-curl=<directory> Specify location of CURL library.
--with-udunits2=<directory>
Specify location of UDUNITS2 library.
--with-magics=<yes|no|directory>
location of magics library (lib and include subdirs)
--with-libxml2=<yes|no|directory>
......@@ -19242,6 +19242,200 @@ fi
 
 
 
# ----------------------------------------------------------------------
# Link application with UDUNITS2 library
# Check whether --with-udunits2 was given.
if test "${with_udunits2+set}" = set; then :
withval=$with_udunits2; case "$with_udunits2" in #(
no) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for udunits2 library" >&5
$as_echo_n "checking for udunits2 library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
$as_echo "suppressed" >&6; } ;; #(
yes) :
for ac_header in udunits2.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "udunits2.h" "ac_cv_header_udunits2_h" "$ac_includes_default"
if test "x$ac_cv_header_udunits2_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_UDUNITS2_H 1
_ACEOF
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ut_parse" >&5
$as_echo_n "checking for library containing ut_parse... " >&6; }
if ${ac_cv_search_ut_parse+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char ut_parse ();
int
main ()
{
return ut_parse ();
;
return 0;
}
_ACEOF
for ac_lib in '' udunits2; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_ut_parse=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_ut_parse+:} false; then :
break
fi
done
if ${ac_cv_search_ut_parse+:} false; then :
else
ac_cv_search_ut_parse=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ut_parse" >&5
$as_echo "$ac_cv_search_ut_parse" >&6; }
ac_res=$ac_cv_search_ut_parse
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_LIBUDUNITS2 1" >>confdefs.h
else
as_fn_error $? "Could not link to udunits2 library!" "$LINENO" 5
fi
UDUNITS_LDFLAGS=" -ludunits2"
UDUNITS_INCLUDE=""
;; #(
*) :
UDUNITS_ROOT=$with_udunits2
if test -d "$UDUNITS_ROOT"; then :
LDFLAGS="$LDFLAGS -L$UDUNITS_ROOT/lib"
CPPFLAGS="$CPPFLAGS -I$UDUNITS_ROOT/include"
for ac_header in udunits2.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "udunits2.h" "ac_cv_header_udunits2_h" "$ac_includes_default"
if test "x$ac_cv_header_udunits2_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_UDUNITS2_H 1
_ACEOF
fi
done
for ac_header in udunits2/udunits2.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "udunits2/udunits2.h" "ac_cv_header_udunits2_udunits2_h" "$ac_includes_default"
if test "x$ac_cv_header_udunits2_udunits2_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_UDUNITS2_UDUNITS2_H 1
_ACEOF
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ut_parse" >&5
$as_echo_n "checking for library containing ut_parse... " >&6; }
if ${ac_cv_search_ut_parse+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char ut_parse ();
int
main ()
{
return ut_parse ();
;
return 0;
}
_ACEOF
for ac_lib in '' udunits2; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_ut_parse=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_ut_parse+:} false; then :
break
fi
done
if ${ac_cv_search_ut_parse+:} false; then :
else
ac_cv_search_ut_parse=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ut_parse" >&5
$as_echo "$ac_cv_search_ut_parse" >&6; }
ac_res=$ac_cv_search_ut_parse
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_LIBUDUNITS2 1" >>confdefs.h
else
as_fn_error $? "Could not link to udunits2 library!" "$LINENO" 5
fi
UDUNITS_LDFLAGS=" -L$UDUNITS_ROOT/lib -ludunits2"
UDUNITS_INCLUDE=" -I$UDUNITS_ROOT/include"
else
as_fn_error $? "$UDUNITS_ROOT is not a directory! UDUNITS2 suppressed" "$LINENO" 5
fi ;; #(
*) :
;;
esac
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the UDUNITS2 library" >&5
$as_echo_n "checking for the UDUNITS2 library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
$as_echo "suppressed" >&6; }
fi
# ----------------------------------------------------------------------
# Link application with CMOR library
CMOR_LIBS=''
......@@ -20161,200 +20355,6 @@ $as_echo_n "checking for the CURL library... " >&6; }
$as_echo "suppressed" >&6; }
fi
 
# ----------------------------------------------------------------------
# Link application with UDUNITS2 library
# Check whether --with-udunits2 was given.
if test "${with_udunits2+set}" = set; then :
withval=$with_udunits2; case "$with_udunits2" in #(
no) :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for udunits2 library" >&5
$as_echo_n "checking for udunits2 library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
$as_echo "suppressed" >&6; } ;; #(
yes) :
for ac_header in udunits2.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "udunits2.h" "ac_cv_header_udunits2_h" "$ac_includes_default"
if test "x$ac_cv_header_udunits2_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_UDUNITS2_H 1
_ACEOF
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ut_parse" >&5
$as_echo_n "checking for library containing ut_parse... " >&6; }
if ${ac_cv_search_ut_parse+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char ut_parse ();
int
main ()
{
return ut_parse ();
;
return 0;
}
_ACEOF
for ac_lib in '' udunits2; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_ut_parse=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_ut_parse+:} false; then :
break
fi
done
if ${ac_cv_search_ut_parse+:} false; then :
else
ac_cv_search_ut_parse=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ut_parse" >&5
$as_echo "$ac_cv_search_ut_parse" >&6; }
ac_res=$ac_cv_search_ut_parse
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_LIBUDUNITS2 1" >>confdefs.h
else
as_fn_error $? "Could not link to udunits2 library!" "$LINENO" 5
fi
UDUNITS_LDFLAGS=" -ludunits2"
UDUNITS_INCLUDE=""
;; #(
*) :
UDUNITS_ROOT=$with_udunits2
if test -d "$UDUNITS_ROOT"; then :
LDFLAGS="$LDFLAGS -L$UDUNITS_ROOT/lib"
CPPFLAGS="$CPPFLAGS -I$UDUNITS_ROOT/include"
for ac_header in udunits2.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "udunits2.h" "ac_cv_header_udunits2_h" "$ac_includes_default"
if test "x$ac_cv_header_udunits2_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_UDUNITS2_H 1
_ACEOF
fi
done
for ac_header in udunits2/udunits2.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "udunits2/udunits2.h" "ac_cv_header_udunits2_udunits2_h" "$ac_includes_default"
if test "x$ac_cv_header_udunits2_udunits2_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_UDUNITS2_UDUNITS2_H 1
_ACEOF
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ut_parse" >&5
$as_echo_n "checking for library containing ut_parse... " >&6; }
if ${ac_cv_search_ut_parse+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$LIBS
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char ut_parse ();
int
main ()
{
return ut_parse ();
;
return 0;
}
_ACEOF
for ac_lib in '' udunits2; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_ut_parse=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_ut_parse+:} false; then :
break
fi
done
if ${ac_cv_search_ut_parse+:} false; then :
else
ac_cv_search_ut_parse=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ut_parse" >&5
$as_echo "$ac_cv_search_ut_parse" >&6; }
ac_res=$ac_cv_search_ut_parse
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
$as_echo "#define HAVE_LIBUDUNITS2 1" >>confdefs.h
else
as_fn_error $? "Could not link to udunits2 library!" "$LINENO" 5
fi
UDUNITS_LDFLAGS=" -L$UDUNITS_ROOT/lib -ludunits2"
UDUNITS_INCLUDE=" -I$UDUNITS_ROOT/include"
else
as_fn_error $? "$UDUNITS_ROOT is not a directory! UDUNITS2 suppressed" "$LINENO" 5
fi ;; #(
*) :
;;
esac
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for the UDUNITS2 library" >&5
$as_echo_n "checking for the UDUNITS2 library... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
$as_echo "suppressed" >&6; }
fi
# ----------------------------------------------------------------------
# Compile application with MAGICS (xml required)
MAGICS_ROOT=''
......
......@@ -200,6 +200,36 @@ AC_SUBST([NETCDF_ROOT])
AC_SUBST([NETCDF_INCLUDE])
AC_SUBST([NETCDF_LIBS])
# ----------------------------------------------------------------------
# Link application with UDUNITS2 library
AC_ARG_WITH([udunits2],
[AS_HELP_STRING([--with-udunits2=<directory>],
[Specify location of UDUNITS2 library.])],
[AS_CASE(["$with_udunits2"],
[no],[AC_MSG_CHECKING([for udunits2 library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS([udunits2.h])
AC_SEARCH_LIBS([ut_parse],
[udunits2],
[AC_DEFINE([HAVE_LIBUDUNITS2],[1],[Define to 1 for UDUNITS2 support])],
[AC_MSG_ERROR([Could not link to udunits2 library!])])
AC_SUBST([UDUNITS_LDFLAGS],[" -ludunits2"])
AC_SUBST([UDUNITS_INCLUDE],[""])],
[*],[UDUNITS_ROOT=$with_udunits2
AS_IF([test -d "$UDUNITS_ROOT"],
[LDFLAGS="$LDFLAGS -L$UDUNITS_ROOT/lib"
CPPFLAGS="$CPPFLAGS -I$UDUNITS_ROOT/include"
AC_CHECK_HEADERS([udunits2.h])
AC_CHECK_HEADERS([udunits2/udunits2.h])
AC_SEARCH_LIBS([ut_parse],
[udunits2],
[AC_DEFINE([HAVE_LIBUDUNITS2],[1],[Define to 1 for UDUNITS2 support])],
[AC_MSG_ERROR([Could not link to udunits2 library!])])
AC_SUBST([UDUNITS_LDFLAGS],[" -L$UDUNITS_ROOT/lib -ludunits2"])
AC_SUBST([UDUNITS_INCLUDE],[" -I$UDUNITS_ROOT/include"])],
[AC_MSG_ERROR([$UDUNITS_ROOT is not a directory! UDUNITS2 suppressed])])])],
[AC_MSG_CHECKING([for the UDUNITS2 library])
AC_MSG_RESULT([suppressed])])
# ----------------------------------------------------------------------
# Link application with CMOR library
CMOR_LIBS=''
AC_ARG_WITH([cmor],
......@@ -389,36 +419,6 @@ AC_ARG_WITH([curl],
[AC_MSG_CHECKING([for the CURL library])
AC_MSG_RESULT([suppressed])])
# ----------------------------------------------------------------------
# Link application with UDUNITS2 library
AC_ARG_WITH([udunits2],
[AS_HELP_STRING([--with-udunits2=<directory>],
[Specify location of UDUNITS2 library.])],
[AS_CASE(["$with_udunits2"],
[no],[AC_MSG_CHECKING([for udunits2 library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS([udunits2.h])
AC_SEARCH_LIBS([ut_parse],
[udunits2],
[AC_DEFINE([HAVE_LIBUDUNITS2],[1],[Define to 1 for UDUNITS2 support])],
[AC_MSG_ERROR([Could not link to udunits2 library!])])
AC_SUBST([UDUNITS_LDFLAGS],[" -ludunits2"])
AC_SUBST([UDUNITS_INCLUDE],[""])],
[*],[UDUNITS_ROOT=$with_udunits2
AS_IF([test -d "$UDUNITS_ROOT"],
[LDFLAGS="$LDFLAGS -L$UDUNITS_ROOT/lib"
CPPFLAGS="$CPPFLAGS -I$UDUNITS_ROOT/include"
AC_CHECK_HEADERS([udunits2.h])
AC_CHECK_HEADERS([udunits2/udunits2.h])
AC_SEARCH_LIBS([ut_parse],
[udunits2],
[AC_DEFINE([HAVE_LIBUDUNITS2],[1],[Define to 1 for UDUNITS2 support])],
[AC_MSG_ERROR([Could not link to udunits2 library!])])
AC_SUBST([UDUNITS_LDFLAGS],[" -L$UDUNITS_ROOT/lib -ludunits2"])
AC_SUBST([UDUNITS_INCLUDE],[" -I$UDUNITS_ROOT/include"])],
[AC_MSG_ERROR([$UDUNITS_ROOT is not a directory! UDUNITS2 suppressed])])])],
[AC_MSG_CHECKING([for the UDUNITS2 library])
AC_MSG_RESULT([suppressed])])
# ----------------------------------------------------------------------
# Compile application with MAGICS (xml required)
MAGICS_ROOT=''
MAGICS_INCLUDE=''
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment