aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2019-12-03 22:37:45 +0100
committercbdev <cb@cbcdn.com>2019-12-03 22:37:45 +0100
commita0831a2b970404eaa9b80ff97ab46ee759131414 (patch)
tree72cff7c1b10b25a4ad2dcc803b06d35a562ccc1d
parent30feadde5b18f49fd853f8ce61d85168db912bb6 (diff)
downloadmidimonster-a0831a2b970404eaa9b80ff97ab46ee759131414.tar.gz
midimonster-a0831a2b970404eaa9b80ff97ab46ee759131414.tar.bz2
midimonster-a0831a2b970404eaa9b80ff97ab46ee759131414.zip
Add error checking for shell callouts during build
-rw-r--r--backends/Makefile8
-rw-r--r--midimonster.c2
-rw-r--r--midimonster.h5
3 files changed, 10 insertions, 5 deletions
diff --git a/backends/Makefile b/backends/Makefile
index 901ec49..4e37ca4 100644
--- a/backends/Makefile
+++ b/backends/Makefile
@@ -43,12 +43,12 @@ winmidi.dll: LDLIBS += -lwinmm -lws2_32
jack.so: LDLIBS = -ljack -lpthread
midi.so: LDLIBS = -lasound
-evdev.so: CFLAGS += $(shell pkg-config --cflags libevdev)
-evdev.so: LDLIBS = $(shell pkg-config --libs libevdev)
+evdev.so: CFLAGS += $(shell pkg-config --cflags libevdev || echo "-DBUILD_ERROR=\"Missing pkg-config data for libevdev\"")
+evdev.so: LDLIBS = $(shell pkg-config --libs libevdev || echo "-DBUILD_ERROR=\"Missing pkg-config data for libevdev\"")
ola.so: LDLIBS = -lola
ola.so: CPPFLAGS += -Wno-write-strings
-lua.so: CFLAGS += $(shell pkg-config --cflags lua5.3)
-lua.so: LDLIBS += $(shell pkg-config --libs lua5.3)
+lua.so: CFLAGS += $(shell pkg-config --cflags lua53 || echo "-DBUILD_ERROR=\"Missing pkg-config data for lua53\"")
+lua.so: LDLIBS += $(shell pkg-config --libs lua53 || echo "-DBUILD_ERROR=\"Missing pkg-config data for lua53\"")
%.so :: %.c %.h $(BACKEND_LIB)
$(CC) $(CFLAGS) $(LDLIBS) $< $(ADDITIONAL_OBJS) -o $@ $(LDFLAGS)
diff --git a/midimonster.c b/midimonster.c
index 25cf4a0..eb64974 100644
--- a/midimonster.c
+++ b/midimonster.c
@@ -224,7 +224,7 @@ static void event_free(){
}
static int usage(char* fn){
- fprintf(stderr, "MIDIMonster v0.1\n");
+ fprintf(stderr, "MIDIMonster v0.2\n");
fprintf(stderr, "Usage:\n");
fprintf(stderr, "\t%s <configfile>\n", fn);
return EXIT_FAILURE;
diff --git a/midimonster.h b/midimonster.h
index b05326c..3922b03 100644
--- a/midimonster.h
+++ b/midimonster.h
@@ -29,6 +29,11 @@
#define DBG(message)
#endif
+/* Stop compilation if the build system reports an error */
+#ifdef BUILD_ERROR
+ #error The build system reported an error, compilation stopped. Refer to the invocation for this compilation unit for more information.
+#endif
+
/* Pull in additional defines for non-linux platforms */
#include "portability.h"