summaryrefslogtreecommitdiffstats
path: root/php-pear/php/DEPENDS
blob: 385b77685723b9d932b64bcb2de99861964ac502 (plain) (blame)
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
. ${GRIMOIRE}/FUNCTIONS &&

# takes two params
# $1 is the driver name
# $2 is the spell name (for depending)
function db_driver_depends() {
  local db_driver="$1"
  local db_spell="$2"

  if list_find "$PHP5_DATABASE_DRIVERS" "$db_driver" || list_find "$PHP5_DATABASE_DRIVERS" "all"; then
    depends $db_spell "--with-$db_driver"
  else
    list_add "PHP5_OPTS" "--without-$db_driver"
  fi
}

depends flex &&
# Officially these are optional, but we require them because some other
# optional extensions depend on it, and they're omnipresent anyway
depends readline "--with-readline" &&
depends zlib "--with-zlib" &&

optional_depends bzip2 \
                 "--with-bz2" "--without-bz2" \
                 "for compression support" &&

if [[ "$PHP5_PEAR" == "y" ]]; then
  depends libxml2 '--enable-xml --enable-dom --with-xmlrpc'
else
  optional_depends libxml2 \
                   "--enable-xml --enable-dom --with-xmlrpc" \
                   "--disable-xml --disable-dom --without-xmlrpc --disable-xmlreader --disable-xmlwriter --disable-simplexml" \
                   "For XML support (required for SOAP)"
fi &&

optional_depends libxslt \
                 "--with-xsl" "--without-xsl" \
                 "for XSLT support" &&

if is_depends_enabled $SPELL libxml2 ; then
  config_query_option PHP5_OPTS "Enable SOAP support?" n \
                      "--enable-soap" "--disable-soap"
else
  list_add "PHP5_OPTS" "--disable-soap"
fi &&

optional_depends pth \
                 "--with-tsrm-pth=${INSTALL_ROOT}/usr" "--with-tsrm-pthreads" \
                 "use GNU Portable Threads instead of POSIX threads" &&

if [[ $PHP5_SAPI == apache ]]; then
  case "${PHP5_APACHE}" in
    handler) depends APACHE;;
    filter) depends APACHE2 '--with-apxs2 --without-apxs';;
  esac &&

  if [[ "$(get_spell_provider $SPELL APACHE)" == 'apache1' ]]; then
    list_add "PHP5_OPTS" "--with-apxs --without-apxs2"
  else
    list_add "PHP5_OPTS" "--with-apxs2 --without-apxs"
  fi
fi &&

if [[ "$PHP5_PCRE" == "none" ]]; then
 list_add "PHP5_OPTS" "--without-pcre-regex --without-pcre"
elif [[ "$PHP5_PCRE" == "external" ]]; then
  depends pcre "--with-pcre-regex=${INSTALL_ROOT}/usr" 
fi &&

optional_depends C-CLIENT \
                 "--with-imap=${INSTALL_ROOT}/usr" "--without-imap" \
                 "for IMAP support" &&

optional_depends SSL \
                 "--with-opennssl" "--without-openssl" \
                 "for OpenSSL support" &&

if is_depends_enabled $SPELL $(get_spell_provider $SPELL C-CLIENT); then
  if is_depends_enabled $SPELL $(get_spell_provider $SPELL SSL); then
    list_add "PHP5_OPTS" "--with-imap-ssl"
  else
    optional_depends SSL \
                     "--with-imap-ssl" \
                     "--without-imap-ssl" \
                     "for SSL support with IMAP (but not elsewhere)"
  fi
fi &&

optional_depends MAIL-TRANSPORT-AGENT "" "" "for SMTP support" &&

optional_depends aspell \
                 "--with-pspell" "--without-pspell" \
                 "use aspell for spelling functions" &&

optional_depends mhash \
                 "--with-mhash" "--without-mhash" \
                 "for hash functions support" &&

if is_version_less 5.2.9999 "${VERSION}"; then
  optional_depends enchant \
                   "--with-enchant" "--without-enchant" \
                   "use enchant for spelling functions?" &&

  optional_depends icu \
                   "--enable-intl --with-icu-dir=${INSTALL_ROOT}/usr" \
                   "--disable-intl --without-icu-dir" \
                   "for ICU unicode (internationalization) support" &&

  optional_depends oniguruma \
                   "--with-onig=${INSTALL_ROOT}/usr" "--without-onig" \
                   "for external oniguruma"
fi &&

optional_depends libmcrypt \
                 "--with-mcrypt" "--without-mcrypt" \
                 "for crypto library" &&

optional_depends curl \
                 "--with-curl" "--without-curl" \
                 "for cURL URL stream functions" &&

optional_depends net-snmp \
                 "--with-snmp" "--without-snmp" \
                 "for SNMP support" &&

if is_depends_enabled $SPELL curl; then
    config_query_option PHP5_OPTS "Do you want to use cURL for URL streams in core PHP functions?" n \
                        "--with-curlwrappers" "--without-curlwrappers" &&
    depends -sub NO_ARES curl '--with-curl'
fi &&

optional_depends gmp \
                 "--with-gmp" "--without-gmp" \
                 "GNU multi-precision library support" &&

optional_depends krb5 \
                 "--with-kerberos" "--without-kerberos" \
                 "for Kerberos support" &&

optional_depends gettext \
                 "--with-gettext" "--without-gettext" \
                 "for GNU gettext support" &&

# new database madness
# DB_DRIVERS="mysql mysqli pgsql sqlite sqlite3 firebird unixODBC iODBC"
# PDO_DRIVERS="mysql pgsql firebird unixODBC iODBC"
if list_find "$PHP5_DATABASE_DRIVERS" "mysql" || list_find "$PHP5_DATABASE_DRIVERS" "all"; then
  depends MYSQL &&

  if is_version_less 5.2.9999 "${VERSION}"; then
    config_query PHP5_MYSQLND "Do you want to use the MySQL Native Driver [mysqlnd]? (expiremental)" n &&

    if [[ "${PHP5_MYSQLND}" == "y" ]]; then
      list_add "PHP5_OPTS" "--with-mysql=mysqlnd"
    else
      list_add "PHP5_OPTS" "--with-mysql=${INSTALL_ROOT}/usr"
    fi
  else
    list_add "PHP5_OPTS" "--with-mysql=${INSTALL_ROOT}/usr"
  fi
else
  list_add "PHP5_OPTS" "--without-mysql"
fi &&

db_driver_depends "mysqli" "MYSQL" &&
db_driver_depends "pgsql" "postgresql" &&

if is_version_less "${VERSION}" 5.4; then
  db_driver_depends "sqlite" "sqlite2"
fi &&

if is_version_less 5.2.9999 "${VERSION}"; then
  db_driver_depends "sqlite3" "sqlite"
fi &&

if list_find "${PHP5_DATABASE_DRIVERS}" "firebird"; then
  depends firebird "--with-pdo-firebird=${INSTALL_ROOT}/usr"
else
  list_add "PHP5_OPTS" "--without-pdo-firebird"
fi &&

if list_find "${PHP5_DATABASE_DRIVERS}" "sqlite3"; then
  depends sqlite "--with-pdo-sqlite=${INSTALL_ROOT}/usr"
else
  list_add "PHP5_OPTS" "--without-pdo-sqlite"
fi &&

# unixODBC and iODBC are mutually exclusive... first one in wins?
if list_find "$PHP5_DATABASE_DRIVERS" "unixODBC" || list_find "$PHP5_DATABASE_DRIVERS" "all"; then
  depends unixodbc "--with-unixODBC=${INSTALL_ROOT}/usr --without-iodbc"
elif list_find "$PHP5_DATABASE_DRIVERS" "iODBC"; then
  depends unixodbc "--with-iodbc=${INSTALL_ROOT}/usr --without-unixODBC"
else
  list_add "PHP5_OPTS" "--without-iodbc --without-unixODBC"
fi &&

# DBA drivers
if list_find "${PHP5_OPTS}" "--enable-dba"; then
  for foo in $PHP5_DBA_DRIVERS; do
    if [[ $foo != none ]]; then
      # handle the few special cases
      if [[ "$foo" == "db4" ]]; then
        depends db "--with-db4"
      elif [[ "$foo" != "flatfile" ]] && [[ "$foo" != "inifile" ]]; then
        depends $foo "--with-$foo"
      fi
    fi
  done
fi &&

optional_depends openldap \
                 "--with-ldap" "--without-ldap" \
                 "for LDAP support" &&

if is_depends_enabled $SPELL openldap; then
  optional_depends LIBSASL \
                 "--with-ldap-sasl" "--without-ldap-sasl" \
                 "for LDAP with Cyrus SASL support" &&

  if list_find "${PHP5_OPTS}" "--with-ldap-sasl"; then
    depends -sub openldap SASL
  fi
fi &&

optional_depends mm \
                 "--with-mm" "--without-mm" \
                 "for sharing memory between related processes" &&

optional_depends tidy \
                 "--with-tidy" "--without-tidy" \
                 "for HTML Tidy support" &&

optional_depends re2c \
                 "" "" \
                 "to regenerate PHP parsers" &&

optional_depends libexif \
                 "--enable-exif" "--disable-exif" \
                 "for image metadata support" &&

if [[ "${PHP5_GD}" == "external" ]]; then
    depends gd "--with-gd=${INSTALL_ROOT}/usr --enable-gd-native-ttf" 
fi &&

if [[ "${PHP5_GD}" != "none" ]]; then
    optional_depends libxpm \
                     "--with-xpm-dir=${INSTALL_ROOT}/usr" \
                     "--without-xpm-dir" \
                     "for XPM image support" &&

  if [[ "${PHP5_GD}" == "internal" ]]; then
    depends JPEG "--with-jpeg-dir=${INSTALL_ROOT}/usr" &&
    depends libpng "--with-png-dir=${INSTALL_ROOT}/usr"
  else
    optional_depends JPEG \
                     "--with-jpeg-dir=${INSTALL_ROOT}/usr" \
                     "--without-jpeg-dir" \
                     "for JPEG support (for GD)" &&

    optional_depends libpng \
                     "--with-png-dir=${INSTALL_ROOT}/usr" \
                     "--without-png-dir" \
                     "for PNG support (for GD)"
  fi &&

  optional_depends t1lib \
                   "--with-t1lib=${INSTALL_ROOT}/usr" \
                   "--without-t1lib" \
                   "for t1lib support" &&

  optional_depends freetype2 \
                   "--with-freetype-dir=${INSTALL_ROOT}/usr" \
                   "--without-freetype-dir" \
                   "for freetype2 support" &&

  optional_depends font-jis-misc \
                   "--enable-gd-jis-conv" \
                   "--disable-gd-jis-conv" \
                   "for JIS-mapped Japanese font support"
fi