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