summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@sun.com>2009-03-06 14:42:59 -0800
committerAlan Coopersmith <alan.coopersmith@sun.com>2009-03-06 14:42:59 -0800
commit8cb8cb390fd3b193e2e0399cf20d92af04fd13cd (patch)
treec8a83b80cd4dceeaa27dd97235e02e18aab54740
parent1a750c272683fab37cc7cd4327ccefdfa39faf85 (diff)
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 <alan.coopersmith@sun.com>
-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