From bd8863e711311297f2928d5357c781db208a50af Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Mon, 30 Apr 2012 20:19:23 +0100
Subject: [PATCH] wmake: updated rules for gcc-4.7.0

---
 wmake/rules/linux64Gcc47/c++Opt   |  2 +-
 wmake/rules/linux64Gcc47/cOpt     |  2 +-
 wmake/rules/linuxGcc47/c          | 16 ++++++++++++++++
 wmake/rules/linuxGcc47/c++        | 21 +++++++++++++++++++++
 wmake/rules/linuxGcc47/c++Debug   |  2 ++
 wmake/rules/linuxGcc47/c++Opt     |  2 ++
 wmake/rules/linuxGcc47/c++Prof    |  2 ++
 wmake/rules/linuxGcc47/cDebug     |  2 ++
 wmake/rules/linuxGcc47/cOpt       |  2 ++
 wmake/rules/linuxGcc47/cProf      |  2 ++
 wmake/rules/linuxGcc47/general    |  9 +++++++++
 wmake/rules/linuxGcc47/mplibHPMPI |  3 +++
 12 files changed, 63 insertions(+), 2 deletions(-)
 create mode 100644 wmake/rules/linuxGcc47/c
 create mode 100644 wmake/rules/linuxGcc47/c++
 create mode 100644 wmake/rules/linuxGcc47/c++Debug
 create mode 100644 wmake/rules/linuxGcc47/c++Opt
 create mode 100644 wmake/rules/linuxGcc47/c++Prof
 create mode 100644 wmake/rules/linuxGcc47/cDebug
 create mode 100644 wmake/rules/linuxGcc47/cOpt
 create mode 100644 wmake/rules/linuxGcc47/cProf
 create mode 100644 wmake/rules/linuxGcc47/general
 create mode 100644 wmake/rules/linuxGcc47/mplibHPMPI

diff --git a/wmake/rules/linux64Gcc47/c++Opt b/wmake/rules/linux64Gcc47/c++Opt
index 1c64f5b4b75..2aedabd6280 100644
--- a/wmake/rules/linux64Gcc47/c++Opt
+++ b/wmake/rules/linux64Gcc47/c++Opt
@@ -1,2 +1,2 @@
 c++DBUG     =
-c++OPT      = -O2
+c++OPT      = -O3
diff --git a/wmake/rules/linux64Gcc47/cOpt b/wmake/rules/linux64Gcc47/cOpt
index 6650ffa4a5d..17318709f1f 100644
--- a/wmake/rules/linux64Gcc47/cOpt
+++ b/wmake/rules/linux64Gcc47/cOpt
@@ -1,2 +1,2 @@
 cDBUG       =
-cOPT        = -O2
+cOPT        = -O3
diff --git a/wmake/rules/linuxGcc47/c b/wmake/rules/linuxGcc47/c
new file mode 100644
index 00000000000..d914fcd37d0
--- /dev/null
+++ b/wmake/rules/linuxGcc47/c
@@ -0,0 +1,16 @@
+.SUFFIXES: .c .h
+
+cWARN        = -Wall
+
+cc          = gcc -m32
+
+include $(RULES)/c$(WM_COMPILE_OPTION)
+
+cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
+
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+
+LINK_LIBS   = $(cDBUG)
+
+LINKLIBSO   = $(cc) -shared
+LINKEXE     = $(cc) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
diff --git a/wmake/rules/linuxGcc47/c++ b/wmake/rules/linuxGcc47/c++
new file mode 100644
index 00000000000..357f4106e10
--- /dev/null
+++ b/wmake/rules/linuxGcc47/c++
@@ -0,0 +1,21 @@
+.SUFFIXES: .C .cxx .cc .cpp
+
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast
+
+CC          = g++ -m32
+
+include $(RULES)/c++$(WM_COMPILE_OPTION)
+
+ptFLAGS     = -DNoRepository -ftemplate-depth-100
+
+c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
+
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+cxxtoo      = $(Ctoo)
+cctoo       = $(Ctoo)
+cpptoo      = $(Ctoo)
+
+LINK_LIBS   = $(c++DBUG)
+
+LINKLIBSO   = $(CC) $(c++FLAGS) -shared -Xlinker --add-needed -Xlinker --no-as-needed
+LINKEXE     = $(CC) $(c++FLAGS) -Xlinker --add-needed -Xlinker --no-as-needed
diff --git a/wmake/rules/linuxGcc47/c++Debug b/wmake/rules/linuxGcc47/c++Debug
new file mode 100644
index 00000000000..19bdb9c3346
--- /dev/null
+++ b/wmake/rules/linuxGcc47/c++Debug
@@ -0,0 +1,2 @@
+c++DBUG    = -ggdb3 -DFULLDEBUG
+c++OPT      = -O0 -fdefault-inline
diff --git a/wmake/rules/linuxGcc47/c++Opt b/wmake/rules/linuxGcc47/c++Opt
new file mode 100644
index 00000000000..2aedabd6280
--- /dev/null
+++ b/wmake/rules/linuxGcc47/c++Opt
@@ -0,0 +1,2 @@
+c++DBUG     =
+c++OPT      = -O3
diff --git a/wmake/rules/linuxGcc47/c++Prof b/wmake/rules/linuxGcc47/c++Prof
new file mode 100644
index 00000000000..3bda4dad55e
--- /dev/null
+++ b/wmake/rules/linuxGcc47/c++Prof
@@ -0,0 +1,2 @@
+c++DBUG    = -pg
+c++OPT     = -O2
diff --git a/wmake/rules/linuxGcc47/cDebug b/wmake/rules/linuxGcc47/cDebug
new file mode 100644
index 00000000000..72b638f4582
--- /dev/null
+++ b/wmake/rules/linuxGcc47/cDebug
@@ -0,0 +1,2 @@
+cDBUG       = -ggdb -DFULLDEBUG
+cOPT        = -O1 -fdefault-inline -finline-functions
diff --git a/wmake/rules/linuxGcc47/cOpt b/wmake/rules/linuxGcc47/cOpt
new file mode 100644
index 00000000000..17318709f1f
--- /dev/null
+++ b/wmake/rules/linuxGcc47/cOpt
@@ -0,0 +1,2 @@
+cDBUG       =
+cOPT        = -O3
diff --git a/wmake/rules/linuxGcc47/cProf b/wmake/rules/linuxGcc47/cProf
new file mode 100644
index 00000000000..ca3ac9bf5f0
--- /dev/null
+++ b/wmake/rules/linuxGcc47/cProf
@@ -0,0 +1,2 @@
+cDBUG       = -pg
+cOPT        = -O2
diff --git a/wmake/rules/linuxGcc47/general b/wmake/rules/linuxGcc47/general
new file mode 100644
index 00000000000..4b051e6b984
--- /dev/null
+++ b/wmake/rules/linuxGcc47/general
@@ -0,0 +1,9 @@
+CPP        = cpp -traditional-cpp
+LD         = ld -melf_i386
+
+PROJECT_LIBS = -l$(WM_PROJECT) -ldl
+
+include $(GENERAL_RULES)/standard
+
+include $(RULES)/c
+include $(RULES)/c++
diff --git a/wmake/rules/linuxGcc47/mplibHPMPI b/wmake/rules/linuxGcc47/mplibHPMPI
new file mode 100644
index 00000000000..8aff40632bd
--- /dev/null
+++ b/wmake/rules/linuxGcc47/mplibHPMPI
@@ -0,0 +1,3 @@
+PFLAGS     =
+PINC       = -I$(MPI_ARCH_PATH)/include -D_MPICC_H
+PLIBS      = -L$(MPI_ARCH_PATH)/lib/linux_ia32 -lmpi
-- 
GitLab