aboutsummaryrefslogtreecommitdiffstats
path: root/www/mod_php4/scripts/configure.php
blob: b4be5546ff64ebb6d670d63812780d675f5d8af1 (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
#!/bin/sh
# $FreeBSD$

if [ -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc ]; then
    exit
fi

if [ "${BATCH}" ]; then
    set \"zlib\" \"MySQL\"
else
    /usr/bin/dialog --title "configuration options" --clear \
        --checklist "\n\
Please select desired options:" -1 -1 16 \
GD      "GD library support" OFF \
FreeType    "TrueType font rendering (implies GD)" OFF \
zlib        "zlib library support" ON \
mcrypt      "Encryption support" OFF \
mhash       "Crypto-hashing support" OFF \
pdflib      "pdflib support (implies zlib)" OFF \
IMAP        "IMAP support" OFF \
MySQL       "MySQL database support" ON \
PostgreSQL  "PostgreSQL database support" OFF \
SybaseDB    "Sybase/MS-SQL database support (DB-lib)" OFF \
SybaseCT    "Sybase/MS-SQL database support (CT-lib)" OFF \
dBase       "dBase database support" OFF \
OpenLDAP    "OpenLDAP support" OFF \
SNMP        "SNMP support" OFF \
XML     "XML support" OFF \
FTP     "File Transfer Protocol support" OFF \
gettext     "gettext library support" OFF \
jstring     "jstring module" OFF \
YP      "YP/NIS support" OFF \
BCMath      "BCMath support" OFF \
2> /tmp/checklist.tmp.$$

    retval=$?

    if [ -s /tmp/checklist.tmp.$$ ]; then
        set `cat /tmp/checklist.tmp.$$`
    fi
    rm -f /tmp/checklist.tmp.$$

    case $retval in
        0)  if [ -z "$*" ]; then
                echo "Nothing selected"
            fi
            ;;
        1)  echo "Cancel pressed."
            exit 1
            ;;
    esac
fi

${MKDIR} ${WRKDIRPREFIX}${CURDIR}
exec > ${WRKDIRPREFIX}${CURDIR}/Makefile.inc

while [ "$1" ]; do
    case $1 in
        \"GD\")
            echo "LIB_DEPENDS+= gd.2:\${PORTSDIR}/graphics/gd"
            echo "CONFIGURE_ARGS+=--with-gd=\${PREFIX}"
            GD=1
            ;;
        \"FreeType\")
            echo "LIB_DEPENDS+= ttf.4:\${PORTSDIR}/print/freetype"
            echo "CONFIGURE_ARGS+=--with-ttf=\${PREFIX}"
            if [ -z "$GD" ]; then
                set $* \"GD\"
            fi
            ;;
        \"zlib\")
            echo "CONFIGURE_ARGS+=--with-zlib"
            ZLIB=1
            ;;
        \"mcrypt\")
            echo "LIB_DEPENDS+= mcrypt.2:\${PORTSDIR}/security/libmcrypt"
            echo "CONFIGURE_ARGS+=--with-mcrypt=\${PREFIX}"
            ;;
        \"mhash\")
            echo "LIB_DEPENDS+= mhash.2:\${PORTSDIR}/security/mhash"
            echo "CONFIGURE_ARGS+=--with-mhash=\${PREFIX}"
            ;;
        \"pdflib\")
            echo "pdflib is DISABLED for now. Ignoring." > /dev/stderr
            ;;
        \"nothing\")
            echo "LIB_DEPENDS+= pdf.2:\${PORTSDIR}/print/pdflib"
            echo "CONFIGURE_ARGS+=--with-pdflib=\${PREFIX} \\"
            echo "      --with-jpeg-dir=\${PREFIX} \\"
            echo "      --with-tiff-dir=\${PREFIX}"
            if [ -z "$ZLIB" ]; then
                set $* \"zlib\"
            fi
            ;;
        \"IMAP\")
            echo "LIB_DEPENDS+= c-client4.8:\${PORTSDIR}/mail/cclient"
            echo "CONFIGURE_ARGS+=--with-imap=\${PREFIX}"
            ;;
        \"MySQL\")
            echo "LIB_DEPENDS+= mysqlclient.10:\${PORTSDIR}/databases/mysql323-client"
            echo "CONFIGURE_ARGS+=--with-mysql=\${PREFIX}"
            ;;
        \"PostgreSQL\")
            echo "LIB_DEPENDS+= pq.2:\${PORTSDIR}/databases/postgresql7"
            echo "CONFIGURE_ARGS+=--with-pgsql=\${PREFIX}/pgsql"
            if /usr/bin/ldd ${PREFIX}/pgsql/bin/postgres | /usr/bin/grep -q "libssl"; then
                LIBS="-lcrypto -lssl"
            fi
            ;;
        \"SybaseDB\")
            echo "LIB_DEPENDS+= sybdb.0:\${PORTSDIR}/databases/freetds"
            echo "CONFIGURE_ARGS+=--with-sybase=\${PREFIX}"
            if [ "$SYBASECT" ]; then
                echo "SybaseDB and SybaseCT are mutually exclusive." > /dev/stderr
                rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
                exit 1
            fi
            SYBASEDB=1
            ;;
        \"SybaseCT\")
            echo "LIB_DEPENDS+= ct.0:\${PORTSDIR}/databases/freetds"
            echo "CONFIGURE_ARGS+=--with-sybase-ct=\${PREFIX}"
            if [ "$SYBASEDB" ]; then
                echo "SybaseDB and SybaseCT are mutually exclusive." > /dev/stderr
                rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
                exit 1
            fi
            SYBASECT=1
            ;;
        \"dBase\")
            echo "CONFIGURE_ARGS+=--with-dbase"
            ;;
        \"OpenLDAP\")
            echo "LIB_DEPENDS+= ldap.1:\${PORTSDIR}/net/openldap"
            echo "LIB_DEPENDS+= lber.1:\${PORTSDIR}/net/openldap"
            echo "CONFIGURE_ARGS+=--with-ldap=\${PREFIX}"
            if [ -f /usr/lib/libkrb.a -a -f /usr/lib/libdes.a -a ! -L /usr/lib/libdes.a ]; then
                LIBS="${LIBS} -lkrb -ldes -L\${PREFIX}/lib"
            fi
            ;;
        \"SNMP\")
            echo "SNMP is DISABLED for now. Ignoring." > /dev/stderr
            ;;
        \"nothing\")
            echo "LIB_DEPENDS+= snmp.4:\${PORTSDIR}/net/net-snmp"
            echo "CONFIGURE_ARGS+=--with-snmp=\${PREFIX} --enable-ucd-snmp-hack"
            ;;
        \"XML\")
            echo "BUILD_DEPENDS+=   \${PREFIX}/lib/libexpat.a:\${PORTSDIR}/textproc/expat"
            echo "BUILD_DEPENDS+=   \${PREFIX}/include/xml/xmlparse.h:\${PORTSDIR}/textproc/expat"
            echo "BUILD_DEPENDS+=   \${PREFIX}/include/xml/xmltok.h:\${PORTSDIR}/textproc/expat"
            echo "CONFIGURE_ARGS+=--with-xml=\${PREFIX}"
            ;;
        \"FTP\")
            echo "CONFIGURE_ARGS+=--enable-ftp"
            ;;
        \"gettext\")
            echo "LIB_DEPENDS+= intl.1:\${PORTSDIR}/devel/gettext"
            echo "CONFIGURE_ARGS+=--with-gettext=\${PREFIX}"
            ;;
        \"jstring\")
            ${CAT} << EOF
MASTER_SITES+=  ftp://night.fminn.nagano.nagano.jp/php4/
DISTFILES=  \${DISTNAME}\${EXTRACT_SUFX} php-4.0RC2_jstring-1.0.tar.gz
CONFIGURE_ARGS+=--enable-jstring
BUILD_DEPENDS+= automake:\${PORTSDIR}/devel/automake
BUILD_DEPENDS+= autoconf:\${PORTSDIR}/devel/autoconf

post-extract:
    [ -d \${WRKDIR}/jstring ] && \\
    (cd \${WRKSRC}; \\
     \${MV} ${WRKDIR}/jstring ext; \\
     \${RM} configure; \\
     ./buildconf)
EOF
            ;;
        \"YP\")
            echo "CONFIGURE_ARGS+=--enable-yp"
            ;;
        \"BCMath\")
            echo "CONFIGURE_ARGS+=--enable-bcmath"
            ;;
        *)
            echo "Invalid option(s): $*" > /dev/stderr
            rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            exit 1
            ;;
    esac
    shift
done

if [ "${LIBS}" ]; then
    echo "CONFIGURE_ENV+=   LIBS='${LIBS}'"
fi