File tree Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Expand file tree Collapse file tree 2 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -6,18 +6,25 @@ MAKE := make
66CFLAGS += -Wall -Wextra -fpic -O2 -fno-strict-aliasing -Wno-unused-parameter
77
88SYS := $(shell gcc -dumpmachine)
9- LIBFFI_PATH := ./libs/libffi/$(SYS )
10- INCLUDES := -I$(LIBFFI_PATH ) /include
9+ LIBFFI_PATH := ./libs/libffi
10+
11+ ifeq ($(SYS ) , x86_64-w64-mingw32)
12+ BUILDSYS := $(SYS)
13+ else
14+ BUILDSYS := $(shell bash $(LIBFFI_PATH)/config.guess)
15+ endif
16+
17+ LIBFFI_PATH := $(LIBFFI_PATH ) /$(BUILDSYS )
18+ INCLUDES :=-I$(LIBFFI_PATH ) /include
1119LIBS := -L$(LIBFFI_PATH ) /.libs -lffi
1220
1321ifneq (, $(findstring linux, $(SYS ) ) )
1422 SUFFIX := so
1523 LDFLAGS := -shared
1624 LIBS += -ldl
1725else ifneq (, $(findstring mingw, $(SYS)))
18- SUFFIX = dll
19- LDFLAGS = -mdll
20- CFLAGS += -I./libs/$(PLATFORM)/include/
26+ SUFFIX := dll
27+ LDFLAGS := -mdll
2128else
2229 $(error Unsupported build platform)
2330endif
@@ -32,12 +39,12 @@ INCLUDES += -I${GLOBALS_HOME}/dev/cpp/include
3239CFLAGS += $(INCLUDES )
3340TESTSDIR := tests
3441
35- .PHONY : all clean libffi libffi_clean
42+ .PHONY : all clean libffi libffi-clean
3643
3744all : libcna.$(SUFFIX ) $(TESTSDIR ) /libtest.$(SUFFIX )
3845
3946libffi :
40- cd libs/libffi && ./configure --build=$(SYS ) --enable-shared=no && $(MAKE )
47+ cd libs/libffi && ./configure --build=$(BUILDSYS ) --enable-shared=no && $(MAKE )
4148
4249cna.o : cna.c storage.h
4350
Original file line number Diff line number Diff line change 11Makefile
22config.log
3+ confdefs.h
34* ~
45x86_64-w64-mingw32
You can’t perform that action at this time.
0 commit comments