1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-26 22:52:34 +02:00

DOS refinements

This allows to use the DOS library trees stored in a user-specified directory.

I have mirrored the needed patches, sources and binaries (the latter
are properly licensed to allow that) in the flashrom wiki, so use those
URLs instead of the original sources.

Corresponding to flashrom svn r1734.

Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
This commit is contained in:
Stefan Tauner 2013-09-11 23:34:57 +00:00
parent cbd566548d
commit 449abe28ab
2 changed files with 19 additions and 13 deletions

View File

@ -39,6 +39,7 @@ CFLAGS ?= -Os -Wall -Wshadow
EXPORTDIR ?= . EXPORTDIR ?= .
AR ?= ar AR ?= ar
RANLIB ?= ranlib RANLIB ?= ranlib
DOSLIBS_BASE ?= ..
# The following parameter changes the default programmer that will be used if there is no -p/--programmer # The following parameter changes the default programmer that will be used if there is no -p/--programmer
# argument given when running flashrom. The predefined setting does not enable any default so that every # argument given when running flashrom. The predefined setting does not enable any default so that every
# user has to declare the programmer he wants to use on every run. The rationale for this to be not set # user has to declare the programmer he wants to use on every run. The rationale for this to be not set
@ -99,11 +100,12 @@ endif
ifeq ($(TARGET_OS), DOS) ifeq ($(TARGET_OS), DOS)
EXEC_SUFFIX := .exe EXEC_SUFFIX := .exe
CPPFLAGS += -I../libgetopt CPPFLAGS += -I$(DOSLIBS_BASE)/libgetopt
# DJGPP has odd uint*_t definitions which cause lots of format string warnings. # DJGPP has odd uint*_t definitions which cause lots of format string warnings.
CFLAGS += -Wno-format CFLAGS += -Wno-format
# FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt # FIXME Check if we can achieve the same effect with -L../libgetopt -lgetopt
LIBS += ../libgetopt/libgetopt.a LIBS += -lgetopt
LDFLAGS += -L$(DOSLIBS_BASE)/libgetopt/
# Bus Pirate, Serprog and PonyProg are not supported under DOS (missing serial support). # Bus Pirate, Serprog and PonyProg are not supported under DOS (missing serial support).
ifeq ($(CONFIG_BUSPIRATE_SPI), yes) ifeq ($(CONFIG_BUSPIRATE_SPI), yes)
UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes UNSUPPORTED_FEATURES += CONFIG_BUSPIRATE_SPI=yes
@ -611,9 +613,9 @@ PCILIBS += -lpciutils -lpci
PCILIBS += -l$(shell uname -p) PCILIBS += -l$(shell uname -p)
else else
ifeq ($(TARGET_OS), DOS) ifeq ($(TARGET_OS), DOS)
# FIXME There needs to be a better way to do this CPPFLAGS += -I$(DOSLIBS_BASE)/libpci/include
CPPFLAGS += -I../libpci/include LDFLAGS += -L$(DOSLIBS_BASE)/libpci/lib/
PCILIBS += ../libpci/lib/libpci.a PCILIBS += -lpci
else else
PCILIBS += -lpci PCILIBS += -lpci
ifeq ($(TARGET_OS), OpenBSD) ifeq ($(TARGET_OS), OpenBSD)

20
README
View File

@ -105,20 +105,24 @@ To cross-compile on Linux for DOS:
djcrx-2.04pre_20090725-13ap.i386.rpm djcrx-2.04pre_20090725-13ap.i386.rpm
The cross toolchain packages for your distribution may have slightly different The cross toolchain packages for your distribution may have slightly different
names (look for packages named *djgpp*). names (look for packages named *djgpp*).
Download pciutils 3.1.5 and apply http://assembler.cz/flashrom/pciutils.patch
Download and compile http://assembler.cz/flashrom/libgetopt/ You will need the following library source trees containing their compiled
static libraries either in the parent directory of the flashrom source or
specify the base folder on compile time with the DOSLIBS_BASE parameter.
The default as described above is equal to calling
'make djgpp-dos DOSLIBS_BASE=..'
To get and build said libraries...
Download pciutils 3.1.5 and apply http://flashrom.org/File:Pciutils.patch.gz
Compile pciutils, see README.DJGPP for instructions. Compile pciutils, see README.DJGPP for instructions.
Download and compile http://flashrom.org/File:Libgetopt.tar.gz
Enter the flashrom directory. Enter the flashrom directory.
../libpci should contain pciutils source and binaries.
../libgetopt should contain getopt.a from libgetopt.
Run either (change settings where appropriate) Run either (change settings where appropriate)
make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip make CC=i586-pc-msdosdjgpp-gcc STRIP=i586-pc-msdosdjgpp-strip
or (above settings hardcoded) or (above settings hardcoded)
make djgpp-dos make djgpp-dos
You might have to add WARNERROR=no to the make command line. To run flashrom.exe, download http://flashrom.org/File:Csdpmi7b.zip and
To run flashrom.exe, download and unpack unpack CWSDPMI.EXE into the current directory or one in PATH.
http://homer.rice.edu/~sandmann/cwsdpmi/csdpmi7b.zip and make sure
CWSDPMI.EXE is in the current directory.
To cross-compile on Linux for Windows: To cross-compile on Linux for Windows: