Analysis of OSS

This section explains the tools and tips for effective analysis of Linux OSS.

Installing Linux packages in Linux

  • Get the latest stable release of OSS from the Internet. Usually OSS come a in compressed format like .tar, .gz, or bz2.

  • Run the configure script using the following command: ./configure. It will look for dependency and creates makefiles.

  • Compile the code using make tool.

  • Copy the files to the target path using the command make install.

Directory analysis

OSS creates the following three subdirectories in the installation directory: include, lib, and bin. These directories contain valuable information required for porting, as explained below:

  • include – This directory contains the user include files that need to be exported to the proper export directory in Symbian platform.

  • lib – This directory gives an idea of the size of the library. It contains libraries built as a result of OSS compilation. Each of these requires an individual MMP file.

    Note: Symbian platform compilers produce much smaller-sized libraries than what there are in Linux.

    Linux

    Symbian platform

    .SO extension for dynamic libraries

    .DLL extension for dynamic libraries

    .A extension for static libraries

    .LIB extension for static libraries

  • bin – This directory contains the executable built during the compilation of OSS.

  • man – This directory contains the man pages of OSS.

Tips and tools

Tools like nm, ldd, and dumpbin are useful in OSS porting:

  • ldd – A Linux tool that can be used to find the dependency library list and overall size of the library, obtained by adding the size of all the dependent libraries. In many cases, to build library 'X' another library 'Y' is needed.

  • nm – Another Linux tool that prints the symbol table in alphabetical order from one or more object files.

  • dumpbin – A Windows-based tool that can be used if Windows port is available for OSS. It gets the list of exported symbols.

The following command can be used to install the software in the user directory:

 ./configure --prefix=$HOME/<foo>

The following commands can be used to decompress the file:

tar -xvjf archivefile.tar.bz2 
tar -zxvf archivefile.tar.bz2

At the end of installing the OSS in Linux, it is good to update the environment variables PKG_CONFIG_PATH and LD_LIBRARY_PATH. One of the many ways to initialize environment variables is to add them in the .bash_rc file.

Makefile gives subtle information about the project. SOURCES in Makefile gives an idea about the source files of the OSS. These files have to be listed in SOURCE in the MMP file.

-D<Foo> in Makefile gives the list of preprocessor declarations. These preprocessor declarations can be done using MACRO in the MMP file.