~ubuntu-branches/ubuntu/karmic/tovid/karmic

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Matvey Kozhev
  • Date: 2008-01-24 22:04:40 UTC
  • Revision ID: james.westby@ubuntu.com-20080124220440-x7cheljduf1rdgnq
Tags: upstream-0.31
ImportĀ upstreamĀ versionĀ 0.31

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Process this file with autoconf to produce a configure script.
 
2
# Autoconf documentation:
 
3
#     http://www.gnu.org/software/autoconf/manual/index.html
 
4
 
 
5
# Project homepage: http://www.tovid.org
 
6
#
 
7
#
 
8
# Copyright (C) 2005 tovid.org <http://www.tovid.org>
 
9
#
 
10
# This program is free software; you can redistribute it and/or
 
11
# modify it under the terms of the GNU General Public License
 
12
# as published by the Free Software Foundation; either
 
13
# version 2 of the License, or (at your option) any later
 
14
# version.
 
15
#
 
16
# This program is distributed in the hope that it will be useful,
 
17
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
18
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
19
# GNU General Public License for more details.
 
20
#
 
21
# You should have received a copy of the GNU General Public License
 
22
# along with this program; if not, write to the Free Software
 
23
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Or see:
 
24
#
 
25
#           http://www.gnu.org/licenses/gpl.txt
 
26
 
 
27
# ******************************************************************************
 
28
# ******************************************************************************
 
29
#
 
30
#
 
31
# INIT
 
32
#
 
33
#
 
34
# ******************************************************************************
 
35
# ******************************************************************************
 
36
 
 
37
# The first arugment sets the package name, the second sets the package version.
 
38
# eg [tovid], [0.40] would yield a tovid-0.40.tar.gz after "$ make dist"
 
39
#                    the version number is also substituted into tovid-init.in
 
40
AC_INIT([tovid], [0.31])
 
41
AC_CONFIG_SRCDIR([src/tovid])
 
42
 
 
43
# Require minimum versions of the autotools
 
44
AC_PREREQ(2.5)
 
45
AM_INIT_AUTOMAKE([1.9])
 
46
 
 
47
 
 
48
 
 
49
 
 
50
# ******************************************************************************
 
51
# ******************************************************************************
 
52
#
 
53
#
 
54
# CHECK FOR DEPENDENCIES
 
55
#
 
56
#
 
57
# ******************************************************************************
 
58
# ******************************************************************************
 
59
 
 
60
# The only 'compile time' dependency we have is txt2tags, which is used to
 
61
# build the man pages.
 
62
AC_CHECK_PROG(TXT2TAGS, [txt2tags], [:], [false])
 
63
if ! $TXT2TAGS; then
 
64
    AC_MSG_ERROR([
 
65
 
 
66
 ERROR:
 
67
 
 
68
 txt2tags cannot be found on your system, but tovid needs it to build
 
69
 the man pages. Please install txt2tags (http://txt2tags.sf.net) and
 
70
 run ./configure again. Thanks!
 
71
 
 
72
     -- http://tovid.org
 
73
])
 
74
fi
 
75
 
 
76
# All run-time dependencies are checked in tovid-init now. In addition to being
 
77
# the Correct Way to do things, it makes packaging much easier for deb|rpm|???
 
78
# maintainers.
 
79
 
 
80
# ******************************************************************************
 
81
# Python
 
82
# ******************************************************************************
 
83
# As seen on http://sources.redhat.com/automake/automake.html#Python
 
84
# AM_PATH_PYTHON sets many vars, including $(pythondir), which is the directory
 
85
# name for the site-packages subdirectory of the standard Python install tree;
 
86
# and $(pyexecdir), which is the directory where Python extension modules
 
87
# (shared libraries) should be installed.
 
88
 
 
89
# For example, on friedrij's woody debian system
 
90
# $(pythondir) = ${prefix}/lib/python2.3/site-packages
 
91
# $(pyexecdir) = ${exec_prefix}/lib/python2.3/site-packages
 
92
 
 
93
# From the autoconf manual, available in anything _but_ html (uf, fsf) from
 
94
# http://www.gnu.org/software/autoconf/manual/index.html
 
95
# $(prefix) is "The common installation prefix for all files. If $(exec_prefix)
 
96
# is defined to a different value, prefix is used only for architecture-
 
97
# independent files."
 
98
# $(exec_prefix) is "The installation prefix for architecture-dependent files.
 
99
# By default it's the same as $(prefix). You should avoid installing anything
 
100
# directly to $(exec_prefix). However, the default value for directories
 
101
# containing architecture-dependent files should be relative to $(exec_prefix)."
 
102
 
 
103
# The GNU Coding Standards, available in html (yosh) from
 
104
# (http://www.gnu.org/prep/standards/standards.html#Directory-Variables),
 
105
# clarifies the difference between $(prefix) and $(exec_prefix): "Generally,
 
106
# $(exec_prefix) is used for directories that contain machine-specific files
 
107
# (such as executables and subroutine libraries), while $(prefix) is used
 
108
# directly for other directories."
 
109
 
 
110
# So, this dev thinks we need $(pythondir) and some 'enlightened' python
 
111
# scripts, as pointed out by
 
112
# http://sources.redhat.com/automake/automake.html#Hard_002dCoded-Install-Paths
 
113
# If you do [use $(pythondir) or $(pyexecdir)], then:
 
114
#    * root users can install your package with the same --prefix as Python (you
 
115
#      get the behavior of the previous attempt - eg /usr/lib/python-2.3/...)
 
116
#    * non-root users can install your package too, they will have the extension
 
117
#      module in a place that is not searched by Python but they can work around
 
118
#      this using environment variables (and if you installed scripts that use
 
119
#      this shared library, it's easy to tell Python were to look in the
 
120
#      beginning of your script, so the script works in both cases).
 
121
 
 
122
# Using pythondir_PYTHON for libtovid will install it to
 
123
# ${prefix}/lib/python2.3/site-packages (for example)
 
124
# and the pytovid suite (left as bin_SCRIPTS, so that they are installed as
 
125
# executables and not byte-compiled like python_PYTHON would do) will need to be
 
126
# told how to look for libtovid.
 
127
 
 
128
AM_PATH_PYTHON(2.4)
 
129
 
 
130
# Attempt to inform user that their pyton installation won't work
 
131
#   with the default prefix (/usr/local)
 
132
USER_PYTHON_PATH=$(python -c "import sys; print sys.path")
 
133
PYTHON_LOCAL=$(echo $USER_PYTHON_PATH | awk -F ',' '{ for (f=1; f<=NF; f++) {print $f}; }' | grep local | tr -d "' ")
 
134
 
 
135
if test -z $PYTHON_LOCAL && test x"$prefix" == "xNONE"; then
 
136
    AC_MSG_ERROR([
 
137
 
 
138
    ERROR:
 
139
 
 
140
    It looks like your python installation doesn't look in /usr/local for
 
141
    python modules. tovid installs a few modules on your system, and if
 
142
    python can't find them, then tovid won't work!
 
143
 
 
144
    Please try:  ./configure --prefix=/usr
 
145
 
 
146
    to install tovid in a place where python will look for modules. Thanks!
 
147
 
 
148
        -- http://tovid.org
 
149
    ])
 
150
fi
 
151
 
 
152
 
 
153
# Check to see if this is a svn checkout and set version to revision number
 
154
if test "$PACKAGE_VERSION" = "svn" && test -e bootstrap; then
 
155
     VERSION="svn-r$(svn info bootstrap | grep Revision | awk '{print $2}')"
 
156
fi
 
157
 
 
158
AC_CONFIG_FILES([Makefile src/tovid-init])
 
159
AC_OUTPUT
 
160
 
 
161
 
 
162
# ******************************************************************************
 
163
# ******************************************************************************
 
164
#
 
165
# PRETTY SUMMARY
 
166
#
 
167
# ******************************************************************************
 
168
# ******************************************************************************
 
169
 
 
170
# Works for all distros
 
171
INSTALL_COMMAND="su -c \"make install\""
 
172
 
 
173
# but *buntu users are used to
 
174
if $(cat /proc/version | grep -iq buntu); then
 
175
    INSTALL_COMMAND="sudo make install"
 
176
fi
 
177
 
 
178
AC_MSG_NOTICE([
 
179
 
 
180
 
 
181
 You may now type '$INSTALL_COMMAND' to compile and install tovid.
 
182
 
 
183
   (or you can try to 'make sense' of it all...)
 
184
 ])