autogen.sh 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #!/bin/sh
  2. # Copyright 1999-2014 the Claws Mail team.
  3. # This file is part of Claws Mail package, and distributed under the
  4. # terms of the General Public License version 3 (or later).
  5. # See COPYING file for license details.
  6. # ***** W32 build script *******
  7. # Used to cross-compile for Windows.
  8. if test "$1" = "--build-w32"; then
  9. tmp=`dirname $0`
  10. tsdir=`cd "$tmp"; pwd`
  11. shift
  12. if [ ! -f $tsdir/config/config.guess ]; then
  13. echo "$tsdir/config/config.guess not found" >&2
  14. exit 1
  15. fi
  16. build=`$tsdir/config/config.guess`
  17. [ -z "$w32root" ] && w32root="$HOME/w32root"
  18. echo "Using $w32root as standard install directory" >&2
  19. if i586-mingw32msvc-gcc --version >/dev/null 2>&1 ; then
  20. host=i586-mingw32msvc
  21. crossbindir=/usr/$host/bin
  22. else
  23. echo "Debian's mingw32 cross-compiler packet is required" >&2
  24. exit 1
  25. fi
  26. if [ -f "$tsdir/config.log" ]; then
  27. if ! head $tsdir/config.log | grep "$host" >/dev/null; then
  28. echo "Pease run a 'make distclean' first" >&2
  29. exit 1
  30. fi
  31. fi
  32. ./configure --enable-maintainer-mode --prefix=${w32root} \
  33. --host=i586-mingw32msvc --build=${build} \
  34. --with-lib-prefix=${w32root} \
  35. --with-libiconv-prefix=${w32root} \
  36. --with-gpg-error-prefix=${w32root} \
  37. --with-gpgme-prefix=${w32root} \
  38. --with-config-dir="Claws-mail" \
  39. --disable-openssl --disable-dillo-viewer-plugin \
  40. --disable-nls --disable-libetpan --disable-enchant \
  41. --disable-trayicon-plugin --disable-spamassassin-plugin \
  42. --disable-bogofilter-plugin --disable-valgrind \
  43. PKG_CONFIG_LIBDIR="$w32root/lib/pkgconfig"
  44. rc=$?
  45. exit $rc
  46. fi
  47. # ***** end W32 build script *******
  48. bisonver=`bison --version`
  49. if [ "$bisonver" = "" ]; then
  50. echo Bison is needed to compile Claws Mail git
  51. exit 1
  52. fi
  53. if [ "$LEX" != "" ]; then
  54. flexver=`$LEX --version|sed "s/.* //"`
  55. else
  56. flexver=`flex --version|sed "s/.* //"`
  57. fi
  58. if [ "$flexver" = "" ]; then
  59. echo Flex 2.5.31 or greater is needed to compile Claws Mail git
  60. exit 1
  61. else
  62. flex_major=`echo $flexver|sed "s/\..*//"`
  63. flex_minor=`echo $flexver|sed "s/$flex_major\.\(.*\)\..*/\1/"`
  64. flex_micro=`echo $flexver|sed "s/$flex_major\.$flex_minor\.\(.*\)/\1/"`
  65. if [ $flex_major -lt 2 -o $flex_minor -lt 5 -o $flex_micro -lt 31 ]; then
  66. echo Flex 2.5.31 or greater is needed to compile Claws Mail git
  67. exit 1
  68. fi
  69. fi
  70. aclocal -I m4 \
  71. && libtoolize --force --copy \
  72. && autoheader \
  73. && automake --add-missing --foreign --copy \
  74. && autoconf
  75. if test -z "$NOCONFIGURE"; then
  76. exec ./configure --enable-maintainer-mode $@
  77. fi