I have finally figured out a way to use BlitzMax in the 64 bit version Ubuntu so that every thing works (so far). The only down side is that you may have to sacrifice 1.5GB (oops got it wrong read on) of hard drive space to do it (I could be wrong as the chroot's home folder is linked to /home).
EDIT: You only have to sacrifice a few hundred megs (if that), thats the chroot directories and the 32bit software thats needed to compile for 32bit apps (synaptic,gcc,g++, 32bit libs and a few others). I originally thought it installed almost a full distro ( checked the size of chroot folder and was 1.5GB ). As it turns out the /chroot/home folder is system linked to /home and I had a bit of stuff there.
The solution is simple in theory but a little tricky to set up as we have to create a “second minimal” install of Ubuntu as a chroot ( here's the description http://en.wikipedia.org/wiki/Chroot ).
What I list here can be found here http://ubuntuforums.org/showthread.php?t=24575 by Crad
NOTE DISCLAIMER: I WILL NOT BE HELD RESPONSIBLE IF.....
1) YOU SCREW UP YOUR SYSTEM.
2) THE WORLD COMES TO AN END.
3) YOU CAN'T GET IT TO WORK, BECAUSE I DID GET IT TO WORK.
Step 1:
Open a command terminal. Note replace hardy with the code name of the Ubuntu distribution (keep this terminal open it saves time).
sudo apt-get install dchroot debootstrap
sudo mkdir /chroot/
sudo gedit /etc/dchroot.conf
Add this line to dchroot.conf:
hardy /chroot
sudo debootstrap --arch i386 hardy /chroot/ http://archive.ubuntu.com/ubuntu
sudo chroot /chroot/
dpkg-reconfigure locales
Step 2:
In another terminal window (or by existing chroot):
sudo gedit /chroot/etc/apt/sources.list
Add the following 2 lines to sources.list:
deb http://archive.ubuntu.com/ubuntu hardy main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
(We do this step because gedit has yet to be installed in the chroot environment)
Step 3:
In your chrooted environment (chroot /chroot):
apt-get update
apt-get upgrade
Step 4:
In another terminal window (or by existing chroot):
sudo cp /etc/passwd /chroot/etc/
sudo cp /etc/shadow /chroot/etc/
sudo cp /etc/group /chroot/etc/
sudo cp /etc/sudoers /chroot/etc/
sudo cp /etc/hosts /chroot/etc/
sudo gedit /etc/fstab
Add the following 6 lines to fstab:
/home /chroot/home none bind 0 0
/tmp /chroot/tmp none bind 0 0
/dev /chroot/dev none bind 0 0
/proc /chroot/proc proc defaults 0 0
/media/cdrom0 /chroot/media/cdrom0 none bind 0 0 ( this can be omitted as it can cause problems mounting and unmounting cd/dvd media)
/usr/share/fonts /chroot/usr/share/fonts none bind 0 0
(you may get a complaint about this not mounting so you will have to do mkdir /chroot/usr/share/fonts before running sudo mount -a)
sudo mkdir /chroot/media/cdrom0
sudo mount -a
sudo gedit /usr/local/bin/do_dchroot
Add the 2 following to do_dchroot:
#!/bin/sh
/usr/bin/dchroot -d "`echo $0 | sed 's|^.*/||'` $*"
sudo chmod 755 /usr/local/bin/do_dchroot
Step 5:
In a new terminal:
dchroot -d
sudo apt-get install synaptic
sudo ln -s /usr/sbin/synaptic /usr/sbin/synaptic32
exit
sudo ln -s /usr/local/bin/do_dchroot /usr/local/bin/synaptic32
sudo synaptic32
Now we need to install the libs and the GCC compiler.
In synaptic32 (type it in a command terminal) find and mark these for installation or try apt-get install in the chroot environment.
UPDATE: If you want to use Ubuntu 8.10 (intrepid) then you will have to manual install g++-3.3/gcc-3.3 from the hardy section in the ubuntu archives. For more on this follow this thread.
http://www.blitzbasic.com/Community/posts.php?topic=81247
g++-3.3
gcc-3.3 ..... (NOTE the gcc-doc package will throw errors so just remove it)
libglu1-mesa-dev
x11proto-core-dev
x11proto-gl-dev
x11proto-kb-dev
libxxf86vm-dev
libasound2-dev
libidn11-dev
And if you want to use gtk applications using Brucey's GTK mod
libglib2.0-dev
libgtk2.0-dev
Now we have to make a couple of system links so the 32bit version of GCC can be found
sudo ln -s /usr/local/bin/do_dchroot /usr/local/bin/g++-3.3
sudo ln -s /usr/local/bin/do_dchroot /usr/local/bin/gcc-3.3
As alway make sure you have 3D Accelarted drivers installed and desktop effects turned off (only for some graphics cards).
And don't forget when you update the 64bit version update the minimal install too.
With any luck BRL may build BlitzMax against the GCC 4.2 suit so all we have to do then is install the mulit-libs package as the chroot method is over kill. (It's how they got 32bit applications to build and work in the early days of 64bit linux)
EDIT: You only have to sacrifice a few hundred megs (if that), thats the chroot directories and the 32bit software thats needed to compile for 32bit apps (synaptic,gcc,g++, 32bit libs and a few others). I originally thought it installed almost a full distro ( checked the size of chroot folder and was 1.5GB ). As it turns out the /chroot/home folder is system linked to /home and I had a bit of stuff there.
The solution is simple in theory but a little tricky to set up as we have to create a “second minimal” install of Ubuntu as a chroot ( here's the description http://en.wikipedia.org/wiki/Chroot ).
What I list here can be found here http://ubuntuforums.org/showthread.php?t=24575 by Crad
NOTE DISCLAIMER: I WILL NOT BE HELD RESPONSIBLE IF.....
1) YOU SCREW UP YOUR SYSTEM.
2) THE WORLD COMES TO AN END.
3) YOU CAN'T GET IT TO WORK, BECAUSE I DID GET IT TO WORK.
Step 1:
Open a command terminal. Note replace hardy with the code name of the Ubuntu distribution (keep this terminal open it saves time).
sudo apt-get install dchroot debootstrap
sudo mkdir /chroot/
sudo gedit /etc/dchroot.conf
Add this line to dchroot.conf:
hardy /chroot
sudo debootstrap --arch i386 hardy /chroot/ http://archive.ubuntu.com/ubuntu
sudo chroot /chroot/
dpkg-reconfigure locales
Step 2:
In another terminal window (or by existing chroot):
sudo gedit /chroot/etc/apt/sources.list
Add the following 2 lines to sources.list:
deb http://archive.ubuntu.com/ubuntu hardy main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu hardy-security main restricted universe multiverse
(We do this step because gedit has yet to be installed in the chroot environment)
Step 3:
In your chrooted environment (chroot /chroot):
apt-get update
apt-get upgrade
Step 4:
In another terminal window (or by existing chroot):
sudo cp /etc/passwd /chroot/etc/
sudo cp /etc/shadow /chroot/etc/
sudo cp /etc/group /chroot/etc/
sudo cp /etc/sudoers /chroot/etc/
sudo cp /etc/hosts /chroot/etc/
sudo gedit /etc/fstab
Add the following 6 lines to fstab:
/home /chroot/home none bind 0 0
/tmp /chroot/tmp none bind 0 0
/dev /chroot/dev none bind 0 0
/proc /chroot/proc proc defaults 0 0
/media/cdrom0 /chroot/media/cdrom0 none bind 0 0 ( this can be omitted as it can cause problems mounting and unmounting cd/dvd media)
/usr/share/fonts /chroot/usr/share/fonts none bind 0 0
(you may get a complaint about this not mounting so you will have to do mkdir /chroot/usr/share/fonts before running sudo mount -a)
sudo mkdir /chroot/media/cdrom0
sudo mount -a
sudo gedit /usr/local/bin/do_dchroot
Add the 2 following to do_dchroot:
#!/bin/sh
/usr/bin/dchroot -d "`echo $0 | sed 's|^.*/||'` $*"
sudo chmod 755 /usr/local/bin/do_dchroot
Step 5:
In a new terminal:
dchroot -d
sudo apt-get install synaptic
sudo ln -s /usr/sbin/synaptic /usr/sbin/synaptic32
exit
sudo ln -s /usr/local/bin/do_dchroot /usr/local/bin/synaptic32
sudo synaptic32
Now we need to install the libs and the GCC compiler.
In synaptic32 (type it in a command terminal) find and mark these for installation or try apt-get install in the chroot environment.
UPDATE: If you want to use Ubuntu 8.10 (intrepid) then you will have to manual install g++-3.3/gcc-3.3 from the hardy section in the ubuntu archives. For more on this follow this thread.
http://www.blitzbasic.com/Community/posts.php?topic=81247
g++-3.3
gcc-3.3 ..... (NOTE the gcc-doc package will throw errors so just remove it)
libglu1-mesa-dev
x11proto-core-dev
x11proto-gl-dev
x11proto-kb-dev
libxxf86vm-dev
libasound2-dev
libidn11-dev
And if you want to use gtk applications using Brucey's GTK mod
libglib2.0-dev
libgtk2.0-dev
Now we have to make a couple of system links so the 32bit version of GCC can be found
sudo ln -s /usr/local/bin/do_dchroot /usr/local/bin/g++-3.3
sudo ln -s /usr/local/bin/do_dchroot /usr/local/bin/gcc-3.3
As alway make sure you have 3D Accelarted drivers installed and desktop effects turned off (only for some graphics cards).
And don't forget when you update the 64bit version update the minimal install too.
With any luck BRL may build BlitzMax against the GCC 4.2 suit so all we have to do then is install the mulit-libs package as the chroot method is over kill. (It's how they got 32bit applications to build and work in the early days of 64bit linux)