From 91794d0657caf22fc1876752cf10c3be24d04387 Mon Sep 17 00:00:00 2001 From: John Hein Date: Thu, 16 Feb 2017 23:23:48 -0700 Subject: [PATCH 1/3] Remove LDFLAGS from commands to build object files. Fixes warnings like: cc: warning: -lftdi: 'linker' input unused --- src/Makefile.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index 25e8434..b67f803 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -26,17 +26,17 @@ example-code: make -C examples mpsse.o: support.o - $(CC) $(CFLAGS) $(LDFLAGS) -DLIBFTDI1=$(LIBFTDI1) -c mpsse.c + $(CC) $(CFLAGS) -DLIBFTDI1=$(LIBFTDI1) -c mpsse.c fast.o: support.o - $(CC) $(CFLAGS) $(LDFLAGS) -c fast.c + $(CC) $(CFLAGS) -c fast.c support.o: - $(CC) $(CFLAGS) $(LDFLAGS) -DLIBFTDI1=$(LIBFTDI1) -c support.c + $(CC) $(CFLAGS) -DLIBFTDI1=$(LIBFTDI1) -c support.c pyswig-build: - $(CC) $(CFLAGS) $(LDFLAGS) -DSWIGPYTHON -DLIBFTDI1=$(LIBFTDI1) -c support.c - $(CC) $(CFLAGS) $(LDFLAGS) -DSWIGPYTHON -DLIBFTDI1=$(LIBFTDI1) -c mpsse.c + $(CC) $(CFLAGS) -DSWIGPYTHON -DLIBFTDI1=$(LIBFTDI1) -c support.c + $(CC) $(CFLAGS) -DSWIGPYTHON -DLIBFTDI1=$(LIBFTDI1) -c mpsse.c $(SWIG) -python $(TARGET).i $(CC) $(CFLAGS) -c -DLIBFTDI1=$(LIBFTDI1) $(TARGET)_wrap.c $(INC) $(CC) $(CFLAGS) -shared $(FRAMEWORK) $(TARGET)_wrap.o mpsse.o support.o \ From cc97da4b38068a832c2d025ddd226879c0cd4526 Mon Sep 17 00:00:00 2001 From: John Hein Date: Thu, 16 Feb 2017 23:27:39 -0700 Subject: [PATCH 2/3] Don't build object files with the same filename for swig python object files & non-swig. This can help fix parallel builds - building with incorrect object file or trying to link with files that are still being written. See https://github.com/devttys0/libmpsse/issues/16 --- src/Makefile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile.in b/src/Makefile.in index b67f803..4eb00b6 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -35,11 +35,11 @@ support.o: $(CC) $(CFLAGS) -DLIBFTDI1=$(LIBFTDI1) -c support.c pyswig-build: - $(CC) $(CFLAGS) -DSWIGPYTHON -DLIBFTDI1=$(LIBFTDI1) -c support.c - $(CC) $(CFLAGS) -DSWIGPYTHON -DLIBFTDI1=$(LIBFTDI1) -c mpsse.c + $(CC) $(CFLAGS) -DSWIGPYTHON -DLIBFTDI1=$(LIBFTDI1) -c support.c -o pyswig_support.o + $(CC) $(CFLAGS) -DSWIGPYTHON -DLIBFTDI1=$(LIBFTDI1) -c mpsse.c -o pyswig_mpsse.o $(SWIG) -python $(TARGET).i $(CC) $(CFLAGS) -c -DLIBFTDI1=$(LIBFTDI1) $(TARGET)_wrap.c $(INC) - $(CC) $(CFLAGS) -shared $(FRAMEWORK) $(TARGET)_wrap.o mpsse.o support.o \ + $(CC) $(CFLAGS) -shared $(FRAMEWORK) $(TARGET)_wrap.o pyswig_mpsse.o pyswig_support.o \ -o _pylib$(TARGET).so $(LDFLAGS) $(INC) pyswig-install: From a3525a5d30141bddcba66b72a7937be705d93cf9 Mon Sep 17 00:00:00 2001 From: John Hein Date: Thu, 16 Feb 2017 23:39:51 -0700 Subject: [PATCH 3/3] include stdlib.h for malloc(3) --- src/support.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/support.c b/src/support.c index d34f8b3..45a4842 100644 --- a/src/support.c +++ b/src/support.c @@ -5,6 +5,7 @@ * 27 December 2011 */ +#include #include #if LIBFTDI1 == 1