⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch63.htm

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTM
📖 第 1 页 / 共 3 页
字号:


<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->










<font face="Arial,Helvetica" size="-1" color="#006666">

<b>Linux</b></font><p>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">











 

















<H1></H1>







<UL>



	<LI><A HREF="#Heading1">- 63 -</A>



	<UL>



		<LI><A HREF="#Heading2">Wine</A>



		<UL>



			<LI><A HREF="#Heading3">The Current Status of Wine</A>



			<UL>



				<LI><A HREF="#Heading4">FIGURE 63.1.</A>



			</UL>



			<LI><A HREF="#Heading5">Setting Up Wine</A>



			<UL>



				<LI><A HREF="#Heading6">System Requirements</A>



			</UL>



			<LI><A HREF="#Heading7">TIP</A>



			<UL>



				<LI><A HREF="#Heading8">Where to Get the Wine Distribution</A>



				<LI><A HREF="#Heading9">How to Install Wine</A>



				<LI><A HREF="#Heading10">How to Configure Wine Before Building</A>



				<LI><A HREF="#Heading11">How to Build Wine</A>



			</UL>



			<LI><A HREF="#Heading12">Using Wine</A>



			<UL>



				<LI><A HREF="#Heading13">Specifying Configuration Parameters</A>



				<LI><A HREF="#Heading14">Using Command-Line Options</A>



				<LI><A HREF="#Heading15">The Wine Debugger</A>



			</UL>



			<LI><A HREF="#Heading16">How Wine Works</A>



			<UL>



				<LI><A HREF="#Heading17">How Wine Loads Programs</A>



				<LI><A HREF="#Heading18">The Wine Library</A>



				<UL>



					<LI><A HREF="#Heading19">FIGURE 63.2.</A>



					<LI><A HREF="#Heading20">FIGURE 63.3.</A>



				</UL>



			</UL>



			<LI><A HREF="#Heading21">Where Does Wine End and MS-Windows Begin?</A>



			<LI><A HREF="#Heading22">The Limitations of Wine</A>



			<UL>



				<LI><A HREF="#Heading23">Software That Works</A>



				<LI><A HREF="#Heading24">Using winestat to Analyze Windows Programs</A>



			</UL>



			<LI><A HREF="#Heading25">TIP</A>



			<UL>



				<LI><A HREF="#Heading26">One Major Piece That Is Missing from Wine</A>



				<LI><A HREF="#Heading27">Software Unlikely to Ever Work</A>



			</UL>



			<LI><A HREF="#Heading28">The History of Wine</A>



		</UL>



	</UL>



</UL>







<P>



<HR SIZE="4">







<H2 ALIGN="CENTER"><A NAME="Heading1<FONT COLOR="#000077">- 63 -</FONT></H2>



<H2 ALIGN="CENTER"><A NAME="Heading2<FONT COLOR="#000077">Wine</FONT></H2>



<P><I>by Robert Pfister</I></P>



<P>IN THIS CHAPTER</P>







<UL>



	<LI>The Current Status of Wine



	<P>



	<LI>Setting Up Wine



	<P>



	<LI>Using Wine



	<P>



	<LI>How Wine Works



	<P>



	<LI>Where Does Wine End and MS-Windows Begin?



	<P>



	<LI>The Limitations of Wine



	<P>



	<LI>The History of Wine



</UL>







<P><BR>



Wine stands for Windows Emulator. It enables MS-Windows programs to run under a UNIX



X Window environment. Like DOSemu, Wine takes direct advantage of the Intel 386 architecture



to actually run the MS-Windows application. Wine simply translates any MS-Windows



API calls into appropriate UNIX and X Window calls. Like OS/2, MS-Windows programs



running under Wine get to take advantage of features of the underlying operating



system. Wine is simply another user-mode Linux process that is protected from corruption



by other processes. This is dubbed crash-protection under OS/2. Because Linux uses



preemptive multitasking, Wine processes can coexist with other processes without



some of the problems experienced by applications running under native MS-Windows.



<H3 ALIGN="CENTER"><A NAME="Heading3<FONT COLOR="#000077">The Current Status



of Wine</FONT></H3>



<P>As with most of the Linux community, developers of Wine are volunteers. Wine is



currently Alpha or pre-release code. Only a few of the simplest MS-Windows applications



run without incident. My favorite MS-Windows Entertainment Pack game, Pipe Dream



by Lucas Arts, runs acceptably under Wine, as shown in Figure 63.1.<BR>



<FONT COLOR="#000077"><BR>



</FONT><A HREF="../art/63/60lnx01.jpg"><FONT COLOR="#000077">FIGURE 63.1.</FONT></A><FONT



COLOR="#000077"> </FONT><I>Pipe Dream running under Wine. </I><BR>



<BR>



Although Pipe Dream and other simple games are certainly playable under Wine, everything



is not perfect. Some speed degradation is noticeable, as is the occasional screen



glitch.</P>



<P>Sun Soft has implemented a similar product, called WABI, for its UNIX-based workstations.



WABI has been on the market for over a year and supports some of the more complex



MS-Windows applications such as Microsoft Excel and Lotus Smart Suite. Given enough



development time, it is reasonable to expect that Wine will be capable of running



general MS-Windows applications as well.



<H3 ALIGN="CENTER"><A NAME="Heading5<FONT COLOR="#000077">Setting Up Wine</FONT></H3>



<P>Wine is available only as source code. If you have the prerequisite software and



a little patience, setting up Wine is not very difficult--even if you are not a programmer.



<H4 ALIGN="CENTER"><A NAME="Heading6<FONT COLOR="#000077">System Requirements</FONT></H4>



<P>Any Linux machine suitable for running X Window will run Wine applications at



a reasonable speed. In theory, Wine should have some advantages running under Linux,



as opposed to under MS-Windows, which is confined to the MS-DOS environment. Experiences



with current versions of Wine show that an application running under Wine is slower



on the same machine running MS-DOS and MS-Windows.</P>



<P>To make full use of Wine, you need MS-Windows 3.1 installed on a disk partition



that is accessible under Linux. It is also convenient to run existing MS-Windows



applications from the same directory in which they are installed under native MS-DOS



and MS-Windows. The typical Linux user also has MS-DOS and MS-Windows installed on



a hard drive; thus it is only a matter of making the directories available under



Linux. Linux kernels as of version 1.1.83 do not support compressed MS-DOS file systems



made by MS-DOS utilities such as <TT>stacker</TT> and <TT>drvspace</TT>.







<DL>



	<DT></DT>



</DL>











<DL>



	<DD>



<HR>



<A NAME="Heading7<FONT COLOR="#000077"><B>TIP:</B> </FONT>Some Linux installation



	programs will prompt you through setting up an MS-DOS partition as a Linux subdirectory.



	If you did not set up such a partition, add the line



</DL>











<DL>



	<DD><FONT COLOR="#0066FF">/dev/hda1 /c MSDOS defaults</FONT>



</DL>







<PRE></PRE>











<BLOCKQUOTE>



	<P>to your <TT>/etc/fstab</TT>, where <TT>hda1</TT> is the partition that contains



	MS-DOS and <TT>/c</TT> is the Linux subdirectory to use. In this example it is assumed



	that the <TT>/c</TT> subdirectory exists. Otherwise, use <TT>mkdir</TT> to create



	the subdirectory. 



<HR>











</BLOCKQUOTE>







<P>Wine is distributed as source code, and must be compiled before use. It requires



approximately 10MB of disk space. 3.5MB of that disk space is the source code alone.



To build Wine, you need to have the following:







<UL>



	<LI>GCC



	<P>



	<LI>LibC



	<P>



	<LI>XFree with development parts loaded



	<P>



	<LI>Linux kernel newer than 99.13



</UL>







<H4 ALIGN="CENTER"><A NAME="Heading8<FONT COLOR="#000077">Where to Get the



Wine Distribution</FONT></H4>



<P>A new version of Wine is released about once a week. Major Linux FTP sites on



the Internet contain the most recent release. On <TT>sunsite.unc.edu</TT>, look in



the <TT>/pub/Linux/ALPHA/Wine</TT> directory. Wine releases are named after the date



they are released. <TT>Wine-950727</TT>.tar.gz was released on 7/27/95. The most



current release is the one with the latest date. For more information, check out



the Web page at <TT>http://daedalus.dra.hmg.gb/gale/wine/wine.html</TT>.



<H4 ALIGN="CENTER"><A NAME="Heading9<FONT COLOR="#000077">How to Install Wine</FONT></H4>



<P>Unlike DOSemu, the Wine distribution is not sensitive to where it is installed.



For brevity, make a symbolic link from the actual directory (say <TT>/usr/src/Wine950122</TT>)



to <TT>/usr/wine</TT> using the <TT>ln</TT> command, as follows:</P>



<PRE><FONT COLOR="#0066FF">bash# ln -s /usr/src/Wine950122 /usr/wine



</FONT></PRE>



<P>A Wine distribution consists of a compressed <TT>tar</TT> file. To unpack the



distribution, use a shell command such as</P>



<PRE><FONT COLOR="#0066FF">bash# tar -zxvf filename.tar.gz



</FONT></PRE>



<H4 ALIGN="CENTER"><A NAME="Heading10<FONT COLOR="#000077">How to Configure



Wine Before Building</FONT></H4>



<P>Wine must be configured before being built. The <TT>configure</TT> utility prompts



the user for the necessary information and automatically builds the appropriate configuration



files. There are three major steps to configuring Wine:







<DL>



	<DD><B>1. </B>Compilation configuration<BR>



	<B><BR>



	2. </B>Run-time parameters<BR>



	<B><BR>



	3.</B> Automatic system specific configuration



</DL>







<P>The configure script begins with the following questions:</P>



<PRE><FONT COLOR="#0066FF">Build Wine as emulator or library (E/L) [E]?



Short filenames (Y/N) [N]?



Use the XPM library (Y/N) [N]?



Language [En/De/No] ?



Global configfile name  /usr/local/etc/wine.conf



</FONT></PRE>



<P>It is safe to press Enter and accept the default answers. These parameters are



added to a global configuration file, <TT>autoconf.h</TT>. If parameter changes are



necessary, re-run <TT>configure</TT>. To avoid errors, do not attempt to edit this



file. Initially Configuring Runtime Parameters with configure The questions in this



section relate to lines in the global configuration file <TT>/usr/local/etc/wine.conf</TT>.



Following each question is an explanation of its meaning.</P>



<PRE><FONT COLOR="#0066FF">Which directory do you want to use as A:



Which directory do you want to use as C:



</FONT></PRE>



<P>Answer these questions with the Linux directory where the MS-DOS A: and C: drives



are mounted. If your disk partition on which MS-Windows is mounted is <TT>/c</TT>,



then use <TT>/c</TT>. If you do not plan on using a floppy disk, do not worry if



A: does not point to a valid directory.</P>



<PRE><FONT COLOR="#0066FF">Where is the Windows directory `c:\windows\'



Where is the System directory `c:\windows\system'



Where should Windows apps store temp files `c:\windows\temp'



Which path should be used to find progs/DLL's `c:\windows;c:\windows\system'



</FONT></PRE>



<P>These directories should match where MS-Windows is installed on your MS-DOS partition.



Because the default MS-Windows installation is in <TT>c:\windows</TT>, the default



answers are usually sufficient.</P>



<PRE><FONT COLOR="#0066FF">Where is sysres.dll  /usr/wine/sysres.dll'



</FONT></PRE>



<P>The <TT>sysres.dll</TT> is a DLL that contains Wine-specific resources. These



resources include bitmaps and dialog boxes for things like the About Wine menu item.



The default value is sufficient here as well.</P>



<PRE><FONT COLOR="#0066FF">Where is COM1&quot; CF_Com1 `/dev/cua0'



Where is COM2&quot; CF_Com2 `/dev/cua1'



Where is LPT1&quot; CF_Lpt1 `/dev/lp0'



</FONT></PRE>



<P>As with DOSemu, the communication and printer ports under Wine can be configured



as any similar port under Linux. For simplicity, it is best to map the COM and LPT



ports to the same ones that would appear under native MS-DOS.</P>



<PRE><FONT COLOR="#0066FF">Log messages to which file (CON = stdout) `CON'



</FONT></PRE>



<P>This defines where the system messages generated by Wine will go. Sending messages



to <TT>CON</TT> will send them to <TT>stdout</TT>. This is the most useful place,



as these messages can easily be redirected elsewhere. By default, Wine generates



a lot of informational messages, which slows things down a bit. A casual user will



likely want to redirect these messages to <TT>/dev/null</TT>. To make this be the



default action, use <TT>/dev/null</TT> for the log file.</P>



<P><TT>Configure</TT> displays a long list of message types and asks the following



question:</P>



<PRE><FONT COLOR="#0066FF">Exclude which messages from the log  `WM_SIZE;WM_TIMER'



</FONT></PRE>



<P>If you don't care about any status messages from Wine, leave this as the default.



Individual error messages can be turned on or off, as well as redirected from the



command line.</P>



<P>At this point, <TT>configure</TT> will display the global configuration file,



based on your responses to the questions. You will be asked if you want to edit the



file using your default editor:</P>



<PRE><FONT COLOR="#0066FF">Do you want to edit it using vi (Y/N) [N]?



</FONT></PRE>



<P>You can always edit this file later with your favorite text editor, so it is safe



to answer no to this question. Automatic System-Specific Configuration After the



<TT>wine.conf</TT> file has been successfully built, the <TT>configure</TT> utility



proceeds to make changes to the source tree via the <TT>xmkmf</TT>. <TT>xmkmf</TT>



is a utility that creates makefiles for X Window and creates a makefile from an imakefile,



taking into account the peculiarities of different X Window installations across



UNIX-like platforms.



<H4 ALIGN="CENTER"><A NAME="Heading11<FONT COLOR="#000077">How to Build Wine</FONT></H4>



<P>To build Wine, simply type</P>



<PRE><FONT COLOR="#0066FF">make



</FONT></PRE>



<P>You're done with the hard part of configuring Wine. However, building Wine seems



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -