Mail Archives: djgpp-workers/2000/11/18/18:27:29
At 07:35 PM 11/17/00 +0000, Richard Dawe wrote:
<Snipped>
>This is not very pretty, but I could not find any way of making the
>code compiled without any warnings/errors with binutils 2.8.1 and
>2.95.2 from the same sources.
>
>I'm not suggesting this be incorporated into the DJGPP build, since
it
>would add a dependency on sed, but it's a solution nonetheless.
Per Eli's suggestion, I have figured out how to use GNU make's builtin
functions to extract the GAS version information. Here is a sample
makefile demonstrating the technique:
---------Start makefile-----------------------------
AS := $(DJDIR)/bin/as
GAS_VERSION := $(subst ., ,$(shell $(AS) --version))
GAS_MAJOR := $(word 3,$(GAS_VERSION))
GAS_MINOR := $(word 4,$(GAS_VERSION))
GAS_MINORMINOR := $(word 5,$(GAS_VERSION))
# Defaults for version numbers
ifeq ($(GAS_MAJOR),)
GAS_MAJOR := 0
endif
ifeq ($(GAS_MINOR),)
GAS_MINOR := 0
endif
ifeq ($(GAS_MINORMINOR),)
GAS_MINORMINOR := 0
endif
# Pass defines as compiler switches
CFLAGS += -DGAS_MAJOR=$(GAS_MAJOR)
CFLAGS += -DGAS_MINOR=$(GAS_MINOR)
CFLAGS += -DGAS_MINORMINOR=$(GAS_MINORMINOR)
all:
@echo GAS_MAJOR = $(GAS_MAJOR)
@echo GAS_MINOR = $(GAS_MINOR)
@echo GAS_MINORMINOR = $(GAS_MINORMINOR)
@echo CFLAGS = $(CFLAGS)
---------End makefile-----------------------------
And here is a sample output for gcc 2.9.5 (also tested with gcc 2.8.1,
works there also):
O:\src>make
GAS_MAJOR = 2
GAS_MINOR = 9
GAS_MINORMINOR = 5
CFLAGS = -DGAS_MAJOR=2 -DGAS_MINOR=9 -DGAS_MINORMINOR=5
Patches for "makefile.inc", "exceptn.S" and "dbgcom.c" to make and use
these defines will follow, as soon as I get them working.
HTH.
---------------------------------------------------------
Peter J. Farley III (pjfarley AT dorsai DOT org OR
pjfarley AT banet DOT net)
- Raw text -