3 # Copyright 2006 David Hilvert <dhilvert@auricle.dyndns.org>,
4 # <dhilvert@ugcs.caltech.edu>
6 # This file is part of the Anti-Lamenessing Engine.
8 # The Anti-Lamenessing Engine is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 3 of the License, or
11 # (at your option) any later version.
13 # The Anti-Lamenessing Engine is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Anti-Lamenessing Engine; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 ### 'bootstrap' generates build files for distribution.
27 # If a version argument is given, generate a tarball.
30 if test "x$1" = "x-v"; then
33 if test "x$BOOTSTRAP_VERSION" = "x"; then
34 echo "bootstrap: -v requires a version argument."
40 REMOTE_REPO
=`./version.sh git-repo`
42 GENERIC_PACKAGE_NAME
=`./version.sh invocation`
44 PACKAGE_NAME
="$GENERIC_PACKAGE_NAME-$BOOTSTRAP_VERSION"
50 if test $SOURCE_DIR = `pwd`; then
51 echo "$0: could not change directory from source."
56 if ! git clone
"$SOURCE_DIR" "$PACKAGE_NAME" && ! git clone
"$REMOTE_REPO" "$PACKAGE_NAME"; then
57 echo "$0: Could not perform git clone."
65 if ! git checkout
$BOOTSTRAP_VERSION && ! git checkout origin
/$BOOTSTRAP_VERSION; then
66 echo "$0: Could not check out version $BOOTSTRAP_VERSION."
72 mv .git ..
/git-moved-
$BOOTSTRAP_VERSION
74 if grep ":version:" VERSION
; then
75 (echo ":%s/^:version:.*/:version: $BOOTSTRAP_VERSION/"; echo ":wq") | ex VERSION
76 elif test -e VERSION
; then
77 echo "$BOOTSTRAP_VERSION" > VERSION
80 if test -e bootstrap
&& (! chmod a
+x bootstrap ||
! .
/bootstrap
); then
81 echo "$0: Nested bootstrap failed."
89 tar czf
$PACKAGE_NAME.
tar.gz
$PACKAGE_NAME
93 mv $TEMPDIR/$PACKAGE_NAME.
tar.gz .
97 echo "Bootstrapped package created as $PACKAGE_NAME.tar.gz."
103 # Check for the existence of a configure script.
106 if test -e configure
&& test "x$1" != "x-r"; then
109 echo "1) Run './configure'."
110 echo "2) Run 'make'."
111 echo "3) Run 'make install'."
113 echo "* To regenerate configure, run '$0 -r'"
120 if ! which gnulib-tool
&> /dev
/null
; then
121 echo "*** Cannot find 'gnulib-tool'. ***"
125 if ! which ln &> /dev
/null
; then
126 echo "*** Cannot find 'ln'. ***"
130 if ! which automake
&> /dev
/null
; then
131 echo "*** Cannot find 'automake'. ***"
135 if ! which autoreconf
&> /dev
/null
; then
136 echo "*** Cannot find 'autoreconf'. ***"
140 if ! test -e /usr
/share
/aclocal
/acx_pthread.
m4; then
141 echo "*** Cannot find file '/usr/share/aclocal/acx_pthread.m4'. ***"
146 # Add autoconf archive files.
150 cp /usr
/share
/aclocal
/acx_pthread.
m4 m
4/.
151 cp /usr
/share
/aclocal
/ax_lang_compiler_ms.
m4 m
4/.
152 cp /usr
/share
/aclocal
/ax_check_gl.
m4 m
4/.
153 cp /usr
/share
/aclocal
/ax_check_glu.
m4 m
4/.
154 cp /usr
/share
/aclocal
/ax_check_glut.
m4 m
4/.
160 chmod a
+x
doc
/make-changelog
161 chmod a
+x
doc
/make-infos
162 XSLT_VERSION_INFO
=`./version.sh -x`
163 export XSLT_VERSION_INFO
164 make -C doc ..
/TODO ..
/README ..
/ChangeLog ..
/NEWS
165 # XXX: Asciidoc considers out-of-directory includes unsafe.
166 a2x
--asciidoc-opts="--unsafe" -f manpage
doc
/man
/ale
.1.txt
169 # Make web documentation
175 # Import GNU extension strndup
178 gnulib-tool
--libtool --import strndup error strtod
181 # Placeholders for automake-mandated files.
188 # Use the automake-mandated spelling for the changelog.
191 # ln -s Changelog ChangeLog
194 # Run autotools' bootstrap script, adding things that automake thinks are
195 # missing, among other things (--install).
201 # Run automake again, with the --foreign option.
205 # echo "Rerunning automake with --foreign flag."
209 # Make wrapper script executable
215 # Indicate that we're done.
222 # Tell the user what to do next.
227 echo "1) Run './configure'."
228 echo "2) Run 'make'."
229 echo "3) Run 'make install'."