Subject: pkg/17374: let SDL support USB gamepad
To: None <gnats-bugs@gnats.netbsd.org>
From: None <rxg@ms25.url.com.tw>
List: netbsd-bugs
Date: 06/24/2002 18:48:56
>Number: 17374
>Category: pkg
>Synopsis: let SDL support USB gamepad
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Mon Jun 24 03:56:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Rui-Xiang Guo
>Release: NetBSD 1.6_BETA1
>Organization:
>Environment:
System: NetBSD hive.u2online 1.6_BETA1 NetBSD 1.6_BETA1 (HIVE) #0: Sun Jun 9 09:10:00 CST 2002 rxg@hive.u2online:/usr/src/sys/arch/i386/compile/HIVE i386
Architecture: i386
Machine: i386
>Description:
I want to play games under zsnes with my USB gamepad. :)
>How-To-Repeat:
1. unpack this tarball under devel/SDL
begin 644 files.tar.gz
M'XL(`(+R%CT``^T\^WO:QK+]%?T54X>;@&/P*X\37/<#`W9H,'`!Y]A-\ZDR
M6HR.A<21A!.?-O_[G=F'M)*`.'W>^]W0).S.SL[.SEN[HE/'9>'N-W_J!Y[M
MO7S^'+X!V'_Y?(^^\:.^90=P!/\[?+'_$M'V#O:>?P//_URVQ&<91E8`\$WP
M\68CWH<98^Y?P=!?^YER_8]:73.\#__EWX>1,[FM3O[0-?;W]EX\>[9.__LO
M]@]U_;]`T.'S%R^^@;T_E(LUG__G^M_=-D@):`!0@9$S7[@,6D[`)M$YLQT+
MNM8]"SA*TU_<!\[-+()2LPS[KUZ]W*%__\'_?;4#!WM[>_S??21GS7&F%SG>
MC67PV>.9$X+K7`=6<`_8G`:,0>A/HP]6P([@WE_"Q/(@P$7#*'"NEQ$#)P++
MLW=]L?[<MYWI/0&7GLT"B&8,(A;,0_"GO'/6NX"N7.&,>2RP7!@LKUUGPN=W
MG0GS0@96"`N"AC-FP_4]GWI*W(PD-W#JXPI6Y/C>$3`'QP4#=RP($08':D%)
M<0?\`$I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V9BO)3](VE>"[4>=K?XE>3N"+=--'5)+TZZ=G,
M%K_7C<GQG\XM0W:T%<]T(GHCCD7\!PJ8],7MY=RZAX#]>XEN+WX08;E`3',"
M`>.9L;J5%UDMSSM)MCIXW>]=U3[C&IMLXZ=U#W4/T\\JK\N;6];XUNMTA;/F
M[?2G]#/&>DL02L\[>\;0-UE([`E4AL@TR;^)#$^0E"=%,HQ38C;GI?JYG/-3
M*@-F4U"JKZ4AU<3I>MY)DE#J%$4F&/H"+3%D-*C<(>_Y67=9ZTF\I\L\(983
MKL$/>1FR)'_W'\*[P^KS5SN'U1>'9;IVI]^U\S<IT#L\/P+VD7YOP'=Q9P4.
MO4\;TEL0??H=SP>'OX4F?X'*7V>`$OGIZ#Y\"^A\N&88E;D/7M,K`1/&;'H%
MH=KKMR_IIQZUC>]B9=[_L>9_PCLFF]__`3C<S_[_7PX0]/7]G[_B8SQZE#I/
M5/_G`/$TDKNEX);7ZO[-ER,K;D?^;CE^_7S]?/U\_7S]?/W\7_K\#\58IS\`
#4```
`
end
2. fix the Makefile
--- /usr/pkgsrc/devel/SDL/Makefile Sun Jun 16 19:58:28 2002
+++ Makefile Sat Jun 22 19:00:14 2002
@@ -48,6 +48,8 @@
pre-patch:
cd ${WRKSRC} && ${MKDIR} src/audio/netbsd
+ cd ${WRKSRC} && ${MKDIR} src/joystick/netbsd
+ ${CP} ${FILESDIR}/* ${WRKSRC}/src/joystick/netbsd
pre-configure:
cd ${WRKSRC} && ${LOCALBASE}/bin/autoreconf --force --foreign
3. replace patch-aj
$NetBSD$
--- configure.in.orig Thu Nov 8 15:28:00 2001
+++ configure.in
@@ -374,10 +374,7 @@
, enable_nas=yes)
if test x$enable_audio = xyes -a x$enable_nas = xyes; then
AC_MSG_CHECKING(for NAS audio support)
- have_nas=no
- if test -r /usr/X11R6/include/audio/audiolib.h; then
- have_nas=yes
- fi
+ have_nas=yes
AC_MSG_RESULT($have_nas)
if test x$have_nas = xyes; then
CFLAGS="$CFLAGS -DNAS_SUPPORT"
@@ -429,7 +426,7 @@
NASMFLAGS="-f win32"
;;
*)
- NASMFLAGS="-f elf"
+ test -n "$NASMFLAGS" || NASMFLAGS="-f elf"
;;
esac
AC_SUBST(NASMFLAGS)
@@ -999,8 +996,8 @@
pthread_lib="-pthread"
;;
*-*-netbsd*)
- pthread_cflags="-I/usr/pkg/include -D_REENTRANT"
- pthread_lib="-L/usr/pkg/lib -lpthread -lsem"
+ pthread_cflags="-D_REENTRANT"
+ pthread_lib="-lpthread"
;;
*-*-openbsd*)
pthread_cflags="-D_REENTRANT"
@@ -1465,11 +1462,13 @@
CheckDummyVideo
CheckDiskAudio
CheckNASM
+ CheckOPENBSDAUDIO
CheckOSS
CheckARTSC
CheckESD
CheckNAS
CheckX11
+ CheckDGA
CheckAAlib
CheckOpenGL
CheckPTHREAD
@@ -1482,10 +1481,10 @@
AUDIO_DRIVERS="$AUDIO_DRIVERS sun/libaudio_sun.la"
fi
# Set up files for the joystick library
- # (No joystick support yet)
if test x$enable_joystick = xyes; then
- JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS dummy"
- JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS dummy/libjoystick_dummy.la"
+ JOYSTICK_SUBDIRS="$JOYSTICK_SUBDIRS netbsd"
+ JOYSTICK_DRIVERS="$JOYSTICK_DRIVERS netbsd/libjoystick_netbsd.la"
+ SYSTEM_LIBS="$SYSTEM_LIBS -lusbhid"
fi
# Set up files for the cdrom library
if test x$enable_cdrom = xyes; then
@@ -1770,7 +1769,11 @@
COPY_ARCH_SRC(src/thread, linux, SDL_systhread_c.h)
COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex.c)
COPY_ARCH_SRC(src/thread, linux, SDL_sysmutex_c.h)
- COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
+ if test x$use_pthreads = xyes -a x$enable_pthread_sem != xyes; then
+ COPY_ARCH_SRC(src/thread, generic, SDL_syssem.c)
+ else
+ COPY_ARCH_SRC(src/thread, linux, SDL_syssem.c)
+ fi
COPY_ARCH_SRC(src/thread, generic, SDL_syssem_c.h)
COPY_ARCH_SRC(src/thread, linux, SDL_syscond.c)
COPY_ARCH_SRC(src/thread, generic, SDL_syscond_c.h)
@@ -2159,6 +2162,10 @@
SDL_RLD_FLAGS="-R\${exec_prefix}/lib"
fi
+if test $ARCH = netbsd; then
+ SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib -Wl,-rpath,${X11BASE}/lib"
+fi
+
if test $ARCH = openbsd; then
SDL_RLD_FLAGS="-Wl,-rpath,\${exec_prefix}/lib $SYSTEM_LIBS"
fi
@@ -2281,6 +2288,7 @@
src/joystick/dummy/Makefile
src/joystick/linux/Makefile
src/joystick/macos/Makefile
+src/joystick/netbsd/Makefile
src/joystick/win32/Makefile
src/cdrom/Makefile
src/cdrom/aix/Makefile
4. type 'make makepatchsum && make install'
5. test it with emulators/zsnes or 'testjoystick' under test/ in SDL
[/home/rxg]% zsnes
ZSNES v1.337 beta (c)1997-2001 ZSNES Team (zsKnight - _Demo_)
Linux version, please report crashes to zsnes-devel@lists.sourceforge.net.
Compiled under NASM, GCC
Programmers : zsKnight, _Demo_
Assistant Coder : Pharos
ZSNES comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions;
check license.txt.
Use ZSNES -? for command line definitions
MMX support enabled. FOUND!
Joystick 0 (8 Buttons): /dev/uhid0
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: