From 0686bdf1e9e636eb97931be110d3bcf0e37ef508 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@Germany>
Date: Mon, 29 Mar 2010 10:59:35 +0200
Subject: [PATCH] ENH: simplify cpp rules to avoid absolute paths and multiple
 GFLAGS.

- otherwise /lib/cpp may need a different library binding than
  currently available and results in this type of error:

  /usr/lib64/gcc/x86_64-suse-linux/4.4/cc1:
  /data/app/OpenFOAM/ThirdParty-1.6.x/platforms/linux64/gcc-4.3.3/lib64/libstdc++.so.6:
  version `GLIBCXX_3.4.11' not found (required by
  /usr/lib64/libppl_c.so.2)

ENH: remove unused flex++ rule for SiCortex that was identical to the
general one anyhow.
---
 wmake/rules/General/general       | 1 +
 wmake/rules/SiCortex64Gcc/flex++  | 6 ------
 wmake/rules/SiCortex64Gcc/general | 1 -
 wmake/rules/SunOS64Gcc/general    | 2 +-
 wmake/rules/linux64Gcc/general    | 3 ---
 wmake/rules/linux64Gcc43/general  | 3 ---
 wmake/rules/linux64Gcc44/general  | 3 ---
 wmake/rules/linux64Icc/general    | 3 ---
 wmake/rules/linuxGcc/general      | 1 -
 wmake/rules/linuxGcc43/general    | 1 -
 wmake/rules/linuxGcc44/general    | 1 -
 wmake/rules/linuxIA64Gcc/general  | 3 ---
 wmake/rules/linuxIA64Icc/general  | 6 +-----
 wmake/rules/linuxIcc/general      | 1 -
 wmake/rules/linuxPPC64Gcc/general | 1 -
 wmake/rules/linuxmingw32/general  | 1 -
 wmake/rules/solarisGcc/general    | 2 +-
 17 files changed, 4 insertions(+), 35 deletions(-)
 delete mode 100644 wmake/rules/SiCortex64Gcc/flex++

diff --git a/wmake/rules/General/general b/wmake/rules/General/general
index 419d9b1d382..d0253e80b31 100644
--- a/wmake/rules/General/general
+++ b/wmake/rules/General/general
@@ -1,6 +1,7 @@
 AR         = ar
 ARFLAGS    = cr
 RANLIB     = ranlib
+CPP        = cpp
 LD         = ld
 
 GFLAGS     = -D$(WM_ARCH) -DWM_$(WM_PRECISION_OPTION)
diff --git a/wmake/rules/SiCortex64Gcc/flex++ b/wmake/rules/SiCortex64Gcc/flex++
deleted file mode 100644
index 69d6f37319a..00000000000
--- a/wmake/rules/SiCortex64Gcc/flex++
+++ /dev/null
@@ -1,6 +0,0 @@
-.SUFFIXES: .L
-
-Ltoo = flex --c++ -o $*.C -f $$SOURCE ; $(CC) $(c++FLAGS) -c $*.C -o $@
-
-.L.dep:
-	$(MAKE_DEP)
diff --git a/wmake/rules/SiCortex64Gcc/general b/wmake/rules/SiCortex64Gcc/general
index d70a77cdb03..eb820ab36dc 100644
--- a/wmake/rules/SiCortex64Gcc/general
+++ b/wmake/rules/SiCortex64Gcc/general
@@ -1,4 +1,3 @@
-CPP        = /lib/cpp $(GFLAGS)
 LD         = ld -A64
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
diff --git a/wmake/rules/SunOS64Gcc/general b/wmake/rules/SunOS64Gcc/general
index f9b56321985..d24e8f00565 100644
--- a/wmake/rules/SunOS64Gcc/general
+++ b/wmake/rules/SunOS64Gcc/general
@@ -1,4 +1,4 @@
-CPP        = /lib/cpp $(GFLAGS)
+CPP        = /lib/cpp
 LD         = ld -64
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -lnsl -lsocket -L$(FOAM_LIBBIN)/dummy -lPstream
diff --git a/wmake/rules/linux64Gcc/general b/wmake/rules/linux64Gcc/general
index 10237bd1b67..7285501d981 100644
--- a/wmake/rules/linux64Gcc/general
+++ b/wmake/rules/linux64Gcc/general
@@ -1,6 +1,3 @@
-CPP        = /lib/cpp $(GFLAGS)
-LD         = ld
-
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
 
 include $(GENERAL_RULES)/standard
diff --git a/wmake/rules/linux64Gcc43/general b/wmake/rules/linux64Gcc43/general
index 10237bd1b67..7285501d981 100644
--- a/wmake/rules/linux64Gcc43/general
+++ b/wmake/rules/linux64Gcc43/general
@@ -1,6 +1,3 @@
-CPP        = /lib/cpp $(GFLAGS)
-LD         = ld
-
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
 
 include $(GENERAL_RULES)/standard
diff --git a/wmake/rules/linux64Gcc44/general b/wmake/rules/linux64Gcc44/general
index 10237bd1b67..7285501d981 100644
--- a/wmake/rules/linux64Gcc44/general
+++ b/wmake/rules/linux64Gcc44/general
@@ -1,6 +1,3 @@
-CPP        = /lib/cpp $(GFLAGS)
-LD         = ld
-
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
 
 include $(GENERAL_RULES)/standard
diff --git a/wmake/rules/linux64Icc/general b/wmake/rules/linux64Icc/general
index 10237bd1b67..7285501d981 100644
--- a/wmake/rules/linux64Icc/general
+++ b/wmake/rules/linux64Icc/general
@@ -1,6 +1,3 @@
-CPP        = /lib/cpp $(GFLAGS)
-LD         = ld
-
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
 
 include $(GENERAL_RULES)/standard
diff --git a/wmake/rules/linuxGcc/general b/wmake/rules/linuxGcc/general
index 02ad6973ff3..c19ca193948 100644
--- a/wmake/rules/linuxGcc/general
+++ b/wmake/rules/linuxGcc/general
@@ -1,4 +1,3 @@
-CPP        = /lib/cpp $(GFLAGS)
 LD         = ld -melf_i386
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
diff --git a/wmake/rules/linuxGcc43/general b/wmake/rules/linuxGcc43/general
index 02ad6973ff3..c19ca193948 100644
--- a/wmake/rules/linuxGcc43/general
+++ b/wmake/rules/linuxGcc43/general
@@ -1,4 +1,3 @@
-CPP        = /lib/cpp $(GFLAGS)
 LD         = ld -melf_i386
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
diff --git a/wmake/rules/linuxGcc44/general b/wmake/rules/linuxGcc44/general
index 02ad6973ff3..c19ca193948 100644
--- a/wmake/rules/linuxGcc44/general
+++ b/wmake/rules/linuxGcc44/general
@@ -1,4 +1,3 @@
-CPP        = /lib/cpp $(GFLAGS)
 LD         = ld -melf_i386
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
diff --git a/wmake/rules/linuxIA64Gcc/general b/wmake/rules/linuxIA64Gcc/general
index 10237bd1b67..7285501d981 100644
--- a/wmake/rules/linuxIA64Gcc/general
+++ b/wmake/rules/linuxIA64Gcc/general
@@ -1,6 +1,3 @@
-CPP        = /lib/cpp $(GFLAGS)
-LD         = ld
-
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
 
 include $(GENERAL_RULES)/standard
diff --git a/wmake/rules/linuxIA64Icc/general b/wmake/rules/linuxIA64Icc/general
index 8d72138115a..66953a96525 100644
--- a/wmake/rules/linuxIA64Icc/general
+++ b/wmake/rules/linuxIA64Icc/general
@@ -1,8 +1,4 @@
-CPP        = /lib/cpp $(GFLAGS) -DICC_IA64_PREFETCH
-AR         = ar
-ARFLAGS    = cr
-RANLIB     = ranlib
-LD         = ld
+CPP        = cpp -DICC_IA64_PREFETCH
 
 GLIBS      = -liberty
 
diff --git a/wmake/rules/linuxIcc/general b/wmake/rules/linuxIcc/general
index 02ad6973ff3..c19ca193948 100644
--- a/wmake/rules/linuxIcc/general
+++ b/wmake/rules/linuxIcc/general
@@ -1,4 +1,3 @@
-CPP        = /lib/cpp $(GFLAGS)
 LD         = ld -melf_i386
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
diff --git a/wmake/rules/linuxPPC64Gcc/general b/wmake/rules/linuxPPC64Gcc/general
index 76d507634a9..81927e682b5 100644
--- a/wmake/rules/linuxPPC64Gcc/general
+++ b/wmake/rules/linuxPPC64Gcc/general
@@ -1,4 +1,3 @@
-CPP        = /lib/cpp $(GFLAGS)
 LD         = ld -m elf64ppc
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
diff --git a/wmake/rules/linuxmingw32/general b/wmake/rules/linuxmingw32/general
index bd79de9270a..26658e0c98f 100644
--- a/wmake/rules/linuxmingw32/general
+++ b/wmake/rules/linuxmingw32/general
@@ -1,4 +1,3 @@
-CPP        = /lib/cpp $(GFLAGS)
 LD         = mingw32-ld
 
 PROJECT_LIBS = -l$(WM_PROJECT)
diff --git a/wmake/rules/solarisGcc/general b/wmake/rules/solarisGcc/general
index 712af785595..c8641ef7e58 100644
--- a/wmake/rules/solarisGcc/general
+++ b/wmake/rules/solarisGcc/general
@@ -1,4 +1,4 @@
-CPP        = /usr/lib/cpp -undef $(GFLAGS)
+CPP        = /usr/lib/cpp -undef
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -lnsl -lsocket -L$(FOAM_LIBBIN)/dummy -lPstream
 
-- 
GitLab