From 494e237b1e63455a797ede2f4d7e226a7bf47597 Mon Sep 17 00:00:00 2001 From: florian Date: Sat, 31 May 2008 11:33:02 +0000 Subject: [PATCH] * Haiku patch by Olivier Coursiere - a little more native rtl: it use a native haiku library for select function instead of relying on a compatibility symlink - haiku in the list of target that support the ide - some more fix in some packages git-svn-id: trunk@11135 - --- Makefile | 4 +-- Makefile.fpc | 2 +- packages/Makefile | 48 ++++++++++++++++++++++++-- packages/Makefile.fpc | 6 +++- packages/fcl-async/Makefile | 6 ++-- packages/fcl-async/Makefile.fpc | 2 ++ packages/gtk2/Makefile | 5 +-- packages/gtk2/Makefile.fpc | 3 +- packages/httpd13/src/ap_config.inc | 55 +++++++++++++++++++----------- rtl/haiku/baseunix.pp | 2 +- rtl/haiku/ossysc.inc | 3 +- rtl/unix/oscdeclh.inc | 4 +++ 12 files changed, 106 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index ef25f2a509..161f350549 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/05/24] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/05/31] # default: help MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded @@ -358,7 +358,7 @@ BUILDOPTS=FPC=$(PPNEW) RELEASE=1 INSTALLOPTS=FPC=$(PPNEW) ZIPDESTDIR=$(BASEDIR) FPCMAKE=$(FPCMAKENEW) ifndef CROSSCOMPILE ifneq ($(wildcard ide),) -IDETARGETS=go32v2 win32 linux freebsd os2 emx beos +IDETARGETS=go32v2 win32 linux freebsd os2 emx beos haiku ifneq ($(findstring $(OS_TARGET),$(IDETARGETS)),) IDE=1 endif diff --git a/Makefile.fpc b/Makefile.fpc index 4bede21f05..fc52616d9e 100644 --- a/Makefile.fpc +++ b/Makefile.fpc @@ -150,7 +150,7 @@ INSTALLOPTS=FPC=$(PPNEW) ZIPDESTDIR=$(BASEDIR) FPCMAKE=$(FPCMAKENEW) # Skipped by default for cross compiles, because it depends on libc ifndef CROSSCOMPILE ifneq ($(wildcard ide),) -IDETARGETS=go32v2 win32 linux freebsd os2 emx beos +IDETARGETS=go32v2 win32 linux freebsd os2 emx beos haiku ifneq ($(findstring $(OS_TARGET),$(IDETARGETS)),) IDE=1 endif diff --git a/packages/Makefile b/packages/Makefile index 6c056fe200..0e428dd863 100644 --- a/packages/Makefile +++ b/packages/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/05/28] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/05/31] # default: all MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded @@ -276,7 +276,7 @@ ifeq ($(FULL_TARGET),i386-beos) override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json fcl-process unzip regexpr chm fcl-res libgd fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl bfd aspell svgalib imlib utmp fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 httpd13 httpd20 httpd22 pxlib numlib endif ifeq ($(FULL_TARGET),i386-haiku) -override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json fcl-process unzip regexpr chm fcl-res libgd +override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json fcl-process unzip regexpr chm fcl-res libgd fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl bfd aspell svgalib imlib utmp fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 httpd13 httpd20 httpd22 pxlib numlib endif ifeq ($(FULL_TARGET),i386-netbsd) override TARGET_DIRS+=hash pasjpeg paszlib fpmkunit fcl-base fcl-db fcl-image fcl-net fcl-passrc fcl-registry fcl-xml fcl-fpcunit fcl-json fcl-process unzip regexpr chm fcl-res libgd fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo gtk1 gtk2 bfd aspell svgalib imlib utmp fpgtk xforms fftw pcap ggi sdl openssl gnome1 httpd13 httpd20 httpd22 pxlib numlib @@ -1859,6 +1859,48 @@ TARGET_DIRS_REGEXPR=1 TARGET_DIRS_CHM=1 TARGET_DIRS_FCL-RES=1 TARGET_DIRS_LIBGD=1 +TARGET_DIRS_FV=1 +TARGET_DIRS_FCL-WEB=1 +TARGET_DIRS_FCL-ASYNC=1 +TARGET_DIRS_IBASE=1 +TARGET_DIRS_MYSQL=1 +TARGET_DIRS_NCURSES=1 +TARGET_DIRS_ZLIB=1 +TARGET_DIRS_ORACLE=1 +TARGET_DIRS_ODBC=1 +TARGET_DIRS_POSTGRES=1 +TARGET_DIRS_SQLITE=1 +TARGET_DIRS_PTHREADS=1 +TARGET_DIRS_IMAGEMAGICK=1 +TARGET_DIRS_GDBINT=1 +TARGET_DIRS_LIBPNG=1 +TARGET_DIRS_X11=1 +TARGET_DIRS_GDBM=1 +TARGET_DIRS_TCL=1 +TARGET_DIRS_SYSLOG=1 +TARGET_DIRS_LIBCURL=1 +TARGET_DIRS_OPENGL=1 +TARGET_DIRS_BFD=1 +TARGET_DIRS_ASPELL=1 +TARGET_DIRS_SVGALIB=1 +TARGET_DIRS_IMLIB=1 +TARGET_DIRS_UTMP=1 +TARGET_DIRS_FPGTK=1 +TARGET_DIRS_XFORMS=1 +TARGET_DIRS_FFTW=1 +TARGET_DIRS_PCAP=1 +TARGET_DIRS_GGI=1 +TARGET_DIRS_SDL=1 +TARGET_DIRS_OPENSSL=1 +TARGET_DIRS_GRAPH=1 +TARGET_DIRS_GNOME1=1 +TARGET_DIRS_GTK1=1 +TARGET_DIRS_GTK2=1 +TARGET_DIRS_HTTPD13=1 +TARGET_DIRS_HTTPD20=1 +TARGET_DIRS_HTTPD22=1 +TARGET_DIRS_PXLIB=1 +TARGET_DIRS_NUMLIB=1 endif ifeq ($(FULL_TARGET),i386-netbsd) TARGET_DIRS_HASH=1 @@ -7927,7 +7969,7 @@ fcl-web_debug: fcl-db_debug fcl-xml_debug fcl-process_debug fcl-web_smart: fcl-db_smart fcl-xml_smart fcl-process_smart fcl-web_release: fcl-db_release fcl-xml_release fcl-process_release fcl-web_shared: fcl-db_shared fcl-xml_shared fcl-process_shared -ifneq ($(findstring $(OS_TARGET),linux freebsd openbsd netbsd win32 beos),) +ifneq ($(findstring $(OS_TARGET),linux freebsd openbsd netbsd win32 beos haiku),) fcl-db_all: fcl-base_all mysql_all ibase_all oracle_all odbc_all postgres_all sqlite_all pxlib_all fcl-db_debug: fcl-base_debug mysql_debug ibase_debug oracle_debug odbc_debug postgres_debug sqlite_debug pxlib_debug fcl-db_smart: fcl-base_smart mysql_smart ibase_smart oracle_smart odbc_smart postgres_smart sqlite_smart pxlib_smart diff --git a/packages/Makefile.fpc b/packages/Makefile.fpc index 2f14a965af..6ee5cf844b 100644 --- a/packages/Makefile.fpc +++ b/packages/Makefile.fpc @@ -15,6 +15,9 @@ dirs_m68k_linux=graph dirs_beos=fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \ gdbint libpng x11 gdbm tcl syslog libcurl opengl bfd aspell svgalib \ imlib utmp fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 httpd13 httpd20 httpd22 pxlib numlib +dirs_haiku=fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \ + gdbint libpng x11 gdbm tcl syslog libcurl opengl bfd aspell svgalib \ + imlib utmp fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 httpd13 httpd20 httpd22 pxlib numlib dirs_freebsd=fv fcl-web fcl-async ibase mysql ncurses zlib oracle odbc postgres sqlite pthreads imagemagick \ gdbint libpng x11 gdbm tcl syslog libcurl opengl cairo bfd aspell svgalib \ imlib utmp fpgtk xforms fftw pcap ggi sdl openssl graph gnome1 gtk1 gtk2 httpd13 httpd20 httpd22 pxlib numlib users @@ -128,7 +131,7 @@ fcl-web_smart: fcl-db_smart fcl-xml_smart fcl-process_smart fcl-web_release: fcl-db_release fcl-xml_release fcl-process_release fcl-web_shared: fcl-db_shared fcl-xml_shared fcl-process_shared -ifneq ($(findstring $(OS_TARGET),linux freebsd openbsd netbsd win32 beos),) +ifneq ($(findstring $(OS_TARGET),linux freebsd openbsd netbsd win32 beos haiku),) fcl-db_all: fcl-base_all mysql_all ibase_all oracle_all odbc_all postgres_all sqlite_all pxlib_all fcl-db_debug: fcl-base_debug mysql_debug ibase_debug oracle_debug odbc_debug postgres_debug sqlite_debug pxlib_debug fcl-db_smart: fcl-base_smart mysql_smart ibase_smart oracle_smart odbc_smart postgres_smart sqlite_smart pxlib_smart @@ -298,3 +301,4 @@ ptc_smart: hermes_smart x11_smart ptc_debug: hermes_debug x11_debug ptc_release: hermes_release x11_release + diff --git a/packages/fcl-async/Makefile b/packages/fcl-async/Makefile index d88cf3094a..39a8d41fbc 100644 --- a/packages/fcl-async/Makefile +++ b/packages/fcl-async/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/05/28] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/05/31] # default: all MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded @@ -453,7 +453,7 @@ ifeq ($(FULL_TARGET),i386-beos) override COMPILER_INCLUDEDIR+=src src/unix endif ifeq ($(FULL_TARGET),i386-haiku) -override COMPILER_INCLUDEDIR+=src +override COMPILER_INCLUDEDIR+=src src/unix endif ifeq ($(FULL_TARGET),i386-netbsd) override COMPILER_INCLUDEDIR+=src src/unix @@ -627,7 +627,7 @@ ifeq ($(FULL_TARGET),i386-beos) override COMPILER_SOURCEDIR+=src src/unix endif ifeq ($(FULL_TARGET),i386-haiku) -override COMPILER_SOURCEDIR+=src +override COMPILER_SOURCEDIR+=src src/unix endif ifeq ($(FULL_TARGET),i386-netbsd) override COMPILER_SOURCEDIR+=src src/unix diff --git a/packages/fcl-async/Makefile.fpc b/packages/fcl-async/Makefile.fpc index e7c024a85e..8f99889226 100644 --- a/packages/fcl-async/Makefile.fpc +++ b/packages/fcl-async/Makefile.fpc @@ -16,6 +16,7 @@ fpcpackage=y sourcedir=src sourcedir_linux=src/unix sourcedir_beos=src/unix +sourcedir_haiku=src/unix sourcedir_freebsd=src/unix sourcedir_darwin=src/unix sourcedir_solaris=src/unix @@ -24,6 +25,7 @@ sourcedir_openbsd=src/unix includedir=src includedir_linux=src/unix includedir_beos=src/unix +includedir_haiku=src/unix includedir_freebsd=src/unix includedir_darwin=src/unix includedir_solaris=src/unix diff --git a/packages/gtk2/Makefile b/packages/gtk2/Makefile index 79d2973474..43fddebd96 100644 --- a/packages/gtk2/Makefile +++ b/packages/gtk2/Makefile @@ -1,5 +1,5 @@ # -# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/05/28] +# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/05/31] # default: all MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded @@ -259,7 +259,7 @@ endif PACKAGESDIR:=$(wildcard $(FPCDIR) $(FPCDIR)/packages $(FPCDIR)/packages/base $(FPCDIR)/packages/extra) override PACKAGE_NAME=gtk2 override PACKAGE_VERSION=2.0.0 -ifneq ($(findstring $(OS_TARGET),linux freebsd netbsd openbsd solaris darwin beos ),) +ifneq ($(findstring $(OS_TARGET),linux freebsd netbsd openbsd solaris darwin beos haiku ),) GDK2X=gdk2x GTK2X11=gtk2x11 GTK2X11INCLUDE=src/gtk2x11/include @@ -1945,6 +1945,7 @@ REQUIRE_PACKAGES_X11=1 endif ifeq ($(FULL_TARGET),i386-haiku) REQUIRE_PACKAGES_RTL=1 +REQUIRE_PACKAGES_X11=1 endif ifeq ($(FULL_TARGET),i386-netbsd) REQUIRE_PACKAGES_RTL=1 diff --git a/packages/gtk2/Makefile.fpc b/packages/gtk2/Makefile.fpc index 0e270097ba..5f4eb4c1c6 100644 --- a/packages/gtk2/Makefile.fpc +++ b/packages/gtk2/Makefile.fpc @@ -9,6 +9,7 @@ version=2.0.0 [require] libc=y packages_beos=x11 +packages_haiku=x11 packages_linux=x11 packages_freebsd=x11 packages_solaris=x11 @@ -36,7 +37,7 @@ build=n fpcdir=../.. [prerules] -ifneq ($(findstring $(OS_TARGET),linux freebsd netbsd openbsd solaris darwin beos ),) +ifneq ($(findstring $(OS_TARGET),linux freebsd netbsd openbsd solaris darwin beos haiku ),) GDK2X=gdk2x GTK2X11=gtk2x11 GTK2X11INCLUDE=src/gtk2x11/include diff --git a/packages/httpd13/src/ap_config.inc b/packages/httpd13/src/ap_config.inc index 881aa819ef..5730f41e8c 100644 --- a/packages/httpd13/src/ap_config.inc +++ b/packages/httpd13/src/ap_config.inc @@ -865,30 +865,46 @@ typedef int rlim_t; #define NEED_STRDUP {$else}{$if defined(BEOS)} -#undef PLATFORM -#define PLATFORM "BeOS" -#include -#include +const + PLATFORM = 'BeOS'; +//#undef PLATFORM +//#define PLATFORM "BeOS" +//#include +//#include -#define HAVE_BEOS_SERIALIZED_ACCEPT -#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT +//#define HAVE_BEOS_SERIALIZED_ACCEPT +{$define HAVE_BEOS_SERIALIZED_ACCEPT} +//#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT +{$define SINGLE_LISTEN_UNSERIALIZED_ACCEPT} -#define NO_WRITEV -#define NO_KILLPG -#define NEED_INITGROUPS -#define PF_INET AF_INET -#define S_IEXEC S_IXUSR +//#define NO_WRITEV +{$define NO_WRITEV} +//#define NO_KILLPG +{$define NO_KILLPG} +//#define NEED_INITGROUPS +{$define NEED_INITGROUPS} +//#define PF_INET AF_INET +{$define PF_INET AF_INET} +//#define S_IEXEC S_IXUSR +{$define S_IEXEC S_IXUSR} {$else}{$if defined(BONE)} -#undef PLATFORM -#define PLATFORM "BeOS BONE" -#include +const + PLATFORM = 'BeOS BONE'; +//#undef PLATFORM +//#define PLATFORM "BeOS BONE" +//#include -#define NO_KILLPG -#define NEED_INITGROUPS -#define S_IEXEC S_IXUSR -#define HAVE_BEOS_SERIALIZED_ACCEPT -#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT +//#define NO_KILLPG +{$define NO_KILLPG} +//#define NEED_INITGROUPS +{$define NEED_INITGROUPS} +//#define S_IEXEC S_IXUSR +{$define S_IEXEC S_IXUSR} +//#define HAVE_BEOS_SERIALIZED_ACCEPT +{$define HAVE_BEOS_SERIALIZED_ACCEPT} +//#define SINGLE_LISTEN_UNSERIALIZED_ACCEPT +{$define SINGLE_LISTEN_UNSERIALIZED_ACCEPT} {$else}{$if defined(_CX_SX)} #define JMP_BUF sigjmp_buf @@ -1494,3 +1510,4 @@ type ap_wait_t = cint; {$endif} + diff --git a/rtl/haiku/baseunix.pp b/rtl/haiku/baseunix.pp index fdd939c11e..fd56004ac4 100644 --- a/rtl/haiku/baseunix.pp +++ b/rtl/haiku/baseunix.pp @@ -37,7 +37,7 @@ uses UnixType; {$ifdef FPC_USE_LIBC} const clib = 'root'; -const netlib = 'net'; +const netlib = 'network'; {$i oscdeclh.inc} {$ELSE} {$i bunxh.inc} { Functions} diff --git a/rtl/haiku/ossysc.inc b/rtl/haiku/ossysc.inc index 37f2e31383..1ee3edc3f5 100644 --- a/rtl/haiku/ossysc.inc +++ b/rtl/haiku/ossysc.inc @@ -21,7 +21,7 @@ {$Linklib root} // Out of date atm. const clib = 'root'; -const netlib = 'net'; +const netlib = 'network'; {$ifdef FPC_IS_SYSTEM} @@ -1058,3 +1058,4 @@ begin end; *) + diff --git a/rtl/unix/oscdeclh.inc b/rtl/unix/oscdeclh.inc index 0860683bec..53f93af968 100644 --- a/rtl/unix/oscdeclh.inc +++ b/rtl/unix/oscdeclh.inc @@ -83,7 +83,11 @@ const function FpIOCtl (Handle:cint;Ndx: TIOCtlRequest;Data: Pointer):cint; cdecl; external clib name 'ioctl'; {$endif bsd or solaris} {$ifdef beos} + {$ifdef haiku} + Function FPSelect (N:cint;readfds,writefds,exceptfds:pfdSet;TimeOut:PTimeVal):cint; cdecl; external 'network' name 'select'; + {$else} Function FPSelect (N:cint;readfds,writefds,exceptfds:pfdSet;TimeOut:PTimeVal):cint; cdecl; external 'net' name 'select'; + {$endif} {$else} Function FPSelect (N:cint;readfds,writefds,exceptfds:pfdSet;TimeOut:PTimeVal):cint; cdecl; external clib name 'select'; {$endif}