automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libcpu_a_CXXFLAGS must be set with '=' before using '+='


From: Jeffrey Walton
Subject: libcpu_a_CXXFLAGS must be set with '=' before using '+='
Date: Fri, 3 Nov 2017 10:53:47 -0400

Hi Everyone,

This is related to Nick and Mathieu's comments about per-object flags
and use of CXXFLAGS.

When I change the pattern to:

  CPU_FLAG = -msse2
  libcpu_a_SOURCES = cpu.cpp
  libcpu_a_CXXFLAGS += $(CPU_FLAG)

I encounter:

  Makefile.am:64: error: libcpu_a_CXXFLAGS must be set with '=' before
using '+='

I think there are two or three issues with what I am trying to do, and
the issue with "+=" is only the most prominent symptom.

I think this document may be controlling:
https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html#Flag-Variables-Ordering.
The paragraph that starts with "What we recommend is that you define
extra flags in separate variables...." is especially interesting to
me. It is interesting because `CPU_FLAG` will eventually need to be
computed based on the platform. (Eventually we need: i386 gets -msse2;
x86_64 gets nothing; ARMv7 gets NEON; and PowerPC gets Power4 and
Altivec; others get nothing).

Please forgive my ignorance, but how do I fix this issue such that it
won't break when I start computing the value of CPU_FLAG in Autoconf?

(And my apologies for biting off more than I can chew. I would rather
invest the time to do it right once rather than applying band-aides
over shoddy techniques).

Jeff



reply via email to

[Prev in Thread] Current Thread [Next in Thread]