app_lua: explicit link against libm only of no pkg-config or lua-config is found
authorDaniel-Constantin Mierla <miconda@gmail.com>
Mon, 4 Jun 2012 09:54:09 +0000 (11:54 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Mon, 4 Jun 2012 09:54:09 +0000 (11:54 +0200)
- otherwise it appears two times in the libs linking string

modules/app_lua/Makefile

index 7dc9546..8bb5f27 100644 (file)
@@ -14,10 +14,10 @@ ifeq ($(BUILDER),)
                LUA51 = $(shell ls /usr/lib/liblua* | grep liblua5.1)
                ifeq ($(LUA51),)
                        DEFS+=-I/usr/include/lua
-                       LIBS= -llua
+                       LIBS= -llua -lm
                else
                        DEFS+=-I/usr/include/lua5.1
-                       LIBS= -llua5.1
+                       LIBS= -llua5.1 -lm
                endif
        else
                LUAVER=XX
@@ -34,10 +34,10 @@ ifeq ($(BUILDER),)
                        LUA51 = $(shell ls /usr/lib/liblua* | grep liblua5.1)
                        ifeq ($(LUA51),)
                                DEFS+=-I/usr/include/lua
-                               LIBS= -llua
+                               LIBS= -llua -lm
                        else
                                DEFS+=-I/usr/include/lua5.1
-                               LIBS= -llua5.1
+                               LIBS= -llua5.1 -lm
                        endif
                else
                        ifeq ($(LUAVER),51)
@@ -54,7 +54,6 @@ else
        LIBS = $(shell lua-config --libs)
 endif
 
-LIBS+=-lm
 DEFS+=-DOPENSER_MOD_INTERFACE
 
 SERLIBPATH=../../lib