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