I have applications which successfully compile with the -m32 switch (in DMD and/or GCC) to produce:
我有使用-m32开关(在DMD和/或GCC中)成功编译的应用程序,以生成:
appname: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked
(uses shared libs), for GNU/Linux 2.6.15, not stripped
The source packages I have created work fine, on both 32 bit and 64 bit Ubuntu to build the appropriate binary .debs.
我创建的源包工作正常,在32位和64位Ubuntu上构建适当的二进制.debs。
I would like to produce the i386 .deb on the same 64 bit machine i use to produce the 64 bit .deb.
我想在我用来生成64位.deb的同一台64位机器上生成i386 .deb。
Is this possible, and where should I look for instructions?
这可能吗,我应该在哪里寻找指示?
3 个解决方案
#1
18
The answer depends on the complexity of your build. When the normal 64 bit userland tools suffice for a build, simply specify the architecture via -a
答案取决于构建的复杂性。当普通的64位用户空间工具足以进行构建时,只需通过-a指定体系结构即可
debuild -ai386
However, there are often cases where this doesn't work, and in these cases you'll need pbuilder. pbuilder builds a clean Debian/Ubuntu system in a chroot-ed environment. man pbuilder
is a good introduction. To get started, you'll need:
但是,通常情况下这不起作用,在这些情况下你需要pbuilder。 pbuilder在chroot-ed环境中构建一个干净的Debian / Ubuntu系统。 man pbuilder是一个很好的介绍。要开始使用,您需要:
sudo pbuilder --create --architecture i386
sudo pbuilder --build mypackage.dsc
#2
3
It starts with calling debuild with the -ai386 option, which will change the architecture that the package is built for.
它首先使用-ai386选项调用debuild,这将改变为其构建包的体系结构。
Of course you have to ensure that the package contains the i386 build of the application.
当然,您必须确保包中包含应用程序的i386版本。
#3
-2
You don't do anything thing different from building a 64bit .deb. Except that you include a 32bit build of your application.
你不做任何与构建64位.deb不同的事情。除非您包含32位构建的应用程序。
The control file specifies the architecture, so be sure you select the correct one.
控制文件指定体系结构,因此请确保选择正确的体系结构。
#1
18
The answer depends on the complexity of your build. When the normal 64 bit userland tools suffice for a build, simply specify the architecture via -a
答案取决于构建的复杂性。当普通的64位用户空间工具足以进行构建时,只需通过-a指定体系结构即可
debuild -ai386
However, there are often cases where this doesn't work, and in these cases you'll need pbuilder. pbuilder builds a clean Debian/Ubuntu system in a chroot-ed environment. man pbuilder
is a good introduction. To get started, you'll need:
但是,通常情况下这不起作用,在这些情况下你需要pbuilder。 pbuilder在chroot-ed环境中构建一个干净的Debian / Ubuntu系统。 man pbuilder是一个很好的介绍。要开始使用,您需要:
sudo pbuilder --create --architecture i386
sudo pbuilder --build mypackage.dsc
#2
3
It starts with calling debuild with the -ai386 option, which will change the architecture that the package is built for.
它首先使用-ai386选项调用debuild,这将改变为其构建包的体系结构。
Of course you have to ensure that the package contains the i386 build of the application.
当然,您必须确保包中包含应用程序的i386版本。
#3
-2
You don't do anything thing different from building a 64bit .deb. Except that you include a 32bit build of your application.
你不做任何与构建64位.deb不同的事情。除非您包含32位构建的应用程序。
The control file specifies the architecture, so be sure you select the correct one.
控制文件指定体系结构,因此请确保选择正确的体系结构。