Subject: pkg/7197: partial upgrade of Wine pkg to version 990314
To: None <gnats-bugs@gnats.netbsd.org>
From: None <woods@mail.weird.com>
List: netbsd-bugs
Date: 03/18/1999 13:24:42
>Number:         7197
>Category:       pkg
>Synopsis:       partial upgrade of Wine pkg to version 990314
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 18 10:35:00 1999
>Last-Modified:
>Originator:     Greg A. Woods
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Release:        NetBSD-current, pkgsrc-current
>Environment:

>Description:

	I wanted to try running a small M$ based device configuration
	application so I thought I'd try it under Wine.  However the
	existing Wine pkgsrc module was way out of date, so first I made
	an attempt to upgrade it.

	I've got it so that it builds fine, but the install fails inside
	the package's own install rules:

02:13 [2020] # make install
===>  Installing for wine-990314
[ -d /usr/pkg/lib ] || mkdir -p /usr/pkg/lib
if [ libwine.so.1.0 ]; then /usr/bin/install -c -o root -g wheel -m 644 libwine.so.1.0 /usr/pkg/lib; fi
if [ -f wine.sym ]; then /usr/bin/install -c -o root -g wheel -m 644 wine.sym /usr/pkg/lib/wine.sym; fi
[ -d /usr/pkg/bin ] || mkdir -p /usr/pkg/bin
install -c  -o root -g wheel -m 555 wine /usr/pkg/bin/wine
install -c  -o root -g wheel -m 555 loader/dos/dosmod /usr/pkg/bin/dosmod
for i in documentation include; do (cd $i && make install) || exit 1; done
[ -d /usr/pkg/man/man1 ] || mkdir -p /usr/pkg/man/man1
/usr/bin/install -c -o root -g wheel -m 644 ./wine.man /usr/pkg/man/man1/wine.1
if [ libwine.so.1.0 ]; then [ -d /usr/pkg/include/wine ] || mkdir -p /usr/pkg/include/wine;  /usr/bin/install -c -o root -g wheel -m 644 windows.h  wingdi.h  wintypes.h  winuser.h /usr/pkg/include/wine; fi
install: wintypes.h: No such file or directory
*** Error code 1


>How-To-Repeat:

>Fix:

	First off remove the following patches from the module:

rm patches/patch-ag
rm patches/patch-ah
rm patches/patch-ai
rm patches/patch-aj
rm patches/patch-ak
rm patches/patch-al
rm patches/patch-am
rm patches/patch-an
rm patches/patch-ao
rm patches/patch-ap
rm patches/patch-aq

	Then apply the following patch to the module:

Index: Makefile
===================================================================
RCS file: /cvs/NetBSD/pkgsrc/emulators/wine/Makefile,v
retrieving revision 1.1.1.9
diff -u -r1.1.1.9 Makefile
--- Makefile	1999/02/10 00:17:06	1.1.1.9
+++ Makefile	1999/03/18 06:46:35
@@ -1,7 +1,7 @@
 # $NetBSD: Makefile,v 1.15 1999/01/30 23:18:46 agc Exp $
 
-DISTNAME=		Wine-981211
-PKGNAME=		wine-981211
+DISTNAME=		Wine-990314
+PKGNAME=		wine-990314
 WRKSRC=			${WRKDIR}/${PKGNAME}
 CATEGORIES=		emulators
 MASTER_SITES=		${MASTER_SITE_SUNSITE}
@@ -12,13 +12,20 @@
 HOMEPAGE=		http://www.winehq.com/
 
 DEPENDS+=		xpm-3.4k:../../graphics/xpm
+DEPENDS+=		ncurses-1.9.9g:../../devel/ncurses
 
 CONFLICTS=		wine-980[26]*
 
 USE_X11BASE=		yes
 GNU_CONFIGURE=		yes
+CONFIGURE_ENV+=		CC='cc -I${PREFIX}/include -L${PREFIX}/lib'
 CONFIGURE_ARGS+=	--enable-dll
 
+pre-configure:
+	${MV} ${WRKSRC}/include/menu.h ${WRKSRC}/include/winemenu.h
+
+# XXX ARGH!!!! THIS SHOULD BE AN INSTALL SCRIPT!!!!
+#
 post-install:
 	${INSTALL_DATA} ${WRKSRC}/wine.ini ${PREFIX}/etc/wine.conf.example
 
Index: files/md5
===================================================================
RCS file: /cvs/NetBSD/pkgsrc/emulators/wine/files/md5,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 md5
--- files/md5	1999/01/07 04:59:22	1.1.1.4
+++ files/md5	1999/03/18 05:57:21
@@ -1,3 +1,3 @@
-$NetBSD: md5,v 1.4 1998/12/14 02:17:10 tv Exp $
+$NetBSD$
 
-MD5 (Wine-981211.tar.gz) = dc51f8faa2bef9053c5f61cd32fa2d62
+MD5 (Wine-990314.tar.gz) = d1776e43bb5954bc9ffccf0dac0c09b1
Index: patches/patch-aa
===================================================================
RCS file: /cvs/NetBSD/pkgsrc/emulators/wine/patches/patch-aa,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 patch-aa
--- patches/patch-aa	1998/09/01 18:41:53	1.1.1.3
+++ patches/patch-aa	1999/03/18 06:47:25
@@ -1,12 +1,19 @@
-$NetBSD: patch-aa,v 1.4 1998/08/07 10:40:35 agc Exp $
-
---- Make.rules.in.orig	Sun Jan 18 12:50:38 1998
-+++ Make.rules.in	Sun Mar 15 23:30:47 1998
-@@ -33,6 +33,7 @@
- DIVINCL   = -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include -I$(SRCDIR) -I.
- ALLCFLAGS = $(CFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL) $(X_CFLAGS)
- LDCOMBINE = ld -r
-+LDSHARE   = @LDSHARE@
- AR        = ar rc
- RM        = rm -f
- MKDIR     = mkdir
+*** controls/menu.c-ORIG	Sun Mar 14 12:25:32 1999
+--- controls/menu.c	Thu Mar 18 01:47:12 1999
+***************
+*** 23,29 ****
+  #include "sysmetrics.h"
+  #include "task.h"
+  #include "heap.h"
+! #include "menu.h"
+  #include "nonclient.h"
+  #include "user.h"
+  #include "message.h"
+--- 23,29 ----
+  #include "sysmetrics.h"
+  #include "task.h"
+  #include "heap.h"
+! #include "winemenu.h"
+  #include "nonclient.h"
+  #include "user.h"
+  #include "message.h"
Index: patches/patch-ab
===================================================================
RCS file: /cvs/NetBSD/pkgsrc/emulators/wine/patches/patch-ab,v
retrieving revision 1.1.1.4
diff -u -r1.1.1.4 patch-ab
--- patches/patch-ab	1999/01/07 04:59:23	1.1.1.4
+++ patches/patch-ab	1999/03/18 06:48:37
@@ -1,22 +1,19 @@
-$NetBSD: patch-ab,v 1.5 1998/12/14 02:17:10 tv Exp $
-
---- Makefile.in.orig	Fri Dec 11 08:26:26 1998
-+++ Makefile.in	Sun Dec 13 17:33:34 1998
-@@ -153,7 +153,7 @@
- lib: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET)
- 
- wine wine.sym: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET) $(EMUSUBDIRS) dummy
--	$(CC) -o wine $(EMUOBJS) $(LIB_TARGET) $(ALT_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
-+	$(CC) -o wine $(EMUOBJS) -L. -lwine $(ALT_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
- 	nm -n wine | grep -v _compiled >wine.sym
- 	@echo "Wine build complete."
- 
-@@ -163,7 +163,7 @@
- 	$(RANLIB) $@
- 
- libwine.so.1.0: $(LIBOBJS) $(X11OBJS)
--	$(CC) -shared -Wl,-soname,libwine.so -o$@ $(LIBOBJS) $(X11OBJS) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
-+	${LDSHARE} -o$@ $(LIBOBJS) $(X11OBJS) $(LDOPTIONS)
- 
- install_emu: install_lib
- 	[ -d $(bindir) ] || $(MKDIR) $(bindir)
+*** loader/main.c-ORIG	Wed Mar 10 09:03:06 1999
+--- loader/main.c	Thu Mar 18 01:48:06 1999
+***************
+*** 15,21 ****
+  #include "comm.h"
+  #include "neexe.h"
+  #include "main.h"
+! #include "menu.h"
+  #include "message.h"
+  #include "multimedia.h"
+  #include "dialog.h"
+--- 15,21 ----
+  #include "comm.h"
+  #include "neexe.h"
+  #include "main.h"
+! #include "winemenu.h"
+  #include "message.h"
+  #include "multimedia.h"
+  #include "dialog.h"
Index: patches/patch-ac
===================================================================
RCS file: /cvs/NetBSD/pkgsrc/emulators/wine/patches/patch-ac,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 patch-ac
--- patches/patch-ac	1999/01/07 04:59:23	1.1.1.3
+++ patches/patch-ac	1999/03/18 06:49:12
@@ -1,205 +1,19 @@
-$NetBSD: patch-ac,v 1.3 1998/12/14 02:17:10 tv Exp $
-
---- configure.orig	Fri Dec 11 08:26:26 1998
-+++ configure	Sun Dec 13 00:59:26 1998
-@@ -2037,8 +2037,51 @@
-   echo "$ac_t""no" 1>&6
- fi
- 
-+echo $ac_n "checking for main in -lossaudio""... $ac_c" 1>&6
-+echo "configure:2042: checking for main in -lossaudio" >&5
-+ac_lib_var=`echo ossaudio'_'main | sed 'y%./+-%__p_%'`
-+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  ac_save_LIBS="$LIBS"
-+LIBS="-lossaudio  $LIBS"
-+cat > conftest.$ac_ext <<EOF
-+#line 2050 "configure"
-+#include "confdefs.h"
-+
-+int main() {
-+main()
-+; return 0; }
-+EOF
-+if { (eval echo configure:2057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-+  rm -rf conftest*
-+  eval "ac_cv_lib_$ac_lib_var=yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  eval "ac_cv_lib_$ac_lib_var=no"
-+fi
-+rm -f conftest*
-+LIBS="$ac_save_LIBS"
-+
-+fi
-+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-+  echo "$ac_t""yes" 1>&6
-+    ac_tr_lib=HAVE_LIB`echo ossaudio | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-+  cat >> confdefs.h <<EOF
-+#define $ac_tr_lib 1
-+EOF
-+
-+  LIBS="-lossaudio $LIBS"
-+
-+else
-+  echo "$ac_t""no" 1>&6
-+fi
-+
- echo $ac_n "checking for iswalnum in -lw""... $ac_c" 1>&6
--echo "configure:2042: checking for iswalnum in -lw" >&5
-+echo "configure:2085: checking for iswalnum in -lw" >&5
- ac_lib_var=`echo w'_'iswalnum | sed 'y%./+-%__p_%'`
- if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-   echo $ac_n "(cached) $ac_c" 1>&6
-@@ -2489,7 +2532,27 @@
- 
- ; return 0; }
- EOF
--if { (eval echo configure:2493: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-+if { (eval echo configure:2536: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-+  rm -rf conftest*
-+  ac_cv_c_opensoundsystem="yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  cat > conftest.$ac_ext <<EOF
-+#line 2544 "configure"
-+#include "confdefs.h"
-+#include <soundcard.h>
-+int main() {
-+
-+/* check for one of the Open Sound System specific SNDCTL_ defines */
-+#if !defined(SNDCTL_DSP_STEREO)
-+#error No open sound system
-+#endif
-+
-+; return 0; }
-+EOF
-+if { (eval echo configure:2556: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
-   rm -rf conftest*
-   ac_cv_c_opensoundsystem="yes"
- else
-@@ -2500,6 +2563,8 @@
- fi
- rm -f conftest*
- fi
-+rm -f conftest*
-+fi
- 
- echo "$ac_t""$ac_cv_c_opensoundsystem" 1>&6
- 
-@@ -2680,50 +2745,90 @@
- 
- 
- DLLFLAGS=""
-+LDSHARE=""
- if test "$LIB_TARGET" = "libwine.so.1.0"
- then
--  echo $ac_n "checking "whether we can build a dll"""... $ac_c" 1>&6
--echo "configure:2687: checking "whether we can build a dll"" >&5
--if eval "test \"`echo '$''{'ac_cv_c_dll'+set}'`\" = set"; then
-+  echo $ac_n "checking "whether we can build a Linux dll"""... $ac_c" 1>&6
-+echo "configure:2753: checking "whether we can build a Linux dll"" >&5
-+if eval "test \"`echo '$''{'ac_cv_c_dll_linux'+set}'`\" = set"; then
-   echo $ac_n "(cached) $ac_c" 1>&6
- else
-   saved_cflags=$CFLAGS
-   CFLAGS="$CFLAGS -fPIC -shared -Wl,-soname,conftest.so.1.0"
-   cat > conftest.$ac_ext <<EOF
--#line 2694 "configure"
-+#line 2760 "configure"
- #include "confdefs.h"
- 
- int main() {
- return 1
- ; return 0; }
- EOF
--if { (eval echo configure:2701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-+if { (eval echo configure:2767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-   rm -rf conftest*
--  ac_cv_c_dll="yes"
-+  ac_cv_c_dll_linux="yes"
- else
-   echo "configure: failed program was:" >&5
-   cat conftest.$ac_ext >&5
-   rm -rf conftest*
--  ac_cv_c_dll="no"
-+  ac_cv_c_dll_linux="no"
- fi
- rm -f conftest*
-   CFLAGS=$saved_cflags
-   
- fi
- 
--echo "$ac_t""$ac_cv_c_dll" 1>&6
--  if test "$ac_cv_c_dll" = "yes"
-+echo "$ac_t""$ac_cv_c_dll_linux" 1>&6
-+  if test "$ac_cv_c_dll_linux" = "yes"
-   then
-     DLLFLAGS="-fPIC"
--  else
-+    LDSHARE="$$(CC) -shared -Wl,-soname,libwine.so"
-+  fi
-+  echo $ac_n "checking "whether we can build a NetBSD dll"""... $ac_c" 1>&6
-+echo "configure:2788: checking "whether we can build a NetBSD dll"" >&5
-+if eval "test \"`echo '$''{'ac_cv_c_dll_netbsd'+set}'`\" = set"; then
-+  echo $ac_n "(cached) $ac_c" 1>&6
-+else
-+  saved_cflags=$CFLAGS
-+  CFLAGS="$CFLAGS -fPIC -Bshareable -Bforcearchive"
-+  cat > conftest.$ac_ext <<EOF
-+#line 2795 "configure"
-+#include "confdefs.h"
-+
-+int main() {
-+return 1
-+; return 0; }
-+EOF
-+if { (eval echo configure:2802: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-+  rm -rf conftest*
-+  ac_cv_c_dll_netbsd="yes"
-+else
-+  echo "configure: failed program was:" >&5
-+  cat conftest.$ac_ext >&5
-+  rm -rf conftest*
-+  ac_cv_c_dll_netbsd="no"
-+fi
-+rm -f conftest*
-+  CFLAGS=$saved_cflags
-+  
-+fi
-+
-+echo "$ac_t""$ac_cv_c_dll_netbsd" 1>&6
-+  if test "$ac_cv_c_dll_netbsd" = "yes"
-+  then
-+    DLLFLAGS="-fPIC"
-+    LDSHARE="ld -Bshareable -Bforcearchive"
-+  fi
-+  if test "$ac_cv_c_dll_linux" = "no" -a "$ac_cv_c_dll_netbsd" = "no"
-+  then
-     LIB_TARGET="libwine.a"
-   fi
- fi
- 
- 
- 
-+
- echo $ac_n "checking "for reentrant libc"""... $ac_c" 1>&6
--echo "configure:2727: checking "for reentrant libc"" >&5
-+echo "configure:2832: checking "for reentrant libc"" >&5
- if eval "test \"`echo '$''{'wine_cv_libc_reentrant'+set}'`\" = set"; then
-   echo $ac_n "(cached) $ac_c" 1>&6
- else
-@@ -3849,6 +3954,7 @@
- s%@C2MAN@%$C2MAN%g
- s%@XLIB@%$XLIB%g
- s%@DLLFLAGS@%$DLLFLAGS%g
-+s%@LDSHARE@%$LDSHARE%g
- /@MAKE_RULES@/r $MAKE_RULES
- s%@MAKE_RULES@%%g
- 
+*** windows/mdi.c-ORIG	Sun Mar 14 12:25:33 1999
+--- windows/mdi.c	Thu Mar 18 01:48:59 1999
+***************
+*** 21,27 ****
+  #include "nonclient.h"
+  #include "mdi.h"
+  #include "user.h"
+! #include "menu.h"
+  #include "resource.h"
+  #include "struct32.h"
+  #include "sysmetrics.h"
+--- 21,27 ----
+  #include "nonclient.h"
+  #include "mdi.h"
+  #include "user.h"
+! #include "winemenu.h"
+  #include "resource.h"
+  #include "struct32.h"
+  #include "sysmetrics.h"
Index: patches/patch-ad
===================================================================
RCS file: /cvs/NetBSD/pkgsrc/emulators/wine/patches/patch-ad,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 patch-ad
--- patches/patch-ad	1998/09/01 18:41:55	1.1.1.2
+++ patches/patch-ad	1999/03/18 06:49:42
@@ -1,19 +1,19 @@
-$NetBSD: patch-ad,v 1.2 1998/08/07 10:40:35 agc Exp $
-
---- multimedia/audio.c.orig	Sun May 31 18:14:49 1998
-+++ multimedia/audio.c	Tue Jun 16 23:58:24 1998
-@@ -28,11 +28,14 @@
- 
- #ifdef HAVE_OSS
- 
-+#ifdef __NetBSD__
-+#include <soundcard.h>
- #ifdef HAVE_MACHINE_SOUNDCARD_H
- # include <machine/soundcard.h>
- #endif
- #ifdef HAVE_SYS_SOUNDCARD_H
- # include <sys/soundcard.h>
-+#endif
- #endif
- 
- #define SOUND_DEV "/dev/dsp"
+*** windows/nonclient.c-ORIG	Sun Mar 14 12:25:33 1999
+--- windows/nonclient.c	Thu Mar 18 01:49:32 1999
+***************
+*** 13,19 ****
+  #include "heap.h"
+  #include "cursoricon.h"
+  #include "dialog.h"
+! #include "menu.h"
+  #include "winpos.h"
+  #include "hook.h"
+  #include "scroll.h"
+--- 13,19 ----
+  #include "heap.h"
+  #include "cursoricon.h"
+  #include "dialog.h"
+! #include "winemenu.h"
+  #include "winpos.h"
+  #include "hook.h"
+  #include "scroll.h"
Index: patches/patch-ae
===================================================================
RCS file: /cvs/NetBSD/pkgsrc/emulators/wine/patches/patch-ae,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 patch-ae
--- patches/patch-ae	1998/09/01 18:41:55	1.1.1.2
+++ patches/patch-ae	1999/03/18 06:50:12
@@ -1,23 +1,19 @@
-$NetBSD: patch-ae,v 1.2 1998/08/07 10:40:35 agc Exp $
-
---- multimedia/dsound.c.orig	Sun May 31 18:14:50 1998
-+++ multimedia/dsound.c	Wed Jun 17 00:00:14 1998
-@@ -45,13 +45,17 @@
- #include "debug.h"
- 
- #ifdef HAVE_OSS
--# include <sys/ioctl.h>
-+#include <sys/ioctl.h>
-+#ifdef __NetBSD__
-+#include <soundcard.h>
-+#else
- # ifdef HAVE_MACHINE_SOUNDCARD_H
- #  include <machine/soundcard.h>
- # endif
- # ifdef HAVE_SYS_SOUNDCARD_H
- #  include <sys/soundcard.h>
- # endif
-+#endif
- 
- static int audiofd = -1;
- static LPDIRECTSOUND	dsound = NULL;
+*** windows/user.c-ORIG	Wed Mar 10 09:03:06 1999
+--- windows/user.c	Thu Mar 18 01:50:02 1999
+***************
+*** 15,21 ****
+  #include "queue.h"
+  #include "win.h"
+  #include "clipboard.h"
+! #include "menu.h"
+  #include "cursoricon.h"
+  #include "hook.h"
+  #include "debug.h"
+--- 15,21 ----
+  #include "queue.h"
+  #include "win.h"
+  #include "clipboard.h"
+! #include "winemenu.h"
+  #include "cursoricon.h"
+  #include "hook.h"
+  #include "debug.h"
Index: patches/patch-af
===================================================================
RCS file: /cvs/NetBSD/pkgsrc/emulators/wine/patches/patch-af,v
retrieving revision 1.1.1.3
diff -u -r1.1.1.3 patch-af
--- patches/patch-af	1999/01/07 04:59:24	1.1.1.3
+++ patches/patch-af	1999/03/18 06:50:40
@@ -1,527 +1,19 @@
-$NetBSD: patch-af,v 1.4 1998/12/14 02:17:11 tv Exp $
-
---- multimedia/mcicda.c.orig	Thu Dec 10 04:03:00 1998
-+++ multimedia/mcicda.c	Sun Dec 13 11:00:34 1998
-@@ -18,6 +18,10 @@
- #include "debug.h"
- #include "multimedia.h"
- 
-+#ifdef __NetBSD__
-+#include <soundcard.h>
-+#include <sys/cdio.h>
-+#else
- #ifdef HAVE_LINUX_CDROM_H
- # include <linux/cdrom.h>
- #endif
-@@ -30,12 +34,17 @@
- #ifdef HAVE_SYS_CDIO_H
- # include <sys/cdio.h>
- #endif
-+#endif
- 
-+#ifdef __NetBSD__
-+#define CDAUDIO_DEV "/dev/rcd0d"
-+#else
- #ifdef __FreeBSD__
- # define CDAUDIO_DEV "/dev/rcd0c"
- #else
- # define CDAUDIO_DEV "/dev/cdrom"
- #endif
-+#endif
- 
- #ifdef SOUND_VERSION
- # define IOCTL(a,b,c)		ioctl(a,b,&c)
-@@ -50,7 +59,7 @@
- #define CDFRAMES_PERMIN 	4500
- #define SECONDS_PERMIN	 	60
- 
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
- typedef struct {
-     int     		nUseCount;          /* Incremented for each shared open */
-     BOOL16  		fShareable;         /* TRUE if first open was shareable */
-@@ -61,7 +70,7 @@
-     int			unixdev;
- #ifdef linux
-     struct cdrom_subchnl	sc;
--#elif defined(__FreeBSD__)
-+#else
-     struct cd_sub_channel_info	sc;
- #endif
-     int			cdMode;
-@@ -103,27 +112,25 @@
-  */
- static UINT16 CDAUDIO_GetNumberOfTracks(WINE_CDAUDIO* wcda)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
- #ifdef linux
-     struct cdrom_tochdr	hdr;
--#elif defined(__FreeBSD__)
-+#else
-     struct ioc_toc_header	hdr;
- #endif
-     
-     if (wcda->nTracks == 0) {
--	if (ioctl(wcda->unixdev,
- #ifdef linux
--		  CDROMREADTOCHDR
--#elif defined(__FreeBSD__)
--		  CDIOREADTOCHEADER
-+	if (ioctl(wcda->unixdev, CDROMREADTOCHDR, &hdr)) {
-+#else
-+	if (ioctl(wcda->unixdev, CDIOREADTOCHEADER, &hdr)) {
- #endif
--		  , &hdr)) {
- 	    WARN(cdaudio, "(%p) -- Error occured !\n", wcda);
- 	    return (WORD)-1;
- 	}
- #ifdef linux
- 	wcda->nTracks = hdr.cdth_trk1;
--#elif defined(__FreeBSD__)
-+#else
- 	wcda->nTracks = hdr.ending_track - hdr.starting_track + 1;
- #endif
-     }
-@@ -139,13 +146,13 @@
-  */
- static BOOL32 CDAUDIO_GetTracksInfo(WINE_CDAUDIO* wcda)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     int		i, length;
-     int		start, last_start = 0;
-     int		total_length = 0;
- #ifdef linux
-     struct cdrom_tocentry	entry;
--#elif defined(__FreeBSD__)
-+#else
-     struct ioc_read_toc_entry	entry;
-     struct cd_toc_entry             toc_buffer;
- #endif
-@@ -177,31 +184,29 @@
- 	if (i == wcda->nTracks)
- #ifdef linux
- 	    entry.cdte_track = CDROM_LEADOUT;
--#elif defined(__FreeBSD__)
-+#else
- #define LEADOUT 0xaa
- 	entry.starting_track = LEADOUT; /* XXX */
- #endif
- 	else
- #ifdef linux
- 	    entry.cdte_track = i + 1;
--#elif defined(__FreeBSD__)
-+#else
- 	entry.starting_track = i + 1;
- #endif
- #ifdef linux
- 	entry.cdte_format = CDROM_MSF;
--#elif defined(__FreeBSD__)
-+#else
- 	bzero((char *)&toc_buffer, sizeof(toc_buffer));
- 	entry.address_format = CD_MSF_FORMAT;
- 	entry.data_len = sizeof(toc_buffer);
- 	entry.data = &toc_buffer;
- #endif
--	if (ioctl(wcda->unixdev, 
- #ifdef linux
--		  CDROMREADTOCENTRY
--#elif defined(__FreeBSD__)
--		  CDIOREADTOCENTRYS
-+	if (ioctl(wcda->unixdev, CDROMREADTOCENTRY, &entry)) {
-+#else
-+	if (ioctl(wcda->unixdev, CDIOREADTOCENTRYS, &entry)) {
- #endif
--		  , &entry)) {
- 	    WARN(cdaudio, "error read entry\n");
- 	    return FALSE;
- 	}
-@@ -209,7 +214,7 @@
- 	start = CDFRAMES_PERSEC * (SECONDS_PERMIN * 
- 				   entry.cdte_addr.msf.minute + entry.cdte_addr.msf.second) + 
- 	    entry.cdte_addr.msf.frame;
--#elif defined(__FreeBSD__)
-+#else
- 	start = CDFRAMES_PERSEC * (SECONDS_PERMIN *
- 				   toc_buffer.addr.msf.minute + toc_buffer.addr.msf.second) +
- 	    toc_buffer.addr.msf.frame;
-@@ -230,7 +235,7 @@
- 	wcda->lpbTrackFlags[i] =
- #ifdef linux
- 		(entry.cdte_adr << 4) | (entry.cdte_ctrl & 0x0f);
--#elif defined(__FreeBSD__)
-+#else
- 		(toc_buffer.addr_type << 4) | (toc_buffer.control & 0x0f);
- #endif 
- 	TRACE(cdaudio, "track #%u flags=%02x\n", i + 1, wcda->lpbTrackFlags[i]);
-@@ -248,7 +253,7 @@
-  */
- static DWORD CDAUDIO_mciOpen(UINT16 wDevID, DWORD dwFlags, LPMCI_OPEN_PARMS32A lpOpenParms)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     DWORD	dwDeviceID;
-     WINE_CDAUDIO* 	wcda;
- 
-@@ -328,7 +333,7 @@
-  */
- static DWORD CDAUDIO_mciClose(UINT16 wDevID, DWORD dwParam, LPMCI_GENERIC_PARMS lpParms)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     WINE_CDAUDIO*	wcda = CDAUDIO_mciGetOpenDrv(wDevID);
- 
-     TRACE(cdaudio,"(%04X, %08lX, %p);\n", wDevID, dwParam, lpParms);
-@@ -351,7 +356,7 @@
- static DWORD CDAUDIO_mciGetDevCaps(UINT16 wDevID, DWORD dwFlags, 
- 				   LPMCI_GETDEVCAPS_PARMS lpParms)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     TRACE(cdaudio,"(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
- 
-     if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
-@@ -403,7 +408,7 @@
-  */
- static DWORD CDAUDIO_mciInfo(UINT16 wDevID, DWORD dwFlags, LPMCI_INFO_PARMS16 lpParms)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     DWORD		ret = 0;
-     LPSTR		str = 0;
-     WINE_CDAUDIO*	wcda = CDAUDIO_mciGetOpenDrv(wDevID);
-@@ -445,7 +450,7 @@
- static DWORD CDAUDIO_CalcFrame(WINE_CDAUDIO* wcda, DWORD dwTime)
- {
-     DWORD	dwFrame = 0;
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     UINT16	wTrack;
-     
-     TRACE(cdaudio,"(%p, %08lX, %lu);\n", wcda, wcda->dwTimeFormat, dwTime);
-@@ -487,9 +492,9 @@
-  */
- static BOOL32 CDAUDIO_GetCDStatus(WINE_CDAUDIO*	wcda)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     int		oldmode = wcda->cdMode;
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__NetBSD__)
-     struct ioc_read_subchannel	read_sc;
-     
-     read_sc.address_format = CD_MSF_FORMAT;
-@@ -500,13 +505,11 @@
- #elif linux
-     wcda->sc.cdsc_format = CDROM_MSF;
- #endif
--    if (ioctl(wcda->unixdev,
- #ifdef linux
--	      CDROMSUBCHNL, &wcda->sc
--#elif defined(__FreeBSD__)
--	      CDIOCREADSUBCHANNEL, &read_sc
-+    if (ioctl(wcda->unixdev, CDROMSUBCHNL, &wcda->sc)) {
-+#else
-+    if (ioctl(wcda->unixdev, CDIOCREADSUBCHANNEL, &read_sc)) {
- #endif
--	      )) {
- 	TRACE(cdaudio,"opened or no_media !\n");
- 	wcda->cdMode = MCI_MODE_OPEN; /* was NOT_READY */
- 	return TRUE;
-@@ -514,13 +517,13 @@
-     switch (
- #ifdef linux
- 	    wcda->sc.cdsc_audiostatus
--#elif defined(__FreeBSD__)
-+#else
- 	    wcda->sc.header.audio_status
- #endif
- 	    ) {
- #ifdef linux
-     case CDROM_AUDIO_INVALID:
--#elif defined(__FreeBSD__)
-+#else
-     case CD_AS_AUDIO_INVALID:
- #endif
- 	WARN(cdaudio, "device doesn't support status, using MCI status.\n");
-@@ -528,7 +531,7 @@
- 	break;
- #ifdef linux
-     case CDROM_AUDIO_NO_STATUS: 
--#elif defined(__FreeBSD__)
-+#else
-     case CD_AS_NO_STATUS:
- #endif
- 	wcda->cdMode = MCI_MODE_STOP;
-@@ -536,7 +539,7 @@
- 	break;
- #ifdef linux
-     case CDROM_AUDIO_PLAY: 
--#elif defined(__FreeBSD__)
-+#else
-     case CD_AS_PLAY_IN_PROGRESS:
- #endif
- 	wcda->cdMode = MCI_MODE_PLAY;
-@@ -544,7 +547,7 @@
- 	break;
- #ifdef linux
-     case CDROM_AUDIO_PAUSED:
--#elif defined(__FreeBSD__)
-+#else
-     case CD_AS_PLAY_PAUSED:
- #endif
- 	wcda->cdMode = MCI_MODE_PAUSE;
-@@ -554,7 +557,7 @@
- #ifdef linux
- 	TRACE(cdaudio,"status=%02X !\n",
- 	      wcda->sc.cdsc_audiostatus);
--#elif defined(__FreeBSD__)
-+#else
- 	TRACE(cdaudio,"status=%02X !\n",
- 	      wcda->sc.header.audio_status);
- #endif
-@@ -565,7 +568,7 @@
- 	CDFRAMES_PERMIN * wcda->sc.cdsc_absaddr.msf.minute +
- 	CDFRAMES_PERSEC * wcda->sc.cdsc_absaddr.msf.second +
- 	wcda->sc.cdsc_absaddr.msf.frame;
--#elif defined(__FreeBSD__)
-+#else
-     wcda->nCurTrack = wcda->sc.what.position.track_number;
-     wcda->dwCurFrame = 
- 	CDFRAMES_PERMIN * wcda->sc.what.position.absaddr.msf.minute +
-@@ -578,7 +581,7 @@
- 	  wcda->sc.cdsc_absaddr.msf.minute,
- 	  wcda->sc.cdsc_absaddr.msf.second,
- 	  wcda->sc.cdsc_absaddr.msf.frame);
--#elif defined(__FreeBSD__)
-+#else
-     TRACE(cdaudio,"%02u-%02u:%02u:%02u \n",
- 	  wcda->sc.what.position.track_number,
- 	  wcda->sc.what.position.absaddr.msf.minute,
-@@ -605,7 +608,7 @@
- static DWORD CDAUDIO_CalcTime(WINE_CDAUDIO* wcda, DWORD dwFrame)
- {
-     DWORD	dwTime = 0;
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     UINT16	wTrack;
-     UINT16	wMinutes;
-     UINT16	wSeconds;
-@@ -651,7 +654,7 @@
-  */
- static DWORD CDAUDIO_mciStatus(UINT16 wDevID, DWORD dwFlags, LPMCI_STATUS_PARMS lpParms)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     WINE_CDAUDIO*	wcda = CDAUDIO_mciGetOpenDrv(wDevID);
-     DWORD	        ret = 0;
- 
-@@ -759,13 +762,13 @@
-  */
- static DWORD CDAUDIO_mciPlay(UINT16 wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     int 	start, end;
-     WINE_CDAUDIO*	wcda = CDAUDIO_mciGetOpenDrv(wDevID);
-     DWORD		ret = 0;
- #ifdef linux
-     struct 	cdrom_msf	msf;
--#elif defined(__FreeBSD__)
-+#else
-     struct	ioc_play_msf	msf;
- #endif
-     
-@@ -796,7 +799,7 @@
-     msf.cdmsf_min1 = end / CDFRAMES_PERMIN;
-     msf.cdmsf_sec1 = (end % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
-     msf.cdmsf_frame1 = end % CDFRAMES_PERSEC;
--#elif defined(__FreeBSD__)
-+#else
-     msf.start_m     = start / CDFRAMES_PERMIN;
-     msf.start_s     = (start % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
-     msf.start_f     = start % CDFRAMES_PERSEC;
-@@ -804,23 +807,19 @@
-     msf.end_s       = (end % CDFRAMES_PERMIN) / CDFRAMES_PERSEC;
-     msf.end_f       = end % CDFRAMES_PERSEC;
- #endif
--	if (ioctl(wcda->unixdev,
- #ifdef linux
--	      CDROMSTART
--#elif defined(__FreeBSD__)
--	      CDIOCSTART
-+    if (ioctl(wcda->unixdev, CDROMSTART)) {
-+#else
-+    if (ioctl(wcda->unixdev, CDIOCSTART, NULL)) {
- #endif
--	      )) {
- 	WARN(cdaudio, "motor doesn't start !\n");
- 	return MCIERR_HARDWARE;
-     }
--	if (ioctl(wcda->unixdev, 
- #ifdef linux
--	      CDROMPLAYMSF
--#elif defined(__FreeBSD__)
--	      CDIOCPLAYMSF
-+    if (ioctl(wcda->unixdev, CDROMPLAYMSF, &msf)) {
-+#else
-+    if (ioctl(wcda->unixdev, CDIOCPLAYMSF, &msf)) {
- #endif
--	      , &msf)) {
- 	WARN(cdaudio, "device doesn't play !\n");
- 	return MCIERR_HARDWARE;
-     }
-@@ -828,7 +827,7 @@
-     TRACE(cdaudio,"msf = %d:%d:%d %d:%d:%d\n",
- 	  msf.cdmsf_min0, msf.cdmsf_sec0, msf.cdmsf_frame0,
- 	  msf.cdmsf_min1, msf.cdmsf_sec1, msf.cdmsf_frame1);
--#elif defined(__FreeBSD__)
-+#else
-     TRACE(cdaudio,"msf = %d:%d:%d %d:%d:%d\n",
- 	  msf.start_m, msf.start_s, msf.start_f,
- 	  msf.end_m,   msf.end_s,   msf.end_f);
-@@ -854,20 +853,19 @@
-  */
- static DWORD CDAUDIO_mciStop(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     WINE_CDAUDIO*	wcda = CDAUDIO_mciGetOpenDrv(wDevID);
- 
-     TRACE(cdaudio,"(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
- 
-     if (wcda == NULL)	return MCIERR_INVALID_DEVICE_ID;
-     
--    if (ioctl(wcda->unixdev,
- #ifdef linux
--	      CDROMSTOP
--#elif defined(__FreeBSD__)
--	      CDIOCSTOP
-+    if (ioctl(wcda->unixdev, CDROMSTOP))
-+#else
-+    if (ioctl(wcda->unixdev, CDIOCSTOP, NULL))
- #endif
--	      )) return MCIERR_HARDWARE;
-+	return MCIERR_HARDWARE;
-     wcda->mciMode = MCI_MODE_STOP;
-     if (lpParms && (dwFlags & MCI_NOTIFY)) {
- 	TRACE(cdaudio, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
-@@ -885,20 +883,19 @@
-  */
- static DWORD CDAUDIO_mciPause(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     WINE_CDAUDIO*	wcda = CDAUDIO_mciGetOpenDrv(wDevID);
- 
-     TRACE(cdaudio,"(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
- 
-     if (wcda == NULL)	return MCIERR_INVALID_DEVICE_ID;
- 
--    if (ioctl(wcda->unixdev,
- #ifdef linux
--	      CDROMPAUSE
--#elif defined(__FreeBSD__)
--	      CDIOCPAUSE
-+    if (ioctl(wcda->unixdev, CDROMPAUSE))
-+#else
-+    if (ioctl(wcda->unixdev, CDIOCPAUSE, NULL))
- #endif
--	      )) return MCIERR_HARDWARE;
-+	return MCIERR_HARDWARE;
-     wcda->mciMode = MCI_MODE_PAUSE;
-     if (lpParms && (dwFlags & MCI_NOTIFY)) {
-         TRACE(cdaudio, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
-@@ -916,20 +913,19 @@
-  */
- static DWORD CDAUDIO_mciResume(UINT16 wDevID, DWORD dwFlags, LPMCI_GENERIC_PARMS lpParms)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     WINE_CDAUDIO*	wcda = CDAUDIO_mciGetOpenDrv(wDevID);
- 
-     TRACE(cdaudio,"(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
- 
-     if (wcda == NULL)	return MCIERR_INVALID_DEVICE_ID;
-     
--    if (ioctl(wcda->unixdev, 
- #ifdef linux
--	      CDROMRESUME
--#elif defined(__FreeBSD__)
--	      CDIOCRESUME
-+    if (ioctl(wcda->unixdev, CDROMRESUME))
-+#else
-+    if (ioctl(wcda->unixdev, CDIOCRESUME, NULL))
- #endif
--	      )) return MCIERR_HARDWARE;
-+	return MCIERR_HARDWARE;
-     wcda->mciMode = MCI_MODE_STOP;
-     if (lpParms && (dwFlags & MCI_NOTIFY)) {
- 	TRACE(cdaudio, "MCI_NOTIFY_SUCCESSFUL %08lX !\n", lpParms->dwCallback);
-@@ -947,7 +943,7 @@
-  */
- static DWORD CDAUDIO_mciSeek(UINT16 wDevID, DWORD dwFlags, LPMCI_SEEK_PARMS lpParms)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     DWORD	dwRet;
-     MCI_PLAY_PARMS PlayParms;
-     WINE_CDAUDIO*	wcda = CDAUDIO_mciGetOpenDrv(wDevID);
-@@ -957,13 +953,11 @@
-     if (wcda == NULL)	return MCIERR_INVALID_DEVICE_ID;
-     if (lpParms == NULL) return MCIERR_NULL_PARAMETER_BLOCK;
-     
--    if (ioctl(wcda->unixdev,
- #ifdef linux
--	      CDROMRESUME
--#elif defined(__FreeBSD__)
--	      CDIOCRESUME
-+    if (ioctl(wcda->unixdev, CDROMRESUME)) {
-+#else
-+    if (ioctl(wcda->unixdev, CDIOCRESUME, NULL)) {
- #endif
--	      )) {
- 	perror("ioctl CDROMRESUME");
- 	return MCIERR_HARDWARE;
-     }
-@@ -1004,16 +998,16 @@
- 
-     if (wcda == NULL) return MCIERR_INVALID_DEVICE_ID;
- 
--#ifdef __FreeBSD__
--    if (ioctl(wcda->unixdev, CDIOCALLOW)) return MCIERR_HARDWARE;
-+ #if defined(__FreeBSD__) || defined(__NetBSD__)
-+    if (ioctl(wcda->unixdev, CDIOCALLOW, NULL)) return MCIERR_HARDWARE;
-     if (open) {
--	if (ioctl(wcda->unixdev, CDIOCEJECT)) return MCIERR_HARDWARE;
-+	if (ioctl(wcda->unixdev, CDIOCEJECT, NULL)) return MCIERR_HARDWARE;
- 	wcda->mciMode = MCI_MODE_OPEN;
-     } else {
--	if (ioctl(wcda->unixdev, CDIOCCLOSE)) return MCIERR_HARDWARE;
-+	if (ioctl(wcda->unixdev, CDIOCCLOSE, NULL)) return MCIERR_HARDWARE;
- 	wcda->mciMode = MCI_MODE_STOP;
-     }
--    if (ioctl(wcda->unixdev, CDIOCPREVENT)) return MCIERR_HARDWARE;
-+    if (ioctl(wcda->unixdev, CDIOCPREVENT, NULL)) return MCIERR_HARDWARE;
- #elif linux
-     if (open) {
- 	if (ioctl(wcda->unixdev, CDROMEJECT)) return MCIERR_HARDWARE;
-@@ -1032,7 +1026,7 @@
-  */
- static DWORD CDAUDIO_mciSet(UINT16 wDevID, DWORD dwFlags, LPMCI_SET_PARMS lpParms)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     WINE_CDAUDIO*	wcda = CDAUDIO_mciGetOpenDrv(wDevID);
-     
-     TRACE(cdaudio,"(%04X, %08lX, %p);\n", wDevID, dwFlags, lpParms);
-@@ -1087,7 +1081,7 @@
- LONG MCICDAUDIO_DriverProc32(DWORD dwDevID, HDRVR16 hDriv, DWORD wMsg, 
- 			  DWORD dwParam1, DWORD dwParam2)
- {
--#if defined(linux) || defined(__FreeBSD__)
-+#if defined(linux) || defined(__FreeBSD__) || defined(__NetBSD__)
-     switch(wMsg) {
-     case DRV_LOAD:		return 1;
-     case DRV_FREE:		return 1;
+*** windows/win.c-ORIG	Sun Mar 14 12:25:33 1999
+--- windows/win.c	Thu Mar 18 01:50:30 1999
+***************
+*** 18,24 ****
+  #include "sysmetrics.h"
+  #include "cursoricon.h"
+  #include "hook.h"
+! #include "menu.h"
+  #include "message.h"
+  #include "nonclient.h"
+  #include "queue.h"
+--- 18,24 ----
+  #include "sysmetrics.h"
+  #include "cursoricon.h"
+  #include "hook.h"
+! #include "winemenu.h"
+  #include "message.h"
+  #include "nonclient.h"
+  #include "queue.h"

>Audit-Trail:
>Unformatted: