[uae] E-UAE on NetBSD: some patches

  • From: Bernhard Moellemann <zza@xxxxxxxxxx>
  • To: uae@xxxxxxxxxxxxx
  • Date: Tue, 12 Apr 2005 10:03:51 +0200

Hi!

I found some time to get euae running on NetBSD/i386. The were three quirks:

src/picasso96.c defines bswap32() This is already used in NetBSD and
imported via some system includes. I checked they do the same on i386 and
changed it to use the system one (but I cannot really test it, because
I don't own a runnable Picasso96 installation right now):

--- src/picasso96.c     2005-01-02 05:58:16.000000000 +0100
+++ src.zza/picasso96.c 2005-04-11 11:11:46.000000000 +0200
@@ -113,6 +113,7 @@
 static int need_argb32_hack = 0;
 
 /* This stuff should probably be moved elsewhere */
+#ifndef bswap32
 STATIC_INLINE uae_u32 bswap32 (uae_u32 x)
 {
     return (x & 0x000000FF) << 24
@@ -120,6 +121,7 @@
         | (x & 0x00FF0000) >> 8
         | (x & 0xFF000000) >> 24;
 }
+#endif
 
 #if (defined __powerpc__ || defined __ppc__ || defined __POWERPC__ \
      || defined __PPC__) && defined __GNUC__

The Right Thing would probably to rename the function.


src/include/unzip.h uses a macro OF(x) which is not defined in NetBSD.
It seems to be a wrapper around prototypes. NetBSDs (g)cc supports Prototypes
so I added

--- src/include/unzip.h       2004-08-04 06:39:43.000000000 +0200
+++ src.zza/include/unzip.h     2005-04-12 08:43:50.000000000 +0200
@@ -45,6 +45,14 @@
 extern "C" {
 #endif
 
+#ifndef OF
+#ifdef __STDC__
+#define OF(x) x
+#else
+#define OF(x) ()
+#endif
+#endif
+
 #ifndef _ZLIB_H
 #include "zlib.h"
 #endif

The Right Thing would probably to get rid of it, or are there any
C-Compilers without prototypes left?


NetBSDs gcc is able to link against libraries in other places as they are 
later at runtime. So the runtime location must be given with -Wl,-R.
I patched config.status to have
-Wl,-R/usr/pkg/lib -Wl,--export-dynamic -L/usr/pkg/lib
and
-Wl,-R/usr/X11R6/lib -L/usr/X11R6/lib
in the s,@LIBS@, line. (the second one was only -L/usr/X11R6/lib in my
config.status.) To give this via LDFLAGS on the command line didn't work.

I am sure that's not The Right Thing, but I don't know The Right Thing,
and it works.


Oh, and I had to use gmake instead of the standard make.


I just tested the Workbench and two or three games, perhaps there are more
issues, when I try to revive my harddisk 8-)

Disclaimer:
I did these changes only on NetBSD and don't know if they break any other
architectures.

    Bernhard  //
            \X/


Other related posts: