Is it possible to tell autotools to link one of the libraries with -Wl,-whole-archive flag?
Makefile.am
bin_PROGRAMS = pktanon
pktanon_SOURCES = main.cpp
pktanon_DEPENDENCIES = $(lib_LIBRARIES)
pktanon_LDADD = libpktanon.a $(LDADD)
I need to link libpktanon.a with -Wl,-whole-archive flag, also I want make to execute something like this:
g++ -o pktanon main.o -Wl,-whole-archive libpktanon.a -Wl,-no-whole-archive -l...
(as in this question)
pktanon_LDADD
?error: linker flags such as '-Wl,-whole-archive' belong in 'pktanon_LDFLAGS'
; addingpktanon_LDFLAGS = -Wl,-whole-archive
generages following line and two pages of link errors:g++ -g -O2 -std=c++11 -Wl,-whole-archive -o pktanon main.o -l...