You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the DOS port, this allows for easier cross-compilation using a local DJGPP toolchain from UNIX. I do this so I can build from OpenBSD or Linux simply using:
It all can work without having to modify the Makefiles at all, with the following changes:
diff --git a/dos/Makefile b/dos/Makefile
index 428e905b..9fd087c2 100644
--- a/dos/Makefile+++ b/dos/Makefile@@ -1,49 +1,49 @@
# GNU Makefile for PDCurses - DOS
#
# Usage: [g]make [-f path\Makefile] [DEBUG=Y] [target]
#
# where target can be any of:
# [all|libs|demos|pdcurses.a|testcurs.exe...]
O = o
E = .exe
-RM = del+RM ?= del
ifndef PDCURSES_SRCDIR
PDCURSES_SRCDIR = ..
endif
osdir = $(PDCURSES_SRCDIR)/dos
common = $(PDCURSES_SRCDIR)/common
include $(common)/libobjs.mif
PDCURSES_DOS_H = $(osdir)/pdcdos.h
-CC = gcc-STRIP = strip+CC ?= gcc+STRIP ?= strip+AR ?= ar-CFLAGS = -Wall+CFLAGS ?= -Wall
ifeq ($(DEBUG),Y)
CFLAGS += -g -DPDCDEBUG
- LDFLAGS = -g+ LDFLAGS ?= -g
else
CFLAGS += -O2
- LDFLAGS =+ LDFLAGS ?=
endif
CFLAGS += -I$(PDCURSES_SRCDIR)
-LINK = gcc+LINK ?= $(CC)-LIBEXE = ar+LIBEXE ?= $(AR)
LIBFLAGS = rcv
LIBCURSES = pdcurses.a
.PHONY: all libs clean demos dist
all: libs
libs: $(LIBCURSES)
Similarly for dosvga, if wanted.
I also propose some changes to Windows ports Makefiles, but it's a bit more complicated, so I hope I did it all right.
PDCursesMod does supports a setting a PREFIX, but still hard-codes gcc, ar, and strip, even thought there are other Windows compilers with compatible front-ends (Midipix, Cygwin, MSVC clang-cl, LLVM mingw-clang, etc.) ... also, assume gcc if PREFIX is set (or CC is set to cc), but don't ever override any user specified CFLAGS/LDFLAGS/PREFIX, and use the PREFIX for calls to ar and strip (since the host versions of those tools might not be compatible with the output formats). (I'm using the Xprefix's when rather than overwriting the variable with itself to get around a bug in some older Windows make ports.)
This allows for cases like env PREFIX=x86_64-pc-cygwin- gmake, env CC=/usr/bin/i686-pc-cygwin-gcc STRIP=/usr/local/bin/my-own-better-strip gmake, and env CC=/opt/wxc/compiler/wxc STRIP=/opt/localbinutils/gstrip gmake to all work sanely.
I don't believe it would break any current use-cases, but I didn't test extensively on Windows. These changes are for wincon but should be applied to wingui as well:
For the DOS port, this allows for easier cross-compilation using a local DJGPP toolchain from UNIX. I do this so I can build from OpenBSD or Linux simply using:
I also have some wrapper hacks that leverage MS-DOS Player in combination with Wine to run Borland C 5.02 for DOS on Linux as a cross-compiler):
It all can work without having to modify the Makefiles at all, with the following changes:
Similarly for
dosvga
, if wanted.I also propose some changes to Windows ports Makefiles, but it's a bit more complicated, so I hope I did it all right.
PDCursesMod does supports a setting a
PREFIX
, but still hard-codesgcc
,ar
, andstrip
, even thought there are other Windows compilers with compatible front-ends (Midipix, Cygwin, MSVC clang-cl, LLVM mingw-clang, etc.) ... also, assumegcc
ifPREFIX
is set (orCC
is set tocc
), but don't ever override any user specifiedCFLAGS
/LDFLAGS
/PREFIX
, and use thePREFIX
for calls toar
andstrip
(since the host versions of those tools might not be compatible with the output formats). (I'm using theX
prefix's when rather than overwriting the variable with itself to get around a bug in some older Windows make ports.)This allows for cases like
env PREFIX=x86_64-pc-cygwin- gmake
,env CC=/usr/bin/i686-pc-cygwin-gcc STRIP=/usr/local/bin/my-own-better-strip gmake
, andenv CC=/opt/wxc/compiler/wxc STRIP=/opt/localbinutils/gstrip gmake
to all work sanely.I don't believe it would break any current use-cases, but I didn't test extensively on Windows. These changes are for
wincon
but should be applied towingui
as well:The text was updated successfully, but these errors were encountered: