autogen.sh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. bisonver=`bison --version`
  7. if [ "$bisonver" = "" ]; then
  8. echo Bison is needed to compile Claws Mail git
  9. exit 1
  10. fi
  11. if [ "$LEX" != "" ]; then
  12. flexver=`$LEX --version|awk '{print $2}'`
  13. else
  14. flexver=`flex --version|awk '{print $2}'`
  15. fi
  16. if [ "$flexver" = "" ]; then
  17. echo Flex 2.5.31 or greater is needed to compile Claws Mail git
  18. exit 1
  19. else
  20. flex_major=`echo $flexver|sed "s/\..*//"`
  21. flex_minor=`echo $flexver|sed "s/$flex_major\.\(.*\)\..*/\1/"`
  22. flex_micro=`echo $flexver|sed "s/$flex_major\.$flex_minor\.\(.*\)/\1/"`
  23. flex_numversion=$(expr \
  24. $flex_major \* 10000 + \
  25. $flex_minor \* 100 + \
  26. $flex_micro)
  27. if [ $flex_numversion -lt 20531 ]; then
  28. echo Flex 2.5.31 or greater is needed to compile Claws Mail git
  29. exit 1
  30. fi
  31. fi
  32. case `uname` in
  33. Darwin*)
  34. if [ "`glibtoolize --version`" = "" ]; then
  35. echo MacOS requires glibtool from either Macport or brew
  36. exit 1
  37. fi
  38. LIBTOOL="glibtoolize --force --copy"
  39. ;;
  40. *)
  41. LIBTOOL="libtoolize --force --copy"
  42. ;;
  43. esac
  44. ${LIBTOOL} \
  45. && aclocal -I m4 \
  46. && autoconf \
  47. && autoheader \
  48. && automake --add-missing --foreign --copy
  49. if test -z "$NOCONFIGURE"; then
  50. exec ./configure --enable-maintainer-mode "$@"
  51. fi