Diff for /parser3/buildall between versions 1.8 and 1.50

version 1.8, 2013/08/26 19:37:20 version 1.50, 2026/10/23 18:59:57
Line 9  cd .. Line 9  cd ..
 project_dir=`pwd`  project_dir=`pwd`
   
 build_xml="yes"  build_xml="yes"
   build_pcre2="yes"
 build_gmime=""  build_gmime=""
 build_apache=""  build_apache=""
 build_stripped=""  build_stripped=""
   direct_download=""
   
 options="--with-included-ltdl"  options="--with-included-ltdl"
 options="$options --with-gc=$project_dir/gc/lib"  options="$options --with-gc=$project_dir/lib/gc/lib"
 options="$options --with-pcre=$project_dir/pcre"  
 #options="$options --disable-stringstream"  #options="$options --disable-stringstream"
   
 echo "Building statically linked parser3\c"  printf "Building statically linked parser3"
 for PARAM in "$@"; do  for PARAM in "$@"; do
     case "$PARAM" in      case "$PARAM" in
         "--without-xml")          "--without-xml")
             echo ", without xml\c"              printf ", without xml"
             build_xml=""              build_xml=""
             ;;              ;;
           "--without-pcre2")
               printf ", without pcre2 library"
               build_pcre2=""
               ;;
         "--with-apache")          "--with-apache")
             echo ", with apache module\c"              printf ", with apache module"
             options="$options --with-apache"              options="$options --with-apache"
             build_apache="yes"              build_apache="yes"
             ;;              ;;
         "--with-mailreceive")          "--with-mailreceive")
             echo ", with mail receiving\c"              printf ", with mail receiving"
             options="$options --with-mailreceive=$project_dir/gnome"              options="$options --with-mailreceive=$project_dir/gmime"
             build_gmime="yes"              build_gmime="yes"
             ;;              ;;
           "--with-system-mailreceive")
               printf ", with mail receiving"
               options="$options --with-mailreceive"
               ;;
           "--with-amqp")
               printf ", with amqp"
               options="$options --with-amqp=$project_dir/lib/amqp"
               build_amqp="yes"
               ;;
           "--with-system-amqp")
               printf ", with amqp"
               options="$options --with-amqp"
               ;;
           "--with-redis")
               printf ", with redis"
               options="$options --with-redis=$project_dir/lib/redis"
               build_redis="yes"
               ;;
           "--with-system-redis")
               printf ", with redis"
               options="$options --with-redis"
               ;;
         "--strip")          "--strip")
             echo ", without debug information\c"              printf ", without debug information"
             build_stripped="yes"              build_stripped="yes"
             ;;              ;;
           "--direct-download")
               printf ", download sources from master"
               direct_download="yes"
               ;;
         "--help")          "--help")
             echo              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              exit 1
             ;;              ;;
         *)          *)
Line 54  if test "$build_xml" = "yes"; then Line 85  if test "$build_xml" = "yes"; then
     options="$options --with-xml=$project_dir/gnome"      options="$options --with-xml=$project_dir/gnome"
 fi  fi
   
 bits=`getconf LONG_BIT`  cflags="$cflags --with-pic"
 if test "$bits" = "64" -a "$build_apache" = "yes"; then  
     cflags="$cflags --with-pic"  
 else  
     cflags="$cflags --without-pic"  
 fi  
   
 if test ! "$build_apache" = "yes"; then  if test ! "$build_apache" = "yes"; then
     cflags="$cflags --disable-shared"      cflags="$cflags --disable-shared" # .so is needed only for parser3 Apache module, not bundled libs
 fi  fi
   
 download=`which fetch 2>/dev/null`  download=`which fetch 2>/dev/null`
Line 74  fi Line 100  fi
   
 ############################### Support functions ################################  ############################### Support functions ################################
   
 prepare_gz () {  prepare () {
     cd $project_dir/src      cd $project_dir/src
   
     if test ! -f "$1"; then      if test ! -f "$1"; then
         echo "Downloading $lib..."          if test "$direct_download" = "yes"; then
         $download $2$1              echo "Downloading $lib from $2..."
               $download $2$3
               if test "$3" != "$1"; then
                   mv "$3" "$1"
               fi
           else
               echo "Downloading $lib (master at $2)..."
               $download https://www.parser.ru/off-line/download/libs/$1
           fi
     fi      fi
   
     echo "Unpacking $lib..."      echo "Unpacking $lib..."
     rm -rf $lib      rm -rf $lib
   }
   
   prepare_gz () {
       prepare $1 $2 ${3:-$1}
     gunzip -c $1 | tar xf - >/dev/null      gunzip -c $1 | tar xf - >/dev/null
     cd $lib      cd $lib
 }  }
   
 prepare_xz () {  prepare_xz () {
     cd $project_dir/src      prepare $1 $2 ${3:-$1}
   
     if test ! -f "$1"; then  
         echo "Downloading $lib..."  
         $download $2$1  
     fi  
   
     echo "Unpacking $lib..."  
     rm -rf $lib  
     xzcat $1 | tar xf - >/dev/null      xzcat $1 | tar xf - >/dev/null
     cd $lib      cd $lib
 }  }
Line 112  cleanup () { Line 142  cleanup () {
 echo  echo
 mkdir src >/dev/null 2>&1  mkdir src >/dev/null 2>&1
   
 if test ! -f "$project_dir/gc/lib/libgc.a"; then  if test ! -f "$project_dir/lib/gc/lib/libgc.a"; then
 #   libgc="gc6.8" # FreeBSD 4.X is not supported in newer gc version      lib="libatomic_ops-7.10.0"
     lib="gc-7.2"      prepare_gz ${lib}.tar.gz https://github.com/bdwgc/libatomic_ops/releases/download/v7.10.0/
     prepare_gz ${lib}d.tar.gz http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/  
       lib="gc-8.2.12"
       prepare_gz ${lib}.tar.gz https://github.com/bdwgc/bdwgc/releases/download/v8.2.12/
   
       mv ../libatomic_ops-7.10.0 libatomic_ops
   
       echo "Configuring $lib..."
       CPPFLAGS="-DUSE_MMAP -DDONT_ADD_BYTE_AT_END -DALWAYS_SMALL_CLEAR_STACK" \
       ./configure --prefix=$project_dir/lib/gc \
           --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/lib/pcre2"
   
   if test ! -f "$project_dir/lib/pcre2/lib/libpcre2-8.a"; then
       lib="pcre2-10.49"
       prepare_gz $lib.tar.gz https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.49/
     echo "Configuring $lib..."      echo "Configuring $lib..."
     CPPFLAGS="-DUSE_LIBC_PRIVATES -DUSE_MMAP -DDONT_ADD_BYTE_AT_END" \      ./configure --prefix="$project_dir/lib/pcre2" \
     ./configure --prefix=$project_dir/gc \          --disable-jit \
         --disable-threads \          --with-match-limit-depth=10000 \
         --disable-shared \          --disable-shared \
         --silent $cflags          --silent $cflags
     echo "Building $lib..."      echo "Building $lib..."
Line 127  if test ! -f "$project_dir/gc/lib/libgc. Line 180  if test ! -f "$project_dir/gc/lib/libgc.
     cleanup      cleanup
 fi  fi
   
 if test ! -f "$project_dir/pcre/lib/libpcre.a"; then  else
     lib="pcre-8.30"  
     prepare_gz $lib.tar.gz ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/  options="$options --with-pcre=$project_dir/lib/pcre"
   
   if test ! -f "$project_dir/lib/pcre/lib/libpcre.a"; then
       lib="pcre-8.45"
       prepare_gz $lib.tar.gz https://sourceforge.net/projects/pcre/files/pcre/8.45/
     echo "Configuring $lib..."      echo "Configuring $lib..."
     ./configure --prefix="$project_dir/pcre" \      ./configure --prefix="$project_dir/lib/pcre" \
         --with-match-limit-recursion=10000 \          --with-match-limit-recursion=10000 \
         --enable-utf8 \          --enable-utf8 \
         --enable-unicode-properties \          --enable-unicode-properties \
Line 145  if test ! -f "$project_dir/pcre/lib/libp Line 202  if test ! -f "$project_dir/pcre/lib/libp
     cleanup      cleanup
 fi  fi
   
   fi
   
 if test "$build_xml" = "yes" -a ! -f "$project_dir/gnome/lib/libxml2.a"; then  if test "$build_xml" = "yes" -a ! -f "$project_dir/gnome/lib/libxml2.a"; then
     lib="libxml2-2.8.0"      lib="libxml2-2.9.9"
     prepare_gz $lib.tar.gz ftp://xmlsoft.org/libxml2/      prepare_gz $lib.tar.gz http://xmlsoft.org/download/
     #sax1, output, tree, xinclude[in libxslt], html[in libxslt, mode=html?], xptr[xinclude], pattern -- needed!      #sax1, output, tree, xinclude[in libxslt], html[in libxslt, mode=html?], xptr[xinclude], pattern -- needed!
     echo "Configuring $lib..."      echo "Configuring $lib..."
     ./configure --prefix=$project_dir/gnome \      ./configure --prefix=$project_dir/gnome \
         --without-catalog \          --without-catalog \
         --without-iconv \          --without-iconv \
         --without-threads \  
         --without-debug \          --without-debug \
         --without-iso8859x \          --without-iso8859x \
         --without-legacy \          --without-legacy \
         --without-push \          --without-push \
         --without-python \          --without-python \
         --without-reader \  
         --without-writer \          --without-writer \
         --without-readline \          --without-readline \
         --without-regexps \          --without-regexps \
Line 179  if test "$build_xml" = "yes" -a ! -f "$p Line 236  if test "$build_xml" = "yes" -a ! -f "$p
 fi  fi
   
 if test "$build_xml" = "yes" -a ! -f "$project_dir/gnome/lib/libxslt.a"; then  if test "$build_xml" = "yes" -a ! -f "$project_dir/gnome/lib/libxslt.a"; then
     lib="libxslt-1.1.26"      lib="libxslt-1.1.34"
     prepare_gz $lib.tar.gz ftp://xmlsoft.org/libxslt/      prepare_gz $lib.tar.gz http://xmlsoft.org/download/
     echo "Configuring $lib..."      echo "Configuring $lib..."
       CFLAGS="$CFLAGS -D__stub_clock_gettime -Dclock_gettime=choke_me" \
     ./configure --prefix=$project_dir/gnome \      ./configure --prefix=$project_dir/gnome \
         --with-libxml-prefix=$project_dir/gnome \          --with-libxml-prefix=$project_dir/gnome \
         --without-debug \          --without-debug \
Line 199  if test "$build_gmime" = "yes"; then Line 257  if test "$build_gmime" = "yes"; then
   
 glib_ldflags=""  glib_ldflags=""
 gmime_cflags=""  gmime_cflags=""
 gmime_ldflags="-L$project_dir/gnome/lib/"  gmime_ldflags="-L$project_dir/gmime/lib/"
   
 os=`uname`  if test "$(uname)" = "FreeBSD"; then
 if test "$os" = "FreeBSD"; then  
     gmime_cflags="CFLAGS=-I/usr/local/include CXXFLAGS=-I/usr/local/include"      gmime_cflags="CFLAGS=-I/usr/local/include CXXFLAGS=-I/usr/local/include"
     glib_ldflags="LDFLAGS=-L/usr/local/lib"      glib_ldflags="LDFLAGS=-L/usr/local/lib"
     gmime_ldflags="$gmime_ldflags -L/usr/local/lib"      gmime_ldflags="$gmime_ldflags -L/usr/local/lib"
 fi  fi
   
 if test ! -f "$project_dir/gnome/lib/libglib-2.0.a"; then  if test ! -f "$project_dir/gmime/lib/libglib-2.0.a"; then
     lib="glib-2.28.8"      lib="glib-2.28.8"
     prepare_xz $lib.tar.xz ftp://ftp.gnome.org/pub/GNOME/sources/glib/2.28/      prepare_xz $lib.tar.xz ftp://ftp.gnome.org/pub/GNOME/sources/glib/2.28/
     echo "Configuring $lib..."      echo "Configuring $lib..."
     ./configure --prefix=$project_dir/gnome \      ./configure --prefix=$project_dir/gmime \
         --enable-dtrace=no \          --enable-dtrace=no \
         --enable-debug=no \          --enable-debug=no \
         --enable-iconv-cache=no \          --enable-iconv-cache=no \
Line 227  if test ! -f "$project_dir/gnome/lib/lib Line 284  if test ! -f "$project_dir/gnome/lib/lib
     cleanup      cleanup
 fi  fi
   
 if test ! -f "$project_dir/gnome/lib/libgmime-2.4.a"; then  if test ! -f "$project_dir/gmime/lib/libgmime-2.4.a"; then
     lib="gmime-2.4.32"      lib="gmime-2.4.32"
     prepare_xz $lib.tar.xz ftp://ftp.gnome.org/pub/GNOME/sources/gmime/2.4/      prepare_xz $lib.tar.xz ftp://ftp.gnome.org/pub/GNOME/sources/gmime/2.4/
     echo "Configuring $lib..."      echo "Configuring $lib..."
     ./configure --prefix=$project_dir/gnome \      ./configure --prefix=$project_dir/gmime \
         --disable-glibtest \          --disable-glibtest \
         --disable-mono \          --disable-mono \
         --disable-shared \          --disable-shared \
         --enable-static \          --enable-static \
         --silent $cflags $gmime_cflags LDFLAGS="$gmime_ldflags" PKG_CONFIG_PATH="$project_dir/gnome/lib/pkgconfig"          --silent $cflags $gmime_cflags LDFLAGS="$gmime_ldflags" PKG_CONFIG_PATH="$project_dir/gmime/lib/pkgconfig"
     echo "Building $lib..."      echo "Building $lib..."
     make install      make install
     cleanup      cleanup
Line 244  fi Line 301  fi
   
 fi  fi
   
   
   if test "$build_amqp" = "yes" -a ! -f "$project_dir/lib/amqp/lib/librabbitmq.a"; then
       lib="rabbitmq-c-0.17.0"
       prepare_gz $lib.tar.gz https://github.com/alanxz/rabbitmq-c/archive/refs/tags/ v0.17.0.tar.gz
       echo "Configuring $lib..."
       cmake -S . -B build \
           -DCMAKE_INSTALL_PREFIX="$project_dir/lib/amqp" \
           -DCMAKE_INSTALL_LIBDIR=lib \
           -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
           -DBUILD_SHARED_LIBS=OFF \
           -DBUILD_TESTING=OFF \
           -DENABLE_SSL_SUPPORT=OFF || exit 1
       echo "Building $lib..."
       cmake --build build --target install || exit 1
       cleanup
   fi
   
   if test "$build_redis" = "yes" -a ! -f "$project_dir/lib/redis/lib/libhiredis.a"; then
       lib="hiredis-1.4.1"
       prepare_gz $lib.tar.gz https://github.com/redis/hiredis/archive/refs/tags/ v1.4.1.tar.gz
       echo "Building $lib..."
       gnu_make=make
       test "$(uname)" = "FreeBSD" && gnu_make="gmake CC=cc"
       $gnu_make PREFIX="$project_dir/lib/redis" install
       cleanup
   fi
   
 cd $parser3_dir  cd $parser3_dir
 if test ! -f "Makefile"; then  if test ! -f "Makefile"; then
     echo "Configuring parser3..."      echo "Configuring parser3..."
     ./configure --prefix=$install_directory "--with-sendmail=$sendmail_command" $options --silent $cflags $gmime_cflags      touch *
       ./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  fi
   
 echo "Building parser3..."  echo "Building parser3..."
Line 263  echo Line 354  echo
 echo "********************************************************************************************************"  echo "********************************************************************************************************"
 echo "Now you can copy $install_directory/bin to your cgi-bin directory"  echo "Now you can copy $install_directory/bin to your cgi-bin directory"
 echo "Read more about installing Parser here:"  echo "Read more about installing Parser here:"
 echo "  http://www.parser.ru/en/docs/lang/install4apachecgi.htm in English"  echo "  https://www.parser.ru/en/docs/lang/install4apachecgi.htm in English"
 echo "  http://www.parser.ru/docs/lang/install4apachecgi.htm in Russian"  echo "  https://www.parser.ru/docs/lang/install4apachecgi.htm in Russian"
 echo "********************************************************************************************************"  echo "********************************************************************************************************"
   

Removed from v.1.8  
changed lines
  Added in v.1.50


E-mail: