当前位置:首页 > Liunx教程 >

wine32和wine64共存编译安装方法

发布时间:2021-06-13 17:27:59 作者:佚名 阅读:(58)

今天在搭建下载服务器,需要在上面运行aapt.exe的apk工具,这个时候我们需要借助wine来完成执行,接下来吾爱编程为大家详细的介绍一下Centos中wine32和wine64共存编译安装方法,有需要的小伙伴可以参考一下:

wine32和wine64共存编译安装方法

1、wine是什么?

Wine (“Wine Is Not an Emulator” 的首字母缩写)是一个能够在多种 POSIX-compliant 操作系统(诸如 Linux,macOS 及 BSD 等)上运行 Windows 应用的兼容层。Wine 不是像虚拟机或者模拟器一样模仿内部的 Windows 逻辑,而是將 Windows API 调用翻译成为动态的 POSIX 调用,免除了性能和其他一些行为的内存占用,让你能够干净地集合 Windows 应用到你的桌面。

2、安装依赖包:

yum groupinstall 'Development Tools'
yum install libX11-devel freetype-devel zlib-devel libxcb-devel
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 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 libX11-devel.i686 docbook-utils-pdf libtextcat tex-cm-lgc
yum install 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 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

3、下载并解压wine:

mkdir wine
cd wine
wget http://dl.winehq.org/wine/source/1.8/wine-1.8.4.tar.bz2
tar -xf wine-1.8.4.tar.bz2

wine32和wine64共存编译安装方法

4、安装:

mkdir -p /root/wine/wine64
cd /root/wine/wine64
../wine-1.8.4/configure --enable-win64
make -j 8 (-j 8根据cpu数量填写,也可以不填写)
cd ..
mkdir wine32
cd wine32
../wine-1.8.4/configure --enable-win32
make -j 8
make install
cd ../wine64
make install

5、PHP调用测试:

$appName='itbiancheng.apk';
$dir = "/data/down";
$nowdir = dirname(__FILE__)."/";
$fileurls = $dir . "/az/".$appName ;
$filesize = filesize ( $fileurls );
$sh = $nowdir.$appName.".sh";
$infourls = $nowdir.$appName .".txt";
$message = "#!/bin/bash" . "\n" . "cd $nowdir" . "\n" . "/usr/local/bin/wine aapt.exe dump badging \"$fileurls\" Manifest.xml >$infourls";
$handle = fopen ( $sh, 'w' );
fwrite ($handle,$message );
fclose ($handle);
chmod ($sh,0777 );
exec($sh);

我们这里测试是使用wine工具执行aapt.exe工具,然后获取apk的包信息

6、查看CPU方法扩展:

    (1)、lscpu

    (2)、cat /proc/cpuinfo

两种方式都可以查看到cpu的信息

wine32和wine64共存编译安装方法

以上就是吾爱编程为大家介绍的Centos安装Wine的全部内容了,希望对大家有所帮助,了解更多相关文章请关注吾爱编程网!

欢迎分享转载→ wine32和wine64共存编译安装方法

© 2015-2021 - 吾爱编程网 版权所有 苏ICP备18033726号-1关于我们 - 网站声明 - 联系我们