1c33d62011-02-12Martin Jonsson AC_INIT(vcdiff.cmod) AC_ARG_WITH(vcdiff, [ --without-vcdiff Disable VCDiff],[],[with_vcdiff=yes]) AC_MODULE_INIT() PIKE_FEATURE_WITHOUT(VCDiff)
ef239e2011-02-14Henrik Grubbström (Grubba) CXX_OBJS=""
1c33d62011-02-12Martin Jonsson if test x$with_vcdiff = xyes ; then PIKE_FEATURE(VCDiff,[no (missing lib)]) AC_LANG(C++) AC_CHECK_HEADERS(google/vcencoder.h google/vcdecoder.h) if test $ac_cv_header_google_vcencoder_h = yes ; then
87256e2015-04-30Henrik Grubbström (Grubba)  PIKE_FEATURE(VCDiff,[no (broken lib)]) AC_CHECK_LIB(stdc++, main)
1c33d62011-02-12Martin Jonsson  AC_MSG_CHECKING(if the library works) AC_CACHE_VAL(pike_cv_vcdiff_works, [ ac_save_LIBS="$LIBS"
0485572011-02-18Martin Jonsson  LIBS="-lvcdenc -lvcddec -lvcdcom $LIBS"
1c33d62011-02-12Martin Jonsson  AC_LINK_IFELSE( [AC_LANG_PROGRAM([#include <google/vcencoder.h> #include <google/vcdecoder.h>], [
13670c2015-05-25Martin Nilsson open_vcdiff::VCDiffEncoder *enc =
1c33d62011-02-12Martin Jonsson  new open_vcdiff::VCDiffEncoder ("A", 1);
13670c2015-05-25Martin Nilsson open_vcdiff::VCDiffDecoder *dec =
1c33d62011-02-12Martin Jonsson  new open_vcdiff::VCDiffDecoder (); ])], [pike_cv_vcdiff_works=yes], [pike_cv_vcdiff_works=no]) LIBS="$ac_save_LIBS" ]) AC_MSG_RESULT($pike_cv_vcdiff_works)
13670c2015-05-25Martin Nilsson 
1c33d62011-02-12Martin Jonsson  if test $pike_cv_vcdiff_works = yes ; then AC_DEFINE(HAVE_VCDIFF) PIKE_FEATURE(VCDiff,[yes])
ef239e2011-02-14Henrik Grubbström (Grubba)  CXX_OBJS="vcdiff_wrapper.o"
0485572011-02-18Martin Jonsson  LIBS="-lvcdenc -lvcddec -lvcdcom $LIBS"
1c33d62011-02-12Martin Jonsson  fi fi fi
ef239e2011-02-14Henrik Grubbström (Grubba) AC_SUBST(CXX_OBJS)
1c33d62011-02-12Martin Jonsson AC_OUTPUT(Makefile,echo FOO >stamp-h )