Commit 1517dee4 authored by Ralf Mueller's avatar Ralf Mueller
Browse files

simplify configuration (refs #949)

parent 64e59708
......@@ -11,7 +11,7 @@ endif
noinst_PROGRAMS += createtable
#
cdi_SOURCES = cdi.c printinfo.h
cdi_LDADD = $(top_builddir)/src/libcdi.la
cdi_LDADD = $(top_builddir)/src/libcdi.la @LIBS@
if ENABLE_ALL_STATIC
cdi_LDFLAGS = -all-static
endif
......
......@@ -246,7 +246,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
#
cdi_SOURCES = cdi.c printinfo.h
cdi_LDADD = $(top_builddir)/src/libcdi.la
cdi_LDADD = $(top_builddir)/src/libcdi.la @LIBS@
@ENABLE_ALL_STATIC_TRUE@cdi_LDFLAGS = -all-static
#
createtable_SOURCES = createtable.c
......
......@@ -22504,9 +22504,6 @@ fi
;; #(
*) :
ZLIB_ROOT=$with_zlib
LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$ZLIB_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$ZLIB_ROOT/include $CPPFLAGS"
for ac_header in zlib.h
......@@ -22579,9 +22576,6 @@ $as_echo "#define HAVE_LIBZ 1" >>confdefs.h
 
fi
 
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
ZLIB_INCLUDE=" -I$ZLIB_ROOT/include"
 
ZLIB_LDFLAGS=" -L$ZLIB_ROOT/lib -lz"
......@@ -22755,10 +22749,7 @@ fi
*) :
SZLIB_ROOT=$with_szlib
if test -d "$SZLIB_ROOT"; then :
LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$SZLIB_ROOT/lib $LDFLAGS"
LDFLAGS="-L$SZLIB_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$SZLIB_ROOT/include $CPPFLAGS"
for ac_header in szlib.h
do :
......@@ -22832,9 +22823,6 @@ else
as_fn_error $? "Could not link to szlib" "$LINENO" 5
fi
 
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
SZLIB_LDFLAGS=" -L$SZLIB_ROOT/lib -lsz"
 
SZLIB_INCLUDE=" -I$SZLIB_ROOT/include"
......@@ -23009,10 +22997,7 @@ fi
*) :
HDF5_ROOT=$with_hdf5
if test -d "$HDF5_ROOT"; then :
LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$HDF5_ROOT/lib $LDFLAGS"
LDFLAGS="-L$HDF5_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$HDF5_ROOT/include $CPPFLAGS"
for ac_header in hdf5.h
do :
......@@ -23152,9 +23137,6 @@ $as_echo "$as_me: Cannot link to hdf5 high level interface! It is required for n
have_hdf5_hl=no
fi
 
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
if test "x$have_libhdf5_hl" = 'xyes'; then :
HDF5_LDFLAGS=" -L$HDF5_ROOT/lib -lhdf5_hl -lhdf5"
 
......@@ -23269,10 +23251,7 @@ fi
*) :
NETCDF_ROOT=$with_netcdf
if test -d "$NETCDF_ROOT"; then :
LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$NETCDF_ROOT/lib $LDFLAGS"
LDFLAGS="-L$NETCDF_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$NETCDF_ROOT/include $CPPFLAGS"
for ac_header in netcdf.h
do :
......@@ -23346,9 +23325,6 @@ else
as_fn_error $? "Could not link to netcdf library" "$LINENO" 5
fi
 
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
NETCDF_LDFLAGS=" -L$NETCDF_ROOT/lib -lnetcdf"
 
NETCDF_INCLUDE=" -I$NETCDF_ROOT/include"
......
......@@ -36,16 +36,10 @@ AC_ARG_WITH([zlib],
AC_SUBST([ZLIB_INCLUDE],[])
AC_SUBST([ZLIB_LDFLAGS],[" -lz"])],
[*],[ZLIB_ROOT=$with_zlib
LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$ZLIB_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$ZLIB_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS(zlib.h)
AC_SEARCH_LIBS([deflate],[z],[AC_DEFINE([HAVE_LIBZ],[1],[Define 1 for ZLIB support])])
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
AC_SUBST([ZLIB_INCLUDE],[" -I$ZLIB_ROOT/include"])
AC_SUBST([ZLIB_LDFLAGS],[" -L$ZLIB_ROOT/lib -lz"])])],
[AC_CHECK_HEADERS(zlib.h)
......@@ -67,19 +61,13 @@ AC_ARG_WITH([szlib],
AC_SUBST([SZLIB_INCLUDE],[""])],
[*],[SZLIB_ROOT=$with_szlib
AS_IF([test -d "$SZLIB_ROOT"],
[LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$SZLIB_ROOT/lib $LDFLAGS"
[LDFLAGS="-L$SZLIB_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$SZLIB_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS(szlib.h)
AC_SEARCH_LIBS([SZ_BufftoBuffCompress],
[sz],
[AC_DEFINE([HAVE_LIBSZ],[1],[Define to 1 for SZIP support])],
[AC_MSG_ERROR([Could not link to szlib])])
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
AC_SUBST([SZLIB_LDFLAGS],[" -L$SZLIB_ROOT/lib -lsz"])
AC_SUBST([SZLIB_INCLUDE],[" -I$SZLIB_ROOT/include"])],
[AC_MSG_NOTICE([$SZLIB_ROOT is not a directory! SZLIB suppressed])])])],
......@@ -108,10 +96,7 @@ AC_ARG_WITH([hdf5],
AC_SUBST([HDF5_INCLUDE],[""])],
[*],[HDF5_ROOT=$with_hdf5
AS_IF([test -d "$HDF5_ROOT"],
[LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$HDF5_ROOT/lib $LDFLAGS"
[LDFLAGS="-L$HDF5_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$HDF5_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS([hdf5.h])
AC_SEARCH_LIBS([H5Fopen],
......@@ -126,9 +111,6 @@ AC_ARG_WITH([hdf5],
--with-zlib option. If HDF5 was also built with szlib, then the location of szlib must also be \
specified with the --with-szlib option..])
have_hdf5_hl=no])
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
AS_IF([test "x$have_libhdf5_hl" = 'xyes'],
[AC_SUBST([HDF5_LDFLAGS],[" -L$HDF5_ROOT/lib -lhdf5_hl -lhdf5"])],
[AC_SUBST([HDF5_LDFLAGS],[" -L$HDF5_ROOT/lib -lhdf5"])])
......@@ -152,19 +134,13 @@ AC_ARG_WITH([netcdf],
AC_SUBST([NETCDF_INCLUDE],[""])],
[*],[NETCDF_ROOT=$with_netcdf
AS_IF([test -d "$NETCDF_ROOT"],
[LDFLAGS_org="$LDFLAGS"
CPPFLAGS_org="$CPPFLAGS"
LIBS_org="$LIBS"
LDFLAGS="-L$NETCDF_ROOT/lib $LDFLAGS"
[LDFLAGS="-L$NETCDF_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$NETCDF_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS([netcdf.h])
AC_SEARCH_LIBS([nc_open],
[netcdf],
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NETCDF support])],
[AC_MSG_ERROR([Could not link to netcdf library])])
LDFLAGS="$LDFLAGS_org"
CPPFLAGS="$CPPFLAGS_org"
LIBS="$LIBS_org"
AC_SUBST([NETCDF_LDFLAGS],[" -L$NETCDF_ROOT/lib -lnetcdf"])
AC_SUBST([NETCDF_INCLUDE],[" -I$NETCDF_ROOT/include"])],
[AC_MSG_NOTICE([$NETCDF_ROOT is not a directory! NETCDF suppressed])])])],
......
......@@ -91,8 +91,8 @@ libcdi_la_SOURCES = \
stream.c \
swap.c
libcdi_la_CPPFLAGS = @GRIB_API_INCLUDE@ @SZLIB_INCLUDE@ @HDF5_INCLUDE@ @NETCDF_INCLUDE@ @ZLIB_INCLUDE@
libcdi_la_LIBADD = @GRIB_API_LDFLAGS@ @SZLIB_LDFLAGS@ @HDF5_LDFLAGS@ @NETCDF_LDFLAGS@ @ZLIB_LDFLAGS@
#libcdi_la_CPPFLAGS = @CPPFLAGS@
#libcdi_la_LIBADD = @LDFLAGS@
#
cdilib.c:
$(top_srcdir)/src/make_cdilib $(top_srcdir)/src
......
This diff is collapsed.
Supports Markdown
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