aboutsummaryrefslogtreecommitdiffstats
path: root/www/mod_php5/scripts/configure.php
blob: 2b140b8a41177b1edabee873c4303182da51c751 (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
#!/bin/sh

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

/usr/bin/dialog --title "PHP configuration options" --clear \
    --checklist "\n\
Please select desired options:" -1 -1 9 \
GD      "GD library support" ON \
zlib        "zlib library support" ON \
MySQL       "MySQL database support" ON \
PostgresSQL "PostgresSQL database support" OFF \
mSQL        "mSQL database support" OFF \
dBase       "dBase database 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

> ${CURDIR}/Makefile.inc

while [ "$1" ]; do
    case $1 in
        \"GD\")
            echo "BUILD_DEPENDS+=       \${PREFIX}/lib/libgd.a:\${PORTSDIR}/graphics/gd" >> ${CURDIR}/Makefile.inc
            echo "PHP3_CONF_ARGS+=  --with-gd" >> ${CURDIR}/Makefile.inc
            ;;
        \"zlib\")
            echo "PHP3_CONF_ARGS+=  --with-zlib" >> ${CURDIR}/Makefile.inc
            ;;
        \"MySQL\")
            echo "BUILD_DEPENDS+=       mysql:\${PORTSDIR}/databases/mysql321" >> ${CURDIR}/Makefile.inc
            echo "PHP3_CONF_ARGS+=  --with-mysql=\${PREFIX}" >> ${CURDIR}/Makefile.inc
            ;;
        \"PostgresSQL\")
            echo "BUILD_DEPENDS+=       \${PREFIX}/pgsql/bin/psql:\${PORTSDIR}/databases/postgresql" >> ${CURDIR}/Makefile.inc
            echo "PHP3_CONF_ARGS+=  --with-pgsql=\${PREFIX}/pgsql" >> ${CURDIR}/Makefile.inc
            ;;
        \"mSQL\")
            echo "BUILD_DEPENDS+=       msql:\${PORTSDIR}/databases/msql" >> ${CURDIR}/Makefile.inc
            echo "PHP3_CONF_ARGS+=  --with-msql=\${PREFIX}" >> ${CURDIR}/Makefile.inc
            ;;
        \"dBase\")
            echo "PHP3_CONF_ARGS+=  --with-dbase" >> ${CURDIR}/Makefile.inc
            ;;
    esac
    shift
done