(Incomplete) Patch for Borland C++


Subject: (Incomplete) Patch for Borland C++
From: Harald Fernengel (harry@bnro.de)
Date: Fri May 19 2000 - 07:48:19 CDT


Hello,

this is my incomplete patch for compiling AbiWord with the free
Borland C++ 5.5 compiler under Windows. I added the ABI_OPT_BORLAND
variable to the makefiles, so it shouldn't break any other compiler.

To compile AbiWord you have to add the Borland \BIN directory to
your path, adjust your BCC32.CFG file (in \BIN directory) and type
the following on a CYGNUS bash:

make realclean
make ABI_OPT_BORLAND=1

Please do not use ABI_OPT_DEBUG, because I haven't implemented this
yet.

All the OBJ's and LIB's compile fine, but near to the end the
compile crashes with unresolved externals. I believe this happens
because of old .H and .LIB's in the BORLAND directory. I tried to
copy some files from VC++ (ZMOUSE.H and others) to the Borland lib
directory but it didn't help.

Please do not apply this patch to the tree, because it is not
working yet and in one place I simply commented out a VC++ call that
is only needed for debugging reasons and crashed BCC.

Any hints are welcome!!!

Harry

? log.txt
? log2.txt
? src/WIN32_20.1_i386_OBJ
? src/wp/main/win/Win32Main.RES
Index: src/af/gr/win/gr_Win32Graphics.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/gr/win/gr_Win32Graphics.cpp,v
retrieving revision 1.42
diff -r1.42 gr_Win32Graphics.cpp
174c174
< ExtTextOutW(m_hdc, xoff, yoff, 0, NULL, &Char, 1, NULL);

---
> 	ExtTextOutW(m_hdc, xoff, yoff, 0, NULL, (const wchar_t *)&Char, 1, NULL);
187c187
< 	ExtTextOutW(m_hdc, xoff, yoff, 0, NULL, pChars + iCharOffset, iLength, NULL);
---
> 	ExtTextOutW(m_hdc, xoff, yoff, 0, NULL, (const wchar_t *)pChars + iCharOffset, iLength, NULL);
Index: src/af/util/xp/ut_misc.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/util/xp/ut_misc.cpp,v
retrieving revision 1.31
diff -r1.31 ut_misc.cpp
188,189c188,189
< 	char * dotpos = strrchr(path, '.');
< 	char * slashpos = strrchr(path, ut_PATHSEP);
---
> 	char * dotpos = strrchr((char*)path, '.');
> 	char * slashpos = strrchr((char*)path, ut_PATHSEP);
Index: src/af/xap/win/xap_Win32Dlg_Insert_Symbol.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/xap/win/xap_Win32Dlg_Insert_Symbol.cpp,v
retrieving revision 1.5
diff -r1.5 xap_Win32Dlg_Insert_Symbol.cpp
221c221
< int XAP_Win32Dialog_Insert_Symbol::fontEnumProcedure(const LOGFONT *pLogFont, const TEXTMETRIC *pTextMetric, DWORD Font_type, LPARAM lParam)
---
> int CALLBACK XAP_Win32Dialog_Insert_Symbol::fontEnumProcedure(const LOGFONT *pLogFont, const TEXTMETRIC *pTextMetric, DWORD Font_type, LPARAM lParam)
Index: src/af/xap/xp/xap_Dialog_Id.h
===================================================================
RCS file: /cvsroot/abi/src/af/xap/xp/xap_Dialog_Id.h,v
retrieving revision 1.13
diff -r1.13 xap_Dialog_Id.h
53c53
< };
---
> } __XAP_Dialog_Id;
Index: src/af/xap/xp/xap_Strings.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/xap/xp/xap_Strings.cpp,v
retrieving revision 1.6
diff -r1.6 xap_Strings.cpp
99c99
< 	setValue(XAP_STRING_ID__FIRST__,0);			// bogus zero element
---
> 	setValue((char*)XAP_STRING_ID__FIRST__,0);			// bogus zero element
Index: src/config/abi_defs_wp.mk
===================================================================
RCS file: /cvsroot/abi/src/config/abi_defs_wp.mk,v
retrieving revision 1.9
diff -r1.9 abi_defs_wp.mk
44a45,47
> ifdef ABI_OPT_BORLAND
> ABI_NAMEDEFS=	-DABIWORD_APP_NAME="\\\"AbiWord\\\""
> else
45a49
> endif
52a57,59
> ifdef ABI_OPT_BORLAND
> ABI_NAMEDEFS=	-DABIWORD_APP_NAME=\\\"AbiWord Personal\\\"
> else
53a61
> endif
67a76,78
> ifdef ABI_OPT_BORLAND
> ABI_APPLIBDIRDEF= -DABIWORD_APP_LIBDIR="\\\"AbiWord\\\""
> else
68a80
> endif
Index: src/config/abi_rules.mk
===================================================================
RCS file: /cvsroot/abi/src/config/abi_rules.mk,v
retrieving revision 1.24
diff -r1.24 abi_rules.mk
81a82
> ifndef ABI_OPT_BORLAND
83a85
> endif
125a128,133
> ifdef ABI_OPT_BORLAND
> 	@echo *** Making Helper Program... ***
> 	@$(CC) $(shell echo $(OBJS) | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')	\
> 		-e$(shell echo $@ | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')		\
> 		-link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
> else
128a137
> endif		
140a150,155
> ifdef ABI_OPT_BORLAND
> ####    Borland's Tools don't work with the workaround mentioned below
> ####    If your bash crashes please update to a newer version
> 	@echo *** Linking... ***
> 	@$(AR) $(shell echo $(OBJS) | sed 's|//[a-zA-Z]/|\+/|g' | sed 's|/|\\\\|g')
> else
148a164
> endif
169a186,189
> ifdef ABI_OPT_BORLAND
> 	@$(RC) -r /fo$(shell echo $(RCOBJS) | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')	\
> 		$(ABI_INCS) $(ABI_TMDEFS) $(RCSRCS)
> else
171a192
> endif		
181a203,205
> ifdef ABI_OPT_BORLAND	
> 	@$(CCC) -o$(shell echo $@ | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g') -c $(CFLAGS) $<
> else
182a207
> endif	
194a220,223
> ifdef ABI_OPT_BORLAND
> 	@$(CCC) -o$(shell echo $@ | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g') -c	\
> 		$(CFLAGS) $(shell echo $< | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')
> else
196a226
> endif		
208a239,241
> ifdef ABI_OPT_BORLAND
> 	@$(CC) -o$(shell echo $@ | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g') -c $(CFLAGS) $<
> else
209a243
> endif	
222a257,260
> ifdef ABI_OPT_BORLAND
> 	@$(CC) -o$(shell echo $@ | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g') -c	\
> 		$(CFLAGS) $(shell echo $< | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')
> else	
224a263
> endif		
Index: src/config/platforms/win32.mk
===================================================================
RCS file: /cvsroot/abi/src/config/platforms/win32.mk,v
retrieving revision 1.18
diff -r1.18 win32.mk
35a36,44
> ifdef ABI_OPT_BORLAND
> CC		= bcc32
> CCC 	= bcc32
> LINK 	= ilink32
> AR 	= tlib "$(shell echo $@ | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')"
> RANLIB 	= echo
> BSDECHO	= echo
> RC 	= brc32.exe
> else
42a52
> endif
81a92,99
> ifdef ABI_OPT_BORLAND
> DEFINES		= -UDEBUG -U_DEBUG -DNDEBUG
> OBJ_DIR_SFX	= OBJ
> OS_CFLAGS 	= -d -DWIN32 -g0
> DLLFLAGS 	= -OUT:"$@"
> LDFLAGS 	=
> OS_DLLFLAGS 	= -DLL -SUBSYSTEM:WINDOWS -PDB:NONE
> else
87a106
> endif
Index: src/text/fmt/xp/fl_BlockLayout.cpp
===================================================================
RCS file: /cvsroot/abi/src/text/fmt/xp/fl_BlockLayout.cpp,v
retrieving revision 1.151
diff -r1.151 fl_BlockLayout.cpp
365c365
< 		char * pPlusFound = strrchr(pszSpacing, '+');
---
> 		char * pPlusFound = strrchr((char*)pszSpacing, '+');
Index: src/tools/cdump/win/Makefile
===================================================================
RCS file: /cvsroot/abi/src/tools/cdump/win/Makefile,v
retrieving revision 1.5
diff -r1.5 Makefile
47a48,54
> ifdef ABI_OPT_BORLAND
> 	@$(CC) $(shell echo $(OBJS) | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')		\
> 		-e$(shell echo $@ | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')		\
> 		-link $(LDFLAGS) $(OS_LIBS) $(ABI_LDFLAGS) $(subst /,\\,$(EXTRA_LIBS))
> # somehow BCC always creates .EXEs in the OBJ dir, so we have to move manually
> 	@mv $(OBJDIR)/cdump$(EXE_SUFFIX) $(BINDIR)/cdump$(EXE_SUFFIX)
> else
50a58
> endif		
Index: src/wp/ap/win/ap_Win32App.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/win/ap_Win32App.cpp,v
retrieving revision 1.45
diff -r1.45 ap_Win32App.cpp
671a672
> 	/*
675c676,677
< 
---
> 	*/
> 	
Index: src/wp/ap/xp/ap_Dialog_Id.h
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Dialog_Id.h,v
retrieving revision 1.18
diff -r1.18 ap_Dialog_Id.h
47c47
< };
---
> } __AP_Dialog_Id;
Index: src/wp/ap/xp/ap_Dialog_Paragraph.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Dialog_Paragraph.cpp,v
retrieving revision 1.22
diff -r1.22 ap_Dialog_Paragraph.cpp
193c193
< 				char * pPlusFound = strrchr(sz, '+');
---
> 				char * pPlusFound = strrchr((char*)sz, '+');
Index: src/wp/ap/xp/ap_EditMethods.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_EditMethods.cpp,v
retrieving revision 1.194
diff -r1.194 ap_EditMethods.cpp
3535c3535
< 			XML_Char*	p = strstr(s, vOn);
---
> 			XML_Char*	p = strstr((char*)s, vOn);
Index: src/wp/ap/xp/ap_Menu_LabelSet.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Menu_LabelSet.cpp,v
retrieving revision 1.11
diff -r1.11 ap_Menu_LabelSet.cpp
103c103
< 		char * dash = strchr(szLanguage, '-');
---
> 		char * dash = strchr((char*)szLanguage, '-');
Index: src/wp/ap/xp/ap_Toolbar_LabelSet.cpp
===================================================================
RCS file: /cvsroot/abi/src/wp/ap/xp/ap_Toolbar_LabelSet.cpp,v
retrieving revision 1.7
diff -r1.7 ap_Toolbar_LabelSet.cpp
107c107
< 		char * dash = strchr(szLanguage, '-');
---
> 		char * dash = strchr((char*)szLanguage, '-');
Index: src/wp/main/win/Makefile
===================================================================
RCS file: /cvsroot/abi/src/wp/main/win/Makefile,v
retrieving revision 1.28
diff -r1.28 Makefile
54a55,65
> ifdef ABI_OPT_BORLAND
> 	@echo OBJS: $(OBJS)
> 	@echo FILES: $@
> 	@echo $(LDFLAGS) $(OS_LIBS) $(ABI_LDFLAGS)
> 	@echo Extra-Libs: $(EXTRA_LIBS)	
> 	@echo @$(CC) $(shell echo $(OBJS) | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')	-e$(shell echo $@ | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')	-link $(LDFLAGS) $(OS_LIBS) $(ABI_LDFLAGS) $(shell echo $(EXTRA_LIBS) | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')
> 	@$(CC) $(shell echo $(OBJS) | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')	\
> 		-e$(shell echo $@ | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')	\
> 		-l $(LDFLAGS) $(OS_LIBS) $(ABI_LDFLAGS)				\
> 		$(shell echo $(EXTRA_LIBS) | sed 's|//[a-zA-Z]/|/|g' | sed 's|/|\\\\|g')	
> else
58a70
> endif		
Index: src/wp/main/xp/Makefile
===================================================================
RCS file: /cvsroot/abi/src/wp/main/xp/Makefile,v
retrieving revision 1.5
diff -r1.5 Makefile
52a53,58
> ifdef ABI_OPT_BORLAND
> ABI_VERFLAGS=		-DABI_BUILD_ID=\\\"$(BUILD_ID)\\\"			\
> 			-DABI_BUILD_VERSION=\\\"$(BUILD_VERSION)\\\"	\
> 			-DABI_BUILD_OPTIONS=\\\"$(BUILD_OPTIONS)\\\"	\
> 			-DABI_BUILD_TARGET=\\\"$(OBJDIR)\\\"
> else
56a63
> endif			



This archive was generated by hypermail 2b25 : Fri May 19 2000 - 07:46:12 CDT