Bug 454097 - [OS/2] get rid of VisualAge in configures; m-c part; r=mozilla
authorWalter Meinl <wuno@lsvw.de>
Sat, 11 Oct 2008 03:01:28 +0200
changeset 20288 2cea81823d55460ab49541bc4159e900c00769c4
parent 20287 d2f88b94140de5d7ad3882d8b9c7a2cb11f41e09
child 20289 2f36cde1694c7f19488a10cbb6f15e38f3f1f02e
push idunknown
push userunknown
push dateunknown
reviewersmozilla
bugs454097
milestone1.9.1b2pre
Bug 454097 - [OS/2] get rid of VisualAge in configures; m-c part; r=mozilla
config/config.mk
config/rules.mk
configure.in
dbm/include/mcom_db.h
dbm/src/h_bigkey.c
dbm/src/h_page.c
dbm/src/hash.c
dbm/src/hash_buf.c
dbm/src/mktemp.c
dbm/src/snprintf.c
modules/libpref/src/prefapi.cpp
modules/libreg/src/vr_stubs.h
profile/pref-migrator/src/Makefile.in
sun-java/stubs/include/jni_md.h
sun-java/stubs/include/jri_md.h
tools/relic/test/addlicense_inputs/emacs_local_vars_line.c
tools/relic/test/addlicense_outputs/emacs_local_vars_line.c
xpcom/reflect/xptcall/src/md/unix/xptc_platforms_unixish_x86.h
xpcom/typelib/xpt/tools/xpt_dump.c
--- a/config/config.mk
+++ b/config/config.mk
@@ -551,24 +551,16 @@ else
 HOST_CFLAGS	+= $(MOZ_OPTIMIZE_FLAGS)
 endif # MODULE_OPTIMIZE_FLAGS
 else
 HOST_CFLAGS	+= $(MOZ_OPTIMIZE_FLAGS)
 endif # MOZ_OPTIMIZE == 1
 endif # MOZ_OPTIMIZE
 endif # CROSS_COMPILE
 
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-ifdef USE_STATIC_LIBS
-RTL_FLAGS += -Gd-
-else # !USE_STATIC_LIBS
-RTL_FLAGS += -Gd+
-endif
-endif
-
 
 ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_)
 #// Currently, unless USE_STATIC_LIBS is defined, the multithreaded
 #// DLL version of the RTL is used...
 #//
 #//------------------------------------------------------------------------
 ifdef USE_STATIC_LIBS
 RTL_FLAGS=-MT          # Statically linked multithreaded RTL
@@ -610,26 +602,24 @@ endif
 # Name of the binary code directories
 #
 # Override defaults
 
 # We need to know where to find the libraries we
 # put on the link line for binaries, and should
 # we link statically or dynamic?  Assuming dynamic for now.
 
-ifneq ($(MOZ_OS2_TOOLS),VACPP)
 ifneq (WINNT_,$(OS_ARCH)_$(GNU_CC))
 ifneq (,$(filter-out WINCE,$(OS_ARCH)))
 LIBS_DIR	= -L$(DIST)/bin -L$(DIST)/lib
 ifdef LIBXUL_SDK
 LIBS_DIR	+= -L$(LIBXUL_SDK)/bin -L$(LIBXUL_SDK)/lib
 endif
 endif
 endif
-endif
 
 # Default location of include files
 IDL_DIR		= $(DIST)/idl
 ifdef MODULE
 PUBLIC		= $(DIST)/include/$(MODULE)
 else
 PUBLIC		= $(DIST)/include
 endif
@@ -711,31 +701,28 @@ MKDEPEND	= $(CYGWIN_WRAPPER) $(MOZ_NATIV
 else
 MKDEPEND_DIR	= $(CONFIG_TOOLS)/mkdepend
 MKDEPEND	= $(CYGWIN_WRAPPER) $(MKDEPEND_DIR)/mkdepend$(BIN_SUFFIX)
 endif
 
 # Set link flags according to whether we want a console.
 ifdef MOZ_WINCONSOLE
 ifeq ($(MOZ_WINCONSOLE),1)
-ifeq ($(MOZ_OS2_TOOLS),EMX)
+ifeq ($(OS_ARCH),OS2)
 BIN_FLAGS	+= -Zlinker -PM:VIO
 endif
 ifeq ($(OS_ARCH),WINNT)
 ifdef GNU_CC
 WIN32_EXE_LDFLAGS	+= -mconsole
 else
 WIN32_EXE_LDFLAGS	+= -SUBSYSTEM:CONSOLE
 endif
 endif
 else # MOZ_WINCONSOLE
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-LDFLAGS += -PM:PM
-endif
-ifeq ($(MOZ_OS2_TOOLS),EMX)
+ifeq ($(OS_ARCH),OS2)
 BIN_FLAGS	+= -Zlinker -PM:PM
 endif
 ifeq ($(OS_ARCH),WINNT)
 ifdef GNU_CC
 WIN32_EXE_LDFLAGS	+= -mwindows
 else
 WIN32_EXE_LDFLAGS	+= -SUBSYSTEM:WINDOWS
 endif
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -64,25 +64,21 @@ endif
 
 # ELOG prints out failed command when building silently (gmake -s).
 ifneq (,$(findstring -s,$(MAKEFLAGS)))
   ELOG := $(EXEC) sh $(BUILD_TOOLS)/print-failed-commands.sh
 else
   ELOG :=
 endif
 
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-_LIBNAME_RELATIVE_PATHS=1
-else
 ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
 ifndef GNU_CC
 _LIBNAME_RELATIVE_PATHS=1
 endif
 endif
-endif
 
 ifeq (,$(filter-out WINNT WINCE,$(OS_ARCH)))
 PWD := $(shell pwd)
 _VPATH_SRCS = $(if $(filter /%,$<),$<,$(PWD)/$<)
 else
 _VPATH_SRCS = $<
 endif
 
@@ -284,22 +280,18 @@ ifndef HOST_OBJS
 _HOST_OBJS		= \
         $(addprefix host_,$(HOST_CSRCS:.c=.$(OBJ_SUFFIX))) \
 	$(addprefix host_,$(patsubst %.cc,%.$(OBJ_SUFFIX),$(HOST_CPPSRCS:.cpp=.$(OBJ_SUFFIX)))) \
 	$(addprefix host_,$(HOST_CMSRCS:.m=.$(OBJ_SUFFIX))) \
 	$(addprefix host_,$(HOST_CMMSRCS:.mm=.$(OBJ_SUFFIX)))
 HOST_OBJS = $(strip $(_HOST_OBJS))
 endif
 
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-LIBOBJS			:= $(OBJS)
-else
 LIBOBJS			:= $(addprefix \", $(OBJS))
 LIBOBJS			:= $(addsuffix \", $(LIBOBJS))
-endif
 
 ifndef MOZ_AUTO_DEPS
 ifneq (,$(OBJS)$(XPIDLSRCS)$(SDK_XPIDLSRCS)$(SIMPLE_PROGRAMS))
 MDDEPFILES		= $(addprefix $(MDDEPDIR)/,$(OBJS:.$(OBJ_SUFFIX)=.pp))
 ifndef NO_GEN_XPT
 MDDEPFILES		+= $(addprefix $(MDDEPDIR)/,$(XPIDLSRCS:.idl=.xpt)) \
 			   $(addprefix $(MDDEPDIR)/,$(SDK_XPIDLSRCS:.idl=.xpt))
 endif
@@ -559,25 +551,21 @@ endif
 ifeq ($(USE_TVFS),1)
 IFLAGS1 = -rb
 IFLAGS2 = -rb
 else
 IFLAGS1 = -m 644
 IFLAGS2 = -m 755
 endif
 
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-OUTOPTION = -Fo# eol
-else
 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
 OUTOPTION = -Fo# eol
 else
 OUTOPTION = -o # eol
 endif # WINNT && !GNU_CC
-endif # VACPP
 ifneq (,$(filter WINCE,$(OS_ARCH)))
 OUTOPTION = -Fo# eol
 endif
 
 ifeq ($(OS_TARGET), WINCE)
 OUTOPTION = -Fo# eol
 HOST_OUTOPTION = -Fo# eol
 else
@@ -846,36 +834,32 @@ distclean:: $(SUBMAKEFILES)
 	+-$(LOOP_OVER_STATIC_DIRS)
 	+-$(LOOP_OVER_TOOL_DIRS)
 	-rm -rf $(ALL_TRASH_DIRS) 
 	-rm -f $(ALL_TRASH)  \
 	Makefile .HSancillary \
 	$(wildcard *.$(OBJ_SUFFIX)) $(wildcard *.ho) $(wildcard host_*.o*) \
 	$(wildcard *.$(LIB_SUFFIX)) $(wildcard *$(DLL_SUFFIX)) \
 	$(wildcard *.$(IMPORT_LIB_SUFFIX))
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
+ifeq ($(OS_ARCH),OS2)
 	-rm -f $(PROGRAM:.exe=.map)
 endif
 
 alltags:
 	rm -f TAGS
 	find $(topsrcdir) -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' -o -name '*.idl' \) -print | $(TAG_PROGRAM)
 
 #
 # PROGRAM = Foo
 # creates OBJS, links with LIBS to create Foo
 #
 $(PROGRAM): $(PROGOBJS) $(LIBS_DEPS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) Makefile Makefile.in
 ifeq (WINCE,$(OS_ARCH))
 	$(LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 else
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-	$(LD) -OUT:$@ $(LDFLAGS) $(PROGOBJS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS) $(EXE_DEF_FILE) -ST:0x100000
-else
-
 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
 	$(LD) -NOLOGO -OUT:$@ -PDB:$(PDBFILE) $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(PROGOBJS) $(RESFILE) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
 		if test -f "$(srcdir)/$@.manifest"; then \
 			mt.exe -NOLOGO -MANIFEST "$(win_srcdir)/$@.manifest" $@.manifest -OUTPUTRESOURCE:$@\;1; \
 		else \
 			mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
@@ -885,36 +869,32 @@ ifdef MSMANIFEST_TOOL
 endif	# MSVC with manifest tool
 else
 ifeq ($(CPP_PROG_LINK),1)
 	$(CCC) -o $@ $(CXXFLAGS) $(WRAP_MALLOC_CFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(SOLARIS_JEMALLOC_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(EXE_DEF_FILE)
 else # ! CPP_PROG_LINK
 	$(CC) -o $@ $(CFLAGS) $(PROGOBJS) $(RESFILE) $(WIN32_EXE_LDFLAGS) $(SOLARIS_JEMALLOC_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(EXE_DEF_FILE)
 endif # CPP_PROG_LINK
 endif # WINNT && !GNU_CC
-endif # OS2
 endif # WINCE
 
 ifdef ENABLE_STRIP
 	$(STRIP) $@
 endif
 ifdef MOZ_POST_PROGRAM_COMMAND
 	$(MOZ_POST_PROGRAM_COMMAND) $@
 endif
 ifeq ($(OS_ARCH),BeOS)
 ifdef BEOS_PROGRAM_RESOURCE
 	xres -o $@ $(BEOS_PROGRAM_RESOURCE)
 	mimeset $@
 endif
 endif # BeOS
 
 $(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) Makefile Makefile.in
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-	$(LD) -OUT:$@ $(LDFLAGS) $(HOST_OBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS) -ST:0x100000
-else
 ifeq (WINCE,$(OS_ARCH))
 	$(HOST_LD) -NOLOGO -OUT:$@ $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 else
 ifeq (_WINNT,$(GNU_CC)_$(HOST_OS_ARCH))
 	$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(PDBFILE) $(HOST_OBJS) $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
 		mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
@@ -924,76 +904,67 @@ endif	# MSVC with manifest tool
 else
 ifeq ($(CPP_PROG_LINK),1)
 	$(HOST_CXX) -o $@ $(HOST_CXXFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 else
 	$(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_LDFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 endif # CPP_PROG_LINK
 endif
 endif
-endif
 
 #
 # This is an attempt to support generation of multiple binaries
 # in one directory, it assumes everything to compile Foo is in
 # Foo.o (from either Foo.c or Foo.cpp).
 #
 # SIMPLE_PROGRAMS = Foo Bar
 # creates Foo.o Bar.o, links with LIBS to create Foo, Bar.
 #
 $(SIMPLE_PROGRAMS): %$(BIN_SUFFIX): %.$(OBJ_SUFFIX) $(LIBS_DEPS) $(EXTRA_DEPS) Makefile Makefile.in
 ifeq (WINCE,$(OS_ARCH))
 	$(LD) -nologo  -entry:main -out:$@ $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 else
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-	$(LD) -Out:$@ $< $(LDFLAGS) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS)
-else
 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
 	$(LD) -nologo -out:$@ -pdb:$(PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(LDFLAGS) $(LIBS) $(EXTRA_LIBS) $(OS_LIBS)
 ifdef MSMANIFEST_TOOL
 	@if test -f $@.manifest; then \
 		mt.exe -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \
 		rm -f $@.manifest; \
 	fi
 endif	# MSVC with manifest tool
 else
 ifeq ($(CPP_PROG_LINK),1)
 	$(CCC) $(WRAP_MALLOC_CFLAGS) $(CXXFLAGS) -o $@ $< $(WIN32_EXE_LDFLAGS) $(SOLARIS_JEMALLOC_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(BIN_FLAGS)
 else
 	$(CC) $(WRAP_MALLOC_CFLAGS) $(CFLAGS) $(OUTOPTION)$@ $< $(WIN32_EXE_LDFLAGS) $(SOLARIS_JEMALLOC_LDFLAGS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(BIN_FLAGS)
 endif # CPP_PROG_LINK
 endif # WINNT && !GNU_CC
-endif # OS/2 VACPP
 endif # WINCE
 
 ifdef ENABLE_STRIP
 	$(STRIP) $@
 endif
 ifdef MOZ_POST_PROGRAM_COMMAND
 	$(MOZ_POST_PROGRAM_COMMAND) $@
 endif
 
 $(HOST_SIMPLE_PROGRAMS): host_%$(HOST_BIN_SUFFIX): host_%.$(OBJ_SUFFIX) $(HOST_LIBS_DEPS) $(HOST_EXTRA_DEPS) Makefile Makefile.in
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-	$(HOST_LD) -OUT:$@ $< $(LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS) -ST:0x100000
-else
 ifeq (WINCE,$(OS_ARCH))
 	$(HOST_LD) -NOLOGO -OUT:$@ $(WIN32_EXE_LDFLAGS) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 else
 ifeq (WINNT_,$(HOST_OS_ARCH)_$(GNU_CC))
 	$(HOST_LD) -NOLOGO -OUT:$@ -PDB:$(PDBFILE) $< $(WIN32_EXE_LDFLAGS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 else
 ifneq (,$(HOST_CPPSRCS)$(USE_HOST_CXX))
 	$(HOST_CXX) $(HOST_OUTOPTION)$@ $(HOST_CXXFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 else
 	$(HOST_CC) $(HOST_OUTOPTION)$@ $(HOST_CFLAGS) $(INCLUDES) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
 endif
 endif
 endif
-endif
 
 #
 # Purify target.  Solaris/sparc only to start.
 # Purify does not recognize "egcs" or "c++" so we go with 
 # "gcc" and "g++" for now.
 #
 pure:	$(PROGRAM)
 ifeq ($(CPP_PROG_LINK),1)
@@ -1114,17 +1085,16 @@ endif
 # so instead of deleting .o files after repacking them into a dylib, we make
 # symlinks back to the originals. The symlinks are a no-op for stabs debugging,
 # so no need to conditionalize on OS version or debugging format.
 
 $(SHARED_LIBRARY): $(OBJS) $(LOBJS) $(DEF_FILE) $(RESFILE) $(SHARED_LIBRARY_LIBS) $(EXTRA_DEPS) $(DSO_LDOPTS_DEPS) Makefile Makefile.in
 ifndef INCREMENTAL_LINKER
 	rm -f $@
 endif
-ifneq ($(MOZ_OS2_TOOLS),VACPP)
 ifeq ($(OS_ARCH),OpenVMS)
 	@if test ! -f $(VMS_SYMVEC_FILE); then \
 	  if test -f $(VMS_SYMVEC_FILE_MODULE); then \
 	    echo Creating specific component options file $(VMS_SYMVEC_FILE); \
 	    cp $(VMS_SYMVEC_FILE_MODULE) $(VMS_SYMVEC_FILE); \
 	  fi; \
 	fi
 ifdef IS_COMPONENT
@@ -1185,19 +1155,16 @@ ifdef EMBED_MANIFEST_AT
 endif   # EMBED_MANIFEST_AT
 endif	# MSVC with manifest tool
 endif	# WINNT && !GCC
 ifeq ($(OS_ARCH),Darwin)
 else # non-Darwin
 	@rm -f $(SUB_SHLOBJS)
 endif # Darwin
 	@rm -f foodummyfilefoo $(DELETE_AFTER_LINK)
-else # os2 vacpp
-	$(MKSHLIB) -O:$@ -DLL -INC:_dllentry $(LDFLAGS) $(OBJS) $(LOBJS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE)
-endif # !os2 vacpp
 	chmod +x $@
 ifdef ENABLE_STRIP
 	$(STRIP) $@
 endif
 ifdef MOZ_POST_DSO_LIB_COMMAND
 	$(MOZ_POST_DSO_LIB_COMMAND) $@
 endif
 
@@ -1278,22 +1245,18 @@ host_%.$(OBJ_SUFFIX): %.mm Makefile Make
 
 moc_%.cpp: %.h Makefile Makefile.in
 	$(MOC) $< $(OUTOPTION)$@ 
 
 ifdef ASFILES
 # The AS_DASH_C_FLAG is needed cause not all assemblers (Solaris) accept
 # a '-c' flag.
 %.$(OBJ_SUFFIX): %.$(ASM_SUFFIX) Makefile Makefile.in
-ifeq ($(MOZ_OS2_TOOLS),VACPP)
-	$(AS) -Fdo:./$(OBJDIR) -Feo:.$(OBJ_SUFFIX) $(ASFLAGS) $(AS_DASH_C_FLAG) $<
-else
 	$(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) $(_VPATH_SRCS)
 endif
-endif
 
 %.$(OBJ_SUFFIX): %.S Makefile Makefile.in
 	$(AS) -o $@ $(ASFLAGS) -c $<
 
 %: %.cpp Makefile Makefile.in
 	@$(MAKE_DEPS_AUTO_CXX)
 	$(CCC) $(OUTOPTION)$@ $(CXXFLAGS) $(_VPATH_SRCS) $(LDFLAGS)
 
--- a/configure.in
+++ b/configure.in
@@ -2283,122 +2283,76 @@ case "$target" in
     CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
     CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
     ;;
 
 
 *-os2*)
     MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
     MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
+    AC_DEFINE(OS2)
     AC_DEFINE(XP_OS2)
+    AC_DEFINE(OS2EMX_PLAIN_CHAR)
+    AC_DEFINE(TCPV40HDRS)
     USE_SHORT_LIBNAME=1
     DLL_PREFIX=
     LIB_PREFIX=
     LIB_SUFFIX=lib
     BIN_SUFFIX=".exe"
     DLL_SUFFIX=".dll"
     IMPORT_LIB_SUFFIX=lib
     DSO_PIC_CFLAGS=
+    AR=emxomfar
+    AR_FLAGS='r $@'
+    CFLAGS="$CFLAGS -Zomf"
+    CXXFLAGS="$CXXFLAGS -Zomf"
+    DSO_LDOPTS='-Zdll'
+    BIN_FLAGS='-Zlinker /ST:0x100000'
+    IMPLIB='emximp -o'
+    FILTER='emxexp -o'
+    LDFLAGS='-Zmap'
+    WARNINGS_AS_ERRORS='-Werror'
+    MOZ_DEBUG_FLAGS="-g -fno-inline"
+    MOZ_OPTIMIZE_FLAGS="-O2"
+    MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
+    MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcomct.lib'
+    DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
+    LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
     TARGET_MD_ARCH=os2
     _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
     MOZ_ENABLE_POSTSCRIPT=
     RC=rc.exe
     RCFLAGS='-n'
     MOZ_USER_DIR="Mozilla"
 
     if test "$MOZTOOLS"; then
         MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
     else
         AC_MSG_ERROR([MOZTOOLS is not set])
     fi
-
-    # EMX/GCC build
-    if test -n "$GNU_CC"; then
-        AC_DEFINE(OS2)
-        AC_DEFINE(XP_OS2_EMX)
-        AC_DEFINE(OS2EMX_PLAIN_CHAR)
-        AC_DEFINE(TCPV40HDRS)
-        AR=emxomfar
-        AR_FLAGS='r $@'
-        CFLAGS="$CFLAGS -Zomf"
-        CXXFLAGS="$CXXFLAGS -Zomf"
-        DSO_LDOPTS='-Zdll'
-        BIN_FLAGS='-Zlinker /ST:0x100000'
-        IMPLIB='emximp -o'
-        FILTER='emxexp -o'
-        LDFLAGS='-Zmap'
-        WARNINGS_AS_ERRORS='-Werror'
-        MOZ_DEBUG_FLAGS="-g -fno-inline"
-        MOZ_OPTIMIZE_FLAGS="-O2"
-        MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
-        MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcomct.lib'
-        DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
-        LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
-        if test -n "$MOZ_OS2_HIGH_MEMORY"; then
-          DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
-          LDFLAGS="$LDFLAGS -Zhigh-mem"
-          MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
-          AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
-        fi
-
-        # GCC for OS/2 currently predefines these, but we don't want them
-        _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
-        _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
-
-        AC_CACHE_CHECK(for __declspec(dllexport),
-           ac_os2_declspec,
-           [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
-                           [return 0;],
-                           ac_os2_declspec="yes",
-                           ac_os2_declspec="no")])
-        if test "$ac_os2_declspec" = "yes"; then
-           FILTER='true'
-           MOZ_OS2_USE_DECLSPEC='1'
-        fi
-        
-    # Visual Age C++ build
-    elif test "$VACPP" = "yes"; then
-        MOZ_BUILD_ROOT=`pwd -D`
-        OBJ_SUFFIX=obj
-        AR=-ilib
-        AR_FLAGS='/NOL /NOI /O:$(subst /,\\,$@)'
-        AR_LIST='/L'
-        AR_EXTRACT='-*'
-        AR_DELETE='-'
-        AS=alp
-        ASFLAGS='-Mb'
-        AS_DASH_C_FLAG=''
-        ASM_SUFFIX=asm
-        LD='-ilink'
-        CFLAGS="/Q /qlibansi /Gm+ /Su4 /Mp /Tl9"
-        CXXFLAGS="/Q /qlibansi /Gm+ /Su4 /Mp /Tl9 /Gx+"
-        MOZ_DEBUG_FLAGS="/Ti+"
-        WARNINGS_AS_ERRORS='-WX'
-        MOZ_OPTIMIZE_FLAGS="/O+ /Gl+ /G5 /qarch=pentium"
-        LDFLAGS="/NOL /M"
-        MOZ_DEBUG_LDFLAGS="/DE"
-        MOZ_OPTIMIZE_LDFLAGS="/OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
-        DSO_LDOPTS=''
-        DSO_PIC_CFLAGS=
-        IMPLIB='implib /NOL /NOI'
-        FILTER='cppfilt -q -B -P'
-        AC_DEFINE(NO_ANSI_KEYWORDS)
-        AC_DEFINE(OS2,4)
-        AC_DEFINE(_X86_)
-        AC_DEFINE(XP_OS2_VACPP)
-        AC_DEFINE(TCPV40HDRS)
-        AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
-        AC_DEFINE(STDC_HEADERS)
-        MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
-        MKSHLIB='$(LD) $(DSO_LDOPTS)'
-        MKCSHLIB='$(LD) $(DSO_LDOPTS)'
-        MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/mozjs.lib'
-        MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcomct.lib'
-        DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
-        LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
+    if test -n "$MOZ_OS2_HIGH_MEMORY"; then
+        DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
+        LDFLAGS="$LDFLAGS -Zhigh-mem"
+        MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
+        AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
+    fi
+
+    # GCC for OS/2 currently predefines these, but we don't want them
+    _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
+    _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
+
+    AC_CACHE_CHECK(for __declspec(dllexport),
+        ac_os2_declspec,
+        [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
+                        [return 0;],
+                        ac_os2_declspec="yes",
+                        ac_os2_declspec="no")])
+    if test "$ac_os2_declspec" = "yes"; then
+        FILTER='true'
+        MOZ_OS2_USE_DECLSPEC='1'
     fi
     ;;
 
 alpha*-*-osf*)
     if test "$GNU_CC"; then
       MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
       MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
 
@@ -2653,24 +2607,16 @@ AC_CACHE_VAL(ac_cv_siginfo_t,
                  [ac_cv_siginfo_t=false])])
 if test "$ac_cv_siginfo_t" = true ; then
   AC_DEFINE(HAVE_SIGINFO_T)
   AC_MSG_RESULT(yes)
 else
   AC_MSG_RESULT(no)
 fi
 
-dnl Visual Age for os/2 also defines size_t and off_t in certain 
-dnl  header files.  These defines make Visual Age use the mozilla
-dnl  defines types.
-if test "$VACPP" = "yes"; then
-   AC_DEFINE(__size_t)
-   AC_DEFINE(__off_t)
-fi
-
 dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
 dnl ========================================================
 AC_MSG_CHECKING(for int16_t)
 AC_CACHE_VAL(ac_cv_int16_t,
  [AC_TRY_COMPILE([#include <stdio.h>
                   #include <sys/types.h>],
                  [int16_t foo = 0;],
                  [ac_cv_int16_t=true],
@@ -4072,20 +4018,17 @@ if test -n "$MOZ_NATIVE_NSPR"; then
                 [#ifndef PR_STATIC_ASSERT
                  #error PR_STATIC_ASSERT not defined
                  #endif],
                 [MOZ_NATIVE_NSPR=1],
                 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
     CFLAGS=$_SAVE_CFLAGS
 else
     NSPR_CFLAGS='`$(DEPTH)/nsprpub/config/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`'
-    # explicitly set libs for Visual Age C++ for OS/2
-    if test "$OS_ARCH" = "OS2" -a "$VACPP" = "yes"; then
-        NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib ${_PTHREAD_LDFLAGS}"
-    elif test "$OS_ARCH" = "WINCE"; then
+    if test "$OS_ARCH" = "WINCE"; then
         NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
         NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
     elif test "$OS_ARCH" = "WINNT"; then
         NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
         if test -n "$GNU_CC"; then
             NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
         else
             NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
@@ -8092,19 +8035,17 @@ if test "$MOZ_X11"; then
     fi
 
 fi # MOZ_X11
 fi # COMPILE_ENVIRONMENT
 
 dnl Set various defines and substitutions
 dnl ========================================================
 
-if test "$OS_ARCH" = "OS2" -a "$VACPP" = "yes"; then
-      LIBS='so32dll.lib tcp32dll.lib'
-elif test "$OS_ARCH" = "BeOS"; then
+if test "$OS_ARCH" = "BeOS"; then
   AC_DEFINE(XP_BEOS)
   MOZ_MOVEMAIL=1
 elif test "$OS_ARCH" = "Darwin"; then
   AC_DEFINE(XP_UNIX)
   AC_DEFINE(UNIX_ASYNC_DNS)
   MOZ_MOVEMAIL=1
 elif test "$OS_ARCH" = "OpenVMS"; then
   AC_DEFINE(XP_UNIX)
@@ -8335,21 +8276,19 @@ if test -z "$MOZ_NATIVE_NSPR"; then
     fi
     AC_OUTPUT_SUBDIRS(nsprpub)
     ac_configure_args="$_SUBDIR_CONFIG_ARGS"
 fi
 
 if test -z "$MOZ_NATIVE_NSPR"; then
     # Hack to deal with the fact that we use NSPR_CFLAGS everywhere
     AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
-    if test ! "$VACPP" && test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE"; then
+    if test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE"; then
        NSPR_LIBS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --libdir=$LIBXUL_DIST/lib --libs`
        $PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $NSPR_LIBS'" config/autoconf.mk
-    fi
-    if test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE" ; then
        NSPR_CFLAGS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --includedir=$LIBXUL_DIST/include/nspr --cflags`
        $PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $NSPR_CFLAGS'" config/autoconf.mk
     fi
     rm -f config/autoconf.mk.bak
 fi
 
 fi # COMPILE_ENVIRONMENT
 
--- a/dbm/include/mcom_db.h
+++ b/dbm/include/mcom_db.h
@@ -151,17 +151,17 @@
 
 #ifdef SNI
 /* #include <sys/hetero.h> */
 #define BYTE_ORDER BIG_ENDIAN
 #define BIG_ENDIAN      4321
 #define LITTLE_ENDIAN   1234
 #endif
 
-#if defined(_WINDOWS) || defined(XP_OS2_VACPP)
+#ifdef _WINDOWS
 #ifdef BYTE_ORDER
 #undef BYTE_ORDER
 #endif
 
 #define BYTE_ORDER LITTLE_ENDIAN
 #define LITTLE_ENDIAN   1234            /* LSB first: i386, vax, all NT risc */
 #define BIG_ENDIAN      4321
 #endif
@@ -183,24 +183,16 @@
 #if defined(_WINDOWS) || defined(XP_OS2)
 #include <stdio.h>
 #include <io.h>
 
 #ifndef XP_OS2 
 #define MAXPATHLEN 	1024               
 #endif
 
-#ifdef XP_OS2_VACPP
-#include <os2.h>
-#define	MAXPATHLEN	CCHMAXPATH
-#define	EPERM		EINVAL
-#define	ENOTDIR		EBADPOS
-#define	S_ISDIR(s)	((s) & S_IFDIR)
-#endif
-
 #define	EFTYPE		EINVAL		/* POSIX 1003.1 format errno. */
 
 #ifndef	STDERR_FILENO
 #define	STDIN_FILENO	0		/* ANSI C #defines */
 #define	STDOUT_FILENO	1
 #define	STDERR_FILENO	2
 #endif
 
--- a/dbm/src/h_bigkey.c
+++ b/dbm/src/h_bigkey.c
@@ -51,17 +51,17 @@ static char sccsid[] = "@(#)hash_bigkey.
  *	__big_return
  *	__big_delete
  *	__find_last_page
  * Internal
  *	collect_key
  *	collect_data
  */
 
-#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP)
+#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh)
 #include <sys/param.h>
 #endif
 
 #include <errno.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
--- a/dbm/src/h_page.c
+++ b/dbm/src/h_page.c
@@ -73,17 +73,17 @@ static char sccsid[] = "@(#)hash_page.c	
 #if defined(_WIN32) || defined(_WINDOWS) 
 #include <io.h>
 #endif
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP)
+#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh)
 #include <unistd.h>
 #endif
 
 #include <assert.h>
 
 #include "mcom_db.h"
 #include "hash.h"
 #include "page.h"
--- a/dbm/src/hash.c
+++ b/dbm/src/hash.c
@@ -33,39 +33,39 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)hash.c	8.9 (Berkeley) 6/16/94";
 #endif /* LIBC_SCCS and not lint */
 
 #include "watcomfx.h"
 
-#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP)
+#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh)
 #include <sys/param.h>
 #endif
 
 #if !defined(macintosh)
-#ifdef XP_OS2_EMX
+#ifdef XP_OS2
 #include <sys/types.h>
 #endif
 #include <sys/stat.h>
 #endif
 
 #if defined(macintosh)
 #include <unix.h>
 #include <unistd.h>
 #endif
 
 #include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
-#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP)
+#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh)
 #include <unistd.h>
 #endif
 #if defined(_WIN32) || defined(_WINDOWS) 
 #include <windows.h>
 #endif
 
 #include <assert.h>
 
--- a/dbm/src/hash_buf.c
+++ b/dbm/src/hash_buf.c
@@ -48,17 +48,17 @@ static char sccsid[] = "@(#)hash_buf.c	8
  * External
  *	__buf_init
  *	__get_buf
  *	__buf_free
  *	__reclaim_buf
  * Internal
  *	newbuf
  */
-#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2_VACPP)
+#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh)
 #include <sys/param.h>
 #endif
 
 #include <errno.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
--- a/dbm/src/mktemp.c
+++ b/dbm/src/mktemp.c
@@ -42,24 +42,20 @@ static char sccsid[] = "@(#)mktemp.c	8.1
 #include <sys/stat.h>
 #endif
 #include <fcntl.h>
 #include <errno.h>
 #include <stdio.h>
 #include <ctype.h>
 #include "mcom_db.h"
 
-#if !defined(_WINDOWS) && !defined(XP_OS2_VACPP)
+#ifndef _WINDOWS
 #include <unistd.h>
 #endif
 
-#ifdef XP_OS2_VACPP
-#include <process.h>
-#endif
-
 #ifdef _WINDOWS
 #include <process.h>
 #include "winfile.h"
 #endif
 
 static int _gettemp(char *path, register int *doopen, int extraFlags);
 
 int
--- a/dbm/src/snprintf.c
+++ b/dbm/src/snprintf.c
@@ -11,40 +11,40 @@
 #include "cdefs.h"
 #endif
 
 #include "prtypes.h"
 
 #include <ncompat.h>
 
 /* The OS/2 VAC compiler doesn't appear to define __STDC__ and won't let us define it either */
-#if defined(__STDC__) || defined(XP_OS2_VACPP)
+#ifdef __STDC__
 #include <stdarg.h>
 #else
 #include <varargs.h>
 #endif
 
 int
-#if defined(__STDC__) || defined(XP_OS2_VACPP)
+#ifdef __STDC__
 snprintf(char *str, size_t n, const char *fmt, ...)
 #else
 snprintf(str, n, fmt, va_alist)
 	char *str;
 	size_t n;
 	const char *fmt;
 	va_dcl
 #endif
 {
 	va_list ap;
 #ifdef VSPRINTF_CHARSTAR
 	char *rp;
 #else
 	int rval;
 #endif
-#if defined(__STDC__) || defined(XP_OS2_VACPP)
+#ifdef __STDC__
 	va_start(ap, fmt);
 #else
 	va_start(ap);
 #endif
 #ifdef VSPRINTF_CHARSTAR
 	rp = vsprintf(str, fmt, ap);
 	va_end(ap);
 	return (strlen(rp));
--- a/modules/libpref/src/prefapi.cpp
+++ b/modules/libpref/src/prefapi.cpp
@@ -42,17 +42,17 @@
 #include "nsCRT.h"
 
 #define PL_ARENA_CONST_ALIGN_MASK 3
 #include "plarena.h"
 
 #if defined(XP_MAC)
   #include <stat.h>
 #else
-  #ifdef XP_OS2_EMX
+  #ifdef XP_OS2
     #include <sys/types.h>
   #endif
 #endif
 #ifdef _WIN32
   #include "windows.h"
 #endif /* _WIN32 */
 
 #ifdef MOZ_SECURITY
--- a/modules/libreg/src/vr_stubs.h
+++ b/modules/libreg/src/vr_stubs.h
@@ -62,17 +62,17 @@
 #include "prmem.h"
 #include "plstr.h"
 
 #endif /* STANDALONE_REGISTRY*/
 
 #ifdef XP_MAC
 #include <stat.h>
 #else
-#if ( defined(BSDI) && !defined(BSDI_2) ) || defined(XP_OS2_EMX)
+#if ( defined(BSDI) && !defined(BSDI_2) ) || defined(XP_OS2)
 #include <sys/types.h>
 #endif
 #include <sys/stat.h>
 #endif
 
 #ifndef FALSE
 #define FALSE 0
 #endif
--- a/profile/pref-migrator/src/Makefile.in
+++ b/profile/pref-migrator/src/Makefile.in
@@ -83,14 +83,9 @@ EXTRA_DSO_LDOPTS = \
 		$(LIBS_DIR) \
 		$(MOZ_COMPONENT_LIBS) \
 		$(MOZ_XPCOM_OBSOLETE_LIBS) \
 		$(MOZ_JS_LIBS) \
 		$(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
-# XXX os/2's gcc crashes on nsPrefMigration.cpp ("virtual memory exhausted")
-ifeq ($(MOZ_OS2_TOOLS),EMX)
-CXXFLAGS	:= $(filter-out -g,$(CXXFLAGS))
-endif
 
-
--- a/sun-java/stubs/include/jni_md.h
+++ b/sun-java/stubs/include/jni_md.h
@@ -139,23 +139,17 @@
 #		define IS_LITTLE_ENDIAN
 #	endif
 	/*  This is the stuff inherited from JavaSoft .. */
 #	define JNIEXPORT __declspec(dllexport)
 #	define JNIIMPORT __declspec(dllimport)
 
 /* OS/2 */
 #elif defined(XP_OS2)
-#	ifdef XP_OS2_VACPP
-#		define JNI_PUBLIC_API(ResultType)	ResultType _System
-#		define JNI_PUBLIC_VAR(VarType)		VarType
-#		define JNICALL				_Optlink
-#		define JNIEXPORT
-#		define JNIIMPORT
-#	elif defined(__declspec)
+#	ifdef __declspec
 #		define JNI_PUBLIC_API(ResultType)	__declspec(dllexport) ResultType
 #		define JNI_PUBLIC_VAR(VarType)		VarType
 #		define JNI_NATIVE_STUB(ResultType)	__declspec(dllexport) ResultType
 #		define JNICALL
 #		define JNIEXPORT
 #		define JNIIMPORT
 #	else
 #		define JNI_PUBLIC_API(ResultType)	ResultType
--- a/sun-java/stubs/include/jri_md.h
+++ b/sun-java/stubs/include/jri_md.h
@@ -116,21 +116,17 @@ extern "C" {
 #		error Unsupported PC development environment.	
 #	endif
 #	ifndef IS_LITTLE_ENDIAN
 #		define IS_LITTLE_ENDIAN
 #	endif
 
 /* OS/2 */
 #elif defined(XP_OS2)
-#	ifdef XP_OS2_VACPP
-#		define JRI_PUBLIC_API(ResultType)	ResultType _Optlink
-#		define JRI_PUBLIC_VAR(VarType)		VarType
-#     		define JRI_CALLBACK
-#	elif defined(__declspec)
+#	ifdef __declspec
 #		define JRI_PUBLIC_API(ResultType)  	__declspec(dllexport) ResultType
 #		define JRI_PUBLIC_VAR(VarType)	   	VarType
 #		define JRI_PUBLIC_VAR_EXP(VarType) 	__declspec(dllexport) VarType
 #		define JRI_PUBLIC_VAR_IMP(VarType) 	__declspec(dllimport) VarType
 #		define JRI_NATIVE_STUB(ResultType) 	__declspec(dllexport) ResultType
 #		define JRI_CALLBACK
 #	else
 #		define JRI_PUBLIC_API(ResultType)	ResultType
--- a/tools/relic/test/addlicense_inputs/emacs_local_vars_line.c
+++ b/tools/relic/test/addlicense_inputs/emacs_local_vars_line.c
@@ -1,21 +1,19 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
 #include <stdio.h>
 #include <stdlib.h>
 
 #if defined(VMS)
 #include <sys/timeb.h>
-#elif defined(XP_UNIX) || defined(XP_OS2_EMX) || defined(XP_BEOS)
+#elif defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS)
 #include <sys/time.h>
 #elif defined(WIN32)
 #include <windows.h>
-#elif defined(XP_OS2_VACPP)
-#include <sys/timeb.h>
 #else
 #error "Architecture not supported"
 #endif
 
 
 int main(int argc, char **argv)
 {
 #if defined(OMIT_LIB_BUILD_TIME)
@@ -32,17 +30,17 @@ int main(int argc, char **argv)
 #elif defined(VMS)
     long long now;
     struct timeb b;
     ftime(&b);
     now = b.time;
     now *= 1000000;
     now += (1000 * b.millitm);
     fprintf(stdout, "%Ld", now);
-#elif defined(XP_UNIX) || defined(XP_OS2_EMX) || defined(XP_BEOS)
+#elif defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS)
     long long now;
     struct timeval tv;
 #ifdef HAVE_SVID_GETTOD
     gettimeofday(&tv);
 #else
     gettimeofday(&tv, NULL);
 #endif
     now = ((1000000LL) * tv.tv_sec) + (long long)tv.tv_usec;
@@ -65,43 +63,16 @@ int main(int argc, char **argv)
      */
 #ifdef __GNUC__
     now = (now - 116444736000000000LL) / 10LL;
     fprintf(stdout, "%lld", now);
 #else
     now = (now - 116444736000000000i64) / 10i64;
     fprintf(stdout, "%I64d", now);
 #endif
-
-#elif defined(XP_OS2_VACPP)
-/* no long long or i64 so we use a string */
-#include <string.h>
-  char buf[24];
-  char tbuf[7];
-  time_t now;
-  long mtime;
-  int i;
-
-  struct timeb b;
-  ftime(&b);
-  now = b.time;
-  _ltoa(now, buf, 10);
-
-  mtime = b.millitm * 1000;
-  if (mtime == 0){
-    ++now;
-    strcat(buf, "000000");
-  } else {
-     _ltoa(mtime, tbuf, 10);
-     for (i = strlen(tbuf); i < 6; ++i)
-       strcat(buf, "0");
-     strcat(buf, tbuf);
-  }
-  fprintf(stdout, "%s", buf);
-
 #else
 #error "Architecture not supported"
 #endif
 
     return 0;
 }  /* main */
 
 /* now.c */
--- a/tools/relic/test/addlicense_outputs/emacs_local_vars_line.c
+++ b/tools/relic/test/addlicense_outputs/emacs_local_vars_line.c
@@ -36,22 +36,20 @@
  * ***** END LICENSE BLOCK ***** */
 
 
 #include <stdio.h>
 #include <stdlib.h>
 
 #if defined(VMS)
 #include <sys/timeb.h>
-#elif defined(XP_UNIX) || defined(XP_OS2_EMX) || defined(XP_BEOS)
+#elif defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS)
 #include <sys/time.h>
 #elif defined(WIN32)
 #include <windows.h>
-#elif defined(XP_OS2_VACPP)
-#include <sys/timeb.h>
 #else
 #error "Architecture not supported"
 #endif
 
 
 int main(int argc, char **argv)
 {
 #if defined(OMIT_LIB_BUILD_TIME)
@@ -68,17 +66,17 @@ int main(int argc, char **argv)
 #elif defined(VMS)
     long long now;
     struct timeb b;
     ftime(&b);
     now = b.time;
     now *= 1000000;
     now += (1000 * b.millitm);
     fprintf(stdout, "%Ld", now);
-#elif defined(XP_UNIX) || defined(XP_OS2_EMX) || defined(XP_BEOS)
+#elif defined(XP_UNIX) || defined(XP_OS2) || defined(XP_BEOS)
     long long now;
     struct timeval tv;
 #ifdef HAVE_SVID_GETTOD
     gettimeofday(&tv);
 #else
     gettimeofday(&tv, NULL);
 #endif
     now = ((1000000LL) * tv.tv_sec) + (long long)tv.tv_usec;
@@ -102,42 +100,16 @@ int main(int argc, char **argv)
 #ifdef __GNUC__
     now = (now - 116444736000000000LL) / 10LL;
     fprintf(stdout, "%lld", now);
 #else
     now = (now - 116444736000000000i64) / 10i64;
     fprintf(stdout, "%I64d", now);
 #endif
 
-#elif defined(XP_OS2_VACPP)
-/* no long long or i64 so we use a string */
-#include <string.h>
-  char buf[24];
-  char tbuf[7];
-  time_t now;
-  long mtime;
-  int i;
-
-  struct timeb b;
-  ftime(&b);
-  now = b.time;
-  _ltoa(now, buf, 10);
-
-  mtime = b.millitm * 1000;
-  if (mtime == 0){
-    ++now;
-    strcat(buf, "000000");
-  } else {
-     _ltoa(mtime, tbuf, 10);
-     for (i = strlen(tbuf); i < 6; ++i)
-       strcat(buf, "0");
-     strcat(buf, tbuf);
-  }
-  fprintf(stdout, "%s", buf);
-
 #else
 #error "Architecture not supported"
 #endif
 
     return 0;
 }  /* main */
 
 /* now.c */
--- a/xpcom/reflect/xptcall/src/md/unix/xptc_platforms_unixish_x86.h
+++ b/xpcom/reflect/xptcall/src/md/unix/xptc_platforms_unixish_x86.h
@@ -145,17 +145,17 @@
 #define THUNK_BASED_THIS_ADJUST
 #else
 #define CFRONT_STYLE_THIS_ADJUST
 #endif
 
 #elif defined(_WIN32)
 #define THUNK_BASED_THIS_ADJUST
 
-#elif defined(__EMX__)
+#elif defined(__OS2__)
 #define THUNK_BASED_THIS_ADJUST
 
 #elif defined (__APPLE__) && (__MACH__)
 #define THUNK_BASED_THIS_ADJUST
 
 #else
 #error "need a platform define if using unixish x86 code"
 #endif
--- a/xpcom/typelib/xpt/tools/xpt_dump.c
+++ b/xpcom/typelib/xpt/tools/xpt_dump.c
@@ -36,17 +36,17 @@
  * ***** END LICENSE BLOCK ***** */
 
 /*
  * A utility for dumping the contents of a typelib file (.xpt) to screen 
  */ 
 
 #include "xpt_xdr.h"
 #include <stdio.h>
-#ifdef XP_OS2_EMX
+#ifdef XP_OS2
 #include <sys/types.h>
 #endif
 #include <sys/stat.h>
 #include <stdlib.h>
 #include <string.h>
 #include "prprf.h"
 
 #define BASE_INDENT 3