Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bcc.mk and hbmk2.prg for BCC64 #330

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
Entries may not always be in chronological/commit order.
See license at the end of file. */

2023-11-04 17:05 UTC+0100 Enrico Maria Giordano ([email protected])
* config/win/bcc.mk
* utils/hbmk2/hbmk2.prg
! fixed for BCC64 compilation

2023-10-29 14:27 UTC+0100 Enrico Maria Giordano ([email protected])
* contrib/hbssl/hbssl.hbp
! added support for Openssl 3
Expand Down
22 changes: 15 additions & 7 deletions config/win/bcc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,25 @@ CC_OUT := -o

CFLAGS += -I. -I$(HB_HOST_INC)

CFLAGS += -q -tWM -CP437
ifeq ($(HB_COMPILER),bcc64)
CFLAGS += -q -tWM
else
CFLAGS += -q -tWM -CP437
endif

ifeq ($(HB_BUILD_WARN),no)
CFLAGS += -w-sig- -w-aus- -w-ccc- -w-csu- -w-par- -w-rch- -w-ucp- -w-use- -w-prc- -w-pia-
ifeq ($(HB_COMPILER),bcc64)
CFLAGS += -w
else
CFLAGS += -w -Q -w-sig-
ifeq ($(HB_BUILD_WARN),no)
CFLAGS += -w-sig- -w-aus- -w-ccc- -w-csu- -w-par- -w-rch- -w-ucp- -w-use- -w-prc- -w-pia-
else
CFLAGS += -w -Q -w-sig-
endif
endif
tuffnatty marked this conversation as resolved.
Show resolved Hide resolved

ifneq ($(HB_BUILD_OPTIM),no)
ifeq ($(HB_COMPILER),bcc64)
CFLAGS += -d -O2 -OS -Ov -Oc
CFLAGS += -d -O2
else
# for some reason -6 generates the exact same code as -4 with both 5.5 and 5.8.
# -5 seems to be significantly slower than both. [vszakats]
Expand Down Expand Up @@ -93,9 +101,9 @@ endif
LIBPATHS := $(foreach dir,$(LIB_DIR) $(3RDLIB_DIR),$(subst /,$(BACKSLASH),-L"$(dir)"))
LDFLAGS += $(LIBPATHS) -Gn -Tpe
ifeq ($(HB_COMPILER),bcc64)
LD_RULE = $(LD) $(LDFLAGS) $(HB_LDFLAGS) $(HB_USER_LDFLAGS) c0x64.obj $(filter-out %$(RES_EXT),$(^F)), "$(subst /,$(BACKSLASH),$(BIN_DIR)/$@)", nul, $(LDLIBS) cw64mt import64,, $(filter %$(RES_EXT),$(^F)) $(LDSTRIP)
LD_RULE = $(LD) $(LDFLAGS) $(HB_LDFLAGS) $(HB_USER_LDFLAGS) c0x64$(OBJ_EXT) $(filter-out %$(RES_EXT),$(^F)), "$(subst /,$(BACKSLASH),$(BIN_DIR)/$@)", nul, $(LDLIBS) cw64mt import64 xmath,, $(filter %$(RES_EXT),$(^F)) $(LDSTRIP)
tuffnatty marked this conversation as resolved.
Show resolved Hide resolved
else
LD_RULE = $(LD) $(LDFLAGS) $(HB_LDFLAGS) $(HB_USER_LDFLAGS) c0x32.obj $(filter-out %$(RES_EXT),$(^F)), "$(subst /,$(BACKSLASH),$(BIN_DIR)/$@)", nul, $(LDLIBS) cw32mt import32,, $(filter %$(RES_EXT),$(^F)) $(LDSTRIP)
LD_RULE = $(LD) $(LDFLAGS) $(HB_LDFLAGS) $(HB_USER_LDFLAGS) c0x32$(OBJ_EXT) $(filter-out %$(RES_EXT),$(^F)), "$(subst /,$(BACKSLASH),$(BIN_DIR)/$@)", nul, $(LDLIBS) cw32mt import32,, $(filter %$(RES_EXT),$(^F)) $(LDSTRIP)
endif

LDLIBS := $(strip $(HB_USER_LIBS) $(LIBS) $(3RDLIBS) $(SYSLIBS))
Expand Down
48 changes: 33 additions & 15 deletions utils/hbmk2/hbmk2.prg
Original file line number Diff line number Diff line change
Expand Up @@ -1969,7 +1969,11 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit
cOptPrefix := "-/"
/* NOTE: Some targets (watcom, pocc/xcc) need kernel32 explicitly. */
l_aLIBSYSCORE := { "winmm", "kernel32", "user32", "gdi32", "advapi32", "ws2_32", "iphlpapi" }
l_aLIBSYSMISC := { "winspool", "comctl32", "comdlg32", "shell32", "uuid", "ole32", "oleaut32", "mpr", "mapi32", "imm32", "msimg32", "wininet" }
IF hbmk[ _HBMK_cCOMP ] == "bcc64"
l_aLIBSYSMISC := { "winspool", "comctl32", "comdlg32", "shell32", "ole32", "oleaut32", "mpr", "mapi32", "imm32", "msimg32", "wininet" }
ELSE
l_aLIBSYSMISC := { "winspool", "comctl32", "comdlg32", "shell32", "uuid", "ole32", "oleaut32", "mpr", "mapi32", "imm32", "msimg32", "wininet" }
ENDIF
CASE hbmk[ _HBMK_cPLAT ] == "wce"
#if ! defined( __PLATFORM__UNIX )
aCOMPDET := { ;
Expand Down Expand Up @@ -5008,16 +5012,20 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit
cBin_CompC := "bcc32.exe"
ENDIF
cBin_CompCPP := cBin_CompC
cOpt_CompC := "-c -q -CP437"
IF hbmk[ _HBMK_cCOMP ] == "bcc64"
cOpt_CompC := "-c -q"
ELSE
cOpt_CompC := "-c -q -CP437"
ENDIF
IF hbmk[ _HBMK_lOPTIM ]
IF hbmk[ _HBMK_cCOMP ] == "bcc64"
cOpt_CompC += " -d -O2 -OS -Ov -Oc"
cOpt_CompC += " -d -O2"
ELSE
cOpt_CompC += " -d -O2 -OS -Ov -Oc -Oi -6"
ENDIF
ENDIF
IF hbmk[ _HBMK_cCOMP ] == "bcc64"
cLibBCC_CRTL := "cw64mt.lib"
cLibBCC_CRTL := "cw64mt.a"
ELSE
cLibBCC_CRTL := "cw32mt.lib"
ENDIF
Expand All @@ -5030,20 +5038,29 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit
AAdd( hbmk[ _HBMK_aOPTC ], "-tWM" )
ELSE
IF hbmk[ _HBMK_cCOMP ] == "bcc64"
cLibBCC_CRTL := "cw64.lib"
cLibBCC_CRTL := "cw64.a"
ELSE
cLibBCC_CRTL := "cw32.lib"
ENDIF
ENDIF
ELSE
AAdd( hbmk[ _HBMK_aOPTC ], "-tWM" )
ENDIF
SWITCH hbmk[ _HBMK_nWARN ]
CASE _WARN_MAX ; AAdd( hbmk[ _HBMK_aOPTC ], "-w -Q" ) ; EXIT
CASE _WARN_YES ; AAdd( hbmk[ _HBMK_aOPTC ], "-w -Q -w-sig-" ) ; EXIT
CASE _WARN_LOW ; AAdd( hbmk[ _HBMK_aOPTC ], "-w-sig- -w-aus- -w-ccc- -w-csu- -w-par- -w-rch- -w-ucp- -w-use- -w-prc- -w-pia-" ) ; EXIT
CASE _WARN_NO ; AAdd( hbmk[ _HBMK_aOPTC ], "-w-" ) ; EXIT
ENDSWITCH
IF hbmk[ _HBMK_cCOMP ] == "bcc64"
SWITCH hbmk[ _HBMK_nWARN ]
CASE _WARN_MAX ; AAdd( hbmk[ _HBMK_aOPTC ], "-w" ) ; EXIT
CASE _WARN_YES ; AAdd( hbmk[ _HBMK_aOPTC ], "-w" ) ; EXIT
CASE _WARN_LOW ; AAdd( hbmk[ _HBMK_aOPTC ], "-w" ) ; EXIT
CASE _WARN_NO ; AAdd( hbmk[ _HBMK_aOPTC ], "-w" ) ; EXIT
ENDSWITCH
tuffnatty marked this conversation as resolved.
Show resolved Hide resolved
ELSE
SWITCH hbmk[ _HBMK_nWARN ]
CASE _WARN_MAX ; AAdd( hbmk[ _HBMK_aOPTC ], "-w -Q" ) ; EXIT
CASE _WARN_YES ; AAdd( hbmk[ _HBMK_aOPTC ], "-w -Q -w-sig-" ) ; EXIT
CASE _WARN_LOW ; AAdd( hbmk[ _HBMK_aOPTC ], "-w-sig- -w-aus- -w-ccc- -w-csu- -w-par- -w-rch- -w-ucp- -w-use- -w-prc- -w-pia-" ) ; EXIT
CASE _WARN_NO ; AAdd( hbmk[ _HBMK_aOPTC ], "-w-" ) ; EXIT
ENDSWITCH
ENDIF
cOpt_CompC += " {FC} {LC}"
cBin_Res := "brcc32.exe"
cOpt_Res := "{FR} {IR} -fo{OS}"
Expand All @@ -5055,14 +5072,15 @@ STATIC FUNCTION __hbmk( aArgs, nArgTarget, nLevel, /* @ */ lPause, /* @ */ lExit
ENDIF
cBin_Dyn := cBin_Link
IF hbmk[ _HBMK_cCOMP ] == "bcc64"
cOpt_Link := "-Gn -Tpe -L{DL} {FL} " + iif( hbmk[ _HBMK_lGUI ], "c0w64.obj", "c0x64.obj" ) + " {LO}, {OE}, " + iif( hbmk[ _HBMK_lMAP ], "{OM}", "nul" ) + ", {LL} {LB} {LF} " + cLibBCC_CRTL + " import64.lib, {IM}, {LS}{SCRIPT}"
cOpt_Dyn := "-Gn -Tpd -L{DL} {FD} " + "c0d64.obj" + " {LO}, {OD}, " + iif( hbmk[ _HBMK_lMAP ], "{OM}", "nul" ) + ", {LL} {LB} {LF} " + cLibBCC_CRTL + " import64.lib, {IM}, {LS}{SCRIPT}"
cOpt_Link := "-Gn -Tpe -L{DL} {FL} " + iif( hbmk[ _HBMK_lGUI ], "c0w64.obj", "c0x64.o" ) + " {LO}, {OE}, " + iif( hbmk[ _HBMK_lMAP ], "{OM}", "nul" ) + ", {LL} {LB} {LF} " + cLibBCC_CRTL + " import64.a, {IM}, {LS}{SCRIPT}"
cOpt_Dyn := "-Gn -Tpd -L{DL} {FD} " + "c0d64.obj" + " {LO}, {OD}, " + iif( hbmk[ _HBMK_lMAP ], "{OM}", "nul" ) + ", {LL} {LB} {LF} " + cLibBCC_CRTL + " import64.a, {IM}, {LS}{SCRIPT}"
ELSE
cOpt_Link := "-Gn -Tpe -L{DL} {FL} " + iif( hbmk[ _HBMK_lGUI ], "c0w32.obj", "c0x32.obj" ) + " {LO}, {OE}, " + iif( hbmk[ _HBMK_lMAP ], "{OM}", "nul" ) + ", {LL} {LB} {LF} " + cLibBCC_CRTL + " import32.lib, {IM}, {LS}{SCRIPT}"
cOpt_Dyn := "-Gn -Tpd -L{DL} {FD} " + "c0d32.obj" + " {LO}, {OD}, " + iif( hbmk[ _HBMK_lMAP ], "{OM}", "nul" ) + ", {LL} {LB} {LF} " + cLibBCC_CRTL + " import32.lib, {IM}, {LS}{SCRIPT}"
ENDIF
IF hbmk[ _HBMK_cCOMP ] == "bcc"
/* TODO: Add support for bcc64/mkexp */
IF hbmk[ _HBMK_cCOMP ] == "bcc64"
bBlk_ImpLib := {| cSourceDLL, cTargetLib, cFlags | win_implib_command_bcc( hbmk, "mkexp.exe {FI} {OL} {ID}", cSourceDLL, cTargetLib, cFlags ) }
ELSE
bBlk_ImpLib := {| cSourceDLL, cTargetLib, cFlags | win_implib_command_bcc( hbmk, "implib.exe -c {FI} {OL} {ID}", cSourceDLL, cTargetLib, cFlags ) }
ENDIF
cLibPathPrefix := ""
Expand Down