summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-08-08 14:58:08 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2014-08-25 15:17:51 -0500
commitf83c7358964cf9f265f21e7dfa72e82a26923b3e (patch)
treeda91d9965ed50b00d1714f52009a3c6ee32a8279 /solenv
parente10e1b06cbbf337e8277063651b6e48011df5fd4 (diff)
fdo#82430: configure: MSVC build: avoid using SSE2 instructions
MSVC 2012 for x86 defaults to -arch:SSE2; binaries do not run on any AMD 32-bit CPU, neither on Intel Pentium III. http://msdn.microsoft.com/en-us/library/vstudio/7t5yh4fd%28v=vs.110%29.aspx (cherry picked from commit 8bd6bf93b7711a7ac7c5cbd7c3bb980481570ebd) fdo#82430: MSVC 2010 refuses both -clr and -arch in the same command (cherry picked from commit 36ce22f41a754fa405804434899a08a23081e721) fdo#82430: gcc-wrappers: don't stop if REAL_CXX_FLAGS is empty Hopefully should fix MSVC 2010 build... (cherry picked from commit a18ff3d5c75c2b468c48bd19439dee0689d24d67) Change-Id: Ie8253137db2699f2a7fa69c4ac4e7ded90931e3e Reviewed-on: https://gerrit.libreoffice.org/10925 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/platform/com_MSC_class.mk6
-rw-r--r--solenv/gcc-wrappers/g++.cxx4
-rw-r--r--solenv/gcc-wrappers/gcc.cxx4
-rw-r--r--solenv/gcc-wrappers/wrapper.cxx5
-rw-r--r--solenv/gcc-wrappers/wrapper.hxx2
5 files changed, 15 insertions, 6 deletions
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index fb617ac9e85b..dec9e81f91d5 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -503,9 +503,11 @@ endef
# /opt/lo/bin/ccache /cygdrive/c/PROGRA~2/MICROS~2.0/VC/bin/cl.exe
gb_AUTOCONF_WRAPPERS = \
- REAL_CC="$(shell cygpath -w $(CC))" \
+ REAL_CC="$(shell cygpath -w $(filter-out -%,$(CC)))" \
+ REAL_CC_FLAGS="$(filter -%,$(CC))" \
CC="$(call gb_Executable_get_target,gcc-wrapper)" \
- REAL_CXX="$(shell cygpath -w $(CXX))" \
+ REAL_CXX="$(shell cygpath -w $(filter-out -%,$(CXX)))" \
+ REAL_CXX_FLAGS="$(filter -%,$(CXX))" \
CXX="$(call gb_Executable_get_target,g++-wrapper)" \
LD="$(shell cygpath -w $(COMPATH)/bin/link.exe) -nologo"
diff --git a/solenv/gcc-wrappers/g++.cxx b/solenv/gcc-wrappers/g++.cxx
index d2ee3d555e0a..626b1643590c 100644
--- a/solenv/gcc-wrappers/g++.cxx
+++ b/solenv/gcc-wrappers/g++.cxx
@@ -13,8 +13,10 @@ int main(int argc, char *argv[]) {
vector<string> rawargs(argv + 1, argv + argc);
string command=getexe("REAL_CXX");
+ string flags=getexe("REAL_CXX_FLAGS", true);
- string args=processccargs(rawargs);
+ string args=flags.empty() ? string() : flags + " ";
+ args += processccargs(rawargs);
setupccenv();
diff --git a/solenv/gcc-wrappers/gcc.cxx b/solenv/gcc-wrappers/gcc.cxx
index b8983cf6e5e6..f34c2dba8c99 100644
--- a/solenv/gcc-wrappers/gcc.cxx
+++ b/solenv/gcc-wrappers/gcc.cxx
@@ -13,8 +13,10 @@ int main(int argc, char *argv[]) {
vector<string> rawargs(argv + 1, argv + argc);
string command=getexe("REAL_CC");
+ string flags=getexe("REAL_CC_FLAGS", true);
- string args=processccargs(rawargs);
+ string args=flags.empty() ? string() : flags + " ";
+ args += processccargs(rawargs);
setupccenv();
diff --git a/solenv/gcc-wrappers/wrapper.cxx b/solenv/gcc-wrappers/wrapper.cxx
index ba22e1642630..585a7df4c95c 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 985074196c75..36baa0899032 100644
--- a/solenv/gcc-wrappers/wrapper.hxx
+++ b/solenv/gcc-wrappers/wrapper.hxx
@@ -13,7 +13,7 @@
using namespace std;
-string getexe(string exename);
+string getexe(string exename, bool maybeempty = false);
void setupccenv();