From a18ff3d5c75c2b468c48bd19439dee0689d24d67 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 18 Aug 2014 12:04:17 +0200 Subject: [PATCH] fdo#82430: gcc-wrappers: don't stop if REAL_CXX_FLAGS is empty Hopefully should fix MSVC 2010 build... Change-Id: I3dc71acfa58cdf65dfc6d731d9ebb77fd18f7fac --- solenv/gcc-wrappers/g++.cxx | 2 +- solenv/gcc-wrappers/gcc.cxx | 2 +- solenv/gcc-wrappers/wrapper.cxx | 5 ++++- solenv/gcc-wrappers/wrapper.hxx | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/solenv/gcc-wrappers/g++.cxx b/solenv/gcc-wrappers/g++.cxx index 289d91973221..626b1643590c 100644 --- a/solenv/gcc-wrappers/g++.cxx +++ b/solenv/gcc-wrappers/g++.cxx @@ -13,7 +13,7 @@ int main(int argc, char *argv[]) { vector rawargs(argv + 1, argv + argc); string command=getexe("REAL_CXX"); - string flags=getexe("REAL_CXX_FLAGS"); + string flags=getexe("REAL_CXX_FLAGS", true); string args=flags.empty() ? string() : flags + " "; args += processccargs(rawargs); diff --git a/solenv/gcc-wrappers/gcc.cxx b/solenv/gcc-wrappers/gcc.cxx index 8ff814856974..f34c2dba8c99 100644 --- a/solenv/gcc-wrappers/gcc.cxx +++ b/solenv/gcc-wrappers/gcc.cxx @@ -13,7 +13,7 @@ int main(int argc, char *argv[]) { vector rawargs(argv + 1, argv + argc); string command=getexe("REAL_CC"); - string flags=getexe("REAL_CC_FLAGS"); + string flags=getexe("REAL_CC_FLAGS", true); string args=flags.empty() ? string() : flags + " "; args += processccargs(rawargs); diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx index ccdf2065ffed..1b8d56223ca9 100644 --- a/solenv/gcc-wrappers/wrapper.cxx +++ b/solenv/gcc-wrappers/wrapper.cxx @@ -15,11 +15,14 @@ #define BUFLEN 2048 -string getexe(string exename) { +string getexe(string exename, bool maybeempty) { char* cmdbuf; size_t cmdlen; _dupenv_s(&cmdbuf,&cmdlen,exename.c_str()); if(!cmdbuf) { + if (maybeempty) { + return string(); + } cout << "Error " << exename << " not defined. Did you forget to source the environment?" << endl; exit(1); } diff --git a/solenv/gcc-wrappers/wrapper.hxx b/solenv/gcc-wrappers/wrapper.hxx index e2ffb01ca902..789bc9280267 100644 --- a/solenv/gcc-wrappers/wrapper.hxx +++ b/solenv/gcc-wrappers/wrapper.hxx @@ -16,7 +16,7 @@ using namespace std; -string getexe(string exename); +string getexe(string exename, bool maybeempty = false); void setupccenv();