configure 117 KB
Newer Older
  ;
  return 0;
}
_ACEOF
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
  CC="$ac_save_CC $ac_arg"
  if ac_fn_c_try_compile "$LINENO"; then :
  ac_cv_prog_cc_c89=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext
  test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC

fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
  x)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
  xno)
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
  *)
    CC="$CC $ac_cv_prog_cc_c89"
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :

fi

ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu

		if test "z$GCC" = zyes; then
			R_IS_GCC=1
		fi
	fi
	R_IS_CLANG=0
	if echo "$R_CC_ARG1" | grep -q "clang"; then
		R_IS_CLANG=1
	fi

	#-------------------------------------------------------------
	# We don't bother emitting the warning if the two compilers in
	# use are clang and gcc -- supposedly they are compatible
	#-------------------------------------------------------------
	if test $NETCDF_IS_CLANG -eq 1 -a $R_IS_GCC   -eq 1; then
		emit_warning=0
	fi
	if test $NETCDF_IS_GCC   -eq 1 -a $R_IS_CLANG -eq 1; then
		emit_warning=0
	fi

	#-----------------------------------------------------
	# Both same, but different exact names of compilers...
	# not sure if this actually guarantees success??
	#-----------------------------------------------------
	if test $NETCDF_IS_CLANG -eq 1 -a $R_IS_CLANG -eq 1; then
		emit_warning=0
	fi
	if test $NETCDF_IS_GCC -eq 1 -a $R_IS_GCC -eq 1; then
		emit_warning=0
	fi

	echo "netcdf cc arg1: $NETCDF_CC_ARG1  R cc arg1: $R_CC_ARG1 R_IS_GCC: $R_IS_GCC R_IS_CLANG: $R_IS_CLANG NETCDF_IS_GCC: $NETCDF_IS_GCC NETCDF_IS_CLANG: $NETCDF_IS_CLANG  emit_warning: $emit_warning"

	if test $emit_warning -eq 1 -o $TEST_EMIT_WARNING -eq 1; then
		echo " "
		echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
		echo "Dear ncdf4 user: The software configuration tool thinks that perhaps different compilers are being"
		echo "used for R and the netcdf library. However, we all know that software configuration tools are"
		echo "not that smart. If ncdf4 compiles fine for you, then please ignore this message. However, if"
		echo "installation fails, it might be that you are using different compilers for R and the netcdf library."
		echo "If so, then you must create a new version of the netcdf library that was compiled with the same"
		echo "compiler that was used to install R (see information above). Then, try installing the ncdf4"
		echo "package again using that new netcdf library. If necessary, you can specify the location of"
		echo "the new nc-config (the one that uses the same compiler used by R) like this:"
		echo " "
		echo "R CMD INSTALL --configure-args=\"--with-nc-config=/home/joe/bin/nc-config\""
		echo " "
		echo "(obviously, put in the correct path to YOUR nc-config, don't just use my example location!)"
		echo "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
		echo " "
	fi

fi