[Interest] Qt build system

Christian Gagneraud chgans at gna.org
Mon Jul 15 23:08:05 CEST 2013


On 16/07/13 08:57, Carl Schumann wrote:
> Hi,
>
> I am using Qt in an environment where there is already a build
> infrastructure in place.   Because of the amount of per-existing non-Qt
> code it is not feasible to build everything with qmake, e.g., because
> slot is actually a very common variable and argument name in our
> existing code base.
>
> Therefore, I am trying to add Qt build support to our existing build
> system only for the programs that need it.   I would like to understand
> what the motivation is for the second command in the link rule of the
> qmake-generated Makefile please:
>> $(TARGET):  $(OBJECTS)
>> 	$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
>> 	{ test -n "$(DESTDIR)" && DESTDIR="$(DESTDIR)" || DESTDIR=.; } && test $$(gdb --version | sed -e 's,[^0-9]\+\([0-9]\)\.\([0-9]\).*,\1\2,;q') -gt 72 && gdb --nx --batch --quiet -ex 'set confirm off' -ex "save gdb-index $$DESTDIR" -ex quit '$(TARGET)' && test -f $(TARGET).gdb-index && objcopy --add-section '.gdb_index=$(TARGET).gdb-index' --set-section-flags '.gdb_index=readonly' '$(TARGET)' '$(TARGET)' && rm -f $(TARGET).gdb-index || true
Hi Carl,

I'm not an expert with all of these, but obviously, the second command 
adds a GDB index section to the binary target if GDB version is greater 
than 7.2, according to [1], it speeds up GDB when debugging.
The index is generated with "gdb --nx --batch ..." and the section added 
with "objcopy --add-section ..."

Hope this helps.

Chris

[1] http://sourceware.org/gdb/onlinedocs/gdb/Index-Files.html

> If it makes a difference this is Qt 4.8.4.
>
> Thanks for your time.
>
> Sincerely,
> Carl Schumann
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list