Next: Using avatarsay, Previous: Overview, Up: Top
Although there are binary packages available, you should install AKFAvatar from the source code package to use the software to its full capacity.
This chapter describes the installation for posix compatible operating systems, mainly for GNU/Linux systems. There are some hints for other systems at the end of this chapter.
For short: ‘./configure && make && make install’
Of course SDL needs a graphical environment to run in. For example the X-Window-System or a Linux framebuffer-device...
This is also needed on systems, which don't use the kernel Linux, but not on Windows. On Debian or derived distributions, you must have the package “ncurses-term” installed.
Without SDL_image you can only use uncompressed BMP images. SDL_image can be installed after the installation of this package.
Run ‘./configure’. If that succeeds run ‘make’ to create the binaries. There are two variants of avatarsay being compiled: 1. “avatarsay” has been statically linked with the avatar library. You can use this to test and play around with it before you install it. 2. “avatarsay-d” is dynamically linked and will only work, when the library is installed. This is the variant that gets installed.
On some systems you need the use the parameter --with-iconv with
.configure to get full iconv support (iconv is a charset-encoding
converter). This parameter is not needed, when SDL is already configured to
use an external iconv. But in some cases it is not, although an external
iconv is available (because maybe there is more than one implementation).
This software (AKFAvatar) does an educated guess to get the internal encoding
for wchar_t right. In some cases it might not work. You might then
provide that information with this option, like this
‘--with-iconv=UCS-4LE’. On many systems you can get a list with the
command iconv -l. If “WCHAR_T” or “wchar_t” is on the list,
use that.
If you know that SDL_image is always installed, then you can provide the parameter --enable-link-sdl-image to directly link to it, instead of loading it at runtime.
To support old versions of SDL on a target machine, it might be necessary to use the parameter --with-oldsdl. Note that this is not needed if you just want to run the program on the same machine on which you compile it.
If you want to use it on devices with a small display, use the
parameter --enable-size=vga or --enable-size=qvga with
configure. The value vga means a size of 640*480 pixels, while
qvga is for very small displays with 320*240 pixels. The size
qvga doesn't look good, it is just barely readable and supports less
characters.
The program avatarsay is a text reader and a simple scripting language. Try to view this text with that program: ‘./avatarsay INSTALL’.
You can stop avatarsay any time with the <Esc> key. On some systems you can toggle between window and fullscreen mode using the key <F11>. Another useful key is the <Pause> key.
There are some example scripts in the package. Try to run ‘./fsdemo-en’ or whatever language you prefer. Open fsdemo-en in a text-editor to see how to write such scripts...
You can also use it as a fancy manpage reader. Try ‘avtman man’...
Dynamically linked programs normally need the libraries to be installed on the system. The script lrun can be used to start programs, when the library is not yet installed. It searches the libraries also in the script's directory and in the current directory. Use it like this: ‘./lrun example’ finds the library in the current directory. Or from the Pascal subdirectory ‘../lrun multiply’ will find the library in the parent directory.
On GNU/Linux systems first make sure /usr/local/lib is mentioned in
the file /etc/ld.so.conf; either directly or indirectly. Also make
sure that /usr/local/bin is in your PATH evironment variable.
Now get root privileges and run ‘make install’ to install it in /usr/local. If you are low on disk space, you can instead use ‘make install-strip’. This installs binaries stripped from debugging information.
If you want to uninstall it later, you can use the command ‘make uninstall’.
With the command ‘make example’ you can compile the program example.c. The file example.c is an example, which you can use to start your own programs. The program gets dynamically linked, that means it needs the installed library. If you want to test it without the library being installed, use the script lrun (see above).
Solution: first try to add /usr/local/lib or wherever you
installed it to the environment variable LD_LIBRARY_PATH:
‘export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib’.
As a more permanent solution make sure /usr/local/lib is directly or indirectly included in the file /etc/ld.so.conf. Then run the command ldconfig with root privileges.
Solution: There are different character sets. Try to use the parameters --utf-8 or --latin1.
AKFAvatar is known to be compilable with FreeBSD 6.2. To get iconv support,
install libiconv and use ‘./configure --with-iconv’.
Windows is just partly supported. I provide binaries which are build with a crosscompiler. I haven't compiled them directly under Windows yet, so you're on your own here. I'm sorry.
For systems like these SDL supports a fallback implementation for iconv. The charset Windows-1252 (often called “ANSI” but it has nothing to do with ANSI) is not fully supported. That charset is partly compatible to the ISO-8859-1 standard, which is supported. Some characters are missing then. If you need these characters, save your text as UTF-8, which is also supported.