~ubuntu-branches/ubuntu/trusty/libdbi/trusty

« back to all changes in this revision

Viewing changes to doc/programmers-guide/x276.html

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS), Laszlo Boszormenyi (GCS), Prach Pongpanich
  • Date: 2014-01-20 21:19:50 UTC
  • mfrom: (3.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20140120211950-zyd6ykii7rd4vm7x
Tags: 0.9.0-1
[ Laszlo Boszormenyi (GCS) ]
* Correct debian/copyright .

[ Prach Pongpanich ]
* Imported Upstream version 0.9.0 (Closes: #708115, #717437)
* Use debhelper short rules with autoreconf (Closes: #565558)
* Add -dbg package
* Update symbols file for new symbols
* Add multiarch support
* Bump Standards-Version to 3.9.5
* Change Vcs fields to point to collab-maint
* Adopt package (Closes: #635659)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
 
<HTML
3
 
><HEAD
4
 
><TITLE
5
 
>Adding libdbi to your project</TITLE
6
 
><META
7
 
NAME="GENERATOR"
8
 
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
9
 
REL="HOME"
10
 
TITLE="Database Independent Abstraction Layer for C"
11
 
HREF="index.html"><LINK
12
 
REL="UP"
13
 
TITLE="libdbi in a Nutshell (Quickstart Guide)"
14
 
HREF="quickstart.html"><LINK
15
 
REL="PREVIOUS"
16
 
TITLE="Loading libdbi at runtime"
17
 
HREF="x267.html"><LINK
18
 
REL="NEXT"
19
 
TITLE="Error Handling"
20
 
HREF="errorhandling.html"></HEAD
21
 
><BODY
22
 
CLASS="SECTION"
23
 
BGCOLOR="#FFFFFF"
24
 
TEXT="#000000"
25
 
LINK="#0000FF"
26
 
VLINK="#840084"
27
 
ALINK="#0000FF"
28
 
><DIV
29
 
CLASS="NAVHEADER"
30
 
><TABLE
31
 
SUMMARY="Header navigation table"
32
 
WIDTH="100%"
33
 
BORDER="0"
34
 
CELLPADDING="0"
35
 
CELLSPACING="0"
36
 
><TR
37
 
><TH
38
 
COLSPAN="3"
39
 
ALIGN="center"
40
 
>Database Independent Abstraction Layer for C: libdbi Programmer's Guide</TH
41
 
></TR
42
 
><TR
43
 
><TD
44
 
WIDTH="10%"
45
 
ALIGN="left"
46
 
VALIGN="bottom"
47
 
><A
48
 
HREF="x267.html"
49
 
ACCESSKEY="P"
50
 
>Prev</A
51
 
></TD
52
 
><TD
53
 
WIDTH="80%"
54
 
ALIGN="center"
55
 
VALIGN="bottom"
56
 
>Chapter 2. libdbi in a Nutshell (Quickstart Guide)</TD
57
 
><TD
58
 
WIDTH="10%"
59
 
ALIGN="right"
60
 
VALIGN="bottom"
61
 
><A
62
 
HREF="errorhandling.html"
63
 
ACCESSKEY="N"
64
 
>Next</A
65
 
></TD
66
 
></TR
67
 
></TABLE
68
 
><HR
69
 
ALIGN="LEFT"
70
 
WIDTH="100%"></DIV
71
 
><DIV
72
 
CLASS="SECTION"
73
 
><H1
74
 
CLASS="SECTION"
75
 
><A
76
 
NAME="AEN276"
77
 
>2.4. Adding libdbi to your project</A
78
 
></H1
79
 
><P
80
 
>If your project uses autoconf to manage the build process on the target machine, you should add some tests to your <TT
81
 
CLASS="FILENAME"
82
 
>./configure</TT
83
 
> script to check for the presence and usability of libdbi. The following example shows how this can be done:</P
84
 
><TABLE
85
 
BORDER="0"
86
 
BGCOLOR="#E0E0E0"
87
 
WIDTH="100%"
88
 
><TR
89
 
><TD
90
 
><FONT
91
 
COLOR="#000000"
92
 
><PRE
93
 
CLASS="PROGRAMLISTING"
94
 
>dnl check for dynamic linking functions
95
 
AC_CHECK_LIB(dl,dlopen)
96
 
 
97
 
dnl check for the libdbi library
98
 
AC_CHECK_LIB(dbi,dbi_initialize)
99
 
 
100
 
dnl to check for the availability and function of a particular
101
 
dnl driver we need a runtime check (since the driver is loaded
102
 
dnl dynamically). This example checks for the mysql driver
103
 
AC_MSG_CHECKING("for libdbi mysql driver (dynamic load)")
104
 
AC_RUN_IFELSE(
105
 
  [AC_LANG_PROGRAM(,
106
 
    [[dbi_initialize(0); return(dbi_conn_new("mysql") ? 0 : 1);]])],
107
 
  [AC_MSG_RESULT("yes")],
108
 
  [AC_MSG_FAILURE("mysql driver not installed?")])</PRE
109
 
></FONT
110
 
></TD
111
 
></TR
112
 
></TABLE
113
 
><P
114
 
>The first two tests add the appropriate flags to the <CODE
115
 
CLASS="VARNAME"
116
 
>LIBS</CODE
117
 
> variable to link against the required libraries.</P
118
 
><P
119
 
>In addition, you have to make sure that both the directory which contains the libdbi header file directory (usually <TT
120
 
CLASS="FILENAME"
121
 
>/usr/include</TT
122
 
> or <TT
123
 
CLASS="FILENAME"
124
 
>/usr/local/include</TT
125
 
>) as well as the directory which contains the libdbi library (usually <TT
126
 
CLASS="FILENAME"
127
 
>/usr/lib</TT
128
 
> or <TT
129
 
CLASS="FILENAME"
130
 
>/usr/local/lib</TT
131
 
>) are accessible to the compiler and to the linker by using the <CODE
132
 
CLASS="OPTION"
133
 
>-I</CODE
134
 
> and <CODE
135
 
CLASS="OPTION"
136
 
>-L</CODE
137
 
> compiler flags, respectively.</P
138
 
></DIV
139
 
><DIV
140
 
CLASS="NAVFOOTER"
141
 
><HR
142
 
ALIGN="LEFT"
143
 
WIDTH="100%"><TABLE
144
 
SUMMARY="Footer navigation table"
145
 
WIDTH="100%"
146
 
BORDER="0"
147
 
CELLPADDING="0"
148
 
CELLSPACING="0"
149
 
><TR
150
 
><TD
151
 
WIDTH="33%"
152
 
ALIGN="left"
153
 
VALIGN="top"
154
 
><A
155
 
HREF="x267.html"
156
 
ACCESSKEY="P"
157
 
>Prev</A
158
 
></TD
159
 
><TD
160
 
WIDTH="34%"
161
 
ALIGN="center"
162
 
VALIGN="top"
163
 
><A
164
 
HREF="index.html"
165
 
ACCESSKEY="H"
166
 
>Home</A
167
 
></TD
168
 
><TD
169
 
WIDTH="33%"
170
 
ALIGN="right"
171
 
VALIGN="top"
172
 
><A
173
 
HREF="errorhandling.html"
174
 
ACCESSKEY="N"
175
 
>Next</A
176
 
></TD
177
 
></TR
178
 
><TR
179
 
><TD
180
 
WIDTH="33%"
181
 
ALIGN="left"
182
 
VALIGN="top"
183
 
>Loading libdbi at runtime</TD
184
 
><TD
185
 
WIDTH="34%"
186
 
ALIGN="center"
187
 
VALIGN="top"
188
 
><A
189
 
HREF="quickstart.html"
190
 
ACCESSKEY="U"
191
 
>Up</A
192
 
></TD
193
 
><TD
194
 
WIDTH="33%"
195
 
ALIGN="right"
196
 
VALIGN="top"
197
 
>Error Handling</TD
198
 
></TR
199
 
></TABLE
200
 
></DIV
201
 
></BODY
202
 
></HTML
203
 
>
 
 
b'\\ No newline at end of file'