-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathINSTALL
84 lines (58 loc) · 2.95 KB
/
INSTALL
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
libsmacker
http://libsmacker.sourceforge.net
Compilation and Install Notes
---
There are two ways to compile libsmacker for use in your own programs.
1. DIRECT COMPILATION
This method is preferred when you can't (or don't want to) build a system
library. Simply take the various smk_* and smacker.* files, add them to your
project, and compile them in as usual.
All external functions (those you, a user, would care about) are contained in
smacker.h - so, in your main program, just
#include "smacker.h"
and you're ready to decode smk files.
To ease the process of managing libsmacker compilation, and to keep your source
tree uncluttered, you may wish to use libsmacker as a compiled static library
instead. This allows you to redistribute it, or compile once / separately from
your project, but with the advantage that linking against it does not create a
run-time dependency. See the next section.
2. LIBRARY COMPILATION
libsmacker is distributed as a standard autotools-based package. The build
requires a GNU- or BSD-compatible "make" program. Optionally, you may need
autotools development packages installed to regenerate some distribution
files if you wish to provide your own distribution.
From the root directory, run "./configure" - this will perform some checks on
your system to find the name of your C compiler, desired compilation flags,
etc. At the end of the configure process, there will be a generated Makefile.
Simply run "make" to build your files.
Compilation via autotools results in these files - though depending on your
system, compilation output may go into a .libs/ subfolder:
* libsmacker.a
* libsmacker.so (and several versioned symlinks)
* driver
* smk2avi
The "libsmacker.a" is a static library file which can be compiled in with an
existing codebase:
cc main.c extra.c libsmacker.a
or (better)
cc main.c -lsmacker
The "libsmacker.so" is a shared object file. Compiling with this means it
needs to be distributed along with your application; this might be useful to
save space if you have multiple programs that use libsmacker.
"driver" and "smk2avi" are example programs that show how to use libsmacker.
They can also test a successful build.
3. INSTALLATION
The makefile from "configure" can be used to install the .so and corresponding
.h file to correct locations - simply run "make install". This will copy the
files to $PREFIX and make them available system-wide to other developers or
applications.
4. CONTROLLING BUILD PARAMETERS
Altering build parameters is done by different flags to "configure". The
default is to build both a static AND shared library, as well as the two demo
programs. Also by default, CFLAGS is set to "-O2 -g". To change this, for
example making a debug build, use something like:
./configure CFLAGS="-O0"
or an optimized release build:
./configure CFLAGS="-march=i686 -O2 -DNDEBUG"
Once reconfigured, running "make" will apply CFLAGS to calls to the C compiler,
passing your options on to the underlying build system.