summaryrefslogtreecommitdiffstats
path: root/php-pear/php/CONFIGURE
blob: 1c3a799bf84f6c70eb3c5c6284a996ccc0483451 (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
. "$GRIMOIRE/FUNCTIONS" &&

message "${MESSAGE_COLOR}PEAR support will enable the CLI version and force depends on libxml2" &&
message "It will also enable some PCRE support (internal recommended)${DEFAULT_COLOR}" &&
# prior pear enabledness
if list_find "$PHP5_OPTS" "--enable-pear" ; then
  PHP5_PEAR="y"
fi &&

config_query PHP5_PEAR "Do you want PEAR support?" y &&

config_query_option PHP5_OPTS "Enable IPv6?" n \
                    "--enable-ipv6" "--disable-ipv6" &&

if is_version_less "${VERSION}" 5.4; then
  config_query_option PHP5_OPTS "Enable PHP safe mode?" n \
                                "--enable-safe-mode" \
                                "--disable-safe-mode"
fi &&

config_query_option PHP5_OPTS "Enable sockets support?" y \
                    "--enable-sockets" "--disable-sockets" &&

config_query_option PHP5_OPTS "Enable FTP support?" y \
                    "--enable-ftp" "--disable-ftp" &&

config_query_option PHP5_OPTS "Enable calendar support?" y \
                    "--enable-calendar" "--disable-calendar" &&

config_query_option PHP5_OPTS "Enable pcntl support (Only affects CLI/CGI)" n \
                    "--enable-pcntl" "--disable-pcntl" &&

message "${MESSAGE_COLOR}Apache-based and *CGI SAPIs are mutually exclusive (though both FastCGI and CGI can be enabled at the same time)${DEFAULT_COLOR}" &&

config_query_list PHP5_SAPI "What SAPI do you want to use?" \
                            apache cgi none &&

if [[ $PHP5_SAPI == cgi ]]; then
  list_add "PHP5_OPTS" "--enable-cgi --without-apxs --without-apxs2" &&

  if is_version_less "${VERSION}" 5.3; then
    config_query_option PHP5_OPTS "Enable FastCGI SAPI?" n \
                        "--enable-fastcgi" "--disable-fastcgi"
  else
    message "${MESSAGE_COLOR}The FastCGI SAPI is now always enabled since PHP 5.3.0${DEFAULT_COLOR}"
  fi
elif [[ $PHP5_SAPI == apache ]]; then
  config_query_list PHP5_APACHE "Which Apache module to build?" \
                                handler filter
fi &&

if [[ "${PHP5_PEAR}" == "y" ]] || list_find "$PHP5_OPTS" "--enable-cgi" || list_find "$PHP5_OPTS" "--enable-fastcgi" ; then
  message "${MESSAGE_COLOR}Enabling CLI version for PEAR/CGI/FastCGI support${DEFAULT_COLOR}" &&
  list_add "PHP5_OPTS" "--enable-cli"
else
  config_query_option PHP5_OPTS "Enable CLI version?" y \
                                "--enable-cli" \
                                "--disable-cli"
fi &&

config_query_option PHP5_OPTS "Enable multibyte support?"  n \
                    "--enable-mbstring --enable-mbregex" \
                    "--disable-mbstring --disable-mbregex" &&

message "${MESSAGE_COLOR}See http://us.php.net/dba.installation for more info${DEFAULT_COLOR}" &&
message "${MESSAGE_COLOR}Not recommended: dbm, ndbm. NOTE: qdbm conflicts with dbm and gdbm${DEFAULT_COLOR}" &&
config_query_multi PHP5_DBA_DRIVERS "Select dbm-style database drivers (if any)" none gdbm db4 flatfile inifile qdbm &&

if ! list_find "${PHP5_DBA_DRIVERS}" "none"; then
  list_add "PHP5_OPTS" "--enable-dba" &&
  
  if list_find "${PHP5_DBA_DRIVERS}" "flatfile"; then
    list_add "PHP5_OPTS" "--enable-inifile"
  else
    list_add "PHP5_OPTS" "--disable-inifile"
  fi &&

  if list_find "${PHP5_DBA_DRIVERS}" "flatfile"; then
    list_add "PHP5_OPTS" "--enable-flatfile"
  else
    list_add "PHP5_OPTS" "--disable-flatfile"
  fi
else
  list_add "PHP5_OPTS" "--disable-dba"
fi &&

# get the native simple drivers
if is_version_less "${VERSION}" 5.3; then
  # 5.2 drops SQLite 3 support
  local DB_DRIVERS="mysql mysqli pgsql sqlite firebird unixODBC iODBC"
elif is_version_less "${VERSION}" 5.4; then
  local DB_DRIVERS="mysql mysqli pgsql sqlite sqlite3 firebird unixODBC iODBC"
else
  # 5.4 drops SQLite 2 support
  local DB_DRIVERS="mysql mysqli pgsql sqlite3 firebird unixODBC iODBC"
fi &&

config_query_multi PHP5_DATABASE_DRIVERS "Select vendor specific database drivers to install (if any)" \
                                         none all $DB_DRIVERS &&

# for PDO-only drivers
if list_find "${PHP5_DATABASE_DRIVERS}" "sqlite3" || list_find "${PHP5_DATABASE_DRIVERS}" "firebird"; then
  list_add "PHP5_OPTS" "--enable-pdo"
else
  # ask if they want the PDO drivers for the drivers they selected
  config_query_option PHP5_OPTS "Enable PHP Data Objects?" y \
                                "--enable-pdo" \
                                "--disable-pdo"
fi &&

if list_find "$PHP5_OPTS" "--enable-pdo"; then
  local PDO_DRIVERS="mysql pgsql unixODBC iODBC" &&

  for foo in $PDO_DRIVERS; do
    if list_find "${PHP5_DATABASE_DRIVERS}" "$foo" || list_find "${PHP5_DATABASE_DRIVERS}" "all"; then
      # odbc special case
      if [[ "$foo" == "unixODBC" ]]; then
        config_query_option PHP5_OPTS "Enable PDO driver for unixodbc?" n \
                                      "--with-pdo-odbc=unixODBC,${INSTALL_ROOT}/usr" \
                                      ""
      elif [[ "$foo" == "iODBC" ]]; then
        config_query_option PHP5_OPTS "Enable PDO driver for libiodbc?" n \
                                      "--with-pdo-odbc=iODBC,${INSTALL_ROOT}/usr" \
                                      ""
      else
        config_query_option PHP5_OPTS "Enable PDO driver for $foo?" n \
                                      "--with-pdo-$foo=${INSTALL_ROOT}/usr" \
                                      "--without-pdo-$foo"
      fi
    else
      if [[ "$foo" != "unixODBC" ]] && [[ "$foo" != "iODBC" ]]; then
        # be sure that the PDO driver is disabled
        list_add "PHP5_OPTS" "--without-pdo-$foo"
      fi
    fi
  done
fi &&

config_query_option PHP5_OPTS "Enable shmop support?" n \
                    "--enable-shmop" "--disable-shmop" &&

config_query_option PHP5_OPTS "Enable ZIP support?" n \
                    "--enable-zip" "--disable-zip" &&

config_query_option PHP5_OPTS "Enable System V message queues support?" n \
                    "--enable-sysvmsg" "--disable-sysvmsg" &&

config_query_option PHP5_OPTS "Enable System V semaphore support?" n \
                    "--enable-sysvsem" "--disable-sysvsem" &&

config_query_option PHP5_OPTS "Enable System V shared memory support?" n \
                    "--enable-sysvshm" "--disable-sysvshm" &&

config_query_list PHP5_GD "Which GD library to use?" \
                  none internal external &&

if [[ "$PHP5_PEAR" == "y" ]]; then
  config_query_list PHP5_PCRE "Which PCRE library to use (internal reccomended)?" \
                              internal external
else
  config_query_list PHP5_PCRE "Which PCRE library to use (internal reccomended)?" \
                              internal external none
fi