Annotation of parser3/buildall-with-xml, revision 1.52

1.2       paf         1: #!/bin/sh
                      2: 
1.52    ! moko        3: # $Id: buildall-with-xml,v 1.51 2012-06-15 19:45:54 moko Exp $
1.2       paf         4: 
                      5: install_directory=$HOME/parser3install
                      6: sendmail_command="/usr/sbin/sendmail -i -t -f postmaster"
1.48      moko        7: cflags=""
1.49      moko        8: #cflags="--with-pic" #required for apache module on x64
1.2       paf         9: 
                     10: echo "buildall-with-xml"
                     11: echo "Script author: Alexander Petrosian <paf@design.ru> (http://paf.design.ru)"
                     12: echo
                     13: echo "Building..."
                     14: 
1.51      moko       15: download=`which fetch 2>/dev/null`
                     16: if test -z "$download"; then
                     17:        download="wget -c --passive-ftp"
                     18: fi
                     19: 
1.2       paf        20: parser3_directory=`pwd`
                     21: cd ..
                     22: project_directory=`pwd`
                     23: mkdir src >/dev/null 2>&1
                     24: 
                     25: if test ! -f "$project_directory/gc/lib/libgc.a"; then
                     26:   cd $project_directory/src
1.33      misha      27: # libgc="gc6.8" # FreeBSD 4.X is not supported in newer gc version
1.27      misha      28:   libgc="gc-7.1"
1.7       misha      29:   if test ! -f "$libgc.tar.gz"; then
1.24      misha      30:     echo "Downloading gc [1 lib of 4]..."
1.48      moko       31:     $download http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/$libgc.tar.gz
1.7       misha      32:   fi
                     33:   echo "Unpacking gc..."
1.9       misha      34:   rm -rf $libgc
1.7       misha      35:   gunzip -c $libgc.tar.gz | tar vxf - >/dev/null
                     36:   cd $libgc
1.24      misha      37:   echo "Configuring gc..."
1.29      misha      38:   CPPFLAGS="-DUSE_LIBC_PRIVATES -DUSE_MMAP -DDONT_ADD_BYTE_AT_END" \
1.14      misha      39:   ./configure --prefix=$project_directory/gc \
                     40:     --disable-threads \
                     41:     --disable-shared \
1.48      moko       42:     --silent $cflags
1.24      misha      43:   echo "Building gc..."
1.2       paf        44:   make
                     45:   make install
1.16      misha      46:   cd ..
1.15      misha      47:   rm -rf $libgc
1.2       paf        48: fi
                     49: 
1.24      misha      50: if test ! -f "$project_directory/pcre/lib/libpcre.a"; then
                     51:   cd $project_directory/src
1.42      misha      52:   libpcre="pcre-8.30"
1.24      misha      53:   if test ! -f "$libpcre.tar.gz"; then
                     54:     echo "Downloading pcre [2 lib of 4]..."
1.48      moko       55:     $download ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/$libpcre.tar.gz
1.24      misha      56:   fi
                     57:   echo "Unpacking pcre..."
                     58:   rm -rf $libpcre
                     59:   gunzip -c $libpcre.tar.gz | tar vxf - >/dev/null
                     60:   cd $libpcre
                     61:   echo "Configuring pcre..."
                     62:   ./configure --prefix="$project_directory/pcre" \
1.41      misha      63:     --with-match-limit-recursion=10000 \
1.24      misha      64:     --enable-utf8 \
                     65:     --enable-unicode-properties \
                     66:     --disable-shared \
                     67:     --disable-cpp \
                     68:     --disable-pcregrep-libz \
1.39      misha      69:     --disable-pcregrep-libbz2 \
1.48      moko       70:     --silent $cflags
1.24      misha      71:   echo "Building pcre..."
1.48      moko       72:   make install
1.24      misha      73:   cd ..
                     74:   rm -rf $libpcre
                     75: fi
                     76: 
1.2       paf        77: if test ! -f "$project_directory/gnome/lib/libxml2.a"; then
                     78:   cd $project_directory/src
1.43      misha      79:   libxml2="libxml2-2.8.0"
1.7       misha      80:   if test ! -f "$libxml2.tar.gz"; then
1.24      misha      81:     echo "Downloading libxml [3 lib of 4]..."
1.48      moko       82:     $download ftp://xmlsoft.org/libxml2/$libxml2.tar.gz
1.7       misha      83:   fi
                     84:   echo "Unpacking libxml2... (be patient)"
1.8       misha      85:   rm -rf $libxml2
1.7       misha      86:   gunzip -c $libxml2.tar.gz | tar vxf - >/dev/null
                     87:   cd $libxml2
1.14      misha      88:   #sax1, output, tree, xinclude[in libxslt], html[in libxslt, mode=html?], xptr[xinclude], pattern -- needed!
1.2       paf        89:   echo "Configuring libxml..."
                     90:   ./configure --prefix=$project_directory/gnome \
1.31      misha      91:     --without-catalog \
1.14      misha      92:     --without-iconv \
                     93:     --without-threads \
                     94:     --without-debug \
                     95:     --without-iso8859x \
                     96:     --without-legacy \
                     97:     --without-push \
                     98:     --without-python \
                     99:     --without-reader \
                    100:     --without-writer \
                    101:     --without-readline \
                    102:     --without-regexps \
                    103:     --without-schemas \
                    104:     --without-schematron \
                    105:     --without-modules \
                    106:     --without-ftp \
                    107:     --without-http \
                    108:     --without-docbook \
1.2       paf       109:     --without-zlib \
1.44      misha     110:     --without-lzma \
1.14      misha     111:     --disable-shared \
1.48      moko      112:     --silent $cflags
1.2       paf       113:   echo "int main(){return 0;}">testapi.c
                    114:   echo "int main(){return 0;}">runtest.c
                    115:   echo "Building libxml..."
                    116:   make
                    117:   make install
1.16      misha     118:   cd ..
1.15      misha     119:   rm -rf $libxml2
1.2       paf       120: fi
                    121: 
                    122: if test ! -f "$project_directory/gnome/lib/libxslt.a"; then
                    123:   cd $project_directory/src
1.32      misha     124:   libxslt="libxslt-1.1.26"
1.7       misha     125:   if test ! -f "$libxslt.tar.gz"; then
1.24      misha     126:     echo "Downloading libxslt [4 lib of 4]..."
1.48      moko      127:     $download ftp://xmlsoft.org/libxslt/$libxslt.tar.gz
1.7       misha     128:   fi
                    129:   echo "Unpacking libxslt... (be patient)"
1.8       misha     130:   rm -rf $libxslt
1.7       misha     131:   gunzip -c $libxslt.tar.gz | tar vxf - >/dev/null
                    132:   cd $libxslt
1.2       paf       133:   echo "Configuring libxslt..."
                    134:   ./configure --prefix=$project_directory/gnome \
                    135:      --with-libxml-prefix=$project_directory/gnome \
1.14      misha     136:      --without-debug \
                    137:      --without-debugger \
                    138:      --without-crypto \
                    139:      --without-plugins \
                    140:      --disable-shared \
1.48      moko      141:      --silent $cflags
1.2       paf       142:   echo "Building libxslt..."
                    143:   make
                    144:   make install
1.16      misha     145:   cd ..
1.15      misha     146:   rm -rf $libxslt
1.2       paf       147: fi
                    148: 
                    149: cd $parser3_directory
                    150: 
                    151: if test ! -f "Makefile"; then
1.45      moko      152:   options="$@"
1.50      moko      153:   options="$options --with-gc=$project_directory/gc/lib"
                    154:   options="$options --with-pcre=$project_directory/pcre"
                    155:   options="$options --with-xml=$project_directory/gnome"
1.38      moko      156: #  options="$options --with-apache"
1.19      misha     157: #  options="$options --disable-safe-mode"
1.21      misha     158: #  options="$options --disable-stringstream"
1.48      moko      159:   options="$options --with-included-ltdl"
                    160:   options="$options --silent $cflags"
1.2       paf       161:   echo "Configuring parser3..."
1.19      misha     162:   ./configure --prefix=$install_directory "--with-sendmail=$sendmail_command" $options
1.2       paf       163: fi
1.48      moko      164: 
1.2       paf       165: echo "Building parser3..."
                    166: make install
1.48      moko      167: if test $? -ne 0; then exit 1; fi
1.17      misha     168: 
                    169: # remove debug info
                    170: # strip ${install_directory}/bin/parser3
                    171: 
1.2       paf       172: echo "DONE"
                    173: 
                    174: echo
                    175: echo
                    176: echo "********************************************************************************************************"
1.50      moko      177: echo "Now you can copy $install_directory/bin to your cgi-bin directory"
1.2       paf       178: echo "  -Parser3 with XML support-"
                    179: echo "Read more about installing Parser here:"
                    180: echo "  http://www.parser.ru/en/docs/lang/install4apachecgi.htm in English"
                    181: echo "  http://www.parser.ru/docs/lang/install4apachecgi.htm in Russian"
                    182: echo "********************************************************************************************************"

E-mail: