aboutsummaryrefslogtreecommitdiffstats
path: root/lang/pike70/scripts/configure.pike
blob: f11a223448b4b0838ff890a3ab5cc62bd717c761 (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
#!/bin/sh

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

/usr/bin/dialog --title "Pike configuration options" --clear \
    --checklist "\n\
Please select desired options:" -1 -1 11 \
FreeType    "TrueType font rendering" OFF \
JPEG        "support JPEG" OFF \
threads     "threads support" ON \
GDBM        "GNU database manager support" OFF \
zlib        "zlib library support" ON \
gmp     "support bignums" ON \
readline    "support for command line editing" ON \
MySQL       "MySQL database support" OFF \
PostgreSQL  "PostgreSQL database support" OFF \
mSQL        "mSQL database support" OFF \
ssl         "SSL 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

mkdir -p ${WRKDIRPREFIX}${CURDIR}
> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc

while [ "$1" ]; do
    case $1 in
        \"FreeType\")
            echo 'LIB_DEPENDS+= ttf.4:${PORTSDIR}/print/freetype' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            echo 'CONFIGURE_ARGS+=  --with-ttflib' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            FreeType=1
            ;;
        \"threads\")
            threads=1
            ;;
        \"gmp\")
            echo '.if ${OSVERSION} >= 500000' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            echo 'LIB_DEPENDS+= gmp.6:${PORTSDIR}/math/libgmp4' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            echo '.endif' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            echo 'CONFIGURE_ARGS+=  --with-gmp' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            gmp=1
            ;;
        \"readline\")
            echo 'CONFIGURE_ARGS+=  --with-readline' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            readline=1
            ;;
        \"JPEG\")
            echo 'LIB_DEPENDS+=     jpeg.9:${PORTSDIR}/graphics/jpeg' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            echo 'CONFIGURE_ARGS+=  --with-jpeg=${PREFIX}' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            JPEG=1
            ;;
        \"GDBM\")
            echo 'LIB_DEPENDS+= gdbm.3:${PORTSDIR}/databases/gdbm' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc 
            echo 'CONFIGURE_ARGS+=  --with-gdbm=${PREFIX}' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            GDBM=1
            ;;
        \"zlib\")
            echo 'CONFIGURE_ARGS+=  --with-zlib' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            zlib=1
            ;;
        \"MySQL\")
            echo 'LIB_DEPENDS+= mysqlclient.10:${PORTSDIR}/databases/mysql323-client' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            echo 'CONFIGURE_ARGS+=  --with-mysql=${PREFIX}' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            MySQL=1
            ;;
        \"PostgreSQL\")
            echo 'USE_PGSQL=        yes' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            echo 'CONFIGURE_ARGS+=  --with-pgsql=${PREFIX}/pgsql' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            PostgresSQL=1
            ;;
        \"mSQL\")
            echo 'BUILD_DEPENDS+=       msql:${PORTSDIR}/databases/msql' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            echo 'CONFIGURE_ARGS+=  --with-msql=${PREFIX}' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            mSQL=1
            ;;
        \"ssl\")
            echo 'CONFIGURE_ARGS+= --with-ssleay' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
            ssl=1
            ;;
    esac
    shift
done
if [ -z "$FreeType" ]; then
    echo 'CONFIGURE_ARGS+=  --without-ttflib' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc  
fi
if [ -z "$threads" ]; then
    echo 'CONFIGURE_ARGS+=  --without-threads' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc  
fi
if [ -z "$GDBM" ]; then
    echo 'CONFIGURE_ARGS+=  --without-gdbm' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc  
fi
if [ -z "$zlib" ]; then
    echo 'CONFIGURE_ARGS+=  --without-zlib' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc  
fi
if [ -z "$MySQL" ]; then
    echo 'CONFIGURE_ARGS+=  --without-mysql' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc  
fi
if [ -z "$PostgreSQL" ]; then
    echo 'CONFIGURE_ARGS+=  --without-postgresql' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc  
fi
if [ -z "$mSQL" ]; then
    echo 'CONFIGURE_ARGS+=  --without-msql' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc  
fi
if [ -z "$gmp" ]; then
    echo 'CONFIGURE_ARGS+=  --without-gmp --without-bignums' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc  
fi
if [ -z "$JPEG" ]; then
    echo 'CONFIGURE_ARGS+=  --without-jpeg' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc  
fi
if [ -z "$readline" ]; then
    echo 'CONFIGURE_ARGS+=  --without-readline' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc  
if [ -z "$ssl" ]; then
    echo 'CONFIGURE_ARGS+=  --without-ssl' >> ${WRKDIRPREFIX}${CURDIR}/Makefile.inc  
fi
fi