summaryrefslogtreecommitdiff
path: root/ext/oci8/config.w32
blob: d83bf3fbdb7d5342eeefd584fa76504b63cf57b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// $Id$
// vim:ft=javascript

if (PHP_OCI8 != "no" && PHP_OCI8_11G != "no") {
	if (!PHP_OCI8_SHARED && !PHP_OCI8_11G_SHARED) {
		WARNING("oci8 and oci8-11g provide the same extension and cannot both be built statically");
		PHP_OCI8 = "no"
	}
}

if (PHP_OCI8 != "no" && PHP_OCI8_12C != "no") {
	if (!PHP_OCI8_SHARED && !PHP_OCI8_12C_SHARED) {
		WARNING("oci8 and oci8-12c provide the same extension and cannot both be built statically");
		PHP_OCI8 = "no"
	}
}

if (PHP_OCI8_11G != "no" && PHP_OCI8_12C != "no") {
	if (!PHP_OCI8_11G_SHARED && !PHP_OCI8_12C_SHARED) {
		WARNING("oci8-11g and oci8-12c provide the same extension and cannot both be built statically");
		PHP_OCI8_11G = "no"
	}
}

ARG_WITH("oci8", "OCI8 support", "no");

if (PHP_OCI8 != "no") {

	oci8_dirs = new Array(
		PHP_OCI8
	);

	oci8_lib_paths = "";
	oci8_inc_paths = "";

	// find the Oracle install
	for (i = 0; i < oci8_dirs.length; i++) {
		oci8_lib_paths += oci8_dirs[i] + "\\lib;";
		oci8_lib_paths += oci8_dirs[i] + "\\lib\\msvc;";
		oci8_inc_paths += oci8_dirs[i] + "\\include;";
	}

	oci8_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient;"
	oci8_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient;";

	if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8", oci8_inc_paths) &&
			CHECK_LIB("oci.lib", "oci8", oci8_lib_paths))
	{
		EXTENSION('oci8', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c');

		AC_DEFINE('HAVE_OCI8', 1);
		AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);

	} else {
		WARNING("oci8 not enabled: Oracle Database client libraries or Oracle 10g Instant Client not found");
		PHP_OCI8 = "no"
	}
}

ARG_WITH("oci8-11g", "OCI8 support using Oracle 11g Instant Client", "no");

if (PHP_OCI8_11G != "no") {

	oci8_11g_dirs = new Array(
		PHP_OCI8_11G
	);

	oci8_11g_lib_paths = "";
	oci8_11g_inc_paths = "";

	// find the Oracle install
	for (i = 0; i < oci8_11g_dirs.length; i++) {
		oci8_11g_lib_paths += oci8_11g_dirs[i] + "\\lib;";
		oci8_11g_lib_paths += oci8_11g_dirs[i] + "\\lib\\msvc;";
		oci8_11g_inc_paths += oci8_11g_dirs[i] + "\\include;";
	}

	oci8_11g_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient_11;"
	oci8_11g_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient_11;";

	if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_11G", oci8_11g_inc_paths) &&
			CHECK_LIB("oci.lib", "oci8_11g", oci8_11g_lib_paths))
	{
		EXTENSION('oci8_11g', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c', null, null, null, "ext\\oci8_11g")

		AC_DEFINE('HAVE_OCI8', 1);
		AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);

	} else {
		WARNING("oci8-11g not enabled: Oracle Database client libraries or Oracle 11g Instant Client not found");
		PHP_OCI8_11G = "no"
	}
}

ARG_WITH("oci8-12c", "OCI8 support using Oracle Database 12c Instant Client", "no");

if (PHP_OCI8_12C != "no") {

	oci8_12c_dirs = new Array(
		PHP_OCI8_12C
	);

	oci8_12c_lib_paths = "";
	oci8_12c_inc_paths = "";

	// find the Oracle install
	for (i = 0; i < oci8_12c_dirs.length; i++) {
		oci8_12c_lib_paths += oci8_12c_dirs[i] + "\\lib;";
		oci8_12c_lib_paths += oci8_12c_dirs[i] + "\\lib\\msvc;";
		oci8_12c_inc_paths += oci8_12c_dirs[i] + "\\include;";
	}

	oci8_12c_inc_paths += PHP_PHP_BUILD + "\\include\\instantclient_12;"
	oci8_12c_lib_paths += PHP_PHP_BUILD + "\\lib\\instantclient_12;";

	if (CHECK_HEADER_ADD_INCLUDE("oci.h", "CFLAGS_OCI8_12C", oci8_12c_inc_paths) &&
			CHECK_LIB("oci.lib", "oci8_12c", oci8_12c_lib_paths))
	{
		EXTENSION('oci8_12c', 'oci8.c oci8_lob.c oci8_statement.c oci8_collection.c oci8_interface.c', null, null, null, "ext\\oci8_12c")

		AC_DEFINE('HAVE_OCI8', 1);
		AC_DEFINE('HAVE_OCI_INSTANT_CLIENT', 1);
	} else {
		WARNING("oci8-12c not enabled: Oracle Database client libraries or Oracle Database 12c Instant Client not found");
		PHP_OCI8_12C = "no"
	}
}