source: libcaca/trunk/bootstrap @ 1829

Last change on this file since 1829 was 1829, checked in by Sam Hocevar, 13 years ago
  • Further refined the tetex/texlive detection method.
  • Support for autotools-1.10.
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1#! /bin/sh
2
3# bootstrap: the ultimate bootstrap/autogen.sh script for autotools projects
4# Copyright (c) 2002, 2003, 2004, 2005, 2006 Sam Hocevar <sam@zoy.org>
5#
6#    This program is free software; you can redistribute it and/or
7#    modify it under the terms of the Do What The Fuck You Want To
8#    Public License, Version 2, as published by Sam Hocevar. See
9#    http://sam.zoy.org/wtfpl/COPYING for more details.
10#
11# The latest version of this script can be found at the following place:
12#   http://sam.zoy.org/autotools/
13
14# Die if an error occurs
15set -e
16
17# Guess whether we are using configure.ac or configure.in
18if test -f configure.ac; then
19  conffile="configure.ac"
20elif test -f configure.in; then
21  conffile="configure.in"
22else
23  echo "$0: could not find configure.ac or configure.in"
24  exit 1
25fi
26
27# Check for needed features
28auxdir="`sed -ne 's/^[ \t]*A._CONFIG_AUX_DIR *( *\([^ )]*\).*/\1/p' $conffile`"
29libtool="`grep -q '^[ \t]*A._PROG_LIBTOOL' $conffile && echo yes || echo no`"
30header="`grep -q '^[ \t]*A._CONFIG_HEADER' $conffile && echo yes || echo no`"
31
32# Check for automake
33amvers="no"
34for n in 10 9 8 7 6 5; do
35  for v in "-1.${n}" "1${n}"; do
36    if automake${v} --version >/dev/null 2>&1; then
37      amvers="${v}"
38      break
39    fi
40  done
41done
42
43if test "${amvers}" = "no" && automake --version > /dev/null 2>&1; then
44  amvers="`automake --version | sed -e '1s/[^0-9]*//' -e q`"
45  if expr "$amvers" "<" "1.5" > /dev/null 2>&1; then
46    amvers="no"
47  else
48    amvers=""
49  fi
50fi
51
52if test "$amvers" = "no"; then
53  echo "$0: you need automake version 1.5 or later"
54  exit 1
55fi
56
57# Check for autoconf
58acvers="no"
59for v in "" "259" "253"; do
60  if autoconf${v} --version >/dev/null 2>&1; then
61    acvers="${v}"
62    break
63  fi
64done
65
66if test "$acvers" = "no"; then
67  echo "$0: you need autoconf"
68  exit 1
69fi
70
71# Check for libtool
72if test "$libtool" = "yes"; then
73  libtoolize="no"
74  if glibtoolize --version >/dev/null 2>&1; then
75    libtoolize="glibtoolize"
76  else
77    for v in "16" "15" "" "14"; do
78      if libtoolize${v} --version >/dev/null 2>&1; then
79        libtoolize="libtoolize${v}"
80        break
81      fi
82    done
83  fi
84
85  if test "$libtoolize" = "no"; then
86    echo "$0: you need libtool"
87    exit 1
88  fi
89fi
90
91# Remove old cruft
92for x in aclocal.m4 configure config.guess config.log config.sub config.cache config.h.in config.h compile libtool.m4 ltoptions.m4 ltsugar.m4 ltversion.m4 ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh; do rm -f $x autotools/$x; if test -n "$auxdir"; then rm -f "$auxdir/$x"; fi; done
93rm -Rf autom4te.cache
94if test -n "$auxdir" -a ! -d "$auxdir"; then mkdir "$auxdir"; fi
95
96# Explain what we are doing from now
97set -x
98
99# Bootstrap package
100if test "$libtool" = "yes"; then
101  ${libtoolize} --copy --force
102  if test -n "$auxdir" -a -f "ltmain.sh"; then
103    echo "$0: working around a minor libtool issue"
104    mv ltmain.sh "$auxdir/"
105  fi
106fi
107
108if test -n "$auxdir"; then
109  aclocal${amvers} -I autotools
110else
111  aclocal${amvers}
112fi
113autoconf${acvers}
114if test "$header" = "yes"; then
115  autoheader${acvers}
116fi
117#add --include-deps if you want to bootstrap with any other compiler than gcc
118#automake${amvers} --add-missing --copy --include-deps
119automake${amvers} --foreign --add-missing --copy
120
121# Remove cruft that we no longer want
122rm -Rf autom4te.cache
123
Note: See TracBrowser for help on using the repository browser.