Hello, Nick Bowler <nbow...@draconx.ca> writes: > > On 11/2/17, Jeffrey Walton <noloa...@gmail.com> wrote: >> >> CPU_FLAG = -msse2 -msse3 -mssse3 >> libcpu_a_SOURCES = cpu.cpp >> libcpu_a_CXXFLAGS = $(CXXFLAGS) $(CPU_FLAG) > > Note that you should not include $(CXXFLAGS) here. CXXFLAGS is always > included (so with this it will duplicated on the command line, which > might be undesired by the user).
I guess Jeffrey was intending to use AM_CXXFLAGS which is overridden by libcpu_a_CXXFLAGS. >> Now that the objects are built we need to add libcpu.a back into >> libcryptopp.la in the exact position it would have been in if I could >> have specified per-object flags. The Automake manual gives an example >> of linking a program with disjoint libraries, but not adding the >> extraneous library back to the main (primary?) library at a particular >> position. >> >> The "in the exact position" is important. I don't fully understand the "static initialization fiasco", however the next entry in the FAQ [1] seems to suggest that it can be avoided programmatically using a function wrapper instead of relying on the linking order. If this kind of issue is common in C++, I think it would be good to give a hint in the Automake manual on how to solve it. Thanks. [1] https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use -- Mathieu Lirzin GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37