From 59432b7b2dd2d67ccab0fb4781b71cdc9edaa2cf Mon Sep 17 00:00:00 2001
From: mark <mark@opencfd>
Date: Fri, 20 Jan 2017 13:21:34 +0100
Subject: [PATCH] ENH: use pkgconfigAdjust when compiling software that has
 pkgconfig files

- simplifies relocation at a later stage
---
 Allwmake       |  5 +++--
 makeCCMIO      |  7 +++----
 makeCGAL       |  2 +-
 makeFFTW       |  8 +++++---
 makeGcc        |  4 ++++
 makeGperftools |  1 +
 makeLLVM       |  2 ++
 makeMesa       | 11 +++++++----
 8 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/Allwmake b/Allwmake
index 13a4821..e21941f 100755
--- a/Allwmake
+++ b/Allwmake
@@ -127,9 +127,11 @@ OPENMPI)
             --enable-mpi-fortran=none \
             --disable-mpi-profile \
             $configOpt \
+        && set +x \
         && make -j $WM_NCOMPPROCS \
         && make install \
-        && echo "Built: $mpiPACKAGE"
+        && echo "Built: $mpiPACKAGE" \
+        && pkgconfigAdjust $MPI_ARCH_PATH
     ) || {
         echo "Error building: $mpiPACKAGE"
         exit 1
@@ -201,7 +203,6 @@ MPICH)
     )
     fi
     ;;
-
 esac
 
 
diff --git a/makeCCMIO b/makeCCMIO
index 1e1d5ec..02e7c21 100755
--- a/makeCCMIO
+++ b/makeCCMIO
@@ -26,7 +26,7 @@
 #     makeCCMIO
 #
 # Description
-#     Build CD-adapco's ccmio library
+#     Build the libccmio library
 #
 # ----------------------------------------------
 # NO USER-CONFIGURABLE SETTINGS WITHIN THIS FILE
@@ -64,8 +64,8 @@ options:
 * Compile the proprietary libccmio library
       $ccmioPACKAGE
 
-  Users wishing to make use of the library should contact cd-adapco
-  (Siemens PLM) for possible download and terms of use.
+  Users wishing to obtain the library should contact Siemens PLM (cd-adapco)
+  for terms of use.
 
   After obtaining the $ccmioPACKAGE library, place in folder
 
@@ -118,7 +118,6 @@ echo "---------------"
     mkdir -p $libDIR 2>/dev/null
 
     cpMakeFiles libccmio 2>/dev/null
-    set +x
     if wmake $targetType
     then
         # make headers available:
diff --git a/makeCGAL b/makeCGAL
index c4acdc2..a3db8aa 100755
--- a/makeCGAL
+++ b/makeCGAL
@@ -452,9 +452,9 @@ CMAKE_OPTIONS
         ${optHeadersOnly:+-DCGAL_HEADER_ONLY=TRUE} \
         $configBoost $configGmp $configMpfr \
         $CGAL_SOURCE_DIR \
+    && set +x \
     && make -j $WM_NCOMPPROCS \
     && make install || exit 1
-    set +x
 
     echo "----"
     echo "create '\$CGAL_ARCH_PATH/share/files'"
diff --git a/makeFFTW b/makeFFTW
index 9a66583..fc8a10e 100755
--- a/makeFFTW
+++ b/makeFFTW
@@ -143,9 +143,11 @@ else
             --libdir=$FFTW_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
             --enable-shared --disable-static \
             --disable-fortran \
-            && make -j $WM_NCOMPPROCS \
-            && make install \
-            && echo "Built $fftwPACKAGE"
+        && set +x \
+        && make -j $WM_NCOMPPROCS \
+        && make install \
+        && echo "Built $fftwPACKAGE" \
+        && pkgconfigAdjust $FFTW_ARCH_PATH
     ) || {
         echo "Error building: FFTW"
         exit 1
diff --git a/makeGcc b/makeGcc
index 85b1571..265d617 100755
--- a/makeGcc
+++ b/makeGcc
@@ -193,6 +193,7 @@ else
         --prefix=$GMP_ARCH_PATH \
         --libdir=$GMP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
         --enable-cxx \
+    && set +x \
     && make -j $WM_NCOMPPROCS \
     && make install \
     && echo "Built: $gmpPACKAGE"
@@ -249,6 +250,7 @@ else
         --prefix=$MPFR_ARCH_PATH \
         --libdir=$MPFR_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
         $configGMP $configOpt \
+    && set +x \
     && make -j $WM_NCOMPPROCS \
     && make install \
     && echo "Built: $mpfrPACKAGE"
@@ -301,6 +303,7 @@ else
         --prefix=$MPC_ARCH_PATH \
         --libdir=$MPC_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH \
         $configGMP $configMPFR \
+    && set +x \
     && make -j $WM_NCOMPPROCS \
     && make install \
     && echo "Built: $mpcPACKAGE"
@@ -366,6 +369,7 @@ else
         --with-system-zlib \
         $configGMP $configMPFR $configMPC $configOpt \
         MAKEINFO=missing \
+    && set +x \
     && make -j $WM_NCOMPPROCS \
     && make install \
     && echo "Built: $gccPACKAGE"
diff --git a/makeGperftools b/makeGperftools
index 767921c..87cdc4c 100755
--- a/makeGperftools
+++ b/makeGperftools
@@ -130,6 +130,7 @@ else
         set -x
         $GPERFTOOLS_SOURCE_DIR/configure \
             --prefix=$GPERFTOOLS_ARCH_PATH \
+        && set +x \
         && make -j $WM_NCOMPPROCS \
         && make install \
         && echo "Built: $gperftoolsPACKAGE" \
diff --git a/makeLLVM b/makeLLVM
index c9ec115..1d45d3a 100755
--- a/makeLLVM
+++ b/makeLLVM
@@ -155,6 +155,7 @@ then
             --with-gcc-toolchain=$(which gcc | sed s%/bin/gcc%%) \
             --enable-optimized \
             --enable-shared \
+        && set +x \
         && make -j $WM_NCOMPPROCS \
         && make install \
         && echo "Built: $llvmPACKAGE"
@@ -183,6 +184,7 @@ else
             -DCMAKE_BUILD_TYPE=Release \
             -DBUILD_SHARED_LIBS=ON \
             $LLVM_SOURCE_DIR \
+        && set +x \
         && make -j $WM_NCOMPPROCS \
         && make install \
         && echo "Built: $llvmPACKAGE"
diff --git a/makeMesa b/makeMesa
index dc17402..edb8d81 100755
--- a/makeMesa
+++ b/makeMesa
@@ -151,6 +151,8 @@ MESA_ARCH_PATH=$installBASE/$mesaPACKAGE
 # - avoid GLES (GLES1) since <GLES/gl.h> may mask the <GL/gl.h> header
 adjustMESA()
 {
+    pkgconfigAdjust $MESA_ARCH_PATH
+
     \rm -rf $MESA_ARCH_PATH/include/GLES $MESA_ARCH_PATH/include/GLES1
     echo "removed all gles1 includes"
 }
@@ -202,10 +204,11 @@ adjustMESA()
         --enable-texture-float \
         --enable-gallium-osmesa --with-gallium-drivers=swrast \
         $configOpt \
-        && make -j $WM_NCOMPPROCS \
-        && make install \
-        && adjustMESA \
-        && echo "Built $mesaPACKAGE"
+    && set +x \
+    && make -j $WM_NCOMPPROCS \
+    && make install \
+    && echo "Built $mesaPACKAGE" \
+    && adjustMESA
 ) || {
     echo "Error building: MESA"
     exit 1
-- 
GitLab