This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 0/6] Move gdbsupport to top level
On Thu, Jan 16, 2020 at 11:23 AM Pedro Alves <palves@redhat.com> wrote:
> > For that patch, why not just use AM_CFLAGS/AM_CXXFLAGS?
>
> I was mainly following what GDB does, with:
>
> COMPILE.pre = $(CXX) -x c++ $(CXX_DIALECT)
>
> I guess I was the one who did that, so that's not going to be
> a strong explanation. :-)
>
> It's just that I feel like the compiler mode is more about
> picking a different compiler than about picking some flags
> like warnings flags or compilation levels. I think that
> in practice the only difference is that you see the
> -std=gnu++11 next to the compiler command:
>
> $ rm -f selftest.o && make V=1 selftest.o
> /opt/gcc-4.8/bin/g++ -std=gnu++11 -DHAVE_CONFIG_H -I. -I/home/pedro/gdb/binutils-gdb/src/gdbsupport -I/home/pedro/gdb/binutils-gdb/src/gdbsupport/config.h -I/home/pedro/gdb/binutils-gdb/src/gdbsupport/../include -I/home/pedro/gdb/binutils-gdb/src/gdbsupport/../gdb -I../gnulib/import -I/home/pedro/gdb/binutils-gdb/src/gdbsupport/../gnulib/import -I.. -I/home/pedro/gdb/binutils-gdb/src/gdbsupport/.. -I../bfd -I/home/pedro/gdb/binutils-gdb/src/gdbsupport/../bfd -g3 -O0 -MT selftest.o -MD -MP -MF .deps/selftest.Tpo -c -o selftest.o /home/pedro/gdb/binutils-gdb/src/gdbsupport/selftest.c
> mv -f .deps/selftest.Tpo .deps/selftest.Po
>
> vs, with AM_CFLAGS:
>
> $ rm -f selftest.o && make V=1 selftest.o
> /opt/gcc-4.8/bin/g++ -DHAVE_CONFIG_H -I. -I/home/pedro/gdb/binutils-gdb/src/gdbsupport -I/home/pedro/gdb/binutils-gdb/src/gdbsupport/config.h -I/home/pedro/gdb/binutils-gdb/src/gdbsupport/../include -I/home/pedro/gdb/binutils-gdb/src/gdbsupport/../gdb -I../gnulib/import -I/home/pedro/gdb/binutils-gdb/src/gdbsupport/../gnulib/import -I.. -I/home/pedro/gdb/binutils-gdb/src/gdbsupport/.. -I../bfd -I/home/pedro/gdb/binutils-gdb/src/gdbsupport/../bfd -std=gnu++11 -g3 -O0 -MT selftest.o -MD -MP -MF .deps/selftest.Tpo -c -o selftest.o /home/pedro/gdb/binutils-gdb/src/gdbsupport/selftest.c
> mv -f .deps/selftest.Tpo .deps/selftest.Po
>
> AFAICT, overriding CXXFLAGS or CXX in the make invocation works
> the same in either case.
How so? override is documented to override commandline variables?
https://www.gnu.org/software/make/manual/html_node/Override-Directive.html#Override-Directive
But yes, that's what I was thinking of, and just in general that
override seems a bit ugly.
Christian