Follows a new patch to build FreeSCI natively in BeOS using gcc. A few
extra things to note:

- SDL_CFLAGS must be added to CFLAGS in the automake-generated Makefiles
  for gfx and sound (the current set of Makefiles seem to ignore SDL_CFLAGS).

- BeOS doesn't like explicit links to libc. Also BeOS doesn't seem to have
  libm. That's strange, but just removing all -lc, -lm made the binaries
  to link correctly. Testing the existance of libm in configure.in can
  solve this problem.

- My port tree didn't include the recent changes for SysV IPC tests, so
  it reverts these changes (ick!). Some parts will need to be applied
  manually.

- collsyms.h, fnmatch.h and fnmatch.c are needed for the BeOS port.
  An autoconf check can be used to include these files or not.
  The files are available at http://strange.merseine.nu:8080/freesci/.


claudio

---

diff -rud freesci/src/include/resource.h beos/freesci/src/include/resource.h
--- freesci/src/include/resource.h      Sun Sep 23 12:31:28 2001
+++ beos/freesci/src/include/resource.h Sun Sep 23 10:31:29 2001
@@ -58,12 +58,6 @@
 #  endif
 #endif
 
-#if defined(HAVE_FORK) && !defined(__BEOS__)
-#  define HAVE_SYSV_IPC
-#else
-#  undef HAVE_SYSV_IPC
-#endif
-
 #ifdef __DECC
 #  include <c_asm.h>
 #endif
@@ -93,6 +87,10 @@
 #  define DLLEXTERN
 #endif /* !_WIN32 */
 
+#ifdef __BEOS__
+#  include <kernel/OS.h>
+#  define usleep snooze
+#endif
 
 #ifdef _MSC_VER
 #      include <sys/timeb.h>
diff -rud freesci/src/scicore/tools.c beos/freesci/src/scicore/tools.c
--- freesci/src/scicore/tools.c Sat Sep 22 19:21:53 2001
+++ beos/freesci/src/scicore/tools.c    Sun Sep 23 09:58:01 2001
@@ -36,6 +36,9 @@
 #      include <windows.h>
 #      define sleep Sleep
 #endif
+#ifdef __BEOS__
+#      include "fnmatch.h"
+#endif
 
 
 #ifdef HAVE_MEMFROB
@@ -442,7 +445,7 @@
 {
 #ifdef _WIN32
        return getenv("WINDIR");
-#elif defined(__unix__) || !defined(X_DISPLAY_MISSING)
+#elif defined(__unix__) || !defined(X_DISPLAY_MISSING) || defined (__BEOS__)
        return getenv("HOME");
 #else
 #  error Please add a $HOME policy for your platform!
diff -rud freesci/src/sound/sound.c beos/freesci/src/sound/sound.c
--- freesci/src/sound/sound.c   Sun Sep 23 12:31:30 2001
+++ beos/freesci/src/sound/sound.c      Sun Sep 23 10:39:04 2001
@@ -43,7 +43,7 @@
 #endif /* _WIN32 */
 #endif /* !HAVE_UNISTD_H */
 
-#if defined HAVE_SYSV_IPC
+#ifdef HAVE_FORK
 extern sound_server_t sound_server_unix;
 #endif
 
@@ -61,7 +61,7 @@
 
 sound_server_t *sound_servers[] = {
 #ifndef NO_SOUND
-#  ifdef HAVE_FORK
+#  if defined (HAVE_FORK) && !defined (__BEOS__)
        /* Assume that sound_null works on any box that has fork() */
        &sound_server_unix,
 #  endif /* HAVE_FORK */
diff -rud freesci/src/sound/soundserver_unix.c 
beos/freesci/src/sound/soundserver_unix.c
--- freesci/src/sound/soundserver_unix.c        Sun Sep 23 12:31:30 2001
+++ beos/freesci/src/sound/soundserver_unix.c   Sat Sep 22 19:22:31 2001
@@ -62,7 +62,7 @@
 static pid_t ppid;
 
 
-#ifdef HAVE_SYSV_IPC
+#ifdef HAVE_FORK
 
 static int
 verify_pid(int pid) /* Checks if the specified PID is in use */
diff -rud freesci/src/tools/sciunpack.c beos/freesci/src/tools/sciunpack.c
--- freesci/src/tools/sciunpack.c       Sat Sep 22 19:22:56 2001
+++ beos/freesci/src/tools/sciunpack.c  Sun Sep 23 10:18:46 2001
@@ -61,7 +61,7 @@
 #  endif /* HAVE_LIBPNG */
 #endif /* DRAW_GRAPHICS */
 
-#ifdef _MSC_VER
+#if defined (_MSC_VER) || defined (__BEOS__)
 /* [DJ] fchmod is not in Visual C++ RTL - and probably not needed,anyway */
 #  define fchmod(file,mode)
 #  define CREAT_OPTIONS O_BINARY


Reply via email to