8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:03:03 +01:00

Frontported fix for freebsd and related OSs, including CORE-2825

This commit is contained in:
alexpeshkoff 2010-02-04 16:05:08 +00:00
parent 03f43eee38
commit 49a4e3fb88
5 changed files with 30 additions and 11 deletions

View File

@ -24,7 +24,7 @@ LINK_OPTS+=-Wl,-rpath,../gen/firebird/lib
PROD_FLAGS=-O -fno-builtin -DFREEBSD -pipe -MMD -fPIC
DEV_FLAGS=-ggdb -DFREEBSD -pipe -MMD -p -fPIC -Wall -Wno-non-virtual-dtor
EMBED_UTIL_TARGETS=gstat gsec nbackup fbguard fb_lock_print
CLIENT_UTIL_TARGETS=gstat gsec fbguard fbmgr_bin nbackup fb_lock_print
EMBED_UTIL_TARGETS=gstat gsec fbguard nbackup fb_lock_print fbsvcmgr fbtracemgr
CLIENT_UTIL_TARGETS=gstat gsec fbguard nbackup fb_lock_print fbsvcmgr fbtracemgr
Physical_IO_Module=os/posix/unix.cpp

View File

@ -24,8 +24,8 @@ LINK_OPTS+=-Wl,-rpath,../gen/firebird/lib
PROD_FLAGS=-O -fno-builtin -DFREEBSD -DAMD64 -pipe -MMD -fPIC
DEV_FLAGS=-ggdb -DFREEBSD -DAMD64 -pipe -MMD -p -fPIC -Wall -Wno-non-virtual-dtor
EMBED_UTIL_TARGETS=gstat gsec nbackup fbguard fb_lock_print
CLIENT_UTIL_TARGETS=gstat gsec fbguard fbmgr_bin nbackup fb_lock_print
EMBED_UTIL_TARGETS=gstat gsec fbguard nbackup fb_lock_print fbsvcmgr fbtracemgr
CLIENT_UTIL_TARGETS=gstat gsec fbguard nbackup fb_lock_print fbsvcmgr fbtracemgr
Physical_IO_Module=os/posix/unix.cpp
# This is needed due to broken port of gcc

View File

@ -110,9 +110,18 @@ dnl CPU_TYPE=ppc64
SHRLIB_EXT=so
;;
amd64-*-freebsd*)
MAKEFILE_PREFIX=freebsd
PLATFORM=FREEBSD
amd64-*-freebsd* | x86_64*-*-k*bsd*-gnu)
MAKEFILE_PREFIX=freebsd_amd64
case "$target" in
x86_64*-*-k*bsd-gnu) # Debian/kFreeBSD
PLATFORM=LINUX
INSTALL_PREFIX=linux
;;
*)
PLATFORM=FREEBSD
INSTALL_PREFIX=freebsd
;;
esac
AC_DEFINE(FREEBSD, 1, [Define this if OS is FreeBSD])
AC_DEFINE(AMD64, 1, [Define this if CPU is amd64])
EDITLINE_FLG=Y
@ -129,7 +138,15 @@ dnl CPU_TYPE=ppc64
*-*-freebsd*)
MAKEFILE_PREFIX=freebsd
PLATFORM=FREEBSD
case "$target" in
*-*-k*bsd-gnu) # Debian/kFreeBSD
PLATFORM=LINUX
INSTALL_PREFIX=linux
;;
*)
PLATFORM=FREEBSD
;;
esac
AC_DEFINE(FREEBSD, 1, [Define this if OS is FreeBSD])
EDITLINE_FLG=Y
SHRLIB_EXT=so

View File

@ -33,7 +33,7 @@
// Firebird platform-specific synchronization data structures
#if defined(DARWIN)
#if defined(DARWIN) || defined(FREEBSD)
#define USE_SYS5SEMAPHORE
#endif

View File

@ -213,8 +213,6 @@ namespace
return rc;
}
#else // HAVE_POSIX_FADVISE
#define POSIX_FADV_SEQUENTIAL 0
#define POSIX_FADV_NOREUSE 0
int fb_fadvise(int, off_t, size_t, int)
{
return 0;
@ -444,12 +442,15 @@ void NBackup::open_database_scan()
status_exception::raise(Arg::Gds(isc_nbackup_err_opendb) << dbname.c_str() << Arg::OsError());
}
#ifdef POSIX_FADV_SEQUENTIAL
int rc = fb_fadvise(dbase, 0, 0, POSIX_FADV_SEQUENTIAL);
if (rc)
{
status_exception::raise(Arg::Gds(isc_nbackup_err_fadvice) <<
"SEQUENTIAL" << dbname.c_str() << Arg::Unix(rc));
}
#endif // POSIX_FADV_SEQUENTIAL
#ifdef POSIX_FADV_NOREUSE
if (direct_io)
{
rc = fb_fadvise(dbase, 0, 0, POSIX_FADV_NOREUSE);
@ -459,6 +460,7 @@ void NBackup::open_database_scan()
"NOREUSE" << dbname.c_str() << Arg::Unix(rc));
}
}
#endif // POSIX_FADV_NOREUSE
#endif // WIN_NT
}