AUTHORS, ChangeLog, NEWS, README: License under AGPL. (Such uniformity with source
[libale.git] / bootstrap
blob2fe746d8af561a5a6329928e0e6c25614a939971
1 #!/bin/bash
3 # Copyright 2008 David Hilvert <dhilvert@gmail.com>
5 # This file is part of libale.
7 # libale is free software: you can redistribute it and/or modify it under the
8 # terms of the GNU Affero General Public License as published by the Free
9 # Software Foundation, either version 3 of the License, or (at your option)
10 # any later version.
12 # libale is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 # FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for
15 # more details.
17 # You should have received a copy of the GNU Affero General Public License
18 # along with libale. If not, see <http://www.gnu.org/licenses/>.
20 ###
21 ### 'bootstrap' generates build files for distribution.
22 ###
25 # Check for the existence of a configure script.
28 if test -e configure && test "x$1" != "x-r"; then
29 echo
30 echo "To install:"
31 echo "1) Run './configure'."
32 echo "2) Run 'make'."
33 echo "3) Run 'make install'."
34 echo ""
35 echo "* To regenerate configure, run '$0 -r'"
36 echo
37 exit
40 function bootstrap_error {
41 exit
45 # Look for files we might need.
48 if ! which autoreconf &> /dev/null; then
49 echo "Cannot find autoreconf. Is autoconf installed?"
50 bootstrap_error
53 if ! which automake &> /dev/null; then
54 echo "Cannot find automake."
55 bootstrap_error
58 if ! which libtool &> /dev/null; then
59 echo "Cannot find libtool."
60 bootstrap_error
63 if ! test -e /usr/share/autoconf-archive/acx_pthread.m4; then
64 echo "Cannot find /usr/share/autoconf-archive/acx_pthread.m4. Is autoconf-archive installed?"
65 bootstrap_error
68 if ! test -e /usr/share/aclocal/guile.m4 &> /dev/null; then
69 echo "Cannot find /usr/share/aclocal/guile.m4. Is guile-1.8-dev (or later) installed?"
70 bootstrap_error
73 if ! which swig &> /dev/null; then
74 echo "Cannot find swig."
75 bootstrap_error
79 # Add autoconf archive files.
82 cp /usr/share/autoconf-archive/acx_pthread.m4 m4/.
83 cp /usr/share/autoconf-archive/ax_lang_compiler_ms.m4 m4/.
84 cp /usr/share/autoconf-archive/ax_check_gl.m4 m4/.
85 cp /usr/share/autoconf-archive/ax_check_glu.m4 m4/.
86 cp /usr/share/autoconf-archive/ax_check_glut.m4 m4/.
87 cp /usr/share/autoconf-archive/ax_cflags_warn_all.m4 m4/.
88 cp /usr/share/autoconf-archive/ac_c_long_long.m4 m4/.
91 # Run autotools' bootstrap script, adding things that automake thinks are
92 # missing, among other things (--install).
95 autoreconf --install
98 # Generate bindings with swig.
101 swig -guile -Iinclude -o src/libale-guile.c src/libale-guile.i
104 # Indicate that we're done.
107 echo ""
108 echo "Done."
111 # Tell the user what to do next.
114 echo
115 echo "To install:"
116 echo "1) Run './configure'."
117 echo "2) Run 'make'."
118 echo "3) Run 'make install'."