[pkg-firebird-general] Bug#626931: Bug#626931: FTBFS on GNU/Hurd

Samuel Thibault sthibault at debian.org
Sat Aug 20 16:00:04 UTC 2011


Samuel Thibault, le Sat 20 Aug 2011 17:58:33 +0200, a écrit :
> Samuel Thibault, le Sat 20 Aug 2011 17:56:14 +0200, a écrit :
> > Damyan Ivanov, le Mon 16 May 2011 21:12:27 +0300, a écrit :
> > > I seem to remember a Hurd porter said that there would be problems 
> > > with semaphores or something like that,
> > 
> > Yes.
> > 
> > GNU/Hurd doesn't (yet) support semctl and memory-shared mutexes.
> 
> That being said, could upstream apply the attached patch to at least fix
> the build?

Oops, the patch wasn't up to date, here is my late version.

Samuel
-------------- next part --------------
diff -ur firebird2.5-2.5.0.26074-0.ds4/configure.in firebird2.5-2.5.0.26074-0.ds4-mine/configure.in
--- firebird2.5-2.5.0.26074-0.ds4/configure.in	2011-08-20 16:40:35.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/configure.in	2011-08-20 16:28:22.000000000 +0000
@@ -297,7 +297,7 @@
    SHRLIB_EXT=so
    ;;
 
-  *-*-linux* | *-*-gnu*)
+  *-*-linux*)
     MAKEFILE_PREFIX=linux_generic
     INSTALL_PREFIX=linux
     PLATFORM=LINUX
@@ -305,6 +305,15 @@
     EDITLINE_FLG=Y
     SHRLIB_EXT=so
     ;;
+
+  *-*-gnu*)
+    MAKEFILE_PREFIX=gnu_generic
+    INSTALL_PREFIX=gnu
+    PLATFORM=GNU
+    AC_DEFINE(GNU, 1, [Define this if OS is GNU])
+    EDITLINE_FLG=Y
+    SHRLIB_EXT=so
+    ;;
 
   *-*-netbsd*)
     MAKEFILE_PREFIX=netbsd
diff -ur firebird2.5-2.5.0.26074-0.ds4/src/gpre/cob.cpp firebird2.5-2.5.0.26074-0.ds4-mine/src/gpre/cob.cpp
--- firebird2.5-2.5.0.26074-0.ds4/src/gpre/cob.cpp	2010-09-08 08:43:39.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/src/gpre/cob.cpp	2011-08-20 16:29:52.000000000 +0000
@@ -61,7 +61,7 @@
 static const char* const COMMIT			= "commit";
 static const char* const ROLLBACK		= "rollback";
 
-#if defined AIX || defined AIX_PPC || defined SOLARIS || defined HP11 || defined LINUX || defined DARWIN || defined FREEBSD || defined NETBSD || defined WIN_NT
+#if defined AIX || defined AIX_PPC || defined SOLARIS || defined HP11 || defined LINUX || defined GNU || defined DARWIN || defined FREEBSD || defined NETBSD || defined WIN_NT
 static const char* const OMITTED 		= "BY VALUE 0";
 static const char* const BY_VALUE		= "BY VALUE ";
 static const char* const END_VALUE		= "";
diff -ur firebird2.5-2.5.0.26074-0.ds4/src/gpre/ftn.cpp firebird2.5-2.5.0.26074-0.ds4-mine/src/gpre/ftn.cpp
--- firebird2.5-2.5.0.26074-0.ds4/src/gpre/ftn.cpp	2010-09-08 08:43:39.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/src/gpre/ftn.cpp	2011-08-20 16:29:29.000000000 +0000
@@ -209,6 +209,23 @@
 const char* const COMMENT			= "*     ";
 const char* const INLINE_COMMENT	= "\n*                ";
 const char* const COMMA				= ",";
+#elif defined(GNU)
+const char* const INCLUDE_ISC_FTN	= "       INCLUDE  '/usr/firebird/include/gds.f\' \n\n";
+const char* const INCLUDE_FTN_FILE	= "gds.f";
+const char* const DOUBLE_DCL		= "DOUBLE PRECISION";
+const char* const I2CONST_1			= "";
+const char* const I2CONST_2			= "";
+const char* const I2_1				= "";
+const char* const I2_2				= "";
+const char* const VAL_1				= "";
+const char* const VAL_2				= "";
+const char* const REF_1				= "";
+const char* const REF_2				= "";
+const char* const I4CONST_1			= "";
+const char* const I4CONST_2			= "";
+const char* const COMMENT			= "*     ";
+const char* const INLINE_COMMENT	= "\n*                ";
+const char* const COMMA				= ",";
 #elif defined(WIN_NT)
 const char* const INCLUDE_ISC_FTN	= "       INCLUDE  \'%s\' \n\n";
 const char* const INCLUDE_FTN_FILE	= "gds.f";
diff -ur firebird2.5-2.5.0.26074-0.ds4/src/include/gen/autoconfig_msvc.h firebird2.5-2.5.0.26074-0.ds4-mine/src/include/gen/autoconfig_msvc.h
--- firebird2.5-2.5.0.26074-0.ds4/src/include/gen/autoconfig_msvc.h	2010-09-08 08:43:28.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/src/include/gen/autoconfig_msvc.h	2011-08-20 16:29:07.000000000 +0000
@@ -297,6 +297,7 @@
 /* various OS efforts */
 #undef DARWIN
 #undef LINUX
+#undef GNU
 #undef FREEBSD
 #undef NETBSD
 #undef sun
diff -ur firebird2.5-2.5.0.26074-0.ds4/src/jrd/ThreadStart.cpp firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/ThreadStart.cpp
--- firebird2.5-2.5.0.26074-0.ds4/src/jrd/ThreadStart.cpp	2010-09-08 08:43:27.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/ThreadStart.cpp	2011-08-20 16:34:03.000000000 +0000
@@ -167,7 +167,7 @@
 	pthread_attr_t pattr;
 	int state;
 
-#if defined (LINUX) || defined (FREEBSD)
+#if defined (LINUX) || defined (GNU) || defined (FREEBSD)
 	if (state = pthread_create(&thread, NULL, THREAD_ENTRYPOINT, THREAD_ARG))
 		Firebird::system_call_failed::raise("pthread_create", state);
 	if (!thd_id)
diff -ur firebird2.5-2.5.0.26074-0.ds4/src/jrd/common.h firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/common.h
--- firebird2.5-2.5.0.26074-0.ds4/src/jrd/common.h	2011-08-20 16:40:35.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/common.h	2011-08-20 16:32:43.000000000 +0000
@@ -196,6 +196,45 @@
 
 
 /*****************************************************
+* GNU platforms
+*****************************************************/
+#ifdef GNU
+#define QUADFORMAT "ll"
+#define QUADCONST(n) (n##LL)
+
+// SLONG is a 32-bit integer on 64-bit platforms
+//#if SIZEOF_LONG == 4
+//#define SLONGFORMAT "ld"
+//#define ULONGFORMAT "lu"
+//#define XLONGFORMAT "lX"
+//#define xLONGFORMAT "lx"
+//#endif
+
+// format for size_t
+#ifndef SIZEFORMAT
+#define SIZEFORMAT "zi"
+#endif
+
+//format for __LINE__
+#define LINEFORMAT "d"
+
+#define UNIX
+#define IEEE
+
+#ifdef i386
+#define I386
+#define IMPLEMENTATION  isc_info_db_impl_i386 /* 60 */
+#endif /* i386 */
+
+#ifndef USE_POSIX_THREADS
+// Enable posix threads
+#define USE_POSIX_THREADS
+#endif
+
+#endif /* GNU */
+
+
+/*****************************************************
 * Darwin Platforms
 *****************************************************/
 #ifdef DARWIN
@@ -545,6 +585,10 @@
 #define SYS_ERR		Arg::Unix
 #endif /* UNIX */
 
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 4096
+#endif
+
 #ifndef SYS_ERR
 #define SYS_ERR		Arg::Unix
 #endif
diff -ur firebird2.5-2.5.0.26074-0.ds4/src/jrd/dbg.cpp firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/dbg.cpp
--- firebird2.5-2.5.0.26074-0.ds4/src/jrd/dbg.cpp	2010-09-08 08:43:27.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/dbg.cpp	2011-08-20 16:34:47.000000000 +0000
@@ -78,7 +78,7 @@
 int (*dbg_check) (int) = DBG_check;
 
 
-#ifdef LINUX
+#if defined LINUX || defined GNU
 FILE *dbg_file = NULL;
 #else
 FILE *dbg_file = stdout;
diff -ur firebird2.5-2.5.0.26074-0.ds4/src/jrd/flu.cpp firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/flu.cpp
--- firebird2.5-2.5.0.26074-0.ds4/src/jrd/flu.cpp	2010-09-08 08:43:27.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/flu.cpp	2011-08-20 16:34:27.000000000 +0000
@@ -65,7 +65,7 @@
 
 #include <string.h>
 
-#if (defined SOLARIS || defined LINUX || defined AIX_PPC || defined FREEBSD || defined NETBSD || defined HPUX)
+#if (defined SOLARIS || defined LINUX || defined GNU || defined AIX_PPC || defined FREEBSD || defined NETBSD || defined HPUX)
 #define DYNAMIC_SHARED_LIBRARIES
 #endif
 
diff -ur firebird2.5-2.5.0.26074-0.ds4/src/jrd/isc_sync.cpp firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/isc_sync.cpp
--- firebird2.5-2.5.0.26074-0.ds4/src/jrd/isc_sync.cpp	2011-08-20 16:40:35.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/isc_sync.cpp	2011-08-20 16:30:16.000000000 +0000
@@ -1268,7 +1268,7 @@
 		{
 			ret = pthread_cond_timedwait(event->event_cond, event->event_mutex, &timer);
 
-#if (defined LINUX || defined DARWIN || defined HP11 || defined FREEBSD)
+#if (defined LINUX || defined GNU || defined DARWIN || defined HP11 || defined FREEBSD)
 			if (ret == ETIMEDOUT)
 #else
 			if (ret == ETIME)
diff -ur firebird2.5-2.5.0.26074-0.ds4/src/jrd/license.h firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/license.h
--- firebird2.5-2.5.0.26074-0.ds4/src/jrd/license.h	2010-09-08 08:43:27.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/license.h	2011-08-20 16:31:16.000000000 +0000
@@ -110,6 +110,10 @@
 #define FB_PLATFORM     "LI"	/* Linux on Intel */
 #endif
 
+#ifdef GNU
+#define FB_PLATFORM     "GN"	/* GNU on Intel */
+#endif
+
 #ifdef FREEBSD
 #define FB_PLATFORM     "FB"	/* FreeBSD/i386 */
 #endif
diff -ur firebird2.5-2.5.0.26074-0.ds4/src/jrd/os/posix/isc_ipc.cpp firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/os/posix/isc_ipc.cpp
--- firebird2.5-2.5.0.26074-0.ds4/src/jrd/os/posix/isc_ipc.cpp	2010-09-08 08:43:19.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/os/posix/isc_ipc.cpp	2011-08-20 16:24:21.000000000 +0000
@@ -124,7 +124,11 @@
 static bool isc_signal2(int signal, FPTR_VOID handler, void* arg, ULONG);
 static SIG que_signal(int signal, FPTR_VOID handler, void* arg, int flags, bool w_siginfo);
 
+#ifdef SA_SIGINFO
 static void CLIB_ROUTINE signal_action(int number, siginfo_t *siginfo, void *context);
+#else
+static void CLIB_ROUTINE signal_action(int number);
+#endif
 
 #ifndef SIG_HOLD
 #define SIG_HOLD	SIG_DFL
@@ -183,20 +187,34 @@
 	if (!sig) {
 		struct sigaction act, oact;
 
+#ifdef SA_SIGINFO
 		act.sa_sigaction = signal_action;
 		act.sa_flags = SA_RESTART | SA_SIGINFO;
+#else
+		act.sa_handler = signal_action;
+#endif
 		sigemptyset(&act.sa_mask);
 		sigaddset(&act.sa_mask, signal_number);
 		sigaction(signal_number, &act, &oact);
+#ifdef SA_SIGINFO
 		old_sig_w_siginfo = oact.sa_flags & SA_SIGINFO;
+#endif
 
-		if (oact.sa_sigaction != signal_action &&
+		if (
+#ifdef SA_SIGINFO
+			oact.sa_sigaction != signal_action &&
+#else
+			oact.sa_handler != signal_action &&
+#endif
 			oact.sa_handler != SIG_DFL &&
 			oact.sa_handler != SIG_HOLD &&
 			oact.sa_handler != SIG_IGN)
 		{
-			que_signal(signal_number, old_sig_w_siginfo ?
+			que_signal(signal_number,
+#ifdef SA_SIGINFO
+			old_sig_w_siginfo ?
 				reinterpret_cast<FPTR_VOID>(oact.sa_sigaction) :
+#endif
 				reinterpret_cast<FPTR_VOID>(oact.sa_handler),
 				NULL, SIG_client, old_sig_w_siginfo);
 			rc = true;
@@ -322,6 +340,12 @@
 		DEV_REPORT("que_signal: out of memory");
 		return NULL;			/* NOMEM: not handled, too difficult */
 	}
+#ifndef SA_SIGINFO
+	if (sig_w_siginfo) {
+		DEV_REPORT("SA_SIGINFO not supported");
+		return NULL;
+	}
+#endif
 
 #ifdef DEBUG_GDS_ALLOC
 /* This will only be freed when a signal handler is de-registered
@@ -344,7 +368,11 @@
 }
 
 
+#ifdef SA_SIGINFO
 static void CLIB_ROUTINE signal_action(int number, siginfo_t *siginfo, void *context)
+#else
+static void CLIB_ROUTINE signal_action(int number)
+#endif
 {
 /**************************************
  *
@@ -364,11 +392,13 @@
 		{
 			if (sig->sig_flags & SIG_client)
 			{
+#ifdef SA_SIGINFO
 				if (sig->sig_w_siginfo)
 				{
 					(*sig->sig_routine.client3)(number, siginfo, context);
 				}
 				else
+#endif
 				{
 					(*sig->sig_routine.client1)(number);
 				}
diff -ur firebird2.5-2.5.0.26074-0.ds4/src/jrd/pag.cpp firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/pag.cpp
--- firebird2.5-2.5.0.26074-0.ds4/src/jrd/pag.cpp	2011-08-20 16:40:35.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/src/jrd/pag.cpp	2011-08-20 16:39:20.000000000 +0000
@@ -162,9 +162,10 @@
 static const int CLASS_LINUX_SHEB = 39;		// LINUX/SH (big-endian)
 static const int CLASS_LINUX_HPPA = 40;		// LINUX/HPPA
 static const int CLASS_LINUX_ALPHA = 41;	// LINUX/ALPHA
+static const int CLASS_GNU_I386 = 42;		// GNU/i386
 
 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_ALPHA;
+static const int CLASS_MAX = CLASS_GNU_I386;
 
 // ARCHITECTURE COMPATIBILITY CLASSES
 
@@ -264,7 +265,8 @@
 	archLittleEndian, // CLASS_LINUX_SH
 	archBigEndian,    // CLASS_LINUX_SHEB
 	archBigEndian,    // CLASS_LINUX_HPPA
-	archLittleEndian  // CLASS_LINUX_ALPHA
+	archLittleEndian, // CLASS_LINUX_ALPHA
+	archLittleEndian  // CLASS_GNU_I386
 };
 
 #ifdef __sun
@@ -332,6 +334,14 @@
 #endif
 #endif	// LINUX
 
+#ifdef GNU
+#if defined(i386) || defined(i586)
+const SSHORT CLASS		= CLASS_GNU_I386;
+#else
+#error no support on other hardware for GNU
+#endif
+#endif	// GNU
+
 #ifdef FREEBSD
 #if defined(i386)
 const SSHORT CLASS		= CLASS_FREEBSD_I386;
diff -ur firebird2.5-2.5.0.26074-0.ds4/src/remote/protocol.h firebird2.5-2.5.0.26074-0.ds4-mine/src/remote/protocol.h
--- firebird2.5-2.5.0.26074-0.ds4/src/remote/protocol.h	2010-09-08 08:43:35.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/src/remote/protocol.h	2011-08-20 16:37:29.000000000 +0000
@@ -155,7 +155,8 @@
 	arch_winnt_64		= 40,
 	arch_darwin_x64		= 41,
 	arch_darwin_ppc64	= 42,
-	arch_max			= 43	// Keep this at the end
+	arch_gnu			= 43,
+	arch_max			= 44	// Keep this at the end
 };
 
 // Protocol Types
diff -ur firebird2.5-2.5.0.26074-0.ds4/src/remote/remote_def.h firebird2.5-2.5.0.26074-0.ds4-mine/src/remote/remote_def.h
--- firebird2.5-2.5.0.26074-0.ds4/src/remote/remote_def.h	2010-09-08 08:43:35.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4-mine/src/remote/remote_def.h	2011-08-20 16:35:08.000000000 +0000
@@ -56,6 +56,8 @@
 const P_ARCH ARCHITECTURE	= arch_rt;
 #elif defined(LINUX)
 const P_ARCH ARCHITECTURE	= arch_linux;
+#elif defined(GNU)
+const P_ARCH ARCHITECTURE	= arch_gnu;
 #elif defined(FREEBSD)
 const P_ARCH ARCHITECTURE	= arch_freebsd;
 #elif defined(NETBSD)
--- /dev/null	2011-08-03 18:03:30.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4/builds/posix/prefix.gnu	2011-08-20 16:48:51.000000000 +0000
@@ -0,0 +1,34 @@
+# The contents of this file are subject to the Interbase Public
+# License Version 1.0 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy
+# of the License at http://www.Inprise.com/IPL.html
+#
+# Software distributed under the License is distributed on an
+# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
+# or implied. See the License for the specific language governing
+# rights and limitations under the License.
+#
+# The Original Code was created by Inprise Corporation
+# and its predecessors. Portions created by Inprise Corporation are
+# Copyright (C) Inprise Corporation.
+#
+# All Rights Reserved.
+# Contributor(s): ______________________________________.
+# Start of file prefix.linux:	$(VERSION)	$(PLATFORM)
+#
+# 2 Oct 2002, Nickolay Samofatov - Major cleanup
+
+COMMON_FLAGS=-ggdb -DFB_SEND_FLAGS=MSG_NOSIGNAL -DGNU -pipe -MMD -fPIC -fmessage-length=0
+OPTIMIZE_FLAGS=-O3 -march=i486 -mtune=i686 -fno-omit-frame-pointer
+WARN_FLAGS=-Wall -Wno-switch -Wno-parentheses -Wno-unknown-pragmas -Wno-unused-variable
+
+PROD_FLAGS=-DNDEBUG $(COMMON_FLAGS) $(OPTIMIZE_FLAGS)
+#DEV_FLAGS=-DUSE_VALGRIND -p $(COMMON_FLAGS) $(WARN_FLAGS)
+DEV_FLAGS=-p $(COMMON_FLAGS) $(WARN_FLAGS)
+
+OS_ServerFiles=inet_server.cpp
+
+EMBED_UTIL_TARGETS=gstat gsec fbguard nbackup fb_lock_print fbsvcmgr fbtracemgr
+CLIENT_UTIL_TARGETS=gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr fbtracemgr
+
+Physical_IO_Module=os/posix/unix.cpp
--- /dev/null	2011-08-03 18:03:30.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4/builds/posix/prefix.gnu_generic	2011-08-20 16:48:10.000000000 +0000
@@ -0,0 +1,32 @@
+# The contents of this file are subject to the Interbase Public
+# License Version 1.0 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy
+# of the License at http://www.Inprise.com/IPL.html
+#
+# Software distributed under the License is distributed on an
+# "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
+# or implied. See the License for the specific language governing
+# rights and limitations under the License.
+#
+# The Original Code was created by Inprise Corporation
+# and its predecessors. Portions created by Inprise Corporation are
+# Copyright (C) Inprise Corporation.
+#
+# All Rights Reserved.
+# Contributor(s): ______________________________________.
+# Start of file prefix.linux:	$(VERSION)	$(PLATFORM)
+#
+# 2 Oct 2002, Nickolay Samofatov - Major cleanup
+
+COMMON_FLAGS=-DGNU -pipe -MMD -fPIC -DFB_SEND_FLAGS=MSG_NOSIGNAL
+
+PROD_FLAGS=-ggdb -O3 -DNDEBUG $(COMMON_FLAGS)
+DEV_FLAGS=-ggdb -p -Wall -Wno-switch $(COMMON_FLAGS)
+CXXFLAGS:= $(CXXFLAGS) -fno-rtti
+
+OS_ServerFiles=inet_server.cpp
+
+EMBED_UTIL_TARGETS=gstat gsec fbguard nbackup fb_lock_print fbsvcmgr fbtracemgr
+CLIENT_UTIL_TARGETS=gstat gsec fbguard fbmgr_bin nbackup fb_lock_print fbsvcmgr fbtracemgr
+
+Physical_IO_Module=os/posix/unix.cpp
--- /dev/null	2011-08-03 18:03:30.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4/builds/install/arch-specific/gnu/Makefile.in	2010-09-08 08:41:27.000000000 +0000
@@ -0,0 +1,203 @@
+#
+#  The contents of this file are subject to the Initial
+#  Developer's Public License Version 1.0 (the "License");
+#  you may not use this file except in compliance with the
+#  License. You may obtain a copy of the License at
+#  http://www.ibphoenix.com/main.nfs?a=ibphoenix&page=ibp_idpl.
+#
+#  Software distributed under the License is distributed AS IS,
+#  WITHOUT WARRANTY OF ANY KIND, either express or implied.
+#  See the License for the specific language governing rights
+#  and limitations under the License.
+#
+#  The Original Code was created by Mark O'Donohue
+#  for the Firebird Open Source RDBMS project.
+#
+#  Copyright (c) Mark O'Donohue <mark.odonohue at ludwig.edu.au>
+#  and all contributors signed below.
+#
+#  All Rights Reserved.
+#  Contributor(s): ______________________________________.
+#
+# 
+#
+ROOT=..
+
+
+
+include     $(ROOT)/gen/make.defaults
+include     $(ROOT)/gen/make.platform
+include     $(ROOT)/gen/make.rules
+include     $(ROOT)/gen/make.shared.variables
+
+
+ @SET_MAKE@
+
+.PHONY: install dist packages tarfile rpmfile 
+.PHONY: buildTarDir buildImageDir buildRoot buildDebugInfo
+
+# Some of these targets are run from the root tree of the build.
+# those need to know where the install subdirectory is kept.
+# Others are run locally these need to know the path back to the
+# root of the build tree.
+
+BuildRoot=$(GEN_ROOT)
+
+InstallRoot=.
+
+BuildVersion=$(FirebirdVersion).$(BuildNum)
+
+Version=$(BuildVersion)-$(PackageVersion)
+
+
+
+# This means something like: FirebirdCS-2.0.0-1.i386.tar.gz
+
+TarDir= Firebird$(ArchPrefix)-$(Version).$(CpuType)
+TarFile=Firebird$(ArchPrefix)-$(Version).$(CpuType).tar.gz
+RPMFile=Firebird$(ArchPrefix)-$(Version).$(CpuType).rpm
+DebugDir=Firebird$(ArchPrefix)-debuginfo-$(Version).$(CpuType)
+DebugFile=Firebird$(ArchPrefix)-debuginfo-$(Version).$(CpuType).tar.gz
+
+
+# Determine where the packages are built.  Each distribution builds them in
+# their own spot.
+# This should be moved to configure.in file
+RedhatPackageDir=/usr/src/redhat/RPMS/$(CpuType)
+MandrakePackageDir=/usr/src/RPM/RPMS/$(CpuType)
+SuSEPackageDir=/usr/src/packages/RPMS/$(CpuType)
+
+PackageDir:=$(shell if [ -d $(RedhatPackageDir) ]; then echo $(RedhatPackageDir); \
+		           elif [ -d $(MandrakePackageDir) ]; then echo $(MandrakePackageDir); \
+		           elif [ -d $(SuSEPackageDir) ]; then echo $(SuSEPackageDir); \
+				   fi)
+
+
+
+PkgSrcDir=$(InstallRoot)/$(ArchType)
+ScriptDir=$(GEN_ROOT)/install/scripts/
+RPMSrcDir=$(GEN_ROOT)/install/scripts
+
+
+TarInstallDir=$(GEN_ROOT)/install
+
+#Target for required libraries detection
+RpmRequiredVersionTarget=$(GEN_ROOT)/firebird/bin/isql
+#Curses library
+TermLib=@TERMLIB at .so
+
+
+dist : packages
+
+packages: tarfile rpmfile debugfile
+
+tarfile:  $(TarFile)
+
+$(TarFile) :  buildTarDir
+	(cd $(GEN_ROOT); tar -czf $(TarFile) $(TarDir))
+
+debugfile:  $(DebugFile)
+
+$(DebugFile) :  buildImageDir
+	(cd $(GEN_ROOT)/$(DebugDir); tar -czf ../$(DebugFile) *)
+
+# objcopy --add-gnu-debuglink fails with binutils 2.14 or older
+# its failure affects only GDB ability to pick up external debug 
+# symbols automatically. We may use eu-strip command from elfutils 
+# instead, but it doesn't work or compile with such distros 
+# as Mandrake 9.0 not saying about older ones. New binutils
+# seem to compile and work everywhere I tried, but we try to 
+# use eu-strip first since it is a part of default Red Hat 9 
+# install and is available in binary form for Mandrake 9.1 and newer.
+#
+#     28-Dec-2003. Nickolay Samofatov
+#
+# Do not use eu-strip any longer because version 0.89/AMD64 shipped with 
+# Mandrake 9.2 produces broken debuginfo packages and there is no easy way to 
+# detect the breakage. Binutils seem to be more reliable alternative to me.
+#
+#     05-Apr-2004. Nickolay Samofatov
+#
+
+buildRoot:
+	(cd $(GEN_ROOT); ./install/makeInstallImage.sh)
+
+buildDebugInfo: buildRoot
+	mkdir -p $(GEN_ROOT)/$(DebugDir)
+	for x in `(cd $(GEN_ROOT)/buildroot; find)`; do \
+        FIL=$(GEN_ROOT)/buildroot/$$x; \
+        D_FIL=$(GEN_ROOT)/$(DebugDir)/`dirname $${x}`/.debug/`basename $${x}`.debug; \
+        if [ ! -h $$FIL ] && readelf -h $$FIL > /dev/null 2> /dev/null; then \
+            mkdir -p $(GEN_ROOT)/$(DebugDir)/`dirname $$x`/.debug; \
+            echo Generating external debug info for $$x; \
+            cp $${FIL} $${D_FIL}; \
+            objcopy --add-gnu-debuglink=$${D_FIL} $${FIL}; \
+            echo Stripping unneeded symbols from $${x}; \
+            objcopy --strip-debug --strip-unneeded $${FIL}; \
+        fi; \
+    done
+# Work around GDB 6.0 bug
+#	mkdir -p $(GEN_ROOT)/$(DebugDir)@libdir@/.debug
+#	for x in `ls $(GEN_ROOT)/$(DebugDir)@prefix@/lib/.debug`; do \
+#       ln -f -s @prefix@/lib/.debug/`basename $$x` $(GEN_ROOT)/$(DebugDir)@libdir@/.debug; \
+#   done
+
+# Use this line if you don't want to use separate debug info
+#buildImageDir: buildRoot
+buildImageDir: buildDebugInfo
+
+
+buildTarDir: buildImageDir
+	mkdir -p $(GEN_ROOT)/$(TarDir)
+	cp -r $(GEN_ROOT)/install/scripts $(GEN_ROOT)/$(TarDir)
+	cp -r $(GEN_ROOT)/install/scripts/tarMainInstall.sh $(GEN_ROOT)/$(TarDir)/install.sh
+	chmod a+x $(GEN_ROOT)/$(TarDir)/install.sh $(GEN_ROOT)/$(TarDir)/scripts/*sh
+	(cd $(GEN_ROOT)/$(TarDir); tar -C ../buildroot -czf buildroot.tar.gz . )
+	(cd $(GEN_ROOT)/$(TarDir); tar -tzf buildroot.tar.gz > manifest.txt )
+
+
+install: buildTarDir
+	(cd $(GEN_ROOT)/$(TarDir); FIREBIRD= ./install.sh)
+	cp -r $(GEN_ROOT)/$(DebugDir)/* /
+
+
+rpmfile: $(RPMFile)
+
+$(RPMFile) : $(GEN_ROOT)/install/rpmscript buildImageDir
+	rpmbuild --define='_topdir @BUILD_ROOT_DIR@/gen/RPM' -bb --target @CPU_TYPE@ $(GEN_ROOT)/install/rpmscript
+#	rpmbuild -bb --buildroot `pwd`/buildroot $(GEN_ROOT)/rpmscript
+	cp @BUILD_ROOT_DIR@/gen/RPM/RPMS/@CPU_TYPE@/$(RPMFile) $(GEN_ROOT)
+
+
+.PHONY: $(GEN_ROOT)/install/rpmscript
+
+$(GEN_ROOT)/install/rpmscript :
+	echo $@
+	awk < $(RPMSrcDir)/rpmheader.txt 'BEGIN {fl=1;} ($$1 == "Requires:") {fl=0;} (fl) {print $$0;}' > $@
+	echo -n "Requires: `ldd $(RpmRequiredVersionTarget) | grep $(TermLib) | awk '{print $$1;}'`" >> $@
+	echo ", `ldd $(RpmRequiredVersionTarget) | grep libstdc++ | awk '{print $$1;}'`" >> $@
+	awk < $(RPMSrcDir)/rpmheader.txt 'BEGIN {fl=0;} (fl) {print $$0;} ($$1 == "Requires:") {fl=1;}' >> $@
+	echo "" >> $@
+	echo "%prep" >> $@
+#	cat $(ClassicSrcDir)/prepinstall.sh >> $@
+	echo "" >> $@
+	echo "%build" >> $@
+#	cat $(ScriptDir)/buildinstall.sh >> $@
+	echo "" >> $@
+	echo "%install" >> $@
+#	cat $(ScriptDir)/install.sh >> $@
+	echo "" >> $@
+	echo "%files" >> $@
+	cat $(RPMSrcDir)/rpmfiles.txt >> $@
+	echo "" >> $@
+	echo "%pre" >> $@
+	cat $(ScriptDir)/preinstall.sh >> $@
+	echo "" >> $@
+	echo "%post" >> $@
+	cat $(ScriptDir)/postinstall.sh >> $@
+	echo "" >> $@
+	echo "%preun" >> $@
+	cat $(ScriptDir)/preuninstall.sh >> $@
+	echo "" >> $@
+	echo "%postun" >> $@
+	cat $(ScriptDir)/postuninstall.sh >> $@
--- firebird2.5-2.5.0.26074-0.ds4/src/jrd/os/posix/unix.cpp.original	2011-08-20 17:05:44.000000000 +0000
+++ firebird2.5-2.5.0.26074-0.ds4/src/jrd/os/posix/unix.cpp	2011-08-20 17:06:08.000000000 +0000
@@ -328,7 +328,7 @@
 }
 
 
-#ifdef SOLARIS
+#if !defined(O_DIRECT)
 // minimize #ifdefs inside PIO_force_write()
 #define O_DIRECT 0
 #endif


More information about the pkg-firebird-general mailing list