Skip to content

Commit b6d0cb0

Browse files
committed
Build OCI8 2.0 on Windows with Oracle Database 12c libraries only
1 parent 3d16522 commit b6d0cb0

File tree

1 file changed

+17
-61
lines changed

1 file changed

+17
-61
lines changed

ext/oci8/config.w32

Lines changed: 17 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,38 @@
11
// $Id$
22
// vim:ft=javascript
33

4-
if (PHP_OCI8 != "no" && PHP_OCI8_11G != "no") {
5-
if (!PHP_OCI8_SHARED && !PHP_OCI8_11G_SHARED) {
6-
WARNING("oci8 and oci8-11g provide the same extension and cannot both be built statically");
7-
PHP_OCI8 = "no"
8-
PHP_OCI8_11G = "no"
9-
}
10-
}
11-
12-
ARG_WITH("oci8", "OCI8 support", "no");
13-
14-
if (PHP_OCI8 != "no") {
15-
16-
oci8_dirs = new Array(
17-
PHP_OCI8
18-
);
19-
20-
oci8_lib_paths = "";
21-
oci8_inc_paths = "";
22-
23-
// find the Oracle install
24-
for (i = 0; i < oci8_dirs.length; i++) {
25-
oci8_lib_paths += oci8_dirs[i] + "\\lib;";
26-
oci8_lib_paths += oci8_dirs[i] + "\\lib\\msvc;";
27-
oci8_inc_paths += oci8_dirs[i] + "\\include;";
28-
}
29-
30-
oci8_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient;"
31-
oci8_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient;";
32-
33-
if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8", oci8_inc_paths) &&
34-
CHECK_LIB("oci.lib", "oci8", oci8_lib_paths))
35-
{
36-
EXTENSION('oci8', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c');
37-
38-
AC_DEFINE('HAVE_OCI8', 1);
39-
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
40-
AC_DEFINE('HAVE_OCI_LOB_READ2', 1);
41-
42-
} else {
43-
WARNING("oci8 not enabled: Oracle Database libraries or Oracle 10g Instant Client not found");
44-
PHP_OCI8 = "no"
45-
}
46-
}
47-
48-
ARG_WITH("oci8-11g", "OCI8 support using Oracle 11g Instant Client", "no");
4+
ARG_WITH("oci8-12c", "OCI8 support using Oracle Database 12c Instant Client", "no");
495

50-
if (PHP_OCI8_11G != "no") {
6+
if (PHP_OCI8_12C != "no") {
517

52-
oci8_11g_dirs = new Array(
53-
PHP_OCI8_11G
8+
oci8_12c_dirs = new Array(
9+
PHP_OCI8_12C
5410
);
5511

56-
oci8_11g_lib_paths = "";
57-
oci8_11g_inc_paths = "";
12+
oci8_12c_lib_paths = "";
13+
oci8_12c_inc_paths = "";
5814

5915
// find the Oracle install
60-
for (i = 0; i < oci8_11g_dirs.length; i++) {
61-
oci8_11g_lib_paths += oci8_11g_dirs[i] + "\\lib;";
62-
oci8_11g_lib_paths += oci8_11g_dirs[i] + "\\lib\\msvc;";
63-
oci8_11g_inc_paths += oci8_11g_dirs[i] + "\\include;";
16+
for (i = 0; i < oci8_12c_dirs.length; i++) {
17+
oci8_12c_lib_paths += oci8_12c_dirs[i] + "\\lib;";
18+
oci8_12c_lib_paths += oci8_12c_dirs[i] + "\\lib\\msvc;";
19+
oci8_12c_inc_paths += oci8_12c_dirs[i] + "\\include;";
6420
}
6521

66-
oci8_11g_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient_11;"
67-
oci8_11g_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient_11;";
22+
oci8_12c_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient_12;"
23+
oci8_12c_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient_12;";
6824

69-
if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_11G", oci8_11g_inc_paths) &&
70-
CHECK_LIB("oci.lib", "oci8_11g", oci8_11g_lib_paths))
25+
if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_12C", oci8_12c_inc_paths) &&
26+
CHECK_LIB("oci.lib", "oci8_12c", oci8_12c_lib_paths))
7127
{
72-
EXTENSION('oci8_11g', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c', null, null, null, "ext\\oci8_11g")
28+
EXTENSION('oci8_12c', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c', null, null, null, "ext\\oci8_12c")
7329

7430
AC_DEFINE('HAVE_OCI8', 1);
7531
AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
7632
AC_DEFINE('HAVE_OCI_LOB_READ2', 1);
7733

7834
} else {
79-
WARNING("oci8-11g not enabled: Oracle Database libraries or Oracle 11g Instant Client not found");
80-
PHP_OCI8_11G = "no"
35+
WARNING("oci8-12c not enabled: Oracle Database client libraries or Oracle Database 12c Instant Client not found");
36+
PHP_OCI8_12C = "no"
8137
}
8238
}

0 commit comments

Comments
 (0)