~ubuntu-branches/ubuntu/precise/libdbi-drivers/precise

« back to all changes in this revision

Viewing changes to acinclude.m4

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2008-08-02 09:00:11 UTC
  • mfrom: (3.1.6 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080802090011-j05v2349u2ptvg05
Tags: 0.8.2-1-4.1
* Non-maintainer upload with maintainer's approval.
* High urgency upload for RC bugfix.
* Pass --freetds-inc-dir to configure, to bypass the ridiculous upstream
  AC_FIND_FILE() checks for files that *aren't used during the build*;
  fixes a build failure with FreeTDS 0.82.  Closes: #493349.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
## Hoenicka who then used for the libdbi-drivers project
7
7
##
8
8
 
9
 
AC_DEFUN(AC_FIND_FILE,
 
9
AC_DEFUN([AC_FIND_FILE],
10
10
[
11
 
$3=NO
 
11
$3=no
12
12
for i in $2; do
13
13
        for j in $1; do
14
14
                if test -r "$i/$j"; then
21
21
 
22
22
## DBI
23
23
 
24
 
AC_DEFUN(AC_CHECK_DBI,
 
24
AC_DEFUN([AC_CHECK_DBI],
25
25
[
26
26
AM_CONDITIONAL(HAVE_DBI, false)
27
 
ac_dbi_incdir="NO"
 
27
ac_dbi_incdir="no"
28
28
 
29
29
# exported variables
30
30
DBI_INCLUDE=""
32
32
AC_MSG_CHECKING(for libdbi framework)
33
33
 
34
34
AC_ARG_WITH(dbi-incdir,
35
 
        [  --with-dbi-incdir      Specifies where the libdbi include files are.],
 
35
        [  --with-dbi-incdir       Specifies where the libdbi include files are.],
36
36
        [  ac_dbi_incdir="$withval" ])
37
37
 
38
 
if test "$ac_dbi_incdir" = "NO"; then
39
 
        dbi_incdirs="/usr/include /usr/local/include /sw/include/"
 
38
if test "$ac_dbi_incdir" = "no"; then
 
39
        dbi_incdirs="/usr/include /usr/local/include /sw/include"
40
40
        AC_FIND_FILE(dbi/dbi.h, $dbi_incdirs, ac_dbi_incdir)
41
 
        if test "$ac_dbi_incdir" = "NO"; then
 
41
        if test "$ac_dbi_incdir" = "no"; then
42
42
                AC_MSG_RESULT(no)
43
43
                AC_MSG_ERROR([Invalid libdbi directory - include files not found.])
44
44
        fi
53
53
 
54
54
## MYSQL
55
55
 
56
 
AC_DEFUN(AC_CHECK_MYSQL,
 
56
AC_DEFUN([AC_CHECK_MYSQL],
57
57
[
58
58
AM_CONDITIONAL(HAVE_MYSQL, false)
59
 
ac_mysql="NO"
60
 
ac_mysql_incdir="NO"
61
 
ac_mysql_libdir="NO"
 
59
ac_mysql="no"
 
60
ac_mysql_incdir="no"
 
61
ac_mysql_libdir="no"
62
62
 
63
63
# exported variables
64
64
MYSQL_LIBS=""
68
68
AC_MSG_CHECKING(for MySQL support)
69
69
 
70
70
AC_ARG_WITH(mysql,
71
 
        [  --with-mysql           Include MySQL support.],
72
 
        [  ac_mysql="YES" ])
 
71
        [  --with-mysql            Include MySQL support.],
 
72
        [  ac_mysql="$withval" ])
73
73
AC_ARG_WITH(mysql-dir,
74
 
        [  --with-mysql-dir       Specifies the MySQL root directory.],
 
74
        [  --with-mysql-dir        Specifies the MySQL root directory.],
75
75
        [  ac_mysql_incdir="$withval"/include
76
76
           ac_mysql_libdir="$withval"/lib ])
77
77
AC_ARG_WITH(mysql-incdir,
78
 
        [  --with-mysql-incdir    Specifies where the MySQL include files are.],
 
78
        [  --with-mysql-incdir     Specifies where the MySQL include files are.],
79
79
        [  ac_mysql_incdir="$withval" ])
80
80
AC_ARG_WITH(mysql-libdir,
81
 
        [  --with-mysql-libdir    Specifies where the MySQL libraries are.],
 
81
        [  --with-mysql-libdir     Specifies where the MySQL libraries are.],
82
82
        [  ac_mysql_libdir="$withval" ])
83
83
 
84
 
if test "$ac_mysql" = "YES"; then
85
 
        if test "$ac_mysql_incdir" = "NO" || test "$ac_mysql_libs" = "NO"; then
 
84
if test "$ac_mysql" = "yes"; then
 
85
        if test "$ac_mysql_incdir" = "no" || test "$ac_mysql_libs" = "no"; then
86
86
                mysql_incdirs="/usr/include /usr/local/include /usr/include/mysql /usr/local/include/mysql /usr/local/mysql/include /usr/local/mysql/include/mysql /opt/mysql/include/mysql /sw/include/mysql"
87
87
                AC_FIND_FILE(mysql/mysql.h, $mysql_incdirs, ac_mysql_incdir)
88
88
                mysql_libdirs="/usr/lib /usr/local/lib /usr/lib/mysql /usr/local/lib/mysql /usr/local/mysql/lib /usr/local/mysql/lib/mysql /opt/mysql/lib/mysql /sw/lib/mysql"
89
89
                mysql_libs="libmysqlclient.so libmysqlclient.a"
90
90
                AC_FIND_FILE($mysql_libs, $mysql_libdirs, ac_mysql_libdir)
91
 
                if test "$ac_mysql_incdir" = "NO"; then
 
91
                if test "$ac_mysql_incdir" = "no"; then
92
92
                        AC_MSG_RESULT(no)
93
93
                        AC_MSG_ERROR([Invalid MySQL directory - include files not found.])
94
94
                fi
95
 
                if test "$ac_mysql_libdir" = "NO"; then
 
95
                if test "$ac_mysql_libdir" = "no"; then
96
96
                        AC_MSG_RESULT(no)
97
97
                        AC_MSG_ERROR([Invalid MySQL directory - libraries not found.])
98
98
                fi
114
114
 
115
115
## PGSQL
116
116
 
117
 
AC_DEFUN(AC_CHECK_PGSQL,
 
117
AC_DEFUN([AC_CHECK_PGSQL],
118
118
[
119
119
AM_CONDITIONAL(HAVE_PGSQL, false)
120
 
ac_pgsql="NO"
121
 
ac_pgsql_incdir="NO"
122
 
ac_pgsql_libdir="NO"
 
120
ac_pgsql="no"
 
121
ac_pgsql_incdir="no"
 
122
ac_pgsql_libdir="no"
123
123
 
124
124
# exported variables
125
125
PGSQL_LIBS=""
129
129
AC_MSG_CHECKING(for PostgreSQL support)
130
130
 
131
131
AC_ARG_WITH(pgsql,
132
 
        [  --with-pgsql           Include PostgreSQL support.],
133
 
        [  ac_pgsql="YES" ])
 
132
        [  --with-pgsql            Include PostgreSQL support.],
 
133
        [  ac_pgsql="$withval" ])
134
134
AC_ARG_WITH(pgsql-dir,
135
 
        [  --with-pgsql-dir       Specifies the PostgreSQL root directory.],
 
135
        [  --with-pgsql-dir        Specifies the PostgreSQL root directory.],
136
136
        [  ac_pgsql_incdir="$withval"/include
137
137
           ac_pgsql_libdir="$withval"/lib ])
138
138
AC_ARG_WITH(pgsql-incdir,
139
 
        [  --with-pgsql-incdir    Specifies where the PostgreSQL include files are.],
 
139
        [  --with-pgsql-incdir     Specifies where the PostgreSQL include files are.],
140
140
        [  ac_pgsql_incdir="$withval" ])
141
141
AC_ARG_WITH(pgsql-libdir,
142
 
        [  --with-pgsql-libdir    Specifies where the PostgreSQL libraries are.],
 
142
        [  --with-pgsql-libdir     Specifies where the PostgreSQL libraries are.],
143
143
        [  ac_pgsql_libdir="$withval" ])
144
144
 
145
 
if test "$ac_pgsql" = "YES"; then
146
 
        if test "$ac_pgsql_incdir" = "NO" || test "$ac_pgsql_libs" = "NO"; then
 
145
if test "$ac_pgsql" = "yes"; then
 
146
        if test "$ac_pgsql_incdir" = "no" || test "$ac_pgsql_libs" = "no"; then
147
147
                pgsql_incdirs="/usr/include /usr/local/include /usr/include/pgsql /usr/local/include/pgsql /usr/local/pgsql/include /usr/include/postgresql /usr/local/postgresql/include /opt/pgsql/include"
148
148
                AC_FIND_FILE(libpq-fe.h, $pgsql_incdirs, ac_pgsql_incdir)
149
149
                pgsql_libdirs="/usr/lib /usr/local/lib /usr/lib/pgsql /usr/local/lib/pgsql /usr/local/pgsql/lib /opt/pgsql/lib"
150
150
                pgsql_libs="libpq.so libpq.a"
151
151
                AC_FIND_FILE($pgsql_libs, $pgsql_libdirs, ac_pgsql_libdir)
152
 
                if test "$ac_pgsql_incdir" = "NO"; then
 
152
                if test "$ac_pgsql_incdir" = "no"; then
153
153
                        AC_MSG_RESULT(no)
154
154
                        AC_MSG_ERROR([Invalid PostgreSQL directory - include files not found.])
155
155
                fi
156
 
                if test "$ac_pgsql_libdir" = "NO"; then
 
156
                if test "$ac_pgsql_libdir" = "no"; then
157
157
                        AC_MSG_RESULT(no)
158
158
                        AC_MSG_ERROR([Invalid PostgreSQL directory - libraries not found.])
159
159
                fi
175
175
 
176
176
## SQLITE
177
177
 
178
 
AC_DEFUN(AC_CHECK_SQLITE,
 
178
AC_DEFUN([AC_CHECK_SQLITE],
179
179
[
180
180
AM_CONDITIONAL(HAVE_SQLITE, false)
181
 
ac_sqlite="NO"
182
 
ac_sqlite_incdir="NO"
183
 
ac_sqlite_libdir="NO"
 
181
ac_sqlite="no"
 
182
ac_sqlite_incdir="no"
 
183
ac_sqlite_libdir="no"
184
184
 
185
185
# exported variables
186
186
SQLITE_LIBS=""
190
190
AC_MSG_CHECKING(for SQLite support)
191
191
 
192
192
AC_ARG_WITH(sqlite,
193
 
        [  --with-sqlite                  Include SQLite support.],
194
 
        [  ac_sqlite="YES" ])
 
193
        [  --with-sqlite           Include SQLite support.],
 
194
        [  ac_sqlite="$withval" ])
195
195
AC_ARG_WITH(sqlite-dir,
196
 
        [  --with-sqlite-dir      Specifies the SQLite root directory.],
 
196
        [  --with-sqlite-dir       Specifies the SQLite root directory.],
197
197
        [  ac_sqlite_incdir="$withval"/include
198
198
           ac_sqlite_libdir="$withval"/lib ])
199
199
AC_ARG_WITH(sqlite-incdir,
200
 
        [  --with-sqlite-incdir   Specifies where the SQLite include files are.],
 
200
        [  --with-sqlite-incdir    Specifies where the SQLite include files are.],
201
201
        [  ac_sqlite_incdir="$withval" ])
202
202
AC_ARG_WITH(sqlite-libdir,
203
 
        [  --with-sqlite-libdir   Specifies where the SQLite libraries are.],
 
203
        [  --with-sqlite-libdir    Specifies where the SQLite libraries are.],
204
204
        [  ac_sqlite_libdir="$withval" ])
205
205
 
206
 
if test "$ac_sqlite" = "YES"; then
207
 
        if test "$ac_sqlite_incdir" = "NO" || test "$ac_sqlite_libs" = "NO"; then
 
206
if test "$ac_sqlite" = "yes"; then
 
207
        if test "$ac_sqlite_incdir" = "no" || test "$ac_sqlite_libs" = "no"; then
208
208
                sqlite_incdirs="/usr/include /usr/local/include /usr/include/sqlite /usr/local/include/sqlite /usr/local/sqlite/include /opt/sqlite/include"
209
209
                AC_FIND_FILE(sqlite.h, $sqlite_incdirs, ac_sqlite_incdir)
210
210
                sqlite_libdirs="/usr/lib /usr/local/lib /usr/lib/sqlite /usr/local/lib/sqlite /usr/local/sqlite/lib /opt/sqlite/lib"
211
211
                sqlite_libs="libsqlite.so libsqlite.a"
212
212
                AC_FIND_FILE($sqlite_libs, $sqlite_libdirs, ac_sqlite_libdir)
213
 
                if test "$ac_sqlite_incdir" = "NO"; then
 
213
                if test "$ac_sqlite_incdir" = "no"; then
214
214
                        AC_MSG_RESULT(no)
215
215
                        AC_MSG_ERROR([Invalid SQLite directory - include files not found.])
216
216
                fi
217
 
                if test "$ac_sqlite_libdir" = "NO"; then
 
217
                if test "$ac_sqlite_libdir" = "no"; then
218
218
                        AC_MSG_RESULT(no)
219
219
                        AC_MSG_ERROR([Invalid SQLite directory - libraries not found.])
220
220
                fi
234
234
fi
235
235
])
236
236
 
 
237
## SQLITE3
 
238
 
 
239
AC_DEFUN([AC_CHECK_SQLITE3],
 
240
[
 
241
AM_CONDITIONAL(HAVE_SQLITE3, false)
 
242
ac_sqlite3="no"
 
243
ac_sqlite3_incdir="no"
 
244
ac_sqlite3_libdir="no"
 
245
 
 
246
# exported variables
 
247
SQLITE3_LIBS=""
 
248
SQLITE3_LDFLAGS=""
 
249
SQLITE3_INCLUDE=""
 
250
 
 
251
AC_MSG_CHECKING(for SQLite3 support)
 
252
 
 
253
AC_ARG_WITH(sqlite3,
 
254
        [  --with-sqlite3          Include SQLite3 support.],
 
255
        [  ac_sqlite3="$withval" ])
 
256
AC_ARG_WITH(sqlite3-dir,
 
257
        [  --with-sqlite3-dir      Specifies the SQLite3 root directory.],
 
258
        [  ac_sqlite3_incdir="$withval"/include
 
259
           ac_sqlite3_libdir="$withval"/lib ])
 
260
AC_ARG_WITH(sqlite3-incdir,
 
261
        [  --with-sqlite3-incdir   Specifies where the SQLite3 include files are.],
 
262
        [  ac_sqlite3_incdir="$withval" ])
 
263
AC_ARG_WITH(sqlite3-libdir,
 
264
        [  --with-sqlite3-libdir   Specifies where the SQLite3 libraries are.],
 
265
        [  ac_sqlite3_libdir="$withval" ])
 
266
 
 
267
if test "$ac_sqlite3" = "yes"; then
 
268
        if test "$ac_sqlite3_incdir" = "no" || test "$ac_sqlite3_libs" = "no"; then
 
269
                sqlite3_incdirs="/usr/include /usr/local/include /usr/include/sqlite3 /usr/local/include/sqlite3 /usr/local/sqlite3/include /opt/sqlite3/include"
 
270
                AC_FIND_FILE(sqlite3.h, $sqlite3_incdirs, ac_sqlite3_incdir)
 
271
                sqlite3_libdirs="/usr/lib /usr/local/lib /usr/lib/sqlite3 /usr/local/lib/sqlite3 /usr/local/sqlite3/lib /opt/sqlite3/lib"
 
272
                sqlite3_libs="libsqlite3.so libsqlite3.a"
 
273
                AC_FIND_FILE($sqlite3_libs, $sqlite3_libdirs, ac_sqlite3_libdir)
 
274
                if test "$ac_sqlite3_incdir" = "no"; then
 
275
                        AC_MSG_RESULT(no)
 
276
                        AC_MSG_ERROR([Invalid SQLite3 directory - include files not found.])
 
277
                fi
 
278
                if test "$ac_sqlite3_libdir" = "no"; then
 
279
                        AC_MSG_RESULT(no)
 
280
                        AC_MSG_ERROR([Invalid SQLite3 directory - libraries not found.])
 
281
                fi
 
282
        fi
 
283
        AC_MSG_RESULT([yes: libs in $ac_sqlite3_libdir, headers in $ac_sqlite3_incdir])
 
284
        AM_CONDITIONAL(HAVE_SQLITE3, true)
 
285
        
 
286
        SQLITE3_LIBS=-lsqlite3
 
287
        SQLITE3_INCLUDE=-I$ac_sqlite3_incdir
 
288
        SQLITE3_LDFLAGS=-L$ac_sqlite3_libdir
 
289
        
 
290
        AC_SUBST(SQLITE3_LIBS)
 
291
        AC_SUBST(SQLITE3_INCLUDE)
 
292
        AC_SUBST(SQLITE3_LDFLAGS)
 
293
else
 
294
        AC_MSG_RESULT(no)
 
295
fi
 
296
])
 
297
 
237
298
## mSQL
238
299
 
239
 
AC_DEFUN(AC_CHECK_MSQL,
 
300
AC_DEFUN([AC_CHECK_MSQL],
240
301
[
241
302
AM_CONDITIONAL(HAVE_MSQL, false)
242
 
ac_msql="NO"
243
 
ac_msql_incdir="NO"
244
 
ac_msql_libdir="NO"
 
303
ac_msql="no"
 
304
ac_msql_incdir="no"
 
305
ac_msql_libdir="no"
245
306
 
246
307
# exported variables
247
308
MSQL_LIBS=""
251
312
AC_MSG_CHECKING(for MiniSQL (mSQL) support)
252
313
 
253
314
AC_ARG_WITH(msql,
254
 
        [  --with-msql            Include mSQL support.],
255
 
        [  ac_msql="YES" ])
 
315
        [  --with-msql             Include mSQL support.],
 
316
        [  ac_msql="$withval" ])
256
317
AC_ARG_WITH(msql-dir,
257
 
        [  --with-msql-dir        Specifies the mSQL root directory.],
 
318
        [  --with-msql-dir         Specifies the mSQL root directory.],
258
319
        [  ac_msql_incdir="$withval"/include
259
320
           ac_msql_libdir="$withval"/lib ])
260
321
AC_ARG_WITH(msql-incdir,
261
 
        [  --with-msql-incdir     Specifies where the mSQL include files are.],
 
322
        [  --with-msql-incdir      Specifies where the mSQL include files are.],
262
323
        [  ac_msql_incdir="$withval" ])
263
324
AC_ARG_WITH(msql-libdir,
264
 
        [  --with-msql-libdir     Specifies where the mSQL libraries are.],
 
325
        [  --with-msql-libdir      Specifies where the mSQL libraries are.],
265
326
        [  ac_msql_libdir="$withval" ])
266
327
 
267
 
if test "$ac_msql" = "YES"; then
268
 
        if test "$ac_msql_incdir" = "NO" || test "$ac_msql_libs" = "NO"; then
 
328
if test "$ac_msql" = "yes"; then
 
329
        if test "$ac_msql_incdir" = "no" || test "$ac_msql_libs" = "no"; then
269
330
                msql_incdirs="/usr/local/msql3/include /usr/msql3/include /opt/msql3/include/ /usr/include /usr/local/include"
270
331
                AC_FIND_FILE(msql.h, $msql_incdirs, ac_msql_incdir)
271
332
                msql_libdirs="/usr/lib /usr/local/lib /usr/lib/msql3 /usr/local/lib/msql /usr/local/msql3/lib /opt/msql3/lib"
272
333
                AC_FIND_FILE(libmsql.a, $msql_libdirs, ac_msql_libdir)
273
 
                if test "$ac_msql_incdir" = "NO"; then
 
334
                if test "$ac_msql_incdir" = "no"; then
274
335
                        AC_MSG_RESULT(no)
275
336
                        AC_MSG_ERROR([Invalid mSQL directory - include files not found.])
276
337
                fi
277
 
                if test "$ac_msql_libdir" = "NO"; then
 
338
                if test "$ac_msql_libdir" = "no"; then
278
339
                        AC_MSG_RESULT(no)
279
340
                        AC_MSG_ERROR([Invalid mSQL directory - libraries not found.])
280
341
                fi
296
357
 
297
358
## Oracle
298
359
 
299
 
AC_DEFUN(AC_CHECK_ORACLE,
 
360
AC_DEFUN([AC_CHECK_ORACLE],
300
361
[
301
362
AM_CONDITIONAL(HAVE_ORACLE, false)
302
 
ac_oracle="NO"
303
 
ac_oracle_incdir="NO"
304
 
ac_oracle_libdir="NO"
 
363
ac_oracle="no"
 
364
ac_oracle_incdir="no"
 
365
ac_oracle_libdir="no"
305
366
 
306
367
# exported variables
307
368
ORACLE_LIBS=""
311
372
AC_MSG_CHECKING(for Oracle support)
312
373
 
313
374
AC_ARG_WITH(oracle,
314
 
        [  --with-oracle                  Include Oracle support.],
315
 
        [  ac_oracle="YES" ])
 
375
        [  --with-oracle           Include Oracle support.],
 
376
        [  ac_oracle="$withval" ])
316
377
AC_ARG_WITH(oracle-dir,
317
 
        [  --with-oracle-dir      Specifies ORACLE_HOME.],
 
378
        [  --with-oracle-dir       Specifies ORACLE_HOME.],
318
379
        [  ac_oracle_incdir="$withval"/rdbms/demo
319
380
           ac_oracle_libdir="$withval"/lib ])
320
381
AC_ARG_WITH(oracle-incdir,
321
 
        [  --with-oracle-incdir   Specifies where the Oracle include files are.],
 
382
        [  --with-oracle-incdir    Specifies where the Oracle include files are.],
322
383
        [  ac_oracle_incdir="$withval" ])
323
384
AC_ARG_WITH(oracle-libdir,
324
 
        [  --with-oracle-libdir   Specifies where the Oracle libraries are.],
 
385
        [  --with-oracle-libdir    Specifies where the Oracle libraries are.],
325
386
        [  ac_oracle_libdir="$withval" ])
326
387
 
327
 
if test "$ac_oracle" = "YES"; then
328
 
        if test "$ac_oracle_incdir" = "NO" || test "$ac_oracle_libs" = "NO"; then
 
388
if test "$ac_oracle" = "yes"; then
 
389
        if test "$ac_oracle_incdir" = "no" || test "$ac_oracle_libs" = "no"; then
329
390
                oracle_incdirs="$ORACLE_HOME/rdbms/demo $ORACLE_HOME/rdbms/public"
330
391
                AC_FIND_FILE(oci.h, $oracle_incdirs, ac_oracle_incdir)
331
392
                oracle_libdirs="$ORACLE_HOME/lib"
332
393
                AC_FIND_FILE(libclntsh.so, $oracle_libdirs, ac_oracle_libdir)
333
 
                if test "$ac_oracle_incdir" = "NO"; then
 
394
                if test "$ac_oracle_incdir" = "no"; then
334
395
                        AC_MSG_RESULT(no)
335
396
                        AC_MSG_ERROR([Invalid Oracle directory - include files not found.])
336
397
                fi
337
 
                if test "$ac_oracle_libdir" = "NO"; then
 
398
                if test "$ac_oracle_libdir" = "no"; then
338
399
                        AC_MSG_RESULT(no)
339
400
                        AC_MSG_ERROR([Invalid Oracle directory - libraries not found.])
340
401
                fi
353
414
        AC_MSG_RESULT(no)
354
415
fi
355
416
])
 
417
 
 
418
## Firebird
 
419
 
 
420
AC_DEFUN([AC_CHECK_FIREBIRD_INTERBASE],
 
421
[
 
422
AM_CONDITIONAL(HAVE_FIREBIRD_INTERBASE, false)
 
423
ac_firebird="no"
 
424
ac_firebird_incdir="no"
 
425
ac_firebird_libdir="no"
 
426
 
 
427
# exported variables
 
428
FIREBIRD_LIBS=""
 
429
FIREBIRD_LDFLAGS=""
 
430
FIREBIRD_INCLUDE=""
 
431
 
 
432
AC_MSG_CHECKING(for Firebird/Interbase support)
 
433
 
 
434
AC_ARG_WITH(firebird,
 
435
        [  --with-firebird         Include Firebird support.],
 
436
        [  ac_firebird="$withval" ])
 
437
AC_ARG_WITH(firebird-dir,
 
438
        [  --with-firebird-dir     Specifies Firebird directory.],
 
439
        [  ac_firebird_incdir="$withval"/include
 
440
           ac_firebird_libdir="$withval"/lib ])
 
441
AC_ARG_WITH(firebird-incdir,
 
442
        [  --with-firebird-incdir  Specifies where Firebird/Interbase include files are.],
 
443
        [  ac_firebird_incdir="$withval" ])
 
444
AC_ARG_WITH(firebird-libdir,
 
445
        [  --with-firebird-libdir  Specifies where Firebird/Interbase libraries are.],
 
446
        [  ac_firebird_libdir="$withval" ])
 
447
 
 
448
if test "$ac_firebird" = "yes"; then
 
449
        if test "$ac_firebird_incdir" = "no" || test "$ac_firebird_libs" = "no"; then
 
450
                firebird_incdirs="/opt/firebird/include /usr/include /usr/local/include /usr/include/firebird /usr/local/include/firebird /usr/local/firebird/include /opt/firebird/include"
 
451
                AC_FIND_FILE(ibase.h, $firebird_incdirs, ac_firebird_incdir)
 
452
                firebird_libdirs="/opt/firebird/lib /usr/lib /usr/local/lib /usr/lib/firebird /usr/local/lib/firebird /usr/local/firebird/lib /opt/firebird/lib"
 
453
                AC_FIND_FILE(libfbclient.so, $firebird_libdirs, ac_firebird_libdir)
 
454
                if test "$ac_firebird_incdir" = "no"; then
 
455
                        AC_MSG_RESULT(no)
 
456
                        AC_MSG_ERROR([Invalid Firebird/Interbase directory - include files not found.])
 
457
                fi
 
458
                if test "$ac_firebird_libdir" = "no"; then
 
459
                        AC_MSG_RESULT(no)
 
460
                        AC_MSG_ERROR([Invalid Firebird/Interbase directory - libraries not found.])
 
461
                fi
 
462
        fi
 
463
        AC_MSG_RESULT([yes: libs in $ac_firebird_libdir, headers in $ac_firebird_incdir])
 
464
        AM_CONDITIONAL(HAVE_FIREBIRD_INTERBASE, true)
 
465
        
 
466
        dnl libfbclient needs pthreads
 
467
        AC_SEARCH_LIBS(pthread_create, c_r pthread,,)
 
468
 
 
469
        FIREBIRD_LIBS="-lfbclient"
 
470
        FIREBIRD_INCLUDE="-I$ac_firebird_incdir"
 
471
        FIREBIRD_LDFLAGS=-L$ac_firebird_libdir
 
472
        
 
473
        AC_SUBST(FIREBIRD_LIBS)
 
474
        AC_SUBST(FIREBIRD_INCLUDE)
 
475
        AC_SUBST(FIREBIRD_LDFLAGS)
 
476
else
 
477
        AC_MSG_RESULT(no)
 
478
fi
 
479
])
 
480
 
 
481
## Freetds
 
482
 
 
483
AC_DEFUN([AC_CHECK_FREETDS],
 
484
[
 
485
AM_CONDITIONAL(HAVE_FREETDS, false)
 
486
ac_freetds="no"
 
487
ac_freetds_incdir="no"
 
488
ac_freetds_libdir="no"
 
489
 
 
490
# exported variables
 
491
FREETDS_LIBS=""
 
492
FREETDS_LDFLAGS=""
 
493
FREETDS_INCLUDE=""
 
494
 
 
495
AC_MSG_CHECKING(for Freetds support)
 
496
 
 
497
AC_ARG_WITH(freetds,
 
498
        [  --with-freetds          Include Freetds support.],
 
499
        [  ac_freetds="$withval" ])
 
500
AC_ARG_WITH(freetds-dir,
 
501
        [  --with-freetds-dir      Specifies FREETDS_HOME.],
 
502
        [  ac_freetds_incdir="$withval"/include
 
503
           ac_freetds_libdir="$withval"/lib ])
 
504
AC_ARG_WITH(freetds-incdir,
 
505
        [  --with-freetds-incdir   Specifies where the Freetds include files are.],
 
506
        [  ac_freetds_incdir="$withval" ])
 
507
AC_ARG_WITH(freetds-libdir,
 
508
        [  --with-freetds-libdir   Specifies where the Freetds libraries are.],
 
509
        [  ac_freetds_libdir="$withval" ])
 
510
 
 
511
if test "$ac_freetds" = "yes"; then
 
512
        if test "$ac_freetds_incdir" = "no" || test "$ac_freetds_libs" = "no"; then
 
513
                freetds_incdirs="/usr/include /usr/local/include"
 
514
                AC_FIND_FILE(tds.h, $freetds_incdirs, ac_freetds_incdir)
 
515
                freetds_libdirs="/usr/lib /usr/local/lib"
 
516
                AC_FIND_FILE(libtds.so, $freetds_libdirs, ac_freetds_libdir)
 
517
                if test "$ac_freetds_incdir" = "no"; then
 
518
                        AC_MSG_RESULT(no)
 
519
                        AC_MSG_ERROR([Invalid Freetds directory - include files not found.])
 
520
                fi
 
521
                if test "$ac_freetds_libdir" = "no"; then
 
522
                        AC_MSG_RESULT(no)
 
523
                        AC_MSG_ERROR([Invalid Freetds directory - libraries not found.])
 
524
                fi
 
525
        fi
 
526
        AC_MSG_RESULT([yes: libs in $ac_freetds_libdir, headers in $ac_freetds_incdir])
 
527
        AM_CONDITIONAL(HAVE_FREETDS, true)
 
528
        
 
529
        FREETDS_LIBS=-lct
 
530
        FREETDS_INCLUDE=-I$ac_freetds_incdir
 
531
        FREETDS_LDFLAGS=-L$ac_freetds_libdir
 
532
        
 
533
        AC_SUBST(FREETDS_LIBS)
 
534
        AC_SUBST(FREETDS_INCLUDE)
 
535
        AC_SUBST(FREETDS_LDFLAGS)
 
536
else
 
537
        AC_MSG_RESULT(no)
 
538
fi
 
539
])
 
540
 
 
541
## Ingres
 
542
 
 
543
AC_DEFUN([AC_CHECK_INGRES],
 
544
[
 
545
AM_CONDITIONAL(HAVE_INGRES, false)
 
546
ac_ingres="no"
 
547
ac_ingres_incdir="no"
 
548
ac_ingres_libdir="no"
 
549
 
 
550
# exported variables
 
551
INGRES_LIBS=""
 
552
INGRES_LDFLAGS=""
 
553
INGRES_INCLUDE=""
 
554
 
 
555
AC_MSG_CHECKING(for Ingres support)
 
556
 
 
557
AC_ARG_WITH(ingres,
 
558
        [  --with-ingres           Include Ingres support.],
 
559
        [  ac_ingres="$withval" ])
 
560
AC_ARG_WITH(ingres-dir,
 
561
        [  --with-ingres-dir       Specifies II_SYSTEM.],
 
562
        [  ac_ingres_incdir="$withval"/ingres/files
 
563
           ac_ingres_libdir="$withval"/ingres/lib ])
 
564
AC_ARG_WITH(ingres-incdir,
 
565
        [  --with-ingres-incdir    Specifies where the Ingres include files are.],
 
566
        [  ac_ingres_incdir="$withval" ])
 
567
AC_ARG_WITH(ingres-libdir,
 
568
        [  --with-ingres-libdir    Specifies where the Ingres libraries are.],
 
569
        [  ac_ingres_libdir="$withval" ])
 
570
 
 
571
if test "$ac_ingres" = "yes"; then
 
572
        if test "$ac_ingres_incdir" = "no" || test "$ac_ingres_libs" = "no"; then
 
573
                ingres_incdirs="/usr/include /usr/local/include /opt/Ingres/IngresII/ingres/files"
 
574
                AC_FIND_FILE(iiapi.h, $ingres_incdirs, ac_ingres_incdir)
 
575
                ingres_libdirs="/usr/lib /usr/local/lib /opt/Ingres/IngresII/ingres/lib"
 
576
                AC_FIND_FILE(libingres.a, $ingres_libdirs, ac_ingres_libdir)
 
577
                if test "$ac_ingres_incdir" = "no"; then
 
578
                        AC_MSG_RESULT(no)
 
579
                        AC_MSG_ERROR([Invalid Ingres directory - include files not found.])
 
580
                fi
 
581
                if test "$ac_ingres_libdir" = "no"; then
 
582
                        AC_MSG_RESULT(no)
 
583
                        AC_MSG_ERROR([Invalid Ingres directory - libraries not found.])
 
584
                fi
 
585
        fi
 
586
        AC_MSG_RESULT([yes: libs in $ac_ingres_libdir, headers in $ac_ingres_incdir])
 
587
        AM_CONDITIONAL(HAVE_INGRES, true)
 
588
        
 
589
        INGRES_LIBS="-lingres -lpthread -ldl -lm -lcrypt"
 
590
        INGRES_INCLUDE=-I$ac_ingres_incdir
 
591
        INGRES_LDFLAGS=-L$ac_ingres_libdir
 
592
        
 
593
        AC_SUBST(INGRES_LIBS)
 
594
        AC_SUBST(INGRES_INCLUDE)
 
595
        AC_SUBST(INGRES_LDFLAGS)
 
596
else
 
597
        AC_MSG_RESULT(no)
 
598
fi
 
599
])