Bug 82171

Summary: Port devel/sdl12: libSDL-1.1 is broken in a world with NO_USB
Product: Ports & Packages Reporter: Björn König <bkoenig>
Component: Individual Port(s)Assignee: Kirill Ponomarev <krion>
Status: Closed FIXED    
Severity: Affects Only Me CC: krion
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Makefile.diff none

Description Björn König 2005-06-12 20:40:11 UTC
	If you have a world which was built with NO_USB=yes then
	libusbhid.so doesn't exist. The current Makefile of the port
	devel/sdl12 just assumes that the old libusb.so is present and
	trusts in the correctness of the configure script; but it'll screw
	up and won't specify any joystick subsystem in this case; not even
	the dummy. This breaks libSDL-1.1 and causes that all ports that
	depend on this library won't compile. 
	 
	You'll get the following errors if you try to link with libSDL-1.1:
	
	libSDL-1.1.so: undefined reference to `SDL_SYS_JoystickUpdate'
	libSDL-1.1.so: undefined reference to `SDL_SYS_JoystickOpen'
	libSDL-1.1.so: undefined reference to `SDL_SYS_JoystickQuit'
	libSDL-1.1.so: undefined reference to `SDL_SYS_JoystickName'
	libSDL-1.1.so: undefined reference to `SDL_SYS_JoystickInit'
	libSDL-1.1.so: undefined reference to `SDL_SYS_JoystickClose'

Fix: The devel/sdl12 port should make a more accurate check whether USB
	related libraries are available. If they aren't then disable
	support for joysticks. Another solution would be to use the dummy
	joystick subsystem, but I was too lazy to create a suitable patch
	right now. I'll do this if desired.
How-To-Repeat: 	Rename usbhid.h to pretend that we live in a world with NO_USB.
	
	   cd /usr/include
	   mv usbhid.h usbhid.h.bak
	
	Build and install devel/sdl12.
	  
	   cd /usr/ports/devel/sdl12i
	   make install clean
	
	Try to build a port that depends on devel/sdl12.
	  
	   cd /usr/ports/x11/electricsheep
	   make build
	
	This will fail with the error messages that were mentioned in the
	description section of this PR.
Comment 1 Thierry Thomas freebsd_committer freebsd_triage 2005-06-12 20:56:26 UTC
Responsible Changed
From-To: freebsd-ports-bugs->krion


Assign to maintainer.
Comment 2 Kirill Ponomarev freebsd_committer freebsd_triage 2005-07-19 18:41:25 UTC
State Changed
From-To: open->closed

Committed, thanks!
Comment 3 David J. Haines 2005-07-21 03:12:54 UTC
The submitted patch now breaks on machines without the NO_USB flag in  
make.conf.  Apparently, it was broken before (it just wouldn't  
compile USB HID support), but now it causes similar errors to those  
listed in the problem report.  The fix is simply changing the line  
".if exists(/usr/include/libusbhid.h)" to ".if exists(/usr/include/ 
usbhid.h)".  If you really need one, I can create a diff file.

Thanks.

David J. Haines
dhaines@gmail.com