configure.ac 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. dnl configure.ac
  2. dnl
  3. dnl Copyright 2012, 2013 Brandon Invergo <brandon@invergo.net>
  4. dnl 2014 MediaGoblin contributors (see MediaGoblin's AUTHORS)
  5. dnl
  6. dnl Copying and distribution of this file, with or without modification,
  7. dnl are permitted in any medium without royalty provided the copyright
  8. dnl notice and this notice are preserved. This file is offered as-is,
  9. dnl without any warranty.
  10. dnl#########
  11. dnl README #
  12. dnl#########
  13. dnl
  14. dnl This is a basic Autoconf configure.ac file for Python-based
  15. dnl projects. It is not intended to be used as-is, but rather to be
  16. dnl modified to the specific needs of the project.
  17. dnl
  18. dnl Lines prefixed with "dnl" are comments that are automatically
  19. dnl removed by Autoconf/M4, thus they will not appear in the generated
  20. dnl configure script (see the M4 documentation for more information).
  21. dnl Such comments are used in this file to communicate information to
  22. dnl you, the developer. In some cases, the comments contain extra
  23. dnl macros that you might consider including in your configure script.
  24. dnl If you wish to include them, simply remove the "dnl" from the
  25. dnl beginning of the line.
  26. dnl
  27. dnl Lines prefixed with "#" are comments that will appear in the
  28. dnl generated configure script. These comments are thus used to clarify
  29. dnl to the user what is happening in that script
  30. dnl
  31. dnl Wherever pyconfigure-specific macros are used, extra comments are
  32. dnl included to describe the macros.
  33. dnl######################
  34. dnl Package Information #
  35. dnl######################
  36. dnl----
  37. dnl Initialize Autoconf with the package metadata
  38. dnl The arguments have been set via the project's PKG-INFO file
  39. dnl and correspond to:
  40. dnl
  41. dnl 1) package name (i.e. foo)
  42. dnl 2) package version (i.e. 1.2)
  43. dnl 3) bug/info/project email address (i.e. bug-foo@gnu.org)
  44. dnl----
  45. dnl
  46. dnl # valid version formats:
  47. dnl # * x.y - final release
  48. dnl # * x.ya1 - alpha 1
  49. dnl # * x.yb1 - beta 1
  50. dnl # * x.yrc1 - release candidate 1
  51. dnl # * x.y.dev - dev
  52. dnl
  53. dnl # see http://www.python.org/dev/peps/pep-0386/
  54. AC_INIT([mediagoblin], [0.8.0], [cwebber@gnu.org])
  55. dnl----
  56. dnl Load macros from the m4/ directory. If you plan to write new
  57. dnl macros, put them in files in this directory.
  58. dnl----
  59. dnl
  60. dnl AC_CONFIG_MACRO_DIR([m4])
  61. dnl # The default prefix should be changed from /usr/local. Set it, as in
  62. dnl # the documentation, to /srv/mediagoblin.example.org/mediagoblin/
  63. dnl AC_PREFIX_DEFAULT([`pwd`])
  64. dnl###########################
  65. dnl Program/command support #
  66. dnl###########################
  67. dnl
  68. dnl In this section, we check for the presence of important commands
  69. dnl and programs.
  70. dnl--A bit simpler python init----------------------------------------
  71. dnl Expect python2.7 or python2.6 unless --with-python3 is given.
  72. dnl----
  73. AC_ARG_WITH([python3],
  74. [AS_HELP_STRING([--with-python3], [Set up to use Python 3 by default.])],
  75. [],
  76. [with_python3=no])
  77. AS_IF([test "x$with_python3" != xno],
  78. AC_CHECK_PROGS([PYTHON], [python3.3], [none])
  79. AC_SUBST([USE_PYTHON3], [true])
  80. AS_IF([test "x$PYTHON" = xnone],
  81. [AC_MSG_FAILURE(
  82. [--with-python3 given but no acceptable python3 (3.3) could be found])]),
  83. AC_CHECK_PROGS([PYTHON], [python2.7], [none])
  84. AC_SUBST([USE_PYTHON3], [false])
  85. AS_IF([test "x$PYTHON" = xnone],
  86. [AC_MSG_FAILURE(
  87. [No acceptable python (2.7) could be found])]))
  88. dnl----
  89. dnl With the following set of macros, we implement an option
  90. dnl "--with-virtualenv", which the user can pass to the configure
  91. dnl script in order to install to a Virtualenv (AC_ARG_WITH). If the
  92. dnl option is specified by the user, then we check if the program is
  93. dnl available, checking both for "virtualenv" and "virtualenv2"
  94. dnl (AC_CHECK_PROGS)
  95. dnl----
  96. dnl
  97. # Support doing development in a virtualenv via the --with-virtualenv
  98. # configure flag
  99. AC_ARG_WITH([virtualenv],
  100. [AS_HELP_STRING([--without-virtualenv],
  101. [don't install a Python virtualenv for the user])],
  102. [],
  103. [with_virtualenv=yes])
  104. AS_IF([test "x$with_virtualenv" != xno],
  105. AC_CHECK_PROGS([VIRTUALENV], [virtualenv virtualenv3 virtualenv2], [no])
  106. AS_IF([test "x$VIRTUALENV" = xno],
  107. [AC_MSG_FAILURE(
  108. [--with-virtualenv given but virtualenv could not be found])]),
  109. AC_SUBST([VIRTUALENV], [no]))
  110. AC_ARG_VAR([VIRTUALENV_FLAGS], [flags to pass to the virtualenv command])
  111. dnl----
  112. dnl If the program uses sphinx-build to build documentation, uncomment
  113. dnl this to create a SPHINXBUILD variable in the Makefile pointing to
  114. dnl the program. Thus, the user would specify
  115. dnl SPHINXBUILD=/path/to/sphinx-build as an argument to the configure
  116. dnl script. Since building the documentation should be optional, just
  117. dnl print a warning. If the program uses some other documentation
  118. dnl system, you can do something similar with it.
  119. dnl----
  120. dnl
  121. dnl # Check for sphinx-build
  122. dnl AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build sphinx-build3 sphinx-build2], [no])
  123. dnl AS_IF([test "x$SPHINXBUILD" = xno],
  124. dnl AC_MSG_WARN(sphinx-build is required to build documentation))
  125. dnl----
  126. dnl These two are standard Autoconf macros which check for the
  127. dnl presence of some programs that we will use in the Makefile.
  128. dnl----
  129. dnl
  130. AC_PROG_MKDIR_P
  131. AC_PROG_INSTALL
  132. dnl--MediaGoblin specific commands/variables ------------------------
  133. dnl#########
  134. dnl Finish #
  135. dnl#########
  136. dnl Define the files to be configured
  137. AC_CONFIG_FILES([Makefile])
  138. dnl Generate config.status
  139. AC_OUTPUT