Default to #!/bin/bash in wrapper scripts on macOS

This gives the user the opportunity to employ BASH_ENV to circumvent
macOS System Integrity Protection and set variables like
DYLD_FRAMEWORK_PATH.

Fixes: QTBUG-57204
Change-Id: Icd99d903a3be76fabd509e204ea61a254a96609c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Joerg Bornemann 2019-10-08 15:24:53 +02:00
parent 6abbecf942
commit a90899df43

View File

@ -159,8 +159,12 @@ defineTest(qtAddToolEnv) {
!isEmpty(cmd): cmd = "$$cmd " !isEmpty(cmd): cmd = "$$cmd "
equals(ds, /) { equals(ds, /) {
batch_name = $${batch_name}.sh batch_name = $${batch_name}.sh
equals(QMAKE_HOST.os, Darwin):exists(/bin/bash): \
shell = /bin/bash
else: \
shell = /bin/sh
batch_cont = \ batch_cont = \
"$$LITERAL_HASH!/bin/sh" \ "$$LITERAL_HASH!$$shell" \
$$batch_sets \ $$batch_sets \
"exec $$cmd\"$@\"" "exec $$cmd\"$@\""
# It would be nicer to use the '.' command (without 'exec' above), # It would be nicer to use the '.' command (without 'exec' above),