--- parser3/buildall 2017/05/22 16:48:31 1.21 +++ parser3/buildall 2024/12/09 01:05:49 1.39 @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: buildall,v 1.21 2017/05/22 16:48:31 moko Exp $ +# $Id: buildall,v 1.39 2024/12/09 01:05:49 moko Exp $ install_directory=$HOME/parser3install sendmail_command="/usr/sbin/sendmail -i -t -f postmaster" @@ -9,39 +9,52 @@ cd .. project_dir=`pwd` build_xml="yes" +build_pcre2="yes" build_gmime="" build_apache="" build_stripped="" +direct_download="" options="--with-included-ltdl" options="$options --with-gc=$project_dir/gc/lib" -options="$options --with-pcre=$project_dir/pcre" #options="$options --disable-stringstream" -echo "Building statically linked parser3\c" +printf "Building statically linked parser3" for PARAM in "$@"; do case "$PARAM" in "--without-xml") - echo ", without xml\c" + printf ", without xml" build_xml="" ;; + "--without-pcre2") + printf ", without pcre2 library" + build_pcre2="" + ;; "--with-apache") - echo ", with apache module\c" + printf ", with apache module" options="$options --with-apache" build_apache="yes" ;; "--with-mailreceive") - echo ", with mail receiving\c" + printf ", with mail receiving" options="$options --with-mailreceive=$project_dir/gnome" build_gmime="yes" ;; + "--with-system-mailreceive") + printf ", with mail receiving" + options="$options --with-mailreceive" + ;; "--strip") - echo ", without debug information\c" + printf ", without debug information" build_stripped="yes" ;; + "--direct-download") + printf ", download sources from master" + direct_download="yes" + ;; "--help") echo - echo "Usage: buildall [--without-xml] [--with-apache] [--with-mailreceive] [--strip] [--disable-safe-mode] [other configure options ...]" + echo "Usage: buildall [--without-xml] [--without-pcre2] [--with-apache] [--with-mailreceive] [--with-system-mailreceive] [--strip] [--direct-download] [--disable-safe-mode] [other configure options ...]" exit 1 ;; *) @@ -74,30 +87,31 @@ fi ############################### Support functions ################################ -prepare_gz () { +prepare () { cd $project_dir/src if test ! -f "$1"; then - echo "Downloading $lib (master at $2)..." - $download https://www.parser.ru/off-line/download/libs/$1 + if test "$direct_download" = "yes"; then + echo "Downloading $lib from $2..." + $download $2$1 + else + echo "Downloading $lib (master at $2)..." + $download https://www.parser.ru/off-line/download/libs/$1 + fi fi echo "Unpacking $lib..." rm -rf $lib +} + +prepare_gz () { + prepare $1 $2 gunzip -c $1 | tar xf - >/dev/null cd $lib } prepare_xz () { - cd $project_dir/src - - if test ! -f "$1"; then - echo "Downloading $lib (master at $2)..." - $download https://www.parser.ru/off-line/download/libs/$1 - fi - - echo "Unpacking $lib..." - rm -rf $lib + prepare $1 $2 xzcat $1 | tar xf - >/dev/null cd $lib } @@ -113,27 +127,50 @@ echo mkdir src >/dev/null 2>&1 if test ! -f "$project_dir/gc/lib/libgc.a"; then - lib="libatomic_ops-7.4.4" + lib="libatomic_ops-7.6.2" prepare_gz ${lib}.tar.gz http://www.hboehm.info/gc/gc_source/ - lib="gc-7.6.0" + + lib="gc-8.0.4" prepare_gz ${lib}.tar.gz http://www.hboehm.info/gc/gc_source/ - mv ../libatomic_ops-7.4.4 libatomic_ops + mv ../libatomic_ops-7.6.2 libatomic_ops echo "Configuring $lib..." - CPPFLAGS="-DUSE_LIBC_PRIVATES -DUSE_MMAP -DDONT_ADD_BYTE_AT_END" \ + CPPFLAGS="-DUSE_MMAP -DDONT_ADD_BYTE_AT_END" \ ./configure --prefix=$project_dir/gc \ - --disable-threads \ --disable-shared \ + --disable-parallel-mark \ --silent $cflags echo "Building $lib..." make install cleanup fi +if test "$build_pcre2" = "yes"; then + +options="$options --with-pcre=$project_dir/pcre2" + +if test ! -f "$project_dir/pcre2/lib/libpcre2-8.a"; then + lib="pcre2-10.44" + prepare_gz $lib.tar.gz https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.44/ + echo "Configuring $lib..." + ./configure --prefix="$project_dir/pcre2" \ + --enable-jit \ + --with-match-limit-depth=10000 \ + --disable-shared \ + --silent $cflags + echo "Building $lib..." + make install + cleanup +fi + +else + +options="$options --with-pcre=$project_dir/pcre" + if test ! -f "$project_dir/pcre/lib/libpcre.a"; then - lib="pcre-8.40" - prepare_gz $lib.tar.gz ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ + lib="pcre-8.45" + prepare_gz $lib.tar.gz https://sourceforge.net/projects/pcre/files/pcre/8.45/ echo "Configuring $lib..." ./configure --prefix="$project_dir/pcre" \ --with-match-limit-recursion=10000 \ @@ -149,15 +186,16 @@ if test ! -f "$project_dir/pcre/lib/libp cleanup fi +fi + if test "$build_xml" = "yes" -a ! -f "$project_dir/gnome/lib/libxml2.a"; then - lib="libxml2-2.9.4" - prepare_gz $lib.tar.gz ftp://xmlsoft.org/libxml2/ + lib="libxml2-2.9.9" + prepare_gz $lib.tar.gz http://xmlsoft.org/download/ #sax1, output, tree, xinclude[in libxslt], html[in libxslt, mode=html?], xptr[xinclude], pattern -- needed! echo "Configuring $lib..." ./configure --prefix=$project_dir/gnome \ --without-catalog \ --without-iconv \ - --without-threads \ --without-debug \ --without-iso8859x \ --without-legacy \ @@ -182,8 +220,8 @@ if test "$build_xml" = "yes" -a ! -f "$p fi if test "$build_xml" = "yes" -a ! -f "$project_dir/gnome/lib/libxslt.a"; then - lib="libxslt-1.1.29" - prepare_gz $lib.tar.gz ftp://xmlsoft.org/libxslt/ + lib="libxslt-1.1.34" + prepare_gz $lib.tar.gz http://xmlsoft.org/download/ echo "Configuring $lib..." CFLAGS="$CFLAGS -D__stub_clock_gettime -Dclock_gettime=choke_me" \ ./configure --prefix=$project_dir/gnome \ @@ -251,7 +289,13 @@ fi cd $parser3_dir if test ! -f "Makefile"; then echo "Configuring parser3..." - ./configure --prefix=$install_directory "--with-sendmail=$sendmail_command" $options --silent $cflags $gmime_cflags + ./configure --prefix=$install_directory \ + --sysconfdir=$install_directory/bin \ + --datadir=$install_directory/bin \ + --datarootdir="\$confdir" \ + --libdir="\$confdir/lib" \ + --with-sendmail="$sendmail_command" \ + $options $cflags $gmime_cflags fi echo "Building parser3..."