From 92e616c8ab9647c42876ecca89da16c7fb5ee982 Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Thu, 27 Jun 2002 22:26:41 +0000 Subject: [PATCH] #154161 r=pedemont, sr=blizzard OS/2 only - get NPNULL plugin working on OS/2 git-svn-id: svn://10.0.0.236/trunk@124231 18797224-902f-48f8-a5cc-f745e15eee43 --- .../plugin/samples/default/os2/Makefile.in | 29 ++++++++++++------- .../plugin/samples/default/os2/dbg.cpp | 13 +++++---- .../modules/plugin/samples/default/os2/dbg.h | 2 +- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/mozilla/modules/plugin/samples/default/os2/Makefile.in b/mozilla/modules/plugin/samples/default/os2/Makefile.in index 10f547ec82f..8c5253ef426 100644 --- a/mozilla/modules/plugin/samples/default/os2/Makefile.in +++ b/mozilla/modules/plugin/samples/default/os2/Makefile.in @@ -27,9 +27,11 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk +MODULE = plugin LIBRARY_NAME = npnulos2 -EXPORT_LIBRARY = 1 +RESFILE = npnulos2.res REQUIRES = java \ + plugin \ $(NULL) CPPSRCS = \ @@ -42,20 +44,25 @@ CPPSRCS = \ utils.cpp\ $(NULL) -RES_FILE = $(srcdir)/npnulos2.res +# plugins should always be shared, even in the "static" build +FORCE_SHARED_LIB = 1 + +NO_DIST_INSTALL = 1 +NO_INSTALL = 1 include $(topsrcdir)/config/rules.mk EXTRA_DSO_LDOPTS += $(MOZ_COMPONENT_LIBS) \ $(NULL) -MOZ_POST_DSO_LIB_COMMAND = rc -n -x2 $(RES_FILE) - -$(SHARED_LIBRARY): $(OBJS) $(RES_FILE) - -$(RES_FILE): $(srcdir)/npnulos2.rc -ifneq ($(DEPTH),$(topsrcdir)) - cp $(srcdir)/plugicon.ico ./plugicon.ico - cp $(srcdir)/resource.h ./resource.h +install-plugin: $(SHARED_LIBRARY) +ifdef SHARED_LIBRARY + $(INSTALL) $(SHARED_LIBRARY) $(DIST)/bin/plugins +endif + +libs:: install-plugin + +install:: $(SHARED_LIBRARY) +ifdef SHARED_LIBRARY + $(SYSINSTALL) $(IFLAGS2) $< $(DESTDIR)$(mozappdir)/plugins endif - rc -n -x2 -r $(srcdir)/npnulos2.rc diff --git a/mozilla/modules/plugin/samples/default/os2/dbg.cpp b/mozilla/modules/plugin/samples/default/os2/dbg.cpp index ae78aef4c2c..1356621b26b 100644 --- a/mozilla/modules/plugin/samples/default/os2/dbg.cpp +++ b/mozilla/modules/plugin/samples/default/os2/dbg.cpp @@ -39,21 +39,22 @@ #include #include #include +#include extern char szAppName[]; #ifdef _DEBUG -void __cdecl dbgOut(LPSTR format, ...) { +void dbgOut(PSZ format, ...) { static char buf[1024]; - lstrcpy(buf, szAppName); - lstrcat(buf, ": "); + strcpy(buf, szAppName); + strcat(buf, ": "); va_list va; va_start(va, format); - wvsprintf(&buf[lstrlen(buf)], format, va); + vsprintf(&buf[strlen(buf)], format, va); va_end(va); - lstrcat(buf, "\n"); - OutputDebugString(buf); + strcat(buf, "\n"); + printf("%s\n", buf); } #endif diff --git a/mozilla/modules/plugin/samples/default/os2/dbg.h b/mozilla/modules/plugin/samples/default/os2/dbg.h index cc56c5f2651..a22c105b6e8 100644 --- a/mozilla/modules/plugin/samples/default/os2/dbg.h +++ b/mozilla/modules/plugin/samples/default/os2/dbg.h @@ -40,7 +40,7 @@ #ifdef _DEBUG -void __cdecl dbgOut(LPSTR format, ...); +void dbgOut(PSZ format, ...); #define dbgOut1(x) dbgOut(x) #define dbgOut2(x,y) dbgOut(x, y) #define dbgOut3(x,y,z) dbgOut(x, y, z)