Commit 76f2929e authored by Sergey Kosukhin's avatar Sergey Kosukhin
Browse files

Omit redundant preprocessor checks when checking for header files at the configure time.

parent 321b8d58
......@@ -66,9 +66,7 @@ AC_FUNC_MMAP
AC_CHECK_MEMBERS([struct stat.st_blksize])
# ----------------------------------------------------------------------
# Checks for header files
AC_CHECK_HEADERS([malloc.h])
AC_CHECK_HEADERS([unistd.h])
AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS([malloc.h unistd.h sys/time.h],,,[AC_INCLUDES_DEFAULT])
AX_EXECINFO
# ----------------------------------------------------------------------
# Checks for the availability of functions
......@@ -219,8 +217,7 @@ main(int argc, char **argv)
[HAVE_PARALLEL_NC4=1],
[AC_MSG_WARN([The supplied netCDF library does not support MPI parallel invocations])],
[AC_INCLUDES_DEFAULT
@%:@include <netcdf.h>])
])
@%:@include <netcdf.h>])], [AC_INCLUDES_DEFAULT])
dnl parallel netCDF support still requires ScalES-PPM and YAXT to
dnl re-arrange the data when running with more than one collector
PKG_CHECK_MODULES([PPM_CORE],[scales-ppm-core],
......@@ -302,7 +299,7 @@ AC_ARG_ENABLE([ruby],
CPPFLAGS="$CPPFLAGS $RUBY_INCLUDES"
AC_CHECK_HEADER([ruby.h],,[enable_ruby=no
RUBY=
])
], [AC_INCLUDES_DEFAULT])
CPPFLAGS=$save_CPPFLAGS
AS_IF([test "x$RUBY" != "x"],
[AS_IF([test "x$SWIG" = "x"],
......@@ -327,7 +324,7 @@ AC_ARG_ENABLE(python,
save_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
AC_CHECK_HEADER([Python.h],[enable_python=yes
break])
break],,[AC_INCLUDES_DEFAULT])
CPPFLAGS=$save_CPPFLAGS
done
AS_IF([test "x$enable_python" != "xno"],
......
......@@ -33,7 +33,7 @@
#serial 1
AC_DEFUN([AX_EXECINFO],
[AC_CHECK_HEADERS([execinfo.h])
[AC_CHECK_HEADERS([execinfo.h], [], [], [AC_INCLUDES_DEFAULT])
AS_IF([test x"$ac_cv_header_execinfo_h" = xyes],
[AC_CACHE_CHECK([size parameter type for backtrace()],
[ax_cv_proto_backtrace_type],
......
......@@ -20,7 +20,7 @@ AS_CASE([$with_threads],
[*],[THREADS_ROOT=$with_threads
LDFLAGS="-L$THREADS_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$THREADS_ROOT/include $CPPFLAGS "
AC_CHECK_HEADERS(pthread.h)
AC_CHECK_HEADERS([pthread.h],,,[AC_INCLUDES_DEFAULT])
AC_CHECK_LIB([pthread],[pthread_create])
THREADS_LIBS=" -L$THREADS_ROOT/lib -lpthread"
THREADS_INCLUDE=" -I$THREADS_ROOT/include"])
......@@ -35,7 +35,7 @@ AC_ARG_WITH([szlib],
[AS_CASE(["$with_szlib"],
[no],[AC_MSG_CHECKING([for szlib library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS(szlib.h)
[yes],[AC_CHECK_HEADERS([szlib.h],,,[AC_INCLUDES_DEFAULT])
AC_SEARCH_LIBS([SZ_BufftoBuffCompress],
[sz],
[AC_DEFINE([HAVE_LIBSZ],[1],[Define to 1 for SZIP support])],
......@@ -45,7 +45,7 @@ AC_ARG_WITH([szlib],
AS_IF([test -d "$SZLIB_ROOT"],
[LDFLAGS="-L$SZLIB_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$SZLIB_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS(szlib.h)
AC_CHECK_HEADERS([szlib.h],,,[AC_INCLUDES_DEFAULT])
AC_SEARCH_LIBS([SZ_BufftoBuffCompress],
[sz],
[AC_DEFINE([HAVE_LIBSZ],[1],[Define to 1 for SZIP support])],
......@@ -72,7 +72,8 @@ AC_ARG_WITH([netcdf],
[no],[AC_MSG_CHECKING([for NetCDF library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS([netcdf.h],,
[AC_MSG_ERROR([Could not find netcdf.h])])
[AC_MSG_ERROR([Could not find netcdf.h])],
[AC_INCLUDES_DEFAULT])
AC_SEARCH_LIBS([nc_open],
[netcdf],
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NetCDF support])
......@@ -85,7 +86,8 @@ AC_ARG_WITH([netcdf],
LDFLAGS="-L$NETCDF_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$NETCDF_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS([netcdf.h],,
[AC_MSG_ERROR([Could not find netcdf.h])])
[AC_MSG_ERROR([Could not find netcdf.h])],
[AC_INCLUDES_DEFAULT])
AC_SEARCH_LIBS([nc_open],
[netcdf],
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NetCDF support])
......@@ -166,7 +168,7 @@ AC_ARG_WITH([eccodes],
[AS_CASE(["$with_eccodes"],
[no],[AC_MSG_CHECKING([for ECCODES library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS([grib_api.h])
[yes],[AC_CHECK_HEADERS([grib_api.h],,,[AC_INCLUDES_DEFAULT])
AC_SEARCH_LIBS([grib_get_message],
[eccodes],
[AC_DEFINE([HAVE_LIBGRIB_API],[1],[ECCODES library is present if defined to 1])],
......@@ -175,7 +177,7 @@ AC_ARG_WITH([eccodes],
AS_IF([test -d "$ECCODES_ROOT"],
[LDFLAGS="-L$ECCODES_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$ECCODES_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS([grib_api.h])
AC_CHECK_HEADERS([grib_api.h],,,[AC_INCLUDES_DEFAULT])
AC_SEARCH_LIBS([grib_get_message],
[eccodes],
[AC_DEFINE([HAVE_LIBGRIB_API],[1],[ECCODES library is present if defined to 1])],
......@@ -198,7 +200,7 @@ AC_ARG_WITH([grib_api],
[AS_CASE(["$with_grib_api"],
[no],[AC_MSG_CHECKING([for GRIB_API library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS([grib_api.h])
[yes],[AC_CHECK_HEADERS([grib_api.h],,,[AC_INCLUDES_DEFAULT])
AC_SEARCH_LIBS([grib_get_message],
[grib_api],
[AC_DEFINE([HAVE_LIBGRIB_API],[1],[GRIB_API library is present if defined to 1])],
......@@ -207,7 +209,7 @@ AC_ARG_WITH([grib_api],
AS_IF([test -d "$GRIB_API_ROOT"],
[LDFLAGS="-L$GRIB_API_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$GRIB_API_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS([grib_api.h])
AC_CHECK_HEADERS([grib_api.h],,,[AC_INCLUDES_DEFAULT])
AC_SEARCH_LIBS([grib_get_message],
[grib_api],
[AC_DEFINE([HAVE_LIBGRIB_API],[1],[GRIB_API library is present if defined to 1])],
......
......@@ -114,7 +114,7 @@ AC_DEFUN([ACX_UUID],
AC_CHECK_HEADERS([uuid/uuid.h],
[AC_CHECK_DECLS([uuid_generate],,
[have_util_linux_uuid_c_bindings=no],[AC_INCLUDES_DEFAULT
@%:@include <uuid/uuid.h>])],[have_util_linux_uuid_c_bindings=no])
@%:@include <uuid/uuid.h>])],[have_util_linux_uuid_c_bindings=no],[AC_INCLUDES_DEFAULT])
CPPFLAGS=$acx_save_CPPFLAGS])],
[have_util_linux_uuid_c_bindings=no])
AS_IF([test x"$enable_ossp_uuid" != xno -a x"$have_util_linux_uuid_c_bindings" = xno],
......@@ -146,7 +146,7 @@ AC_INCLUDES_DEFAULT])
[AC_CHECK_DECLS([uuid_create],
[have_dce_uuid_c_bindings=yes],
[have_dce_uuid_c_bindings=no],[AC_INCLUDES_DEFAULT
@%:@include <uuid.h>])],[have_dce_uuid_c_bindings=yes])
@%:@include <uuid.h>])],[have_dce_uuid_c_bindings=yes], [AC_INCLUDES_DEFAULT])
CPPFLAGS=$acx_save_CPPFLAGS])])
AS_IF([test x"$have_util_linux_uuid_c_bindings" = xyes],
......
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