Compilation under FreeBSD fails

I was trying to compile SDL 1.2.4 and 1.2 snapshot (Jun 15)
and got a failure in both cases somewhere in the joystick
area.

1.2:

…/src/events -I…/…/…/src/joystick -I…/…/…/src/cdrom -I…/…/…/src/thread -I…/…/…/src/timer -I…/…/…/src/endian -I…/…/…/src/file -c SDL_sysjoystick.c -fPIC -DPIC -o .libs/SDL_sysjoystick.lo
SDL_sysjoystick.c: In function report_alloc': SDL_sysjoystick.c:414: incompatible type for argument 3 ofhid_report_size’
*** Error code 1

Stop in /home/kuku/SDL-1.2/src/joystick/bsd.
*** Error code 1

Stop in /home/kuku/SDL-1.2/src/joystick.
*** Error code 1

Stop in /home/kuku/SDL-1.2/src.
*** Error code 1

Stop in /home/kuku/SDL-1.2.

1.2.4:

de -I…/…/…/include/SDL -I…/…/…/src -I…/…/…/src/freebsd -I…/…/…/src/main -I…/…/…/src/audio -I…/…/…/src/video -I…/…/…/src/video/XFree86/extensions -I…/…/…/src/events -I…/…/…/src/joystick -I…/…/…/src/cdrom -I…/…/…/src/thread -I…/…/…/src/timer -I…/…/…/src/endian -I…/…/…/src/file -c SDL_sysjoystick.c -fPIC -DPIC -o .libs/SDL_sysjoystick.lo
SDL_sysjoystick.c:44: usbhid.h: No such file or directory
*** Error code 1

Stop in /home/kuku/SDL-1.2.4/src/joystick/bsd.
*** Error code 1

Stop in /home/kuku/SDL-1.2.4/src/joystick.
*** Error code 1

Stop in /home/kuku/SDL-1.2.4/src.

Any clues?–
Chris Christoph P. U. Kukulies kukulies at rwth-aachen.de

I was trying to compile SDL 1.2.4 and 1.2 snapshot (Jun 15)
and got a failure in both cases somewhere in the joystick
area.

1.2.4:

SDL_sysjoystick.c:44: usbhid.h: No such file or directory
*** Error code 1

Hey, I got this exact same error. Anyone know what’s up? I’m running 4.6-STABLE.On Wed, 24 Jul 2002 22:37:00 +0200 Christoph Kukulies wrote:

I was trying to compile SDL 1.2.4 and 1.2 snapshot (Jun 15)
and got a failure in both cases somewhere in the joystick
area.

1.2:

Please apply the following patch and see if it fixes your problem. I have
no idea if this is correct…it’s just from Googling for hid_report_size
and BSD. If other BSDers can check this, it’d be appreciated (it looks
like NetBSD and FreeBSD need the 3rd arg to be a pointer, and OpenBSD
needs it to be an int. Argh.)

–ryan.

----snip----

diff -u -r1.10 SDL_sysjoystick.c
— src/joystick/bsd/SDL_sysjoystick.c 2002/06/12 03:32:01 1.10
+++ src/joystick/bsd/SDL_sysjoystick.c 2002/07/26 06:23:59
@@ -409,9 +409,9 @@
int len;

#ifdef USBHID_NEW

  • len = hid_report_size(rd, repinfo[repind].kind, r->rid);
    -#else
    len = hid_report_size(rd, repinfo[repind].kind, &r->rid);
    +#else
  • len = hid_report_size(rd, repinfo[repind].kind, r->rid);
    #endif
    if (len < 0) {
    SDL_SetError(“Negative HID report size”);

FreeBSD has a bunch of patches for SDL in the port… try installing it
from there, works great for me.

# cd /usr/ports/devel/sdl12 && make install clean

If anyone wants to see the patches and doesn’t have fbsd, the cvs
repositories url for the sdl12 patches are at
http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/sdl12/files/

(if you use fbsd but don’t have a ports dir, install it from your cd or
better yet, set up cvsup and get the latest version)On Thu, Jul 25, 2002 at 10:47:32PM -0700, Eron Hennessey wrote:

On Wed, 24 Jul 2002 22:37:00 +0200 Christoph Kukulies wrote:

I was trying to compile SDL 1.2.4 and 1.2 snapshot (Jun 15)
and got a failure in both cases somewhere in the joystick
area.

1.2.4:

SDL_sysjoystick.c:44: usbhid.h: No such file or directory
*** Error code 1

Hey, I got this exact same error. Anyone know what’s up? I’m running 4.6-STABLE.


-Erik <@Erik_Greenwald> [http://math.smsu.edu/~erik]

The opinions expressed by me are not necessarily opinions. In all probability,
they are random rambling, and to be ignored. Failure to ignore may result in
severe boredom or confusion. Shake well before opening. Keep Refrigerated.

Hi

I’ve encoutered problems with SDL 1.2. on FreeBSD/NetBSD some time ago.
The ‘usbhid.h’-workarround works quite well on FreeBSD prior 4.6.
The workaround ryan gave for 4.6 is absolutely correct.
I’ve also submitted this diff to Sam some time ago but since noone tested if the diffed version still runs under OpenBSD it wasn’t included in the cvs.
Maybe if someone could test this under OpenBSD it could be added now ?.
It works quite well under FreeBSD 4.5/4.6 and NetBSD 1.52.
regards, robert.

allow: post

Use freebsd port instead.

-Maxim

Christoph Kukulies wrote:>

I was trying to compile SDL 1.2.4 and 1.2 snapshot (Jun 15)
and got a failure in both cases somewhere in the joystick
area.

1.2:

…/src/events -I…/…/…/src/joystick -I…/…/…/src/cdrom -I…/…/…/src/thread -I…/…/…/src/timer -I…/…/…/src/endian -I…/…/…/src/file -c SDL_sysjoystick.c -fPIC -DPIC -o .libs/SDL_sysjoystick.lo
SDL_sysjoystick.c: In function report_alloc': SDL_sysjoystick.c:414: incompatible type for argument 3 ofhid_report_size’
*** Error code 1

Stop in /home/kuku/SDL-1.2/src/joystick/bsd.
*** Error code 1

Stop in /home/kuku/SDL-1.2/src/joystick.
*** Error code 1

Stop in /home/kuku/SDL-1.2/src.
*** Error code 1

Stop in /home/kuku/SDL-1.2.

1.2.4:

de -I…/…/…/include/SDL -I…/…/…/src -I…/…/…/src/freebsd -I…/…/…/src/main -I…/…/…/src/audio -I…/…/…/src/video -I…/…/…/src/video/XFree86/extensions -I…/…/…/src/events -I…/…/…/src/joystick -I…/…/…/src/cdrom -I…/…/…/src/thread -I…/…/…/src/timer -I…/…/…/src/endian -I…/…/…/src/file -c SDL_sysjoystick.c -fPIC -DPIC -o .libs/SDL_sysjoystick.lo
SDL_sysjoystick.c:44: usbhid.h: No such file or directory
*** Error code 1

Stop in /home/kuku/SDL-1.2.4/src/joystick/bsd.
*** Error code 1

Stop in /home/kuku/SDL-1.2.4/src/joystick.
*** Error code 1

Stop in /home/kuku/SDL-1.2.4/src.

Any clues?


Chris Christoph P. U. Kukulies kukulies at rwth-aachen.de

Use freebsd port instead.

What’dya mean, “Use freebsd port instead”? If the ports maintainer’s got
patches that aren’t in the main SDL tree, let’s get them merged!

(Granted, the FreeBSD ports system is cool, and probably a better way to
install, but I’d like to have SDL’s CVS compile out of the box on FreeBSD.
That doesn’t seem unreasonable to me.)

–ryan.

The workaround ryan gave for 4.6 is absolutely correct. I’ve also
submitted this diff to Sam some time ago but since noone tested if the
diffed version still runs under OpenBSD it wasn’t included in the cvs.
Maybe if someone could test this under OpenBSD it could be added now
?. It works quite well under FreeBSD 4.5/4.6 and NetBSD 1.52. regards,

No better way than forced testing; I’m committing the HID patch to CVS.
That’ll get it tested on OpenBSD, no doubt. :slight_smile:

If anyone has problems, let me know, and we’ll fix it.

–ryan.

What’dya mean, “Use freebsd port instead”? If the ports maintainer’s got
patches that aren’t in the main SDL tree, let’s get them merged!

The libSDL in the ports tree is an ‘old’ version without joystick support
which introduced all this trouble.
regards robert–
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net