File add-experimental-support-for-m68k-architecture.patch of Package firebird

From: Andreas Schwab <schwab@suse.de>
Date: Sun, 7 Dec 2014 21:44:27 +0100
Subject: add experimental support for m68k architecture

As this is probably never going to get to upstream, one cannot expect
architecture id to be persistent. Whenever upstream adds a new
architecture, the id is going to collide, patch will need an update and
database file will not be compatible with new binaries (so that backup
and restore will be needed). As noone is likely to be actually using
Firebird on m68k for real data, there should be no harm.
---
 src/jrd/common.h  | 6 ++++++
 src/jrd/inf_pub.h | 1 +
 src/jrd/pag.cpp   | 8 ++++++--
 src/jrd/utl.cpp   | 3 ++-
 4 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/src/jrd/common.h b/src/jrd/common.h
index 875040f..b7d1a33 100644
--- a/src/jrd/common.h
+++ b/src/jrd/common.h
@@ -202,6 +202,12 @@
 
 
 
+#ifdef __mc68000__
+#define IMPLEMENTATION  isc_info_db_impl_linux_m68k /* 85  */
+#undef FB_ALIGNMENT
+#define FB_ALIGNMENT 4
+#endif /* mc68000 */
+
 #endif /* LINUX */
 
 
diff --git a/src/jrd/inf_pub.h b/src/jrd/inf_pub.h
index de6bec3..8e7884aa 100644
--- a/src/jrd/inf_pub.h
+++ b/src/jrd/inf_pub.h
@@ -217,6 +217,7 @@ enum  info_db_implementations
 	isc_info_db_impl_linux_alpha = 83,
 	isc_info_db_impl_linux_arm64 = 84,
 	isc_info_db_impl_linux_ppc64el = 85,
+	isc_info_db_impl_linux_m68k = 86,
 
 	isc_info_db_impl_last_value   // Leave this LAST!
 };
diff --git a/src/jrd/pag.cpp b/src/jrd/pag.cpp
index a6e9322..de12c4d 100644
--- a/src/jrd/pag.cpp
+++ b/src/jrd/pag.cpp
@@ -165,10 +165,11 @@ static const int CLASS_LINUX_HPPA = 40;		// LINUX/HPPA
 static const int CLASS_LINUX_ALPHA = 41;	// LINUX/ALPHA
 static const int CLASS_LINUX_ARM64 = 42;	// LINUX/ARM64
 static const int CLASS_LINUX_PPC64EL = 43;	// LINUX/PowerPc64EL
+static const int CLASS_LINUX_M68K = 44;		// LINUX/M68K
 
 
 static const int CLASS_MAX10 = CLASS_LINUX_AMD64;	// This should not be changed, no new ports with ODS10
-static const int CLASS_MAX = CLASS_LINUX_PPC64EL;
+static const int CLASS_MAX = CLASS_LINUX_M68K;
 
 // ARCHITECTURE COMPATIBILITY CLASSES
 
@@ -269,7 +270,8 @@ static const ArchitectureType archMatrix[CLASS_MAX + 1] =
 	archBigEndian,    // CLASS_LINUX_HPPA
 	archLittleEndian, // CLASS_LINUX_ALPHA
 	archLittleEndian, // CLASS_LINUX_ARM64
-	archLittleEndian  // CLASS_LINUX_PPC64EL
+	archLittleEndian, // CLASS_LINUX_PPC64EL
+	archBigEndian	  // CLASS_LINUX_M68K
 
 };
 
@@ -338,6 +340,8 @@ const SSHORT CLASS		= CLASS_LINUX_ALPHA;
 const SSHORT CLASS		= CLASS_LINUX_ARM64;
 #elif defined(PPC64EL)
 const SSHORT CLASS		= CLASS_LINUX_PPC64EL;
+#elif defined(__mc68000__)
+const SSHORT CLASS		= CLASS_LINUX_M68K;
 #else
 #error no support on other hardware for Linux
 #endif
diff --git a/src/jrd/utl.cpp b/src/jrd/utl.cpp
index 63263a0..bd0472d 100644
--- a/src/jrd/utl.cpp
+++ b/src/jrd/utl.cpp
@@ -229,7 +229,8 @@ static const TEXT* const impl_implementation[] =
 	"Firebird/linux HPPA",			// 82
 	"Firebird/linux ALPHA",			// 83
 	"Firebird/linux ARM64",			// 84
-	"Firebird/linux PPC64EL"		// 85
+	"Firebird/linux PPC64EL",		// 85
+	"Firebird/linux M68K"			// 86
 
 };
 
-- 
1.8.4.5