Programming

From Tuxwiki

Table of contents

General

I18N

Python

Perl

Java

XML

C/C++

Software Configuration Management

Profiling tools

pkg-config

pkg-config is used in conjunction with the GNU autotools to make putting together all necessary flags when compiling and linking an application much easier.

autotools

n .libs/liblog4cxx.a
../libtool: line 5465: n: command not found

This issue occurs when the RANLIB variable is set to a strange value in an autotools libtool script. Replace

RANLIB="n"

with

RANLIB="ranlib"

libtool

  • Linker option to set a SONAME when creating a shared library:
 -Wl,-soname,libfoo.so.0
  • Option for libtool to create a SONAME:

Running gdb

libtool --mode=execute gdb programScript

How to copy files from the source tree to the build tree

# If build directory and source directory are different, then
# copy the necessary files
all-local:
        @if test "${top_srcdir}" -ne "${top_builddir}"; then \
                echo "cp ${srcdir}/*.properties ."; \
        fi;

This was necessary for a test suite, but on the other hand, the automake manual says:

Support for test suites
Automake supports a two forms of test suite. 
 If the variable TESTS is defined, its value is taken to be a list of programs to run in order to 
 do the testing. The programs can either be derived objects or source objects; the generated rule 
 will look both in srcdir and `.'. Programs needing data files should look for them in srcdir
 (which is both an environment variable and a make variable) so they work when building in a
 separate directory.

Shared libraries

GDB

Some hints on GDB usage