configure.mak 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # -*- make -*-
  2. # This make fragment is included by the toplevel make to handle configure
  3. # and setup. It defines a target called startup that when run will init
  4. # the build directory, generate configure from configure.ac, create aclocal
  5. # and has rules to run config.status should one of the .in files change.
  6. # Input
  7. # BUILDDIR - The build directory
  8. # CONVERTED - List of files output by configure $(BUILD) is prepended
  9. # The caller must provide depends for these files
  10. # It would be a fairly good idea to run this after a cvs checkout.
  11. BUILDDIR=build
  12. .PHONY: startup missing-config-files
  13. startup: $(BUILDDIR)/configure-stamp $(addprefix $(BUILDDIR)/,$(CONVERTED))
  14. # use the files provided from the system instead of carry around
  15. # and use (most of the time outdated) copycats
  16. ifeq (file-okay,$(shell test -r buildlib/config.sub && echo 'file-okay'))
  17. buildlib/config.sub:
  18. else
  19. ifeq (file-okay,$(shell test -r /usr/share/misc/config.sub && echo 'file-okay'))
  20. buildlib/config.sub:
  21. ln -sf /usr/share/misc/config.sub buildlib/config.sub
  22. else
  23. buildlib/config.sub: missing-config-files
  24. endif
  25. endif
  26. ifeq (file-okay,$(shell test -r buildlib/config.guess && echo 'file-okay'))
  27. buildlib/config.guess:
  28. else
  29. ifeq (file-okay,$(shell test -r /usr/share/misc/config.guess && echo 'file-okay'))
  30. buildlib/config.guess:
  31. ln -sf /usr/share/misc/config.guess buildlib/config.guess
  32. else
  33. buildlib/config.guess: missing-config-files
  34. endif
  35. endif
  36. missing-config-files:
  37. @echo "APT needs 'config.guess' and 'config.sub' in buildlib/ for configuration."
  38. @echo "On Debian systems these are available in the 'autotools-dev' package."
  39. @echo
  40. @echo "The latest versions can be acquired from the upstream git repository:"
  41. @echo "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD"
  42. @echo "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD"
  43. exit 100
  44. configure: aclocal.m4 configure.ac
  45. autoconf
  46. aclocal.m4: $(wildcard buildlib/*.m4)
  47. aclocal -I buildlib
  48. $(BUILDDIR)/configure-stamp: configure buildlib/config.guess buildlib/config.sub
  49. /usr/bin/test -e '$(BUILDDIR)' || mkdir '$(BUILDDIR)'
  50. (HERE="`pwd`"; cd '$(BUILDDIR)' && "$$HERE/configure")
  51. touch '$(BUILDDIR)/configure-stamp'
  52. $(addprefix $(BUILDDIR)/,$(CONVERTED)): $(BUILDDIR)/configure-stamp