From: Peter van Dijk Date: Mon, 5 Nov 2012 14:28:55 +0000 (+0000) Subject: add semistaticg++ wrapper X-Git-Tag: auth-3.2-rc1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8d30633216e1e36d8a0d93e5dafa963e7f88209;p=thirdparty%2Fpdns.git add semistaticg++ wrapper git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2849 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/build-scripts/semistaticg++ b/build-scripts/semistaticg++ new file mode 100755 index 0000000000..4a7f1a0c12 --- /dev/null +++ b/build-scripts/semistaticg++ @@ -0,0 +1,19 @@ +#!/usr/bin/env python +import sys,os + +args = sys.argv[1:] +if '-static' not in args: + os.execvp('g++', ['g++']+args) + +libs = [] +otherargs = [] +for arg in args: + if arg == '-static': + continue + if arg.startswith('-l') and arg not in ('-lm','-ldl','-lpthread'): + libs.append(arg) + else: + otherargs.append(arg) + +gargv=['gcc']+otherargs+['-Wl,-Bstatic']+libs+['-lstdc++','-Wl,-Bdynamic','-static-libgcc'] +os.execvp('gcc', gargv)