Warpzilla patches OS2_BRANCH
authorlaw
Wed, 08 Apr 1998 01:39:25 +0000
branchOS2_BRANCH
changeset 12 edd5af52a26f7d2c90583bdb53d43b0e74f817d5
parent 4 5e8b6f02baafcd2cc1be0b3a813562c0ce608b93
child 13 d9af9428853b33769372eefe6225dc1cec03a0c3
push idunknown
push userunknown
push dateunknown
Warpzilla patches
config/OS2.mk
config/arch.mk
config/rules.mk
--- a/config/OS2.mk
+++ b/config/OS2.mk
@@ -21,31 +21,37 @@
 # OS_CFLAGS is the command line options for the compiler when
 #   building the .DLL object files.
 # OS_EXE_CFLAGS is the command line options for the compiler
 #   when building the .EXE object files; this is for the test
 #   programs.
 # the macro OS_CFLAGS is set to OS_EXE_CFLAGS inside of the
 #   makefile for the pr/tests directory. ... Hack.
 
+# Specify toolset.  Default to EMX.
+ifeq ($(MOZ_OS2_TOOLS),VACPP)
+XP_OS2_VACPP = 1
+else
+XP_OS2_EMX   = 1
+endif
 
 #
 # On OS/2 we proudly support gbash...
 #
 SHELL = GBASH.EXE
 
 CC			= icc -q -DXP_OS2 -N10
 CCC			= icc -q -DXP_OS2 -DOS2=4 -N10
 LINK			= flipper ilink
 AR			= flipper ilibo //noignorecase //nologo $@
 RANLIB = echo
 BSDECHO = echo
 NSINSTALL = nsinstall
 INSTALL	= $(NSINSTALL)
-MAKE_OBJDIR = mkdir $(OBJDIR)
+MAKE_OBJDIR = -mkdir $(OBJDIR)
 IMPLIB = flipper implib -nologo -noignorecase
 FILTER = flipper cppfilt -q
 RC = rc.exe
 
 GARBAGE =
 
 XP_DEFINE = -DXP_PC
 LIB_SUFFIX = lib
@@ -79,8 +85,35 @@ OBJDIR_NAME = $(subst OS2,NAV,$(OS_CONFI
 else
 OBJDIR_NAME = $(OS_CONFIG)$(OBJDIR_TAG).OBJ
 endif
 else
 OBJDIR_NAME = $(OS_CONFIG)$(CPU_ARCH)$(OBJDIR_TAG).OBJ
 endif
 
 OS_DLLFLAGS = -nologo -DLL -FREE -NOE
+
+ifdef XP_OS2_VACPP
+
+DEFINES += -DXP_OS2_VACPP
+
+else
+
+CC		= gcc
+CCC		= gcc
+LINK	= gcc
+AR      = gcc
+RC 		= rc.exe
+
+DEFINES += -DXP_OS2_EMX
+
+ifdef BUILD_OPT
+OPTIMIZER	= -O3
+else
+OPTIMIZER	= -g
+endif
+
+OS_CFLAGS     = -I. -Wall -Zmt $(DEFINES)
+OS_EXE_CFLAGS = -I. -Wall -Zmt $(DEFINES)
+
+endif
+
+
--- a/config/arch.mk
+++ b/config/arch.mk
@@ -112,16 +112,25 @@ endif
 # OS_OBJTYPE is used only by Linux
 #
 
 ifeq ($(OS_ARCH),Linux)
 	OS_OBJTYPE := ELF
 	OS_RELEASE := $(basename $(OS_RELEASE))
 endif
 
+#
+# Handle uname variants for OS/2.
+#
+
+ifeq ($(OS_ARCH),OS_2)
+	OS_ARCH		:= OS2
+	OS_RELEASE	:= 4.0
+endif
+
 #######################################################################
 # Master "Core Components" macros for getting the OS target           #
 #######################################################################
 
 #
 # Note: OS_TARGET should be specified on the command line for gmake.
 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
 # The difference between the Win95 target and the WinNT target is that
@@ -156,17 +165,21 @@ ifeq ($(OS_ARCH), OS2)
 	OS_TARGET := OS2
 endif
 
 #
 # On WIN32, we also define the variable CPU_ARCH.
 #
 
 ifeq ($(OS_ARCH), WINNT)
-	CPU_ARCH := $(shell uname -p)
+	ifneq ($(subst /,_,$(shell uname -s)),OS_2)
+		CPU_ARCH := $(shell uname -p)
+	else
+		CPU_ARCH := $(shell uname -m)
+	endif
 	ifeq ($(CPU_ARCH),I386)
 		CPU_ARCH = x386
 	endif
 else
 #
 # If uname -s returns "Windows_NT", we assume that we are using
 # the uname.exe in MKS toolkit.
 #
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -311,34 +311,42 @@ else
 	$(RC) -Fo$(RES) $(RESNAME)
 endif
 	@echo $(RES) finished
 endif
 
 $(OBJDIR)/%.o: %.cpp
 	@$(MAKE_OBJDIR)
 ifeq ($(OS_ARCH), WINNT)
+ifndef XP_OS2_EMX
 	$(CCC) -Fo$@ -c $(CFLAGS) $<
 else
 	$(CCC) -o $@ -c $(CFLAGS) $< 
 endif
+else
+	$(CCC) -o $@ -c $(CFLAGS) $< 
+endif
 
 WCCFLAGS1 = $(subst /,\\,$(CFLAGS))
 WCCFLAGS2 = $(subst -I,-i=,$(WCCFLAGS1))
 WCCFLAGS3 = $(subst -D,-d,$(WCCFLAGS2))
 $(OBJDIR)/%.o: %.c
 	@$(MAKE_OBJDIR)
 ifeq ($(OS_ARCH), WINNT)
 ifeq ($(OS_TARGET), WIN16)
 #	$(MOD_DEPTH)/config/w16opt $(WCCFLAGS3)
 	echo $(WCCFLAGS3) >w16wccf
 	$(CC) -zq -fo$(OBJDIR)\\$*.o  @w16wccf $*.c
 	rm w16wccf
 else
+ifndef XP_OS2_EMX
 	$(CC) -Fo$@ -c $(CFLAGS) $*.c
+else
+	$(CC) -o $@ -c $(CFLAGS) $*.c
+endif
 endif
 else
 	$(CC) -o $@ -c $(CFLAGS) $*.c
 endif
 
 $(OBJDIR)/%.o: %.s
 	@$(MAKE_OBJDIR)
 	$(AS) -o $@ $(ASFLAGS) -c $*.s