How to install sdl and aditional libraries from scratch?

I have ubuntu and I would like to install sdl, mixer, ttf, gfx from
source code, in a same directory like when I install it from synaptic,
Because when I write a program just put in the header:
#include "SDL/sdl.h
first what packages have to download, and how to compile it to make a
good instalation? If I want to desinstalling how to make it?
Thank you in advance

download the SDL package (or get the mercurial version)
navigate using the terminal to the directory you have SDL’s source code
do this:
./configure
(if that doesn’t work, you’ll need to do ./autoconf …I can’t recall if SDL
uses that or not)
then:
make; sudo make install

It will take a while for ‘make’ to finish the first time (about 5-10
minutes, depending how fast your computer is), then it should be installed
in the default directories.

Take care,
-AlexOn Fri, Nov 26, 2010 at 11:01 PM, juan hernandez wrote:

I have ubuntu and I would like to install sdl, mixer, ttf, gfx from
source code, in a same directory like when I install it from synaptic,
Because when I write a program just put in the header:
#include "SDL/sdl.h
first what packages have to download, and how to compile it to make a
good instalation? If I want to desinstalling how to make it?
Thank you in advance


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

If you want it installed in the standard system directories, then you need to
specify the --prefix=/usr option to the configure script. Assuming you need
no other special options, this is what you would need to do download, build
and install SDL

hg clone http://hg.libsdl.org/SDL
cd SDL
./autogen.sh
./configure --prefix="/usr"
make
make install

To uninstall , just run

make uninstall

and all of the files will be removed. SDL_image mixer net ttf should be
similar. That is use “hg clone http://hg.libsdl.org/SDL_image” and “hg clone
http://hg.libsdl.org/SDL_mixer” etc to get the files and then change to the
appropriate directory. Except SDL_gfx. I haven’t used that yet.

Personally I have SDL 1.3 installed in a different directory, though. That
way I can have the OS supplied SDL 1.2 as the default one, and SDL 1.3
available for development. Then I write #include “SDL.h” in my code and use
the sdl-config script to automatically provide the correct compiler options so
the compiler knows where to find the headers and libraries I want

For example if I install SDL with “./configure --prefix=/home/eris/sdl” and I
then write the following program in a file named sdlversion.c:

#include "SDL.h"
int main() {
SDL_version compiled;
SDL_VERSION(&compiled);
printf(“SDL version is %d.%d.%d\n”,
compiled.major, compiled.minor, compiled.patch);
return 0;
}

I can compile the program with
gcc -o sdlversion sdlversion.c ~/sdl/bin/sdl-config --cflags ~/sdl/bin/sdl- config --libs

If I later want to try it with the regular system provided SDL I can recompile
with very little change
gcc -o sdlversion sdlversion.c sdl-config --cflags sdl-config --libs

If you want to see how I installed SDL on my systems, look here:
http://eldalin.com/?p=176

ErisOn Friday 26 November 2010, juan hernandez wrote:

I have ubuntu and I would like to install sdl, mixer, ttf, gfx from
source code, in a same directory like when I install it from synaptic,
Because when I write a program just put in the header:
#include "SDL/sdl.h
first what packages have to download, and how to compile it to make a
good instalation? If I want to desinstalling how to make it?
Thank you in advance

thank you 4 the reply. I noticed in ubuntu there are 2 reposities
sdl-runtime enviroment and sdl-sdk for development. But if I download
from web, only there is one archive to compile, It is ok?On 11/26/10, eris-sdl at eldalin.com wrote:

On Friday 26 November 2010, juan hernandez wrote:

I have ubuntu and I would like to install sdl, mixer, ttf, gfx from
source code, in a same directory like when I install it from synaptic,
Because when I write a program just put in the header:
#include "SDL/sdl.h
first what packages have to download, and how to compile it to make a
good instalation? If I want to desinstalling how to make it?
Thank you in advance

If you want it installed in the standard system directories, then you need
to
specify the --prefix=/usr option to the configure script. Assuming you need
no other special options, this is what you would need to do download, build
and install SDL

hg clone http://hg.libsdl.org/SDL
cd SDL
./autogen.sh
./configure --prefix="/usr"
make
make install

To uninstall , just run

make uninstall

and all of the files will be removed. SDL_image mixer net ttf should be
similar. That is use “hg clone http://hg.libsdl.org/SDL_image” and “hg
clone
http://hg.libsdl.org/SDL_mixer” etc to get the files and then change to the
appropriate directory. Except SDL_gfx. I haven’t used that yet.

Personally I have SDL 1.3 installed in a different directory, though. That
way I can have the OS supplied SDL 1.2 as the default one, and SDL 1.3
available for development. Then I write #include “SDL.h” in my code and
use
the sdl-config script to automatically provide the correct compiler options
so
the compiler knows where to find the headers and libraries I want

For example if I install SDL with “./configure --prefix=/home/eris/sdl” and
I
then write the following program in a file named sdlversion.c:

#include "SDL.h"
int main() {
SDL_version compiled;
SDL_VERSION(&compiled);
printf(“SDL version is %d.%d.%d\n”,
compiled.major, compiled.minor, compiled.patch);
return 0;
}

I can compile the program with
gcc -o sdlversion sdlversion.c ~/sdl/bin/sdl-config --cflags
~/sdl/bin/sdl- config --libs

If I later want to try it with the regular system provided SDL I can
recompile
with very little change
gcc -o sdlversion sdlversion.c sdl-config --cflags sdl-config --libs

If you want to see how I installed SDL on my systems, look here:
http://eldalin.com/?p=176

Eris


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Yes, it’s OK. The source code archive you download from the libsdl website
has everything combined together.

ErisOn Tuesday 30 November 2010, juan hernandez wrote:

thank you 4 the reply. I noticed in ubuntu there are 2 reposities
sdl-runtime enviroment and sdl-sdk for development. But if I download
from web, only there is one archive to compile, It is ok?

ok thank youOn 11/30/10, Eris Caffee wrote:

On Tuesday 30 November 2010, juan hernandez wrote:

thank you 4 the reply. I noticed in ubuntu there are 2 reposities
sdl-runtime enviroment and sdl-sdk for development. But if I download
from web, only there is one archive to compile, It is ok?

Yes, it’s OK. The source code archive you download from the libsdl website
has everything combined together.

Eris


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org