From 8cb8cb390fd3b193e2e0399cf20d92af04fd13cd Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Fri, 6 Mar 2009 14:42:59 -0800 Subject: Make plugin build compatible with Firefox 3.1 renaming of npupp.h Checks which header to include, the older npupp.h or the newer npfunctions.h, falls back to the ancient copy included from the Netscape SDK if neither are found in either the default path or the pkg-config provided paths. See https://bugzilla.mozilla.org/show_bug.cgi?id=455458 Signed-off-by: Alan Coopersmith --- configure.ac | 18 +++++++++++++----- plugin/common/npunix.c | 7 ++++++- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 9b5bdfc..8a94a58 100644 --- a/configure.ac +++ b/configure.ac @@ -55,7 +55,6 @@ AC_SUBST(XRX_CFLAGS) AC_SUBST(XRX_LIBS) # Check for mozilla/firefox plugin headers via pkg-config. -# If not found, fall back to the ancient copy we carry around. if test "x$PLUGIN_CFLAGS" = x ; then PKG_CHECK_MODULES([MOZILLA_PLUGIN], [mozilla-plugin], [PLUGIN_CFLAGS=${MOZILLA_PLUGIN_CFLAGS}], [AC_MSG_RESULT([no])]) @@ -63,14 +62,23 @@ if test "x$PLUGIN_CFLAGS" = x ; then if test "x$PLUGIN_CFLAGS" = x ; then PKG_CHECK_MODULES([FIREFOX_PLUGIN], [firefox-plugin], [PLUGIN_CFLAGS=${FIREFOX_PLUGIN_CFLAGS}], [AC_MSG_RESULT([no])]) - - if test "x$PLUGIN_CFLAGS" = x ; then - PLUGIN_CFLAGS='-I$(top_srcdir)/plugin/include' - fi fi fi + +# Check which header to include, the older npupp.h or the newer npfunctions.h +# See https://bugzilla.mozilla.org/show_bug.cgi?id=455458 +save_CPPFLAGS="${CPPFLAGS}" +CPPFLAGS="${PLUGIN_CFLAGS} ${save_CPPFLAGS}" +AC_CHECK_HEADERS([npupp.h npfunctions.h], [PLUGIN_HEADERS_FOUND=yes]) +CPPFLAGS="${save_CPPFLAGS}" + +# If neither header found, fall back to the ancient copy we carry around. +if test "x$PLUGIN_HEADERS_FOUND" != "xyes" ; then + PLUGIN_CFLAGS='-I$(top_srcdir)/plugin/include' +fi AC_SUBST(PLUGIN_CFLAGS) + PKG_CHECK_MODULES(XRX_PLUGIN, xaw7) AC_SUBST(XRX_PLUGIN_CFLAGS) AC_SUBST(XRX_PLUGIN_LIBS) diff --git a/plugin/common/npunix.c b/plugin/common/npunix.c index d2b5338..bdc5bf1 100644 --- a/plugin/common/npunix.c +++ b/plugin/common/npunix.c @@ -15,9 +15,14 @@ #define XP_UNIX 1 +#include "config.h" #include #include "npapi.h" -#include "npupp.h" +#ifdef HAVE_NPFUNCTIONS_H +# include +#else +# include "npupp.h" +#endif /* * Define PLUGIN_TRACE to have the wrapper functions print -- cgit v1.2.3