如何在64bit linux系统上安装32bit wine方法 ?Building 32-bit Wine on a 64-bit (x86-64) system
If you just want to
If you want to run 64-bit Windows programs, see
If you want to build Wine on a 32-bit system, see
目录
Ubuntu
You will need to create a 32-bit chroot. For more information on chroot and Ubuntu, see
First, install the dchroot and debootstrap packages and create /var/chroot:
sudo apt-get install dchroot debootstrap sudo mkdir /var/chroot
Add the following to /etc/schroot/schroot.conf, replacing your_username and the Ubuntu version accordingly:
[precise] description=Ubuntu Precise directory=/var/chroot users=your_username groups=sbuild root-groups=root
Create a working installation of Ubuntu inside the chroot. Replace “precise” with your Ubuntu version and
sudo debootstrap --variant=buildd --arch i386 precise /var/chroot/ http://ubuntu.cs.utah.edu/ubuntu/
Make apt-get work from within the chroot:
sudo cp /etc/apt/sources.list /var/chroot/etc/apt/
Enter the chroot:
sudo chroot /var/chroot
Once inside the chroot, install the build dependencies:
apt-get update apt-get build-dep wine
Download the Wine source tree into your chroot:
apt-get install git git clone git://source.winehq.org/git/wine
Compile:
cd wine ./configure make
To be able to use Wine from outside the chroot, Wine’s dependencies must be installed outside the chroot. The easiest way is to exit the chroot and install a prepackaged copy of Wine:
exit sudo apt-get install wine
After all this you can run a Windows program from outside the chroot using your new build. For example:
/var/chroot/wine/wine notepad
Debian Testing
- apt-get the following packages:
- ia32-libs (you need version 1.18 at least)
- libc6-dev-i386
- lib32z1-dev
- ia32-libs-dev (it has the /usr/lib32/libpng.so, which seems to be required when installing TTF fonts)
- optionally, a bunch of other libraries: libxcursor-dev libfontconfig1-dev libldap2-dev libxslt-dev libgl1-mesa-dev libglu1-xorg-dev libgnutls-dev libxi-dev lib32ncurses5-dev libxrandr-dev libxxf86vm-dev
- Make symlinks (see below, in the Debian SID section, for the full list of symlinks):
cd /usr/lib32 ln -s libdbus-1.so.3 libdbus-1.so
This is required as of 2008/05/20 to prevent Wine warning that HAL cannot be found. See
- Download the wine source and assuming gcc and all needed development packages are installed (see
Recommended Packages) you can compile wine using (you shouldn’t need –prefix=… or –x-libraries=… with the latest Debian Unstable AMD64): ./configure make make install
- If the configure command fails with “configure: error: C compiler cannot create executables” and you use gcc-4.1, install “gcc-4.1-multilib” to solve it.
- Run wine by executing /emul/ia32-linux/usr/bin/wine (you can add the directory to the path or make a script). If wine complains that it can’t find libwine.so.1 make sure /emul/ia32-linux/usr/lib is part of the LD_LIBRARY_PATH or run ldconfig -v.
Debian Unstable (Sid)
The build dependencies in the released Wine have most of what you need:
sudo apt-get build-dep wine
On Debian you may need to add some more, or run the build-dep command after adding the
To get Direct X working with nvidia, install the 32-bit drivers:
sudo apt-get install nvidia-glx-ia32
To add pulseaudio support, install the package lib32asound2-plugins:
sudo aptitude install lib32asound2-plugins
Run configure with:
CC="gcc-4.4 -m32" LDFLAGS="-m32 -L/lib32 -L/usr/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,/usr/lib32" ./configure -v
It’s likely that you will get some missing library warnings. To fix this, you need to hunt down the 32-bit development files for each missing library. It is not crucial to get rid of all the missing library warnings, but you should try to minimize them.
For example,
configure: libv4l 32-bit development files not found.
is fixed by:
sudo aptitude install lib32v4l-dev
If all needed libraries are present there will be no missing-library warnings or errors anywhere. If you find that this process misses a library, then it means we are either missing a link or the ia32-libs package is missing the 32-bit version of the library. In either case, contact the Ubuntu package maintainer,
We explicitly set CC=”gcc-4.4 -m32″, as the 32-bit libraries are no longer provided for gcc-4.2 or earlier. Newer version of gcc also work. Update version of gcc as needed. Also, the LDFLAGS explicitly set 32-bit mode.
Now build and install with:
make sudo make install
Troubleshooting
If you have problems with libjpeg, there is a
You need to remove the version 0.62 and create a symbolic link to the version 0.8, probably both are installed into /usr/lib, in my case (i’m using debian amd64) are installed in /usr/lib32, i just type: $ ls | grep libjpeg, i’ve located the both libjpeg, deleted the 62 typing: # rm -f ./libjpeg.so.62 ./libjpeg.so.62.0.0 and create the two symlinks from version 0.8 typing: # ln -s ./libjpeg.so.8 ./libjpeg.so.62 and # ln -s ./libjpeg.so.8 ./libjpeg.so.62.0.0 and just compiled the wine again and problem solved, to assure that is the correct version of libjpeg just type: ./configure | grep jpeg before the make.
I found that ./configure still gave me a libjpeg error, but programs that used libjpeg worked well.
Gentoo
NOTE: This will compile wine
- Emerge wine and wine should install fine, if on the other hand you want to compile wine by hand follow the steps below.
- Install the x86 compatibility libraries (emul-linux-x86-xlibs, emul-linux-x86-soundlibs, ..)
- Download the wine source and assuming gcc and all needed development packages are installed (see
Recommended Packages) you can compile wine using: configure –prefix=/emul/linux/x86/usr –x-libraries=/emul/linux/x86/usr/lib/X11 (in case of xorg 7.0, else */usr/X11R6/lib), make depend && make, make install - Run wine by executing /emul/linux/usr/bin/wine (you can also make a symlink /usr/bin/wine -> /emul/linux/usr/bin/wine and the same for wineserver, then you can just type wine). If wine complains that it can’t find libwine.so.1 make sure /emul/linux/usr/lib is part of the LD_LIBRARY_PATH or run ldconfig -v.
If nothing seems to work try using ebuild to compile it once and copy the source from /var/tmp/portage/wine-9999/work/wine somewhere. Ebuild /usr/portage/app-emulation/wine/wine-9999.ebuild fetch unpack compile. To update CVS add clean to the beginning.
openSUSE
Make sure you have the following 32 bit development packages installed
- capi4linux-32bit
- cups-libs-32bit
- fontconfig-devel-32bit
- freeglut-devel-32bit
- freetype2-devel-32bit
- gcc-32bit
- giflib-devel-32bit
- glibc-devel-32bit
- hal-32bit
- libjpeg-devel-32bit
- liblcms-devel-32bit
- libpng-devel-32bit
- libxml2-devel-32bit
- libxslt-devel-32bit
- Mesa-devel-32bit
- ncurses-devel-32bit
- openldap2-devel-32bit
- openssl-devel-32bit
- sane-32bit
- unixODBC-devel-32bit
- xorg-x11-devel-32bit
- xorg-x11-libICE-32bit
- xorg-x11-libICE-devel-32bit
- xorg-x11-libSM-devel-32bit
- xorg-x11-libX11-devel-32bit
- xorg-x11-libXext-32bit
- xorg-x11-libXext-devel-32bit
- xorg-x11-libXp-32bit
- xorg-x11-libXrender-devel-32bit
- xorg-x11-libXt-32bit
- zlib-devel-32bit Additional for SuSE 11.x:
- libasound2-32bit
- libcom_err-devel-32bit
- libgnutls26-32bit
- libgphoto2-32bit
- libopenssl0_9_8-32bit
For
cd /usr/lib sudo ln -s libasound.so.2.0.0 libasound.so sudo ln -s libfreetype.so.6 libfreetype.so sudo ln -s libgphoto2.so.2.4.0 libgphoto2.so sudo ln -s libcups.so.2 libcups.so sudo ln -s libssl.so.0.9.8 libssl.so sudo ln -s libcrypto.so.0.9.8 libcrypto.so sudo ln -s libhal.so.1.0.0 libhal.so sudo ln -s libgphoto2_port.so.0.8.0 libgphoto2_port.so sudo ln -s libgnutls.so.26 libgnutls.so sudo ln -s libgstreamer-0.10.so.0.29.0 libgstreamer-0.10.so sudo ln -s libgstapp-0.10.so.0.24.0 libgstapp-0.10.so sudo ln -s libgstbase-0.10.so.0.29.0 libgstbase-0.10.so cd /lib sudo ln -s libdbus-1.so.3.4.0 libdbus-1.so sudo ln -s libkeyutils.so.1 /usr/lib/libkeyutils.so sudo ln -s libgobject-2.0.so.0.2800.0 /usr/lib/libgobject-2.0.so sudo ln -s libgmodule-2.0.so.0.2800.0 /usr/lib/libgmodule-2.0.so sudo ln -s libgthread-2.0.so.0.2800.0 /usr/lib/libgthread-2.0.so sudo ln -s libglib-2.0.so.0.2800.0 /usr/lib/libglib-2.0.so
Note: the targets of the above symlinks may need to be adjusted depending on what versions of the libraries you have installed on your system.
Run configure with:
./configure --x-libraries=/usr/X11R6/lib
The –x-libraries switch is important, otherwise it will pick up the 64bit X libraries and just not work.
Fedora 16
Install the development packages needed to compile Wine as follows:
yum install alsa-lib-devel.i686 alsa-lib-devel audiofile-devel.i686 audiofile-devel cups-devel.i686 cups-devel dbus-devel.i686 dbus-devel fontconfig-devel.i686 fontconfig-devel freetype.i686 freetype-devel.i686 freetype-devel giflib-devel.i686 giflib-devel lcms-devel.i686 lcms-devel libICE-devel.i686 libICE-devel libjpeg-turbo-devel.i686 libjpeg-turbo-devel libpng-devel.i686 libpng-devel libSM-devel.i686 libSM-devel libusb-devel.i686 libusb-devel libX11-devel.i686 libX11-devel libXau-devel.i686 libXau-devel libXcomposite-devel.i686 libXcomposite-devel libXcursor-devel.i686 libXcursor-devel libXext-devel.i686 libXext-devel libXi-devel.i686 libXi-devel libXinerama-devel.i686 libXinerama-devel libxml2-devel.i686 libxml2-devel libXrandr-devel.i686 libXrandr-devel libXrender-devel.i686 libXrender-devel libxslt-devel.i686 libxslt-devel libXt-devel.i686 libXt-devel libXv-devel.i686 libXv-devel libXxf86vm-devel.i686 libXxf86vm-devel mesa-libGL-devel.i686 mesa-libGL-devel mesa-libGLU-devel.i686 mesa-libGLU-devel ncurses-devel.i686 ncurses-devel openldap-devel.i686 openldap-devel openssl-devel.i686 openssl-devel zlib-devel.i686 pkgconfig sane-backends-devel.i686 sane-backends-devel xorg-x11-proto-devel glibc-devel.i686 prelink fontforge flex bison libstdc++-devel.i686 pulseaudio-libs-devel.i686 gnutls-devel.i686 libgphoto2-devel.i686 openal-soft-devel openal-soft-devel.i686 isdn4k-utils-devel.i686 gsm-devel.i686 samba-winbind libv4l-devel.i686 cups-devel.i686 libtiff-devel.i686 gstreamer-devel.i686 gstreamer-plugins-base-devel.i686 gettext-devel.i686 libmpg123-devel.i686
Run the configure script, compile Wine, and install it as follows:
./configure make && make install
Fedora 17
Install the development packages needed to compile Wine as follows:
yum install alsa-lib-devel.i686 alsa-lib-devel audiofile-devel.i686 audiofile-devel cups-devel.i686 cups-devel dbus-devel.i686 dbus-devel fontconfig-devel.i686 fontconfig-devel freetype.i686 freetype-devel.i686 freetype-devel giflib-devel.i686 giflib-devel lcms-devel.i686 lcms-devel libICE-devel.i686 libICE-devel libjpeg-turbo-devel.i686 libjpeg-turbo-devel libpng-devel.i686 libpng-devel libSM-devel.i686 libSM-devel libusb-devel.i686 libusb-devel libX11-devel.i686 libX11-devel libXau-devel.i686 libXau-devel libXcomposite-devel.i686 libXcomposite-devel libXcursor-devel.i686 libXcursor-devel libXext-devel.i686 libXext-devel libXi-devel.i686 libXi-devel libXinerama-devel.i686 libXinerama-devel libxml2-devel.i686 libxml2-devel libXrandr-devel.i686 libXrandr-devel libXrender-devel.i686 libXrender-devel libxslt-devel.i686 libxslt-devel libXt-devel.i686 libXt-devel libXv-devel.i686 libXv-devel libXxf86vm-devel.i686 libXxf86vm-devel mesa-libGL-devel.i686 mesa-libGL-devel mesa-libGLU-devel.i686 mesa-libGLU-devel ncurses-devel.i686 ncurses-devel openldap-devel.i686 openldap-devel openssl-devel.i686 openssl-devel zlib-devel.i686 pkgconfig sane-backends-devel.i686 sane-backends-devel xorg-x11-proto-devel glibc-devel.i686 prelink fontforge flex bison libstdc++-devel.i686 pulseaudio-libs-devel.i686 gnutls-devel.i686 libgphoto2-devel.i686 openal-soft-devel openal-soft-devel.i686 isdn4k-utils-devel.i686 gsm-devel.i686 samba-winbind libv4l-devel.i686 cups-devel.i686 libtiff-devel.i686 gstreamer-devel.i686 gstreamer-plugins-base-devel.i686 gettext-devel.i686 libmpg123-devel.i686
Run the configure script, compile Wine, and install it as follows:
./configure make && make install
CentOS 5
Here is a
yum groupinstall "Development Tools" yum install alsa-lib-devel audiofile-devel cups-devel dbus-devel fontconfig-devel freetype-devel giflib-devel hal-devel lcms-devel libICE-devel libjpeg-devel libpng-devel libSM-devel libusb-devel libX11-devel libXau-devel libXcomposite-devel libXcursor-devel libXext-devel libXi-devel libXinerama-devel llibxml2-devel libXrandr-devel libXrender-devel libxslt-devel libXt-devel libXv-devel libXxf86vm-devel mesa-libGL-devel mesa-libGLU-devel ncurses-devel openldap-devel openssl-devel pkgconfig sane-backends-devel xorg-x11-proto-devel glibc-devel prelink fontforge flex bison gnutls-devel pulseaudio-libs-devel gcc.i386 gcc-c++.i386 autoconf.i386 automake.i386 binutils.i386 ccache.i386 elf*.i386 libtool.i386 lua.i386 make.i386 pkgconfig.i386 patchutils.i386 tolua++.i386 bzip2-devel.i386 glibc-devel.i386 zlib-devel.i386 libX*.i386 libX*-devel.i386 mesa*-devel.i386 gphoto2-devel isdn4k-utils-devel XFree86-devel bison flex gcc prelink pkgconfig libstdc++-devel.i386 yum groupinstall "X Window System"
You can get the
Contents: gnutls-2.8.6.tar.bz2, flex-2.5.35.tar.bz2, libtiff-3.5.5-2.i386.rpm , libtool-ltdl-1.5.22-7.el5_4.i386.rpm, mpg123-1.3.1-1.el5.rf.i386.rpm, openal-0.0.9-0.9.20060204cvs.el5.kb.i386.rpm, openal-0.0.9-0.9.20060204cvs.el5.kb.x86_64.rpm, libtool-ltdl-1.5.22-7.el5_4.x86_64.rpm, mpg123-1.9.1-1.el5.rf.x86_64.rpm, and wine-1.2.2.tar.bz2
EL6 (RHEL6 and SL6)
Required packages for proper building of 32-bit Wine on 64-bit EL6
yum install alsa-lib-devel.i686 libsndfile-devel.i686 readline-devel.i686 glib2.i686 glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 pulseaudio-libs-devel.i686 cmake portaudio-devel.i686 openal-soft-devel.i686 audiofile-devel.i686 freeglut-devel.i686 lcms-devel.i686 libieee1284-devel.i686 openldap-devel.i686 unixODBC-devel.i686 sane-backends-devel.i686 fontforge libgphoto2-devel.i686 isdn4k-utils-devel.i686 mesa-libGL-devel.i686 mesa-libGLU-devel.i686 libXxf86dga-devel.i686 libXxf86vm-devel.i686 giflib-devel.i686 cups-devel.i686 gsm-devel.i686 libv4l-devel.i686 fontpackages-devel ImageMagick-devel.i686 openal-soft-devel.i686 libX11-devel.i686 docbook-utils-pdf libtextcat tex-cm-lgc
Trying to rebuild the epel 6 wine srpms (wine-1.2.3-1.el6.src.rpm) in 32-bit mode, I had to do the following manual changes to the spec files:
- portaudio.spec: add an “export CC=’gcc -m32 -march=i686′” in an %ifarch %{ix86}
- wine.spec: add an “export CC=’gcc -m32 -march=i686′” in an %ifarch %{ix86}, and remove ‘TARGETFLAGS=”" %{?_smp_mflags}’ after %{make}
The resulting packages (src and binary) are available here
Then, I could build the rpms in this order:
rpmbuild -ba --sign --target i686 portaudio.spec rpmbuild -ba --sign --target i686 openal-soft.spec rpmbuild -ba --sign --target i686 nss-mdns.spec rpmbuild -ba --sign --target i686 wine.spec rpmbuild -ba --sign wine-docs.spec
- We should probably also have a page called
UsingWineOn64bit for users (as opposed to developers).
WineOn64bit (2012-07-30 18:42:20由KyleAuble编辑)