nvramtool: Allow build under Cygwin
To build under Cygwin, nvramtool depends upon the package ioperm: http://openwince.sourceforge.net/ioperm/ for sys/io.h and sys/perm.h. This change causes the nvramtool make to correctly include and link against these headers and libraries. Change-Id: If6cd9d324de7bc19830e0018844f42761b28ddd3 Signed-off-by: Raymond Danks <ray.danks@se-eng.com> Reviewed-on: http://review.coreboot.org/940 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
parent
61e7c289d4
commit
a293714579
|
@ -42,6 +42,10 @@ endif
|
||||||
ifeq ($(OS_ARCH), NetBSD)
|
ifeq ($(OS_ARCH), NetBSD)
|
||||||
LDFLAGS = -l$(shell uname -p)
|
LDFLAGS = -l$(shell uname -p)
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(shell uname -o), Cygwin)
|
||||||
|
LDFLAGS = -lioperm
|
||||||
|
CFLAGS += -D__GLIBC__
|
||||||
|
endif
|
||||||
|
|
||||||
all: dep $(PROGRAM)
|
all: dep $(PROGRAM)
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,12 @@ ifeq ($(OS_ARCH), Darwin)
|
||||||
NVRAMTOOLFLAGS += -framework DirectHW
|
NVRAMTOOLFLAGS += -framework DirectHW
|
||||||
endif
|
endif
|
||||||
ifeq ($(OS_ARCH), NetBSD)
|
ifeq ($(OS_ARCH), NetBSD)
|
||||||
NVRAMTOOLFLAGS += -l$(shell uname -p)
|
NVRAMTOOLLDLFLAGS = -l$(shell uname -p)
|
||||||
|
endif
|
||||||
|
ifeq ($(shell uname -o), Cygwin)
|
||||||
|
NVRAMTOOLFLAGS += -O2 -g -Wall -W -D__GLIBC__
|
||||||
|
NVRAMTOOLLDFLAGS = -lioperm
|
||||||
|
HOSTCFLAGS =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
nvramtoolobj :=
|
nvramtoolobj :=
|
||||||
|
@ -43,6 +48,6 @@ $(objutil)/nvramtool/%.o: $(top)/util/nvramtool/%.c
|
||||||
|
|
||||||
$(objutil)/nvramtool/nvramtool: $(objutil)/nvramtool $(objutil)/nvramtool/accessors $(objutil)/nvramtool/cli $(addprefix $(objutil)/nvramtool/,$(nvramtoolobj))
|
$(objutil)/nvramtool/nvramtool: $(objutil)/nvramtool $(objutil)/nvramtool/accessors $(objutil)/nvramtool/cli $(addprefix $(objutil)/nvramtool/,$(nvramtoolobj))
|
||||||
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
|
||||||
$(HOSTCC) $(NVRAMTOOLFLAGS) -o $@ $(addprefix $(objutil)/nvramtool/,$(nvramtoolobj))
|
$(HOSTCC) $(NVRAMTOOLFLAGS) -o $@ $(addprefix $(objutil)/nvramtool/,$(nvramtoolobj)) $(NVRAMTOOLLDFLAGS)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue