Building standalone libjar for installer use.

[nsbeta3+ b=48109; r=ssu]
This commit is contained in:
sgehani%netscape.com 2000-08-18 22:09:26 +00:00
Родитель dabc124880
Коммит 00aa10a96d
6 изменённых файлов: 84 добавлений и 11 удалений

Просмотреть файл

@ -17,6 +17,7 @@
# Rights Reserved.
#
# Contributor(s):
# Samir Gehani <sgehani@netscape.com>
#
DEPTH = ../..
@ -26,12 +27,14 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = standalone
MODULE = jar
LIBRARY_NAME = jar$(VERSION_NUMBER)
IS_COMPONENT = 1
CPPSRCS = \
nsJARInputStream.cpp \
nsJARInputStream.cpp \
nsZipArchive.cpp \
nsJAR.cpp \
nsJARFactory.cpp \
@ -39,7 +42,8 @@ CPPSRCS = \
$(NULL)
EXPORTS = zipfile.h \
$(NULL)
zipstub.h \
$(NULL)
EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS))

Просмотреть файл

@ -234,7 +234,7 @@ PR_PUBLIC_API(PRInt32) ZIP_FindNext( void* hFind, char * outbuf, PRUint16 bufsiz
/*--- return next filename file ---*/
nsZipItem* item;
status = find->mArchive->FindNext( find, &item );
status = find->GetArchive()->FindNext( find, &item );
if ( status == ZIP_OK )
{
if ( bufsize > item->namelen )
@ -268,7 +268,7 @@ PR_PUBLIC_API(PRInt32) ZIP_FindFree( void* hFind )
return ZIP_ERR_PARAM; /* whatever it is isn't one of ours! */
/* free the find structure */
return find->mArchive->FindFree( find );
return find->GetArchive()->FindFree( find );
}
#endif /* STANDALONE */

Просмотреть файл

@ -32,7 +32,9 @@
#define ZIP_TABSIZE 256
#define ZIP_BUFLEN 32767
#ifdef STANDALONE
#define nsZipArchive nsZipArchiveStandalone
#endif
class nsZipFind;
class nsZipRead;
@ -254,10 +256,6 @@ private:
class nsZipFind
{
friend class nsZipArchive;
#ifdef STANDALONE
friend PRInt32 ZIP_FindNext( void*, char*, PRUint16 );
friend PRInt32 ZIP_FindFree( void* );
#endif
public:
const PRInt32 kMagic;

Просмотреть файл

@ -1,3 +1,4 @@
Makefile
nsZipArchive.cpp
nsZipArchive.h
zipfile.h

Просмотреть файл

@ -0,0 +1,62 @@
#
# The contents of this file are subject to the Netscape 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/NPL/
#
# 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 Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Samir Gehani <sgehani@netscape.com>
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = jar
LIBRARY_NAME = jar$(VERSION_NUMBER)_s
CPPSRCS = \
nsJARInputStream.cpp \
nsZipArchive.cpp \
nsJAR.cpp \
nsJARFactory.cpp \
nsWildCard.cpp \
$(NULL)
override NO_SHARED_LIB=1
override NO_STATIC_LIB=
SHARED_LIBRARY_LIBS = $(DIST)/lib/libzlib.a
include $(topsrcdir)/config/rules.mk
DEFINES += -DSTANDALONE
export:: copysrcs
copysrcs::
cp ../*.cpp .
cp ../*.h .
clean::
$(RM) -f *.cpp *.h *.o *.a
clobber:: clean
clobber_all:: clean

Просмотреть файл

@ -46,15 +46,23 @@
#define PR_Seek fseek
#define PR_Delete remove
#ifdef __cplusplus
#define PR_BEGIN_EXTERN_C extern "C" {
#define PR_END_EXTERN_C }
#else
#define PR_BEGIN_EXTERN_C
#define PR_END_EXTERN_C
#endif
#ifdef XP_MAC
#if defined(XP_MAC)
#define PR_EXTERN(__type) extern __declspec(export) __type
#define PR_PUBLIC_API(__type) __declspec(export) __type
#else
#elif defined(XP_PC)
#define PR_EXTERN(__type) extern _declspec(dllexport) __type
#define PR_PUBLIC_API(__type) _declspec(dllexport) __type
#else /* XP_UNIX */
#define PR_EXTERN(__type) extern __type
#define PR_PUBLIC_API(__type) __type
#endif
#define NS_STATIC_CAST(__type, __ptr) ((__type)(__ptr))