summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Lee <lee218@llnl.gov>2017-05-04 04:43:28 -0700
committerAdam J. Stewart <ajstewart426@gmail.com>2017-05-04 06:43:27 -0500
commit26a9793148fe419b2895fe325b63dbe66df74b29 (patch)
tree98ac894e1da24778365edbe80b98874d7586a8de
parentbee105fbb97a4eaf4ce5f215b50f2ea4f6683f6a (diff)
downloadspack-26a9793148fe419b2895fe325b63dbe66df74b29.tar.gz
spack-26a9793148fe419b2895fe325b63dbe66df74b29.tar.bz2
spack-26a9793148fe419b2895fe325b63dbe66df74b29.tar.xz
spack-26a9793148fe419b2895fe325b63dbe66df74b29.zip
patch sqlite to work around macro definition (#4117)
-rw-r--r--var/spack/repos/builtin/packages/sqlite/package.py6
-rw-r--r--var/spack/repos/builtin/packages/sqlite/sqlite_b0.patch13
2 files changed, 19 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/sqlite/package.py b/var/spack/repos/builtin/packages/sqlite/package.py
index c2f2268f1f..c12e937af9 100644
--- a/var/spack/repos/builtin/packages/sqlite/package.py
+++ b/var/spack/repos/builtin/packages/sqlite/package.py
@@ -40,6 +40,12 @@ class Sqlite(AutotoolsPackage):
depends_on('readline')
+ # On some platforms (e.g., PPC) the include chain includes termios.h which
+ # defines a macro B0. Sqlite has a shell.c source file that declares a
+ # variable named B0 and will fail to compile when the macro is found. The
+ # following patch undefines the macro in shell.c
+ patch('sqlite_b0.patch', when='@3.18.0')
+
def get_arch(self):
arch = architecture.Arch()
arch.platform = architecture.platform()
diff --git a/var/spack/repos/builtin/packages/sqlite/sqlite_b0.patch b/var/spack/repos/builtin/packages/sqlite/sqlite_b0.patch
new file mode 100644
index 0000000000..0be1bb95c1
--- /dev/null
+++ b/var/spack/repos/builtin/packages/sqlite/sqlite_b0.patch
@@ -0,0 +1,13 @@
+--- a/shell.c 2017-05-03 10:49:13.266276246 -0700
++++ b/shell.c 2017-05-03 10:51:34.868963321 -0700
+@@ -198,6 +198,10 @@
+ #define getrusage(A,B) memset(B,0,sizeof(*B))
+ #endif
+
++#ifdef B0
++#undef B0
++#endif
++
+ /* Saved resource information for the beginning of an operation */
+ static struct rusage sBegin; /* CPU time at start */
+ static sqlite3_int64 iBegin; /* Wall-clock time at start */