autogen.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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 depcomp; do
  20. test -r /usr/share/automake/${i} && {
  21. rm -f ${i}
  22. }
  23. done
  24. tools/setup
  25. # For the Debian build
  26. test -d debian && {
  27. # Kill executable list first
  28. rm -f debian/executable.files
  29. # Make sure our executable and removable lists won't be screwed up
  30. debclean && echo Cleaned buildtree just in case...
  31. # refresh list of executable scripts, to avoid possible breakage if
  32. # upstream tarball does not include the file or if it is mispackaged
  33. # for whatever reason.
  34. echo Generating list of executable files...
  35. rm -f debian/executable.files
  36. find -type f -perm +111 ! -name '.*' -fprint debian/executable.files
  37. # link these in Debian builds
  38. rm -f config.sub config.guess
  39. ln -s /usr/share/misc/config.sub .
  40. ln -s /usr/share/misc/config.guess .
  41. }
  42. ./configure $*
  43. exit 0