From: Ryan Niebur <ryan@freegeek.org>

This patch fixes build, the problem here is that the library we're
testing is a C library, incompatible under C++ without some special
handling. Took the easy route of having autoconf just test it as a
C library, but the source code also needed some compatibility changes.

Index: zoneminder/configure.ac
===================================================================
--- zoneminder.orig/configure.ac	2012-01-14 11:02:27.000000000 -0800
+++ zoneminder/configure.ac	2012-01-14 11:05:38.000000000 -0800
@@ -4,6 +4,8 @@
 AC_CONFIG_SRCDIR(src/zm.h)
 AM_CONFIG_HEADER(config.h)
 
+AC_SUBST([AM_CXXFLAGS], [-D__STDC_CONSTANT_MACROS])
+
 PATH_BUILD=`pwd`
 AC_SUBST(PATH_BUILD)
 TIME_BUILD=`date +'%s'`
@@ -301,10 +303,12 @@
 fi
 AC_CHECK_HEADERS(jpeglib.h,,AC_MSG_ERROR(zm requires libjpeg headers to be installed),)
 AC_CHECK_HEADERS(mysql/mysql.h,,AC_MSG_ERROR(zm requires MySQL headers - check that MySQL development packages are installed),)
+AC_LANG_PUSH([C])
 AC_CHECK_HEADERS(libavutil/avutil.h,,,)
 AC_CHECK_HEADERS(libavcodec/avcodec.h,,,)
 AC_CHECK_HEADERS(libavformat/avformat.h,,,)
 AC_CHECK_HEADERS(libswscale/swscale.h,,,)
+AC_LANG_POP([C])
 AC_CHECK_HEADERS(pcre/pcre.h,AC_SUBST(ZM_PCRE,"1"),,)
 AC_CHECK_HEADERS(pcre.h,AC_SUBST(ZM_PCRE,"1"),,)
 if test "$ENABLE_MMAP" == "yes"; then
Index: zoneminder/src/zm_ffmpeg.h
===================================================================
--- zoneminder.orig/src/zm_ffmpeg.h	2012-01-14 11:02:02.000000000 -0800
+++ zoneminder/src/zm_ffmpeg.h	2012-01-14 11:04:40.000000000 -0800
@@ -24,6 +24,10 @@
 
 #ifdef __cplusplus
 extern "C" {
+#ifdef _STDINT_H
+#undef _STDINT_H
+#endif
+#include <stdint.h>
 #endif
 #if HAVE_LIBAVUTIL_AVUTIL_H
 #include <libavutil/avutil.h>
