~ubuntu-branches/ubuntu/quantal/pgbouncer/quantal-security

« back to all changes in this revision

Viewing changes to lib/mk/temos/expected/libusual1.txt

  • Committer: Package Import Robot
  • Author(s): Christoph Berg, Peter Eisentraut, Christoph Berg
  • Date: 2012-01-27 17:40:22 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20120127174022-zrp5nr3h6lwi5l1e
Tags: 1.5-1
[ Peter Eisentraut ]
* Update watch file to allow .tar.gz in addition to .tgz
* Remove obsolete README.source and repack support in watch file

[ Christoph Berg ]
* New upstream release.
* Use start-stop-daemon for stopping the daemon.  Closes: #641568.
* Use pgbouncer -R to restart in place, thanks Cody Cutrer for the patch.
  Closes: #657204.
* Update URL in README.Debian.  Closes: #655283.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
= Use libusual the simplest way =
 
3
 
 
4
 
 
5
Simplest usage would be to configure and build libusual
 
6
locally and point your projects CPPFLAGS and LDFLAGS there.
 
7
 
 
8
That way you get access to not only code but also
 
9
various autoconfigued symbols without any complexities
 
10
in your project.
 
11
 
 
12
 
 
13
== Build libusual ==
 
14
 
 
15
---------------------------------
 
16
$ git clone git://github.com/libusual/libusual.git lib
 
17
Cloning into lib...
 
18
done.
 
19
$ cd lib
 
20
$ ./autogen.sh
 
21
[...]
 
22
$ ./configure --disable-shared --prefix=/opt
 
23
[...]
 
24
$ make
 
25
[...]
 
26
$ make install DESTDIR=`pwd`/../inst
 
27
[...]
 
28
$ cd ..
 
29
---------------------------------
 
30
 
 
31
== Build our own code ==
 
32
 
 
33
 
 
34
Now we prepare our own code.
 
35
 
 
36
 
 
37
First, this is the source file:
 
38
 
 
39
.File: prog.c
 
40
[source,c]
 
41
-----------------------------------
 
42
#include <stdio.h>
 
43
#include <string.h>
 
44
#include <usual/crc32.h>
 
45
 
 
46
int main(void)
 
47
{
 
48
        const char *data = "CECSFXX";
 
49
        uint32_t crc;
 
50
 
 
51
        crc = calc_crc32(data, strlen(data), 0);
 
52
        printf("crc: %08x\n", crc);
 
53
        return 0;
 
54
}
 
55
-----------------------------------
 
56
 
 
57
Here is corresponding Makefile:
 
58
 
 
59
.File: Makefile
 
60
[source,makefile]
 
61
-----------------------------------
 
62
# here we describe our program
 
63
SRCS = prog.c
 
64
OBJS = $(SRCS:.c=.o)
 
65
 
 
66
# here we link to libusual
 
67
CPPFLAGS = -I./inst/opt/include
 
68
LDFLAGS = -L./inst/opt/lib
 
69
LIBS = -lusual
 
70
 
 
71
CC = gcc
 
72
CFLAGS = -O -g -Wall
 
73
 
 
74
all: prog
 
75
 
 
76
prog: $(OBJS)
 
77
        $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
 
78
-----------------------------------
 
79
 
 
80
Build the project
 
81
 
 
82
---------------------------------
 
83
$ make
 
84
gcc -O -g -Wall -I./inst/opt/include  -c -o prog.o prog.c
 
85
gcc -O -g -Wall -L./inst/opt/lib prog.o -lusual -o prog
 
86
$ ls
 
87
Makefile  inst  lib  prog  prog.c  prog.o
 
88
$ ./prog
 
89
crc: 12345678
 
90
---------------------------------
 
91
 
 
92
Done!
 
93