1

I'm running Ubuntu 11.10. I'm installing GNAT, but I want GNAT 3.40 (which came with Ubuntu 5.10), not the latest version. Is it possible to get GNAT 3.40 on an Ubuntu 11.10 machine?

I thought about this solution:

/etc/apt/preferences.d/gnat

Package: gnat
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: gcc
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: libc6
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: libc6-dev
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: libgcc1
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: libgnat
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: libgnatprj4.1
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Package: libgnatvsn4.1
Pin: release v=5.10, l=Ubuntu
Pin-Priority: 1001

Or is this impossible? Maybe these version are too old to be compatible with Ubuntu 11.10? Or the changes are too extensive?

1

Please state your arch. I'd try rebuilding the gnat source package on your current Ubuntu. Based on a quick Google, and looking at eg https://launchpad.net/ubuntu/+source/gcc-3.4/3.4.3-9ubuntu4.1 it seems like it might work, but you won't know till you try. The dsc file on that page has:

Source: gcc-3.4
Version: 3.4.3-9ubuntu4.1
Binary: gnat-3.4-doc, lib64gcc1, lib64gcj5, libstdc++6-dbg, libgcj5-awt, lib32stdc++6-0, libgcc1, gcc-3.4-doc, libg2c0, g++-3.4, libstdc++6-0-dev, fastjar, lib32gcc1, libffi3-dev, libobjc1, libstdc++6-doc, g77-3.4-doc, libstdc++6, libg2c0-dev, libstdc++6-pic, libstdc++6-dev, cpp-3.4-doc, libgcj5-dev, gcc-3.4, libgcc2, fixincludes, lib64g2c0, gnat-3.4, gcj-3.4, lib64ffi3, g77-3.4, libgcj5, libffi3, gcc-3.4-hppa64, gpc-2.1-3.4-doc, libstdc++6-0-pic, lib64objc1, libgnat-3.4, lib32stdc++6, lib64gcj5-awt, lib64stdc++6, libgcj-common, gcc-3.4-nof, libstdc++6-0, gij-3.4, gobjc-3.4, treelang-3.4, gpc-2.1-3.4, cpp-3.4, libgcj5-common, gcc-3.4-base, libstdc++6-0-dbg, lib64gnat-3.4, gcc-3.4-soft-float, protoize
Maintainer: Debian GCC maintainers <debian-gcc@lists.debian.org>
Architecture: any
Standards-Version: 3.6.1
Build-Depends: libc6.1-dev (>= 2.3.2.ds1-16) [alpha ia64] | libc0.3-dev (>= 2.3.2.ds1-16) | libc0.1-dev (>= 2.3.2.ds1-16) | libc12-dev (>= 2.3.2.ds1-16) | libc6-dev (>= 2.3.2.ds1-16), libc6-dev-sparc64 [sparc], libc6-dev-s390x [s390], amd64-libs-dev [i386], ia32-libs-dev [amd64], libunwind7-dev (>= 0.98.3-3ubuntu1) [ia64], libatomic-ops-dev [ia64], m4, autoconf2.13, autoconf, automake1.4, automake1.7, libtool, autotools-dev, gawk, dejagnu (>= 1.4.3) [!hurd-i386 !kfreebsd-gnu !knetbsd-gnu], expect (>= 5.38.0) [!hurd-i386 !kfreebsd-gnu !knetbsd-gnu], bzip2, binutils (>= 2.15-5) | binutils-multiarch (>= 2.15-5), binutils-hppa64 [hppa], debhelper (>= 4.1), gperf (>= 2.7-3), bison (>= 1:1.875a-1) | bison (<< 1:1.50), flex, gettext, texinfo (>= 4.3), zlib1g-dev, libgc-dev [!avr !kfreebsd-gnu !knetbsd-gnu], xlibs-dev, gnat-3.3 [!arm !m68k !m32r !hurd-i386 !kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu] | gnat-3.4 [!arm !m68k !m32r !hurd-i386 !kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu] | gnat [i386 powerpc sparc], libncurses5-dev [!netbsd-elf-gnu], libgmp3-dev, tetex-bin [!netbsd-elf-gnu], locales [!kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu !hurd-i386], procps [!hurd-i386 !kfreebsd-gnu !knetbsd-gnu], help2man [!netbsd-elf-gnu], sharutils, libgtk2.0-dev (>= 2.4.4-2) [!mips !mipsel !m32r !hurd-i386 !kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu], libart-2.0-dev [!mips !mipsel !m32r !hurd-i386 !kfreebsd-gnu !knetbsd-gnu !netbsd-elf-gnu], g++-3.3 [!amd64], g77-3.3 [!amd64], gobjc-3.3 [!amd64], realpath (>= 1.9.12)
Build-Depends-Indep: doxygen (>= 1.3.9.1), graphviz (>= 2.0)

You'll need to install all the build dependencies first and then debuild binary or similar. This looks intimidating, but notice that most of the dependencies are >=, which means that more recent versions should work. Note also that | means or.

If you can't install all the build dependencies, you can try removing the ones you can't get from debian/control, and building anyway. The gcc build procedure it designed to be reasonably robust, and it fails, it will tell you what it is missing. For g++-3.3, g77-3.3, gobjc-3.3 try using the current versions and hope for the best. It is also possible to strip down the build process so that it only builds what is necessary for gnat, but this is quite a lot more complicated, so I don't suggest you go there.

|improve this answer|||||
  • @MarcoW.: Did it work for you? – Faheem Mitha Apr 13 '12 at 6:18
  • Yes, it did. :) – caw Apr 13 '12 at 13:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.