patch sqlite to work around macro definition (#4117)

This commit is contained in:
Gregory Lee 2017-05-04 04:43:28 -07:00 committed by Adam J. Stewart
parent bee105fbb9
commit 26a9793148
2 changed files with 19 additions and 0 deletions

View File

@ -40,6 +40,12 @@ class Sqlite(AutotoolsPackage):
depends_on('readline') 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): def get_arch(self):
arch = architecture.Arch() arch = architecture.Arch()
arch.platform = architecture.platform() arch.platform = architecture.platform()

View File

@ -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 */