質問

We have some C++ applications which are developed specifically and only for Debian stable (x86).

Currently, development of these application is also done using a Debian stable (x86) system so the developer has all the same library versions as on the target system.
Occasionally, I also need to work on these components and it keeps bugging me that I'm stuck with a very outdated version of KDevelop (4.0.1 vs. the latest 4.4.1). I'd like to use a more up-to-date system for development (like the latest Ubuntu or Debian testing) but how can I create binaries suitable for the target system?
Is there some simple way I can tell the compiler/linker to use the library versions which are available on the target platform only?
I looked at Emdebian and their cross-compiling packages but I don't think this would work for me. They seem to have only packages for targetting other architectures like ARM.

役に立ちましたか?

解決

I recommend using schroot.

$ sudo apt-get install schroot debootstrap

$ sudo debootstrap squeeze /opt/squeeze

Then in /etc/schroot/schroot.conf add and entry like this:

[squeeze]
type=directory
description=Debian squeeze
directory=/opt/squeeze
users=myusername
root-users=myusername

After that you are ready to install packages in the chroot:

$ schroot -c squeeze -u root
(squeeze)# aptitude

After you install all the packages you need, you can enter the chroot as a normal user (as long as you are listed in the schroot.conf file):

$ schroot -c squeeze

The schroot program is also useful for running newer X11 applications on older desktops, and you only need to pass the environment along as well:

$ schroot -c squeeze -p

他のヒント

A simple solution for that would be to install a stable chroot-ed Debian distribution under e.g. a testing (or an instable) Debian distribution (or even some non-Debian but Debian "compatible" thing, like Mint or Ubuntu).

You want to use the debootstrap utility (to install the chrooted distribution), and you'll need to bind-mount pseudofile systems like /proc/, /dev/, /sys/ and perhaps your /home. Then use schroot to go into your stable Debian (and compile inside it).

You can:

  1. Install Debian testing on your workstation
  2. Create a chroot jail.
  3. Install Debian stable into chroot jail
  4. Compile your project from within the jail.
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top