提交 d30a975f 编写于 作者: D Daniel Gustafsson

Check for libyaml when building gpmapreduce

Greenplum Mapreduce requires libyaml, but was lacking a specific
test for it in autoconf. This worked since gpfdist has the same
check but when building with --disable-gpfdist we need to ensure
we have libyaml to avoid late compilation failures.
上级 3ae06a9b
......@@ -10845,6 +10845,68 @@ fi
LIBS="$_LIBS"
fi
if test "$enable_mapreduce" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing yaml_parser_initialize" >&5
$as_echo_n "checking for library containing yaml_parser_initialize... " >&6; }
if ${ac_cv_search_yaml_parser_initialize+:} 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 yaml_parser_initialize ();
int
main ()
{
return yaml_parser_initialize ();
;
return 0;
}
_ACEOF
for ac_lib in '' yaml; 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_yaml_parser_initialize=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if ${ac_cv_search_yaml_parser_initialize+:} false; then :
break
fi
done
if ${ac_cv_search_yaml_parser_initialize+:} false; then :
else
ac_cv_search_yaml_parser_initialize=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_yaml_parser_initialize" >&5
$as_echo "$ac_cv_search_yaml_parser_initialize" >&6; }
ac_res=$ac_cv_search_yaml_parser_initialize
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
have_yaml=yes
else
as_fn_error $? "libyaml is required for Greenplum Mapreduce" "$LINENO" 5
fi
fi
if test "$enable_gpperfmon" = yes; then
......
......@@ -1308,6 +1308,11 @@ if test "$enable_gpfdist" = yes ; then
AC_SUBST(have_yaml)
fi
if test "$enable_mapreduce" = yes; then
AC_SEARCH_LIBS(yaml_parser_initialize, [yaml], [have_yaml=yes], [AC_MSG_ERROR([libyaml is required for Greenplum Mapreduce])])
AC_SUBST(have_yaml)
fi
if test "$enable_gpperfmon" = yes; then
CHECK_APR()
GPAC_PATH_APU_1_CONFIG
......
......@@ -27,7 +27,6 @@ OBJS = mapred_test.o
include $(top_srcdir)/src/Makefile.shlib
override CPPFLAGS += $(BLD_CPPFLAGS_SOLARIS_OLD_VERSIONS) -I$(SRCDIR) -I$(INCDIR) -I$(libpq_srcdir)
override LDFLAGS += -lyaml
FILES = main.o mapred.o parse.o yaml_scan.o yaml_parse.o
GENFILES = yaml_parse.h yaml_parse.c yaml_scan.c yaml_scan.h
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册