]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: Fix LDFLAGS vs. LIBS re linking order in various makefiles
authorChristian Ruppert <idl0r@qasl.de>
Thu, 30 Nov 2017 09:11:36 +0000 (10:11 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 2 Dec 2017 13:36:15 +0000 (14:36 +0100)
Libraries should always be listed last. Should be backported to 1.8.

Signed-off-by: Christian Ruppert <idl0r@qasl.de>
contrib/mod_defender/Makefile
contrib/modsecurity/Makefile
contrib/spoa_example/Makefile

index ac17774d3e557d9e63647c33c38f54986a335228..efc7d7f6e18e2742b0fbbc37d980879981635293 100644 (file)
@@ -28,9 +28,8 @@ EVENT_INC := /usr/include
 endif
 
 CFLAGS  += -g -Wall -pthread
-LDFLAGS += -lpthread  $(EVENT_LIB) -levent_pthreads -lapr-1 -laprutil-1 -lstdc++ -lm
 INCS += -I../../include -I../../ebtree -I$(MOD_DEFENDER_SRC) -I$(APACHE2_INC) -I$(APR_INC) -I$(EVENT_INC)
-LIBS =
+LIBS += -lpthread  $(EVENT_LIB) -levent_pthreads -lapr-1 -laprutil-1 -lstdc++ -lm
 
 CXXFLAGS = -g -std=gnu++11
 CXXINCS += -I$(MOD_DEFENDER_SRC) -I$(MOD_DEFENDER_SRC)/deps -I$(APACHE2_INC) -I$(APR_INC)
@@ -43,7 +42,7 @@ CXXSRCS = $(wildcard $(MOD_DEFENDER_SRC)/*.cpp)
 CXXOBJS = $(patsubst %.cpp, %.o, $(CXXSRCS))
 
 defender: $(OBJS) $(CXXOBJS)
-       $(LD) -o $@ $^ $(LDFLAGS) $(LIBS)
+       $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 install: defender
        install defender $(DESTDIR)$(BINDIR)
index bb918c30b215c0dda980e0c9cb01c93448dfd873..aa0d6e38db1a0817c82d5c455c7b261f7cb0a6ff 100644 (file)
@@ -34,14 +34,13 @@ EVENT_INC := /usr/include
 endif
 
 CFLAGS  += -g -Wall -pthread
-LDFLAGS += -lpthread  $(EVENT_LIB) -levent_pthreads -lcurl -lapr-1 -laprutil-1 -lxml2 -lpcre -lyajl
 INCS += -I../../include -I../../ebtree -I$(MODSEC_INC) -I$(APACHE2_INC) -I$(APR_INC) -I$(LIBXML_INC) -I$(EVENT_INC)
-LIBS =
+LIBS += -lpthread  $(EVENT_LIB) -levent_pthreads -lcurl -lapr-1 -laprutil-1 -lxml2 -lpcre -lyajl
 
 OBJS = spoa.o modsec_wrapper.o
 
 modsecurity: $(OBJS)
-       $(LD) $(LDFLAGS) $(LIBS) -o $@ $^ $(MODSEC_LIB)/standalone.a
+       $(LD) $(LDFLAGS) -o $@ $^ $(MODSEC_LIB)/standalone.a $(LIBS)
 
 install: modsecurity
        install modsecurity $(DESTDIR)$(BINDIR)
index d04a01e11aad731ae0dfc18916cc86860bd0b690..c44c2b87937a6512bc4688737e23b8d02faa2d25 100644 (file)
@@ -6,15 +6,14 @@ CC = gcc
 LD = $(CC)
 
 CFLAGS  = -g -O2 -Wall -Werror -pthread
-LDFLAGS = -lpthread -levent -levent_pthreads
 INCS += -I../../ebtree -I./include
-LIBS =
+LIBS = -lpthread -levent -levent_pthreads
 
 OBJS = spoa.o
 
 
 spoa: $(OBJS)
-       $(LD) $(LDFLAGS) $(LIBS) -o $@ $^
+       $(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
 
 install: spoa
        install spoa $(DESTDIR)$(BINDIR)