How to compile in DSL


Forum: Other Help Topics
Topic: How to compile in DSL
started by: kwjake

Posted by kwjake on May 20 2005,01:52
How do I compile programs in DSL? What do I need?

Plz help!

Posted by Guest on May 20 2005,03:47
Try the gcc1.dsl extension, which contains gcc, g++, make, and the standard header files.  You may not be able to compile source packages that depend on libraries other than libm / libc standard because the header files of these other libraries are not included in DSL nor in gcc1.dsl.  You will have to retrieve these header files, place them somewhere, and use the -I (that is, "dash eye") option to append the location to where gcc/g++ will usually search.

If you are compiling something simple ("Hello, world!"), try the tcc (tiny C compiler) that comes with DSL.  But instead of doing #include <stdio.h>, you will have to do #include <tcclib.h>.  Also, you will have to inspect the header file /usr/lib/tcc/include/tcclib.h to see if all the functions you need are declared.  If not, you will have to declare the functions explicitly in your program.

For example, no math function is declared.  So if you want to use the sin() function, you should have the following line in your program:

    double sin(double x);

and then compile your program with the -lm (that is "dash ell em") option.  You can do this for any function that is not declared in tcclib.h but is known to be in the ANSI C standard libraries.

Posted by kwjake on May 20 2005,03:57
so where can I get the libm and libc at? How do I know which ones I need? I already have gcc (I think). When I try to compile somthing, I get:

Code Sample

loading cache ./config.cache
Checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
Checking for working aclocal... missing
Checking for working autoconf... missing
Checking for working automake... missing
Checking for working autoheader... missing
Checking for working makeinfo... missing

Checking host system type... Configure: error: can not gess host type; you must specify one


Thanks for the help :D  !

Posted by clacker on May 20 2005,12:18
kwjake, you're trying to compile tuxnes, right?  You need to get the gcc1.dsl, the dsl-dpkg.dsl, and gnu-utils.dsl packages.

Most programs can be compiled using the following three commands:

./configure
make
sudo make install

If the program is graphical, you will  need the X developement libraries as well.  Since tuxnes is graphical, get these libraries.  You can get them using apt-get, which is in the dsl-dpkg.dsl package also in the repository.  You set your /etc/apt/sources.list file to unstable from stable, and the run apt-get:

Code Sample
sudo su
beaver /etc/apt/sources.list
### change    deb http://ftp.us.debian.org/debian/ stable main non-free contrib
### to            deb http://ftp.us.debian.org/debian/ unstable main non-free contrib
apt-get update
apt-get install xlibs-dev
### if that failed you may need to run the next command as well
dpkg --force-overwrite -i /var/cache/apt/archive/*.deb
exit


If that worked, you're ready to try compiling again.  If it didn't, you needed to load the gnu-utils package first.  Try the command ./configure --help to get some information on the available options.   I used these options and it worked:

Code Sample
./configure --with-x --host=i386-linux-gnu
make
sudo make install

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.