all: link with -lm where <math.h> is included.
authorFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 21 Nov 2017 07:05:59 +0000 (08:05 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Tue, 21 Nov 2017 07:45:07 +0000 (08:45 +0100)
Otherwise we'll get crashes on OpenWRT

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
Makefile
lib/dot_draw/Makefile
lib/httpinfo/Makefile
lib/jsoninfo/Makefile
lib/netjson/Makefile
lib/secure/Makefile
lib/txtinfo/Makefile

index fc38917..05e3cc7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -89,7 +89,7 @@ $(EXENAME):   $(OBJS) $(ANDROIDREGEX) src/builddata.o
 ifeq ($(VERBOSE),0)
                @echo "[LD] $@"
 endif
-               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
+               $(MAKECMDPREFIX)$(CC) $(LDFLAGS) -lm -o $@ $^ $(LIBS)
 
 cfgparser:     $(CFGDEPS) src/builddata.o
                $(MAKECMDPREFIX)$(MAKECMD) -C $(CFGDIR)
index d0860ad..72fff7f 100644 (file)
@@ -48,6 +48,8 @@ PLUGIN_VER =  0.3
 TOPDIR =       ../..
 include $(TOPDIR)/Makefile.inc
 
+LDFLAGS += -lm
+
 default_target: $(PLUGIN_FULLNAME)
 
 $(PLUGIN_FULLNAME): $(OBJS) version-script.txt
index 8efc7a1..0f07aa4 100644 (file)
@@ -52,6 +52,8 @@ ifdef ADMIN_INTERFACE
 CPPFLAGS +=    -DADMIN_INTERFACE
 endif
 
+LDFLAGS += -lm
+
 OBJS += $(TOPDIR)/src/cfgparser/cfgfile_gen.o
 
 default_target: $(PLUGIN_FULLNAME)
index 4851872..cd96ce6 100644 (file)
@@ -48,6 +48,8 @@ PLUGIN_VER =  1.1
 TOPDIR =       ../..
 include $(TOPDIR)/Makefile.inc
 
+LDFLAGS += -lm
+
 COMMONINFO = $(wildcard ../info/*.c)
 OBJS += $(COMMONINFO:%.c=%.o)
 
index 2474830..dd344f2 100644 (file)
@@ -48,6 +48,8 @@ PLUGIN_VER =  1.1
 TOPDIR =       ../..
 include $(TOPDIR)/Makefile.inc
 
+LDFLAGS += -lm
+
 COMMONINFO = $(wildcard ../info/*.c)
 OBJS += $(COMMONINFO:%.c=%.o)
 
index ec1794a..dfb5e5e 100644 (file)
@@ -48,6 +48,8 @@ PLUGIN_VER =  0.6
 TOPDIR = ../..
 include $(TOPDIR)/Makefile.inc
 
+LDFLAGS += -lm
+
 ifdef USE_OPENSSL
 CPPFLAGS +=    -DUSE_OPENSSL
 LIBS +=                -lssl -lcrypto
index e53b280..a452564 100644 (file)
@@ -48,6 +48,8 @@ PLUGIN_VER =  1.1
 TOPDIR =       ../..
 include $(TOPDIR)/Makefile.inc
 
+LDFLAGS += -lm
+
 COMMONINFO = $(wildcard ../info/*.c)
 OBJS += $(COMMONINFO:%.c=%.o)