@@ -10,23 +10,13 @@ if test "$PHP_PDO_DBLIB" != "no"; then
10
10
fi
11
11
12
12
if test "$PHP_PDO_DBLIB" = "yes"; then
13
-
14
- for i in /usr/local /usr; do
15
- if test -f $i/include/sybdb.h; then
16
- PDO_FREETDS_INSTALLATION_DIR=$i
17
- PDO_FREETDS_INCLUDE_DIR=$i/include
18
- break
19
- elif test -f $i/include/freetds/sybdb.h; then
20
- PDO_FREETDS_INSTALLATION_DIR=$i
21
- PDO_FREETDS_INCLUDE_DIR=$i/include/freetds
22
- break;
23
- fi
24
- done
25
-
26
- if test -z "$PDO_FREETDS_INSTALLATION_DIR"; then
27
- AC_MSG_ERROR ( Cannot find FreeTDS in known installation directories )
28
- fi
29
-
13
+ dnl FreeTDS must be on the default system include/library path.
14
+ dnl Only perform a sanity check that this is really the case.
15
+ PHP_CHECK_LIBRARY(sybdb, dbsqlexec,
16
+ [ ] ,[
17
+ AC_MSG_ERROR ( [ Cannot find FreeTDS in known installation directories] )
18
+ ] )
19
+ PHP_ADD_LIBRARY(sybdb,,GMP_SHARED_LIBADD)
30
20
elif test "$PHP_PDO_DBLIB" != "no"; then
31
21
32
22
if test -f $PHP_PDO_DBLIB/include/sybdb.h; then
@@ -38,18 +28,18 @@ if test "$PHP_PDO_DBLIB" != "no"; then
38
28
else
39
29
AC_MSG_ERROR ( Directory $PHP_PDO_DBLIB is not a FreeTDS installation directory )
40
30
fi
41
- fi
42
31
43
- if test "x$PHP_LIBDIR" = "x" ; then
44
- PHP_LIBDIR=lib
45
- fi
32
+ if test "x$PHP_LIBDIR" = "x" ; then
33
+ PHP_LIBDIR=lib
34
+ fi
46
35
47
- if test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so"; then
48
- AC_MSG_ERROR ( Could not find $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb. [ a|so] )
49
- fi
36
+ if test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.a" && test ! -r "$PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb.so"; then
37
+ AC_MSG_ERROR ( Could not find $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR/libsybdb. [ a|so] )
38
+ fi
50
39
51
- PHP_ADD_INCLUDE($PDO_FREETDS_INCLUDE_DIR)
52
- PHP_ADD_LIBRARY_WITH_PATH(sybdb, $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR, PDO_DBLIB_SHARED_LIBADD)
40
+ PHP_ADD_INCLUDE($PDO_FREETDS_INCLUDE_DIR)
41
+ PHP_ADD_LIBRARY_WITH_PATH(sybdb, $PDO_FREETDS_INSTALLATION_DIR/$PHP_LIBDIR, PDO_DBLIB_SHARED_LIBADD)
42
+ fi
53
43
54
44
PHP_CHECK_PDO_INCLUDES
55
45
0 commit comments