BUILD: Fix LDFLAGS vs. LIBS re linking order in various makefiles
Libraries should always be listed last. Should be backported to 1.8. Signed-off-by: Christian Ruppert <idl0r@qasl.de>
This commit is contained in:
parent
81991d3285
commit
57dc283014
@ -28,9 +28,8 @@ EVENT_INC := /usr/include
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += -g -Wall -pthread
|
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)
|
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
|
CXXFLAGS = -g -std=gnu++11
|
||||||
CXXINCS += -I$(MOD_DEFENDER_SRC) -I$(MOD_DEFENDER_SRC)/deps -I$(APACHE2_INC) -I$(APR_INC)
|
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))
|
CXXOBJS = $(patsubst %.cpp, %.o, $(CXXSRCS))
|
||||||
|
|
||||||
defender: $(OBJS) $(CXXOBJS)
|
defender: $(OBJS) $(CXXOBJS)
|
||||||
$(LD) -o $@ $^ $(LDFLAGS) $(LIBS)
|
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||||
|
|
||||||
install: defender
|
install: defender
|
||||||
install defender $(DESTDIR)$(BINDIR)
|
install defender $(DESTDIR)$(BINDIR)
|
||||||
|
@ -34,14 +34,13 @@ EVENT_INC := /usr/include
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
CFLAGS += -g -Wall -pthread
|
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)
|
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
|
OBJS = spoa.o modsec_wrapper.o
|
||||||
|
|
||||||
modsecurity: $(OBJS)
|
modsecurity: $(OBJS)
|
||||||
$(LD) $(LDFLAGS) $(LIBS) -o $@ $^ $(MODSEC_LIB)/standalone.a
|
$(LD) $(LDFLAGS) -o $@ $^ $(MODSEC_LIB)/standalone.a $(LIBS)
|
||||||
|
|
||||||
install: modsecurity
|
install: modsecurity
|
||||||
install modsecurity $(DESTDIR)$(BINDIR)
|
install modsecurity $(DESTDIR)$(BINDIR)
|
||||||
|
@ -6,15 +6,14 @@ CC = gcc
|
|||||||
LD = $(CC)
|
LD = $(CC)
|
||||||
|
|
||||||
CFLAGS = -g -O2 -Wall -Werror -pthread
|
CFLAGS = -g -O2 -Wall -Werror -pthread
|
||||||
LDFLAGS = -lpthread -levent -levent_pthreads
|
|
||||||
INCS += -I../../ebtree -I./include
|
INCS += -I../../ebtree -I./include
|
||||||
LIBS =
|
LIBS = -lpthread -levent -levent_pthreads
|
||||||
|
|
||||||
OBJS = spoa.o
|
OBJS = spoa.o
|
||||||
|
|
||||||
|
|
||||||
spoa: $(OBJS)
|
spoa: $(OBJS)
|
||||||
$(LD) $(LDFLAGS) $(LIBS) -o $@ $^
|
$(LD) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||||
|
|
||||||
install: spoa
|
install: spoa
|
||||||
install spoa $(DESTDIR)$(BINDIR)
|
install spoa $(DESTDIR)$(BINDIR)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user