xref: /PHP-5.6/ext/oci8/config.w32 (revision 141c2cb9)
1// $Id$
2// vim:ft=javascript
3
4if (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	}
9}
10
11if (PHP_OCI8 != "no" && PHP_OCI8_12C != "no") {
12	if (!PHP_OCI8_SHARED && !PHP_OCI8_12C_SHARED) {
13		WARNING("oci8 and oci8-12c provide the same extension and cannot both be built statically");
14		PHP_OCI8 = "no"
15	}
16}
17
18if (PHP_OCI8_11G != "no" && PHP_OCI8_12C != "no") {
19	if (!PHP_OCI8_11G_SHARED && !PHP_OCI8_12C_SHARED) {
20		WARNING("oci8-11g and oci8-12c provide the same extension and cannot both be built statically");
21		PHP_OCI8_11G = "no"
22	}
23}
24
25ARG_WITH("oci8", "OCI8 support", "no");
26
27if (PHP_OCI8 != "no") {
28
29	oci8_dirs = new Array(
30		PHP_OCI8
31	);
32
33	oci8_lib_paths = "";
34	oci8_inc_paths = "";
35
36	// find the Oracle install
37	for (i = 0; i < oci8_dirs.length; i++) {
38		oci8_lib_paths += oci8_dirs[i] + "\\lib;";
39		oci8_lib_paths += oci8_dirs[i] + "\\lib\\msvc;";
40		oci8_inc_paths += oci8_dirs[i] + "\\include;";
41	}
42
43	oci8_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient;"
44	oci8_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient;";
45
46	if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8", oci8_inc_paths) &&
47			CHECK_LIB("oci.lib", "oci8", oci8_lib_paths))
48	{
49		EXTENSION('oci8', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c');
50
51		AC_DEFINE('HAVE_OCI8', 1);
52		AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
53
54	} else {
55		WARNING("oci8 not enabled: Oracle Database client libraries or Oracle 10g Instant Client not found");
56		PHP_OCI8 = "no"
57	}
58}
59
60ARG_WITH("oci8-11g", "OCI8 support using Oracle 11g Instant Client", "no");
61
62if (PHP_OCI8_11G != "no") {
63
64	oci8_11g_dirs = new Array(
65		PHP_OCI8_11G
66	);
67
68	oci8_11g_lib_paths = "";
69	oci8_11g_inc_paths = "";
70
71	// find the Oracle install
72	for (i = 0; i < oci8_11g_dirs.length; i++) {
73		oci8_11g_lib_paths += oci8_11g_dirs[i] + "\\lib;";
74		oci8_11g_lib_paths += oci8_11g_dirs[i] + "\\lib\\msvc;";
75		oci8_11g_inc_paths += oci8_11g_dirs[i] + "\\include;";
76	}
77
78	oci8_11g_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient_11;"
79	oci8_11g_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient_11;";
80
81	if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_11G", oci8_11g_inc_paths) &&
82			CHECK_LIB("oci.lib", "oci8_11g", oci8_11g_lib_paths))
83	{
84		EXTENSION('oci8_11g', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c', null, null, null, "ext\\oci8_11g")
85
86		AC_DEFINE('HAVE_OCI8', 1);
87		AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
88
89	} else {
90		WARNING("oci8-11g not enabled: Oracle Database client libraries or Oracle 11g Instant Client not found");
91		PHP_OCI8_11G = "no"
92	}
93}
94
95ARG_WITH("oci8-12c", "OCI8 support using Oracle Database 12c Instant Client", "no");
96
97if (PHP_OCI8_12C != "no") {
98
99	oci8_12c_dirs = new Array(
100		PHP_OCI8_12C
101	);
102
103	oci8_12c_lib_paths = "";
104	oci8_12c_inc_paths = "";
105
106	// find the Oracle install
107	for (i = 0; i < oci8_12c_dirs.length; i++) {
108		oci8_12c_lib_paths += oci8_12c_dirs[i] + "\\lib;";
109		oci8_12c_lib_paths += oci8_12c_dirs[i] + "\\lib\\msvc;";
110		oci8_12c_inc_paths += oci8_12c_dirs[i] + "\\include;";
111	}
112
113	oci8_12c_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient_12;"
114	oci8_12c_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient_12;";
115
116	if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_12C", oci8_12c_inc_paths) &&
117			CHECK_LIB("oci.lib", "oci8_12c", oci8_12c_lib_paths))
118	{
119		EXTENSION('oci8_12c', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c', null, null, null, "ext\\oci8_12c")
120
121		AC_DEFINE('HAVE_OCI8', 1);
122		AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
123	} else {
124		WARNING("oci8-12c not enabled: Oracle Database client libraries or Oracle Database 12c Instant Client not found");
125		PHP_OCI8_12C = "no"
126	}
127}
128