Kaydet (Commit) bdead69d authored tarafından Tomas Chvatal's avatar Tomas Chvatal Kaydeden (comit) Rene Engelhard

Add switch for system/internal npapi.h

This commit also update the internal includes to latest mozilla ones
including the .c{,pp} file updates.

The ldap check is also simplified from 2 check into plain one.
üst f6b9a2f4
......@@ -1302,6 +1302,12 @@ AC_ARG_WITH(system-mozilla,
WITH_SYSTEM_MOZILLA=$withval ,
WITH_SYSTEM_MOZILLA=no)
AC_ARG_WITH(system-mozilla-headers,
AS_HELP_STRING([--with-system-mozilla-headers],
[Use mozilla headers provided by system instead of bundled ones. Needed for
nsplugin])
)
AC_ARG_WITH(system-gettext,
AS_HELP_STRING([--with-system-gettext],
[Use gettext runtime library already on system.]),,
......@@ -5697,41 +5703,29 @@ fi
AC_SUBST(ENABLE_XMLSEC)
AC_MSG_CHECKING([whether to build LDAP configuration backend])
if test -z "$enable_ldap" || test "$enable_ldap" = "yes"; then
if test "$enable_mozilla" = "yes" || test "$with_openldap" = "yes"; then
AC_MSG_RESULT([yes])
WITH_LDAP=YES
else
AC_MSG_RESULT([no. Either Mozilla or OpenLDAP needed])
WITH_LDAP=NO
fi
else
AC_MSG_RESULT([no])
if test "$enable_ldap" != "no"; then
WITH_OPENLDAP=NO
WITH_LDAP=NO
fi
if test "$WITH_LDAP" = "YES"; then
dnl ===================================================================
dnl Test whether we want to use the Mozilla or the OpenLDAP LDAP SDK
dnl ===================================================================
AC_MSG_CHECKING([which LDAP SDK to use])
if test -n "$with_openldap" && test "$with_openldap" != "no"; then
if test "$with_openldap" = "yes"; then
WITH_LDAP=YES
AC_MSG_RESULT([OpenLDAP])
WITH_OPENLDAP=YES
AC_CHECK_HEADERS(ldap.h, [],
[AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
AC_CHECK_LIB(ldap, ldap_simple_bind_s, [],
[AC_MSG_ERROR(openldap lib not found or functional)], [])
# rumours say that OpenLDAP doesn't have that function. I looked and
# it has it. Test for it to be sure
AC_CHECK_LIB(ldap, ldap_set_option, [],
[AC_MSG_ERROR(openldap lib not found or functional)], [])
else
AC_MSG_RESULT([Netscape/Mozilla])
# TODO. Actually do a sanity check and check for
# LDAP_OPT_SIZELIMIT and LDAP_X_OPT_CONNECT_TIMEOUT
[AC_MSG_ERROR(ldap.h not found. install openldap libs)], [])
AC_CHECK_LIB(ldap, ldap_simple_bind_s, [],
[AC_MSG_ERROR(openldap lib not found or functional)], [])
AC_CHECK_LIB(ldap, ldap_set_option, [],
[AC_MSG_ERROR(openldap lib not found or functional)], [])
elif test "$enable_mozilla" != "no"; then
AC_MSG_RESULT([Mozilla])
WITH_LDAP=YES
WITH_OPENLDAP=NO
else
AC_MSG_RESULT([no. Either Mozilla or OpenLDAP required])
fi
else
AC_MSG_RESULT([no])
WITH_LDAP=NO
fi
AC_SUBST(WITH_LDAP)
AC_SUBST(WITH_OPENLDAP)
......@@ -5942,7 +5936,7 @@ AC_SUBST(MOZ_LDAP_CFLAGS)
dnl ===================================================================
dnl Check for system NSS only with xmlsec or mozilla build enabled
dnl ===================================================================
if test "x$enable_xmlsec" != "xno" -o "x$enable_mozilla" = "xyes"; then
if test "x$enable_xmlsec" != "xno" -o "x$enable_mozilla" != "xno"; then
AC_MSG_CHECKING([which NSS to use])
if test "$with_system_nss" = "yes"; then
AC_MSG_RESULT([external])
......@@ -5975,12 +5969,37 @@ from http://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32])
fi
fi
fi
fi
fi
fi # system nss
fi # enable xmlsec || enable mozilla
AC_SUBST(SYSTEM_NSS)
AC_SUBST(NSS_CFLAGS)
AC_SUBST(NSS_LIBS)
dnl ===================================================================
dnl Check for system mozilla headers
dnl ===================================================================
AC_MSG_CHECKING([which mozilla headers to use])
if test -n "$with_system_mozilla_headers" -o -n "$with_system_headers" && \
test "x$with_system_mozilla_headers" != "xno"; then
AC_MSG_RESULT([external])
SYSTEM_MOZILLA_HEADERS=YES
# First try npapi-sdk:
PKG_CHECK_MODULES(MOZILLA_HEADERS, npapi-sdk, [LOCATED=yes], [LOCATED=NO])
# Then go with libxul:
if test "x$LOCATED" != "xyes"; then
PKG_CHECK_MODULES(MOZILLA_HEADERS, libxul, [LOCATED=yes], [LOCATED=NO])
fi
# if still not found bail out
if test "x$LOCATED" != "xyes"; then
AC_MSG_ERROR([npapi.h header file not found])
fi
else
AC_MSG_RESULT([internal])
SYSTEM_MOZILLA_HEADERS=NO
fi
AC_SUBST(MOZILLA_HEADERS_CFLAGS)
AC_SUBST(SYSTEM_MOZILLA_HEADERS)
dnl ===================================================================
dnl Check for system sane
dnl ===================================================================
......
Please be apprised of the following Legal Notices:
A) The U.S. District Court for the Eastern District of Virginia has
ruled that the Netscape Navigator code does not infringe Wang's U.S.
Patent No. 4,751,669 ("the '669 Patent") because: 1) HTML is not
Videotex as defined by the '669 patent; 2) web servers are not central
suppliers; and 3) Navigator does not "connect," as defined by the '669
Patent, to web servers on the Internet. Wang may appeal this decision to
the Federal Circuit. Wang contended that its Patent disclosing a
"Videotext" system, is infringed by the following functionality in the
Netscape Navigator code: 1) the animated logo and status line indicators
--See Claims 1,8 and 9; 2) the "File Save As" function --See Claims
23-27; 3) Bookmarks and Rename Bookmarks in the Properties window --See
Claims 20-22; 4) storing HTML, GIF, and JPEG files and adding filename
extensions --See Claim 38
B) Intermind owns pending U.S. patent applications on communications
systems which employ metadata ("channel objects") to define a control
structure for information transfer. The Netscape code does not infringe
as released; however, modifications which utilize channel objects as
described by Intermind should be considered carefully. The following is
a statement from Intermind: "Intermind's claims fundamentally involve
the use of a control structure to automate communications. ...The
essence of Intermind's top claim is that two devices sender and
receiver have persistent storage, communicate over a network,
and exchange a control structure including metadata which describes: 1)
what information is to be updated, 2) when to update this information,
and 3) how to transfer the updated information. In addition, at least
the receiving device must be able to process the metadata in order to
perform the update determination and transfer. Any digital
communications system which incorporates all of these elements will be
covered by Intermind's patents." See Intermind.com.
C) Stac, Inc., and its licensing agent Hi/fn, own several patents which
disclose data compression methods implementing an LZS compression
algorithm, including U.S. Patent Nos. 4,701,745 and 5,016, 009 ("the
Stac Patents"). The Netscape Communicator code does not perform
compression. If you modify the Netscape source code to perform
compression, please take notice of the Stac Patents.
D) Netscape Communications Corporation ("Netscape") does not guarantee
that any source code or executable code available from the mozilla.org
domain is Year 2000 compliant.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* mozilla.org.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Johnny Stenback <jst@mozilla.org> (Original author)
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef nptypes_h_
#define nptypes_h_
/*
* Header file for ensuring that C99 types ([u]int32_t, [u]int64_t and bool) and
* true/false macros are available.
*/
#if defined(WIN32) || defined(OS2)
/*
* Win32 and OS/2 don't know C99, so define [u]int_16/32/64 here. The bool
* is predefined tho, both in C and C++.
*/
typedef short int16_t;
typedef unsigned short uint16_t;
typedef int int32_t;
typedef unsigned int uint32_t;
typedef long long int64_t;
typedef unsigned long long uint64_t;
#elif defined(_AIX) || defined(__sun) || defined(__osf__) || defined(IRIX) || defined(HPUX)
/*
* AIX and SunOS ship a inttypes.h header that defines [u]int32_t,
* but not bool for C.
*/
#include <inttypes.h>
#ifndef __cplusplus
typedef int bool;
#define true 1
#define false 0
#endif
#elif defined(bsdi) || defined(FREEBSD) || defined(OPENBSD)
/*
* BSD/OS, FreeBSD, and OpenBSD ship sys/types.h that define int32_t and
* u_int32_t.
*/
#include <sys/types.h>
/*
* BSD/OS ships no header that defines uint32_t, nor bool (for C)
*/
#if defined(bsdi)
typedef u_int32_t uint32_t;
typedef u_int64_t uint64_t;
#if !defined(__cplusplus)
typedef int bool;
#define true 1
#define false 0
#endif
#else
/*
* FreeBSD and OpenBSD define uint32_t and bool.
*/
#include <inttypes.h>
#include <stdbool.h>
#endif
#elif defined(BEOS)
#include <inttypes.h>
#else
/*
* For those that ship a standard C99 stdint.h header file, include
* it. Can't do the same for stdbool.h tho, since some systems ship
* with a stdbool.h file that doesn't compile!
*/
#include <stdint.h>
#ifndef __cplusplus
#if !defined(__GNUC__) || (__GNUC__ > 2 || __GNUC_MINOR__ > 95)
#include <stdbool.h>
#else
/*
* GCC 2.91 can't deal with a typedef for bool, but a #define
* works.
*/
#define bool int
#define true 1
#define false 0
#endif
#endif
#endif
#endif /* nptypes_h_ */
......@@ -39,6 +39,14 @@ EXTERNAL_WARNINGS_NOT_ERRORS := TRUE
.IF "$(L10N_framework)"==""
JDKINCS=
.IF "$(SYSTEM_MOZILLA_HEADERS)" = "YES"
CFLAGS+= $(MOZILLA_HEADERS_CFLAGS)
CXXFLAGS+= $(MOZILLA_HEADERS_CFLAGS)
.ELSE
CFLAGS+= -I..$/inc
CXXFLAGS+= -I..$/inc
.ENDIF
# --- Files --------------------------------------------------------
.IF "$(GUI)" == "WNT"
......
......@@ -130,14 +130,14 @@ NPN_GetURLNotify(NPP instance, const char* url, const char* window, void* notify
NPError
NPN_PostURL(NPP instance, const char* url, const char* window,
uint32 len, const char* buf, NPBool file)
uint32_t len, const char* buf, NPBool file)
{
return CallNPN_PostURLProc(gNetscapeFuncs.posturl, instance,
url, window, len, buf, file);
}
NPError
NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len,
NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len,
const char* buf, NPBool file, void* notifyData)
{
return CallNPN_PostURLNotifyProc(gNetscapeFuncs.posturlnotify,
......@@ -159,8 +159,8 @@ NPN_NewStream(NPP instance, NPMIMEType type, const char *window,
type, window, stream_ptr);
}
int32
NPN_Write(NPP instance, NPStream* stream, int32 len, void* buffer)
int32_t
NPN_Write(NPP instance, NPStream* stream, int32_t len, void* buffer)
{
return CallNPN_WriteProc(gNetscapeFuncs.write, instance,
stream, len, buffer);
......@@ -186,7 +186,7 @@ NPN_UserAgent(NPP instance)
}
void*
NPN_MemAlloc(uint32 size)
NPN_MemAlloc(uint32_t size)
{
return CallNPN_MemAllocProc(gNetscapeFuncs.memalloc, size);
}
......@@ -196,7 +196,7 @@ void NPN_MemFree(void* ptr)
CallNPN_MemFreeProc(gNetscapeFuncs.memfree, ptr);
}
uint32 NPN_MemFlush(uint32 size)
uint32_t NPN_MemFlush(uint32_t size)
{
return CallNPN_MemFlushProc(gNetscapeFuncs.memflush, size);
}
......@@ -251,8 +251,8 @@ NPN_ForceRedraw(NPP instance)
***********************************************************************/
NPError
Private_New(NPMIMEType pluginType, NPP instance, uint16 mode,
int16 argc, char* argn[], char* argv[], NPSavedData* saved)
Private_New(NPMIMEType pluginType, NPP instance, uint16_t mode,
int16_t argc, char* argn[], char* argv[], NPSavedData* saved)
{
NPError ret;
PLUGINDEBUGSTR("New");
......@@ -278,7 +278,7 @@ Private_SetWindow(NPP instance, NPWindow* window)
NPError
Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
NPBool seekable, uint16* stype)
NPBool seekable, uint16_t* stype)
{
NPError err;
PLUGINDEBUGSTR("NewStream");
......@@ -286,7 +286,7 @@ Private_NewStream(NPP instance, NPMIMEType type, NPStream* stream,
return err;
}
int32
int32_t
Private_WriteReady(NPP instance, NPStream* stream)
{
unsigned int result;
......@@ -295,8 +295,8 @@ Private_WriteReady(NPP instance, NPStream* stream)
return result;
}
int32
Private_Write(NPP instance, NPStream* stream, int32 offset, int32 len,
int32_t
Private_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len,
void* buffer)
{
unsigned int result;
......@@ -483,7 +483,7 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
pluginFuncs->javaClass = Private_GetJavaClass();
#endif
err = NPP_Initialize();
err = NPERR_NO_ERROR;
}
return err;
......@@ -496,10 +496,8 @@ NP_Initialize(NPNetscapeFuncs* nsTable, NPPluginFuncs* pluginFuncs)
* the last object of this kind has been destroyed.
*
*/
NPError
void
NP_Shutdown(void)
{
PLUGINDEBUGSTR("NP_Shutdown");
NPP_Shutdown();
return NPERR_NO_ERROR;
}
This diff is collapsed.
......@@ -35,12 +35,8 @@
*
* ***** END LICENSE BLOCK ***** */
#ifndef _NPAPI_H_
#include "npapi.h"
#endif
#ifndef _NPUPP_H_
#include "npupp.h"
#endif
//\\// DEFINE
#define NP_EXPORT
......@@ -153,8 +149,7 @@ NP_Initialize(NPNetscapeFuncs* pFuncs)
}
#endif
// NPP_Initialize is a standard (cross-platform) initialize function.
return NPP_Initialize();
return NPERR_NO_ERROR;
}
//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\//\\.
......@@ -165,12 +160,10 @@ NP_Initialize(NPNetscapeFuncs* pFuncs)
// This functio shuold check for some ref count on the dll to see if it is
// unloadable or it needs to stay in memory.
//
NPError WINAPI NP_EXPORT
void WINAPI NP_EXPORT
NP_Shutdown()
{
NPP_Shutdown();
g_pNavigatorFuncs = NULL;
return NPERR_NO_ERROR;
}
char * NP_GetMIMEDescription()
......@@ -230,7 +223,7 @@ NPError NPN_GetURL(NPP instance, const char *url, const char *target)
return g_pNavigatorFuncs->geturl(instance, url, target);
}
NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file, void* notifyData)
NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file, void* notifyData)
{
int navMinorVers = g_pNavigatorFuncs->version & 0xFF;
NPError err;
......@@ -244,7 +237,7 @@ NPError NPN_PostURLNotify(NPP instance, const char* url, const char* window, uin
}
NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file)
NPError NPN_PostURL(NPP instance, const char* url, const char* window, uint32_t len, const char* buf, NPBool file)
{
return g_pNavigatorFuncs->posturl(instance, url, window, len, buf, file);
}
......@@ -278,11 +271,11 @@ NPError NPN_NewStream(NPP instance, NPMIMEType type,
/* Provides len bytes of data.
*/
int32 NPN_Write(NPP instance, NPStream *stream,
int32 len, void *buffer)
int32_t NPN_Write(NPP instance, NPStream *stream,
int32_t len, void *buffer)
{
int navMinorVersion = g_pNavigatorFuncs->version & 0xFF;
int32 result;
int32_t result;
if( navMinorVersion >= NPVERS_HAS_STREAMOUTPUT ) {
result = g_pNavigatorFuncs->write(instance, stream, len, buffer);
......@@ -329,7 +322,7 @@ const char* NPN_UserAgent(NPP instance)
*/
void* NPN_MemAlloc(uint32 size)
void* NPN_MemAlloc(uint32_t size)
{
return g_pNavigatorFuncs->memalloc(size);
}
......
......@@ -1477,6 +1477,8 @@ ToFile( "PREBUILD_MOZAB", $PREBUILD_MOZAB, "e" );
ToFile( "MOZILLA_VERSION", $MOZILLA_VERSION, "e" );
ToFile( "DEFAULT_MOZILLA_TOOLKIT", $MOZILLA_TOOLKIT, "e" );
ToFile( "SYSTEM_NSS", "@SYSTEM_NSS@", "e" );
ToFile( "MOZILLA_HEADERS_CFLAGS", "@MOZILLA_HEADERS_CFLAGS@", "e" );
ToFile( "SYSTEM_MOZILLA_HEADERS", "@SYSTEM_MOZILLA_HEADERS@", "e" );
ToFile( "MOZILLABUILD", "@MOZILLABUILD@", "e" );
ToFile( "BUILD_VER_STRING", "@BUILD_VER_STRING@", "e" );
if ($platform =~ m/linux/ && $platform =~ m/powerpc/) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment