The following are for installing FreeBASIC in Ubuntu, Debian, Fedora, Puppy and Slax distributions, and their derivatives.
There are also instructions for x86-64 architecture (AMD64, Intel64, whatever). They have a "64-bit" suffix. You don't need to read the instructions for x86 if there is a section for the 64-bit machine, i.e. read only Ubuntu 64-bit not Ubuntu unless there's no Ubuntu 64-bit in a section. Currently, Ubuntu is the only distro with instructions for 64-bit in this howto. Be aware that when compiling with a library (i.e. GTK+), you still need the 32-bit ones, that can be installed with getlibs.
When it says "tested", it doesn't mean everything is tested, only compiling a command line and gfxlib "Hello World!" program is compiled and tested to work.
Make sure to read the notes!
Before anything else:
Open a terminal in your distribution then type the following commands. Press enter after each command. Don't type the "#"!
Add your username to sudoers if you're not a sudoer:
Code: Select all
# su
# echo 'username ALL=(ALL) ALL' >> /etc/sudoers
# exit
You might need to provide the superuser/root (su) password after typing the first command.
Debian and Fedora do not add the first user to the sudoers file. Ubuntu adds the first user by default. Puppy and Slax do not use sudo (you're always logged in as root), so remove any "sudo" from commands in installing FreeBASIC below.
If you're not using Puppy or Slax, or you prefer su than sudo, you may change to su then execute the commands with sudo removed.
Download FreeBASIC:
If packages are not available for your distribution, or you don't want packages created for your distribution, you need to download the official tarballs of FreeBASIC. Slax have modules available in my website (check it out in the Slax section). Puppy Linux packages are also available. A Fedora 13/14 repository is also available in my website.
Download FreeBASIC-X.X.X-linux.tar.gz or FreeBASIC-X.X.X-linux-standalone.tar.gz (the one with the latest version) using your web browser:
http://www.sourceforge.net/projects/fbc ... 0-%20Linux
Direct links (i.e. for downloading with wget):
http://nchc.dl.sourceforge.net/project/ ... x.tar.lzma
http://nchc.dl.sourceforge.net/project/ ... e.tar.lzma
Note: It seems that FreeBASIC 0.21.x had been linked with a newer libc which means some distros cannot use the packages from sourceforge.net. Affected are Debian, older Ubuntu, Slax and older versions of other distros. Here's an installer for Debian which might be used on other distros, a prefix compiler linked against libc 2.7 (no standalone yet):
http://wargaleon.users.sourceforge.net/ ... n.tar.lzma
Note: This is not well tested. Tested on Debian GNU/Linux 5.0.6 and Slax 6.1.2 by Galeon.
Note for symlinks for libbfd: Creating a symlink to an older or newer libbfd is dangerous and might cause compiling problems. I suggest that you do it, then recompile the FreeBASIC compiler, install the new one then recompile it again.
Install required packages and fixes:
Ubuntu/Debian:
For Debian-derivatives: Ubuntu Linux, Kubuntu Linux, Xubuntu Linux, Lubuntu Linux, Debian GNU/Linux, Linux Mint, etc.
It might be possible that other distributions (i.e. Fedora with apt-get) could use these.
Tested in Ubuntu Linux 10.04.1, Ubuntu Linux 10.10, Debian GNU/Linux Lenny 5.0.6 and Linux Mint 9 Isadora by Galeon.
Update packages (optional):
Code: Select all
# sudo apt-get update
# sudo apt-get upgrade
Code: Select all
# sudo apt-get install gcc g++ libncurses5-dev libx11-dev libxext-dev libxpm-dev libxrandr-dev libxrender-dev
Ubuntu/Debian 64-bit:
For 64-bit Debian-derivatives: Ubuntu Linux, Kubuntu Linux, Xubuntu Linux, Lubuntu Linux, Debian GNU/Linux, Linux Mint, etc.
It might be possible that other distributions (i.e. Fedora with apt-get) could use these.
Tested in Ubuntu Linux 10.10 AMD64 by Galeon and Debian GNU/Linux Squeeze 6.0.1a AMD64 by jvd.
Update packages (optional):
Code: Select all
# sudo apt-get update
# sudo apt-get upgrade
Code: Select all
# sudo apt-get install libc6-i386 lib32ncurses5-dev gcc-multilib g++-multilib lib32mudflap0
Download and install getlibs:
Code: Select all
# wget http://frozenfox.freehostia.com/cappy/getlibs-all.deb
# sudo dpkg -i getlibs-all.deb
Code: Select all
# getlibs -p libx11-dev libxext-dev libxpm-dev libxrandr-dev libxrender-dev
Code: Select all
# sudo getlibs -p binutils
# sudo ln -s /usr/lib32/libbfd-2.20.1-system.20100303.so /usr/lib32/libbfd.so
# sudo ln -s /usr/lib32/libbfd.so /usr/lib32/libbfd-2.18.0.20080103.so
Fedora:
For Fedora Linux, its spins and derivatives.
Tested in Fedora 14 (chroot only) and Fedora 13 by Galeon.
Note: When running fbc, it may show a warning about ospeed. You may just ignore it, it is caused by the compiler being compiled in a Debian-based system.
Update packages (optional):
Code: Select all
# sudo yum upgrade
Please read this: http://wargaleon.users.sourceforge.net/ ... ies/fedora. It is complete and compiled in Fedora, so you don't need to do the next steps if you decide to use this instead. Packages are available for FreeBASIC, FreeBASIC Manual and FBHelp.
Install required packages:
Code: Select all
# sudo yum install gcc libstdc++-devel ncurses-devel libX11-devel libXext-devel libXpm-devel libXrandr-devel libXrender-devel
Code: Select all
# sudo yum install libstdc++-static
Puppy:
For Puppy Linux and puplets.
Tested in Puppy Linux 5.1.1 by Galeon.
Install "dev" module:
The dev module is required by prefix versions of FreeBASIC: http://www.puppylinux.com/development/compileapps.htm
Install "FreeBASIC" package:
I created modules for use in Puppy Linux: http://wargaleon.users.sourceforge.net/ ... uppy-linux. It is complete and compiled in Puppy Linux, so you don't need to do the next steps if you decide to use this instead. Packages are available for FreeBASIC, FreeBASIC Manual and FBHelp.
Create man directory:
Standalone:
Code: Select all
# mkdir /usr/share/man/man1
Code: Select all
# mkdir PREFIX/man/man1
Note: This is needed because FreeBASIC installs a man page but Puppy doesn't use those. FreeBASIC installer will not install without this. You may remove this file afterwards if you want.
If you don't like the above approach, you may just comment out the line in install.sh that installs the manpage:
Code: Select all
gzip -c docs/fbc.1 > /usr/share/man/man1/fbc.1.gz && \
Code: Select all
#gzip -c docs/fbc.1 > /usr/share/man/man1/fbc.1.gz && \#
Slax:
For Slax Linux.
Tested on Slax Linux 6.1.2 by Galeon.
Installing "Slax Devel" module:
Slax Devel module is installed by default. If you have a customized Slax, the author (or you) might have removed it to conserve space. Type gcc in the terminal then press enter; if it showed "-bash: l: command not found", it means you don't have the devel module installed. In that case, follow these instructions: http://www.slax.org/documentation_use_modules.php.
Install "FreeBASIC" module:
I created modules for use in Slax: http://wargaleon.users.sourceforge.net/ ... ories/slax. It is complete and compiled in Slax, so you don't need to do the next steps if you decide to use this instead. Packages are available for FreeBASIC, FreeBASIC Manual, FBHelp and gEdit.
Create a symbolic link to the newer version of libbfd:
Slax comes with a newer libbfd than Debian which is used to compile the compiler I provided. In that case, you need to create a symbolic link to it:
Code: Select all
# ln -s /usr/lib/libbfd.so /usr/lib/libbfd-2.18.0.20080103.so
Installing FreeBASIC:
Extract and Install FreeBASIC:
Code: Select all
# cd ~/Downloads
# tar -xvf FreeBASIC-X.X.X-linux.tar.lzma
# cd FreeBASIC-X.X.X-linux
# sudo ./install.sh -i
Replace "X.X.X" with version of FreeBASIC, i.e. "0.21.1".
Note: You don't need to use the first command if you're already in the directory where FreeBASIC's installation tarball (FreeBASIC-X.X.X-linux.tar.lzma) is downloaded. Commonly, Mozilla Firefox in Ubuntu and Fedora save downloaded files to ~/Downloads, Ice-Weasel in Debian to ~/Desktop/Downloads and Midori in Puppy save downloaded files to ~. ~ is shortcut to home.
Note: If your tar doesn't support lzma compression, use this instead:
Code: Select all
# lzma -cd FreeBASIC-X.X.X-linux.tar.lzma | tar -xv
Cleanup Install (optional):
Code: Select all
# cd ..
# rm -rf FreeBASIC-X.X.X-linux
# exit
Replace "X.X.X" with version of FreeBASIC, i.e. "0.21.1".
Note: If you want to add a distribution, reply to the thread and I will add it to the first post.