Hello

In my qmake file, I added to a variable the following:

MYSQLIBS = "$$system(mysql_config --libs)"
MYSQLIBS ~= s/-arch +[a-z0-9_]+//g #remove all "-arch arg" settings
LIBS += MYSQLIBS

Unfortunately here, LIBS in the generated Makefile now contains:
LIBS = $(SUBLIBS) -L/usr/local/mythtv-trunk/lib -Wl,-Bsymbolic-functions\ -rdynamic\ -L/usr/lib/mysql\ -lmysqlclient


see that all the space have been escaped.

What I would like to end-up with is:
LIBS = $(SUBLIBS) -L/usr/local/mythtv-trunk/lib -Wl,-Bsymbolic-functions -rdynamic -L/usr/lib/mysql -lmysqlclient

Otherwise the following would fail to compile under linux.

Now that brings me to another weirdness.
The reason I did:

MYSQLIBS = "$$system(mysql_config --libs)"
instead of:
MYSQLIBS = $$system(mysql_config --libs)

It's because otherwise, the regex replacement that follow would have otherwise no effect at all, and it only works if the variable has been placed in quote.

Another annoyance I do not know how to deal with is: on mac, some linker settings are in the form:
-arch arg
where arg can be i386, x86_64, ppc7400, ppc64

The problem is how qmake deals when adding those parameters.
If I have

EXTRA_LFLAGS = -arch i386
and
QMAKE_LFLAGS = -arch i386

doing:

QMAKE_LFLAGS += $$EXTRA_LFLAGS

The generated makefile will contain:
LFLAGS = -arch i386 -arch

the 2nd i386 has been dropped. Compilation *will* failt
According to the qmake documentation, += shouldn't drop items, that's what *= does:
The *= operator adds a value to the list of values in a variable, but only if it is not already present. This prevents values from being included many times in a variable. For example:

Now I could do:
EXTRA_FLAGS = "-arch i386"
QMAKE_LFLAGS += $$EXTRA_FLAGS

but then I end up in the Makefile with:
LFLAGS = -arch i386 -arch\ i386

which will not always work depending on how the linker is called.

Any advice on how to resolve the above issues would be *extremely* appreciated.

Thank you in advance.
Kind regards
JY