Fix #5432 - Comment report link doens't work
[mediagoblin.git] / configure.ac
index b3933e88da933f8d2c15ac4832a45d0bcd2392b6..15c42b1c0f74cb9f6ad2e960a4cb1ce09eec9d87 100644 (file)
@@ -1,6 +1,7 @@
 dnl configure.ac
 dnl
 dnl Copyright 2012, 2013 Brandon Invergo <brandon@invergo.net>
 dnl configure.ac
 dnl
 dnl Copyright 2012, 2013 Brandon Invergo <brandon@invergo.net>
+dnl           2014 MediaGoblin contributors (see MediaGoblin's AUTHORS)
 dnl
 dnl Copying and distribution of this file, with or without modification,
 dnl are permitted in any medium without royalty provided the copyright
 dnl
 dnl Copying and distribution of this file, with or without modification,
 dnl are permitted in any medium without royalty provided the copyright
@@ -45,19 +46,30 @@ dnl 2) package version (i.e. 1.2)
 dnl 3) bug/info/project email address (i.e. bug-foo@gnu.org)
 dnl----
 dnl
 dnl 3) bug/info/project email address (i.e. bug-foo@gnu.org)
 dnl----
 dnl
-AC_INIT([mediagoblin], [0.4.0.dev], [cwebber@gnu.org])
+
+dnl # valid version formats:
+dnl # * x.y      - final release
+dnl # * x.ya1    - alpha 1
+dnl # * x.yb1    - beta 1
+dnl # * x.yrc1   - release candidate 1
+dnl # * x.y.dev  - dev
+dnl 
+dnl # see http://www.python.org/dev/peps/pep-0386/
+
+AC_INIT([mediagoblin], [0.8.2.dev], [cwebber@gnu.org])
+
 
 dnl----
 dnl Load macros from the m4/ directory. If you plan to write new 
 dnl macros, put them in files in this directory.
 dnl----
 dnl
 
 dnl----
 dnl Load macros from the m4/ directory. If you plan to write new 
 dnl macros, put them in files in this directory.
 dnl----
 dnl
-AC_CONFIG_MACRO_DIR([m4])
+dnl AC_CONFIG_MACRO_DIR([m4])
 
 
 
 
-# The default prefix should be changed from /usr/local. Set it, as in
-# the documentation, to /srv/mediagoblin.example.org/mediagoblin/
-AC_PREFIX_DEFAULT([`pwd`])
+dnl # The default prefix should be changed from /usr/local. Set it, as in
+dnl # the documentation, to /srv/mediagoblin.example.org/mediagoblin/
+dnl AC_PREFIX_DEFAULT([`pwd`])
 
 
 dnl###########################
 
 
 dnl###########################
@@ -67,36 +79,26 @@ dnl
 dnl In this section, we check for the presence of important commands
 dnl and programs.
 
 dnl In this section, we check for the presence of important commands
 dnl and programs.
 
-dnl--PC_INIT----------------------------------------------------------
-dnl This is the only required macro. Its primary function is to find
-dnl a Python interpreter that is compatible with the package and set 
-dnl the PYTHON variable to hold its path. It can optionally take
-dnl arguments to specify minimum and/or maximum versions:
-dnl PC_INIT: find an interpreter with a version between 2.0 and 3.3.99
-dnl          (in other words, up to and including any possible release
-dnl          in the 3.3 series)
-dnl PC_INIT([MIN_VER], [MAX_VER]): Find an interpreter that is between
-dnl          the minimum and maximum version. If the min is in the 2.0
-dnl          series and the max is in the 3.0 series, non-existent 
-dnl          releases (2.8 & 2.9) will be correctly skipped.
+dnl--A bit simpler python init----------------------------------------
+dnl Expect python2.7 or python2.6 unless --with-python3 is given.
 dnl----
 dnl----
-dnl
-PC_INIT([2.6], [2.7.99])
-
-dnl--PC_PYTHON_PROG_PYTHON_CONFIG-------------------------------------
-dnl In order to use some of the other macros, you also need the 
-dnl python-config command, which will fall subject to the same problem 
-dnl of python3-config being preferred to python2-config. This macro
-dnl will be automatically included if you use on of the macros that 
-dnl depends on it, so you normally don't have to call it. However, if
-dnl you require a specific version, you can do something like the
-dnl following example.
-dnl----
-dnl
-PC_PYTHON_PROG_PYTHON_CONFIG([python2-config])
-if [[ "x$PYTHON_CONFIG" == "x" ]]; then
-   PC_PYTHON_PROG_PYTHON_CONFIG([$PYTHON-config])
-fi   
+
+
+AC_ARG_WITH([python3],
+       [AS_HELP_STRING([--with-python3], [Set up to use Python 3 by default.])],
+       [],
+       [with_python3=no])
+AS_IF([test "x$with_python3" != xno],
+        AC_CHECK_PROGS([PYTHON], [python3], [none])
+        AC_SUBST([USE_PYTHON3], [true])
+       AS_IF([test "x$PYTHON" = xnone],
+              [AC_MSG_FAILURE(
+               [--with-python3 given but no acceptable python3 could be found])]),
+      AC_CHECK_PROGS([PYTHON], [python2.7], [none])
+      AC_SUBST([USE_PYTHON3], [false])
+      AS_IF([test "x$PYTHON" = xnone],
+              [AC_MSG_FAILURE(
+               [No acceptable python (2.7) could be found])]))
 
 dnl----
 dnl With the following set of macros, we implement an option 
 
 dnl----
 dnl With the following set of macros, we implement an option 
@@ -107,10 +109,11 @@ dnl available, checking both for "virtualenv" and "virtualenv2"
 dnl (AC_CHECK_PROGS)
 dnl----
 dnl
 dnl (AC_CHECK_PROGS)
 dnl----
 dnl
-# Support installing to a virtualenv via the --with-virtualenv 
+# Support doing development in a virtualenv via the --with-virtualenv 
 # configure flag
 AC_ARG_WITH([virtualenv],
 # configure flag
 AC_ARG_WITH([virtualenv],
-       [AS_HELP_STRING([--without-virtualenv], [install to a Python virtualenv])],
+       [AS_HELP_STRING([--without-virtualenv],
+                        [don't install a Python virtualenv for the user])],
        [],
        [with_virtualenv=yes])
 AS_IF([test "x$with_virtualenv" != xno],
        [],
        [with_virtualenv=yes])
 AS_IF([test "x$with_virtualenv" != xno],
@@ -131,10 +134,10 @@ dnl print a warning. If the program uses some other documentation
 dnl system, you can do something similar with it.
 dnl----
 dnl
 dnl system, you can do something similar with it.
 dnl----
 dnl
-# Check for sphinx-build
-AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build sphinx-build3 sphinx-build2], [no])
-AS_IF([test "x$SPHINXBUILD" = xno], 
-    AC_MSG_WARN(sphinx-build is required to build documentation))
+dnl # Check for sphinx-build
+dnl AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build sphinx-build3 sphinx-build2], [no])
+dnl AS_IF([test "x$SPHINXBUILD" = xno], 
+dnl     AC_MSG_WARN(sphinx-build is required to build documentation))
 
 
 dnl----
 
 
 dnl----
@@ -145,51 +148,7 @@ dnl
 AC_PROG_MKDIR_P
 AC_PROG_INSTALL            
 
 AC_PROG_MKDIR_P
 AC_PROG_INSTALL            
 
-# Check for a supported database program
-AC_PATH_PROG([SQLITE], [sqlite3])
-AC_PATH_PROG([POSTGRES], [psql])
-AS_IF([test "x$SQLITE" = x -a "x$POSTGRES" = "x"],
-   [AC_MSG_ERROR([SQLite or PostgreSQL is required])])
-
-
-dnl--PC_PYTHON_SITE_PACKAGE_DIR---------------------------------------
-dnl This uses PYTHON_SITE_DIR to construct a directory for this
-dnl project (ie $PYTHON_SITE_DIR/project_name) and stores it in
-dnl pkgpythondir. This value is used by Automake for installing Python
-dnl scripts. By default, this begins with $pythondir, unexpanded, to
-dnl provide compatibility with GNU Makefile specifications, allowing
-dnl the user to change the prefix from the commandline.
-dnl----
-dnl
-PC_PYTHON_SITE_PACKAGE_DIR
-
-dnl--PC_PYTHON_EXEC_PACKAGE_DIR----------------------------------------
-dnl Same as PC_PYTHON_SITE_PACKAGE_DIR but for $exec-prefix. Stored in
-dnl pkgpyexecdir
-dnl----
-dnl
-PC_PYTHON_EXEC_PACKAGE_DIR
-
-
-dnl###############################
-dnl Checking Python capabilities #
-dnl###############################
-
-dnl--PC_PYTHON_CHECK_MODULE([PYTHON-MODULE], [ACTION-IF-PRESENT],
-dnl                         [ACTION-IF-ABSENT]) 
-dnl This macro lets you check if a given Python module exists on the
-dnl system.
-dnl----
-dnl
-dnl PC_PYTHON_CHECK_MODULE([foo])
-
-# Check for python-lxml module
-PC_PYTHON_CHECK_MODULE([lxml], [], 
-                       [AC_MSG_ERROR([python-lxml is required])])
-
-# Check for the Python Imaging Library
-PC_PYTHON_CHECK_MODULE([Image], [],
-                       [AC_MSG_ERROR([Python Imaging Library is required])])
+dnl--MediaGoblin specific commands/variables ------------------------
 
 
 dnl#########
 
 
 dnl#########
@@ -198,5 +157,6 @@ dnl#########
 
 dnl Define the files to be configured
 AC_CONFIG_FILES([Makefile])
 
 dnl Define the files to be configured
 AC_CONFIG_FILES([Makefile])
+
 dnl Generate config.status
 AC_OUTPUT
 dnl Generate config.status
 AC_OUTPUT