autogen.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/sh
  2. #
  3. # autogen.sh glue for CMU Cyrus IMAP
  4. # $Id$
  5. #
  6. # Requires: automake, autoconf, dpkg-dev
  7. # set -e
  8. MAKE=$(which gnumake)
  9. if test ! -x "$MAKE" ; then MAKE=$(which gmake) ; fi
  10. if test ! -x "$MAKE" ; then MAKE=$(which make) ; fi
  11. HAVE_GNU_MAKE=$($MAKE --version|grep -c "Free Software Foundation")
  12. if test "$HAVE_GNU_MAKE" != "1"; then
  13. echo Could not find GNU make on this system, can not proceed with build.
  14. exit 1
  15. else
  16. echo Found GNU Make at $MAKE ... good.
  17. fi
  18. # Refresh GNU autotools toolchain.
  19. for i in config.guess config.sub missing install-sh mkinstalldirs ; do
  20. test -r /usr/share/automake/${i} && {
  21. rm -f ${i}
  22. cp /usr/share/automake/${i} .
  23. }
  24. chmod 755 ${i}
  25. done
  26. aclocal -I lib
  27. autoheader
  28. automake -c -a
  29. autoconf
  30. # For the Debian build
  31. test -d debian && {
  32. # Kill executable list first
  33. rm -f debian/executable.files
  34. # Make sure our executable and removable lists won't be screwed up
  35. debclean && echo Cleaned buildtree just in case...
  36. # refresh list of executable scripts, to avoid possible breakage if
  37. # upstream tarball does not include the file or if it is mispackaged
  38. # for whatever reason.
  39. echo Generating list of executable files...
  40. rm -f debian/executable.files
  41. find -type f -perm +111 ! -name '.*' -fprint debian/executable.files
  42. # link these in Debian builds
  43. rm -f config.sub config.guess
  44. ln -s /usr/share/misc/config.sub .
  45. ln -s /usr/share/misc/config.guess .
  46. }
  47. ./configure $*
  48. exit 0