要在64位机器上构建32位的wine,您可以使用LXC(Linux容器),它是一个操作系统级别的虚拟化环境,用于运行多个隔离的Linux系统。这是目前最简单的解决方案,因为Linux(如Ubuntu或Debian)很难构建32位的wine,因为64位系统没有完整的32位开发库(参见:
Install the 64-bit prerequisites:
sudo apt-get update
sudo apt-get build-dep wine
Build 64-bit wine:
mkdir $HOME/wine64
cd $HOME/wine64
../wine-git/configure --enable-win64
make -j4
Install lxc:
sudo apt-get install lxc
Create a 32-bit container named "my32bitbox" using the Ubuntu
template and bind your home directory to the /home directory in the
container:
sudo lxc-create -t ubuntu -n my32bitbox -- --bindhome $LOGNAME -a i386
Copy the apt configuration from the host to the lxc container:
sudo cp -R /etc/apt /var/lib/lxc/my32bitbox/rootfs/etc
Start the container; at the console login prompt it gives you, log
in with your username and password.
sudo lxc-start -n my32bitbox
Now you're inside the container, in your real home directory. If you
are not in the container (you do not have the prompt
username@my32bitbox), then open a new terminal and:
sudo lxc-attach -n my32bitbox
login yourusername+password
Now, you are in the container. Do an out-of-tree build of Wine as
normal, just to get the tools. You'll have to install all the needed
prerequisites first. For instance:
sudo apt-get update
sudo apt-get install python-software-properties git-core
sudo apt-get build-dep wine
mkdir $HOME/wine32-tools
cd $HOME/wine32-tools
~/wine-git/configure
make -j4
Still inside the container, do it again, this time pointing to the
64-bit build for data, and the 32-bit tools build for tools:
mkdir $HOME/wine32
cd $HOME/wine32
~/wine-git/configure --with-wine64=$HOME/wine64 --with-wine-tools=$HOME/wine32-tools
make -j4
Still inside the container, install the 32-bit wine to force the
last little bit of building:
cd $HOME/wine32
sudo make install
While still inside the container, shut it down:
sudo shutdown -h now
This drops you back out into your real machine. Next, you need to
remove all existing Wine packages. You can do this from the command
line but it's probably easier with aptitude or one of the GUI
package management tools. You will need wine-mono, wine-gecko, and
optionally winetricks for your compiled version of wine. However,
these packages may depend on the existing wine installation which
may force you to remove them.
Install the newly built wine into your real machine:
cd $HOME/wine32
sudo make install
cd $HOME/wine64
sudo make install
Warning: When you install a locally built version of Wine, the
package management system will not know it exists since it did not
come from a package. Thus it is possible to later break its
dependencies or install a conflicting version of wine without a
warning from the package management tools. You can prevent this by
creating a package or by blocking conflicting packages with
apt-pinning by setting "Pin-Priority: -1" for the packages.
- Next, install Mono, Gecko, and optionally winetricks if you had to
remove their packages because of a dependency on a conflicting wine
package.