From b1eb7ee26dbb340bd2efa99afe69902d7ccba07a Mon Sep 17 00:00:00 2001
From: Barry Smith <bsmith@mcs.anl.gov>
Date: Sun, 4 Mar 2018 16:47:58 -0600
Subject: [PATCH] Issue 208 Set PETSC_DIR appropriately in petscconf.h for
 --prefix installs

 Combining commits b1eb7ee26db and deb554b.

Commit-type: bug-fix
---
 config/install.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/config/install.py b/config/install.py
index 35ebf0d..a5ca14e 100755
--- a/config/install.py
+++ b/config/install.py
@@ -271,6 +271,7 @@ class Installer(script.Script):
       line = line.replace(os.path.realpath(os.path.join(self.rootDir, 'bin')), self.installBinDir)
       line = line.replace(os.path.join(self.rootDir, 'include'), self.installIncludeDir)
       line = line.replace(os.path.realpath(os.path.join(self.rootDir, 'include')), self.installIncludeDir)
+      line = line.replace(self.rootDir, self.installDir)
       # remove PETSC_DIR/PETSC_ARCH variables from conf-makefiles. They are no longer necessary
       line = line.replace('${PETSC_DIR}/${PETSC_ARCH}', self.installDir)
       line = line.replace('PETSC_ARCH=${PETSC_ARCH}', '')
@@ -287,6 +288,7 @@ class Installer(script.Script):
     for file in ['rules', 'variables','petscrules', 'petscvariables']:
       self.fixConfFile(os.path.join(self.destConfDir,file))
     self.fixConfFile(os.path.join(self.destLibDir,'pkgconfig','PETSc.pc'))
+    self.fixConfFile(os.path.join(self.destIncludeDir,'petscconf.h'))
     return
 
   def createUninstaller(self):
-- 
2.7.4.1.g5468f9e

