From a0b9daf63bfb0b5e7cd59806a9329382122dcac6 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Thu, 19 Dec 2013 20:42:59 -0800 Subject: [PATCH] Improve signing script, adjust flags for gcc-4.2 On one of my machines codesign doesn't find my signing key by hash, but does find it by name. Go figure. Also on that same system (32bit Mac Mini with running Snow Leopard / 10.6) gcc 4.2 doesn't support the -unused-result warning. So let's only turn that on for more modern versions of gcc Signed-off-by: Dirk Hohndel --- packaging/macosx/sign | 30 ++++++++++++++---------------- subsurface-configure.pri | 11 ++++++++++- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/packaging/macosx/sign b/packaging/macosx/sign index de0680e14..46755e9fa 100644 --- a/packaging/macosx/sign +++ b/packaging/macosx/sign @@ -1,27 +1,25 @@ #!/bin/bash +# Hash is 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 but it doesn't seem to +# find the key by hash echo -- signing staging/Subsurface.app cd staging -#echo -- signing application -# -#codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 ./Subsurface.app/Contents/MacOS/Subsurface - echo -- signing Qt frameworks -codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 ./Subsurface.app//Contents/Frameworks/QtCore.framework/Versions/4/QtCore -codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 ./Subsurface.app//Contents/Frameworks/QtDeclarative.framework/Versions/4/QtDeclarative -codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 ./Subsurface.app//Contents/Frameworks/QtGui.framework/Versions/4/QtGui -codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 ./Subsurface.app//Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork -codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 ./Subsurface.app//Contents/Frameworks/QtScript.framework/Versions/4/QtScript -codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 ./Subsurface.app//Contents/Frameworks/QtSql.framework/Versions/4/QtSql -codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 ./Subsurface.app//Contents/Frameworks/QtSvg.framework/Versions/4/QtSvg -codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 ./Subsurface.app//Contents/Frameworks/QtWebKit.framework/Versions/4/QtWebkit -codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 ./Subsurface.app//Contents/Frameworks/QtXml.framework/Versions/4/QtXml -codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 ./Subsurface.app//Contents/Frameworks/QtXmlPatterns.framework/Versions/4/QtXmlPatterns +codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s Dirk ./Subsurface.app//Contents/Frameworks/QtCore.framework/Versions/4/QtCore +codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s Dirk ./Subsurface.app//Contents/Frameworks/QtDeclarative.framework/Versions/4/QtDeclarative +codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s Dirk ./Subsurface.app//Contents/Frameworks/QtGui.framework/Versions/4/QtGui +codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s Dirk ./Subsurface.app//Contents/Frameworks/QtNetwork.framework/Versions/4/QtNetwork +codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s Dirk ./Subsurface.app//Contents/Frameworks/QtScript.framework/Versions/4/QtScript +codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s Dirk ./Subsurface.app//Contents/Frameworks/QtSql.framework/Versions/4/QtSql +codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s Dirk ./Subsurface.app//Contents/Frameworks/QtSvg.framework/Versions/4/QtSvg +codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s Dirk ./Subsurface.app//Contents/Frameworks/QtWebKit.framework/Versions/4/QtWebkit +codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s Dirk ./Subsurface.app//Contents/Frameworks/QtXml.framework/Versions/4/QtXml +codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s Dirk ./Subsurface.app//Contents/Frameworks/QtXmlPatterns.framework/Versions/4/QtXmlPatterns echo -- signing plugins -find ./Subsurface.app/Contents/PlugIns -name \*.dylib | xargs codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 +find ./Subsurface.app/Contents/PlugIns -name \*.dylib | xargs codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s Dirk echo -- finally sign .app -codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s 3A8CE62A483083EDEA5581A61E770EC1FA8BECE8 ./Subsurface.app +codesign --keychain /Users/hohndel/Library/Keychains/login.keychain -s Dirk ./Subsurface.app diff --git a/subsurface-configure.pri b/subsurface-configure.pri index 24bf08638..2a369da2b 100644 --- a/subsurface-configure.pri +++ b/subsurface-configure.pri @@ -10,7 +10,16 @@ # these warnings are in general just wrong and annoying - but should be # turned on every once in a while in case they do show the occasional # actual bug -*-g++* | *-clang*: QMAKE_CFLAGS += -Wno-unused-result -Wno-pointer-sign -fno-strict-overflow +# turns out the gcc 4.2 (as used on MacOS 10.6) doesn't have no-unused-result, yet +*-clang*: QMAKE_CFLAGS += -Wno-unused-result -Wno-pointer-sign -fno-strict-overflow +*-g++*: { + system( g++ --version | grep -e "4\\.2\\." > /dev/null ) { + QMAKE_CFLAGS += -Wno-pointer-sign -fno-strict-overflow + } else { + QMAKE_CFLAGS += -Wno-unused-result -Wno-pointer-sign -fno-strict-overflow + } +} + *-clang*: QMAKE_CFLAGS += -Wno-format-security *-g++*: QMAKE_CXXFLAGS += -fno-strict-overflow !win32: !mac: {