summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac18
-rw-r--r--plugin/common/npunix.c7
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 <stdio.h>
#include "npapi.h"
-#include "npupp.h"
+#ifdef HAVE_NPFUNCTIONS_H
+# include <npfunctions.h>
+#else
+# include "npupp.h"
+#endif
/*
* Define PLUGIN_TRACE to have the wrapper functions print