File: compiling.txt

package info (click to toggle)
libtpl 1.5-2
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 4,284 kB
  • ctags: 748
  • sloc: sh: 10,059; ansic: 5,644; perl: 1,062; makefile: 119; cpp: 32
file content (38 lines) | stat: -rwxr-xr-x 1,173 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Compiling libtpl.a and libtpl.so
--------------------------------

********************************************************************************
Normally in the top-level directory you simply run:

    ./configure
    make
    make install

The rest of the document is not needed if you use this method.
********************************************************************************


Manual compilation of static and shared library on a GNU Linux system:
----------------------------------------------------------------------

First cd into the "src" directory.

Static library
~~~~~~~~~~~~~~
You can build the static library `libtpl.a` using these commands:

    cc -c tpl.c
    ar rc libtpl.a tpl.o
    ranlib libtpl.a

Dynamic library
~~~~~~~~~~~~~~
You can build the dynamic library `libtpl.so` using these commands:

    cc -fpic -c tpl.c
    cc -shared -o libtpl.so tpl.o

Keep in mind that you need to set the `LD_LIBRARY_PATH` environment variable
to include the directory where `libtpl.so` is installed in order for your
program to run. Alternatively you can put `libtpl.so` in a standard place like
`/usr/lib` and regenerate `ld.so.cache` using `ldconfig`.