~ubuntu-branches/ubuntu/trusty/flac/trusty-proposed

« back to all changes in this revision

Viewing changes to autogen.sh

  • Committer: Bazaar Package Importer
  • Author(s): Marc 'HE' Brockschmidt
  • Date: 2008-03-16 18:02:56 UTC
  • mfrom: (1.1.5 upstream) (8.1.2 gutsy)
  • Revision ID: james.westby@ubuntu.com-20080316180256-qhf3wk704rp165pm
Tags: 1.2.1-1.2
* Non-maintainer upload.
* Fix gcc-4.3 FTBFS, patch by KiBi (Closes: #455304)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
 
2
# Run this to set up the build system: configure, makefiles, etc.
 
3
# (based on the version in enlightenment's cvs)
2
4
 
3
 
# FLAC needs relatively recent versions of autotools for autogen.sh to
4
 
# run properly.  For example, if your autoconf is too old, it will not
5
 
# check for inttypes.h and compilation will fail later.  If you are
6
 
# having problems with autogen.sh it is best to upgrade to at least the
7
 
# following if possible:
8
 
#
9
 
# - autoconf 2.59
10
 
# - automake 1.8.5
11
 
# - libtool 1.5.6
12
 
#
13
 
# You may need to specify -I /SOME_PATH/share/aclocal if the packages
14
 
# FLAC relies on (autotools, libogg, libiconv) are installed in
15
 
# non-standard places.
 
5
# Some notes:
 
6
#
 
7
# You may need to specify -I /SOME_PATH/share/aclocal in ACLOCAL_FLAGS
 
8
# if any packages FLAC relies on (autotools, libogg, libiconv) are
 
9
# installed in non-standard places.
16
10
#
17
11
# If you don't have XMMS installed at all, you should comment out
18
12
# AM_PATH_XMMS in configure.in.
19
13
#
20
 
# 'hacks' is the place to put some commands you may need.  There is one
21
 
# that seems to be necessary in some situations:
22
 
#
23
 
#  * FLAC uses iconv but not gettext.  iconv requires config.rpath which
24
 
#    is supplied by gettext, which is copied in by gettextize.  But we
25
 
#    can't run gettextize since we do not fulfill all it's requirements
26
 
#    (because we don't use it).
27
 
#
28
 
# If the default doesn't work, try:
29
 
#
30
 
#hacks="cp /usr/share/gettext/config.rpath ."
31
 
#
32
 
# Otherwise, this is the no-op:
33
 
hacks=true
 
14
# FLAC uses iconv but not gettext.  iconv requires config.rpath which
 
15
# is supplied by gettext, which is copied in by gettextize.  But we
 
16
# can't run gettextize since we do not fulfill all it's requirements
 
17
# (because we don't use it).  So you may have to:
 
18
#
 
19
#   cp /usr/share/gettext/config.rpath .
 
20
#
 
21
# before running autogen.sh
 
22
#
 
23
# If you are running on OS X and get errors related to the AM_ICONV
 
24
# and/or AM_LANGINFO_CODESET macros, replace those 2 lines in
 
25
# configure.in with
 
26
#
 
27
#   AC_DEFINE([HAVE_ICONV], [], [Whether we have libiconv available]) LIBICONV="-liconv"
 
28
#   AC_SUBST(LIBICONV)
 
29
#
 
30
# See also http://lists.xiph.org/pipermail/flac-dev/2007-September/002384.html
34
31
#
35
32
# Also watchout, if you replace ltmain.sh, there is a bug in some
36
33
# versions of libtool (or maybe autoconf) on some platforms where the
37
34
# configure-generated libtool does not have $SED defined.  See also:
38
35
#
39
36
#   http://lists.gnu.org/archive/html/libtool/2003-11/msg00131.html
40
 
#
41
 
 
42
 
aclocal && libtoolize && autoconf && autoheader && $hacks && automake --foreign --include-deps --add-missing --copy
 
37
 
 
38
package="flac"
 
39
 
 
40
olddir=`pwd`
 
41
srcdir=`dirname $0`
 
42
test -z "$srcdir" && srcdir=.
 
43
 
 
44
cd "$srcdir"
 
45
DIE=0
 
46
 
 
47
ACLOCAL_FLAGS="-I m4 $ACLOCAL_FLAGS"
 
48
 
 
49
echo "checking for autoconf... "
 
50
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
 
51
        echo
 
52
        echo "You must have autoconf installed to compile $package."
 
53
        echo "Download the appropriate package for your distribution,"
 
54
        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
 
55
        DIE=1
 
56
}
 
57
 
 
58
VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/"
 
59
VERSIONMKMAJ="sed -e s/\([0-9][0-9]*\)[^0-9].*/\\1/"
 
60
VERSIONMKMIN="sed -e s/.*[0-9][0-9]*\.//"
 
61
 
 
62
# do we need automake?
 
63
if test -r Makefile.am; then
 
64
  AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am`
 
65
  AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP`
 
66
  if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then
 
67
    AM_NEEDED=""
 
68
  fi
 
69
  if test -z $AM_NEEDED; then
 
70
    echo -n "checking for automake... "
 
71
    AUTOMAKE=automake
 
72
    ACLOCAL=aclocal
 
73
    if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
 
74
      echo "yes"
 
75
    else
 
76
      echo "no"
 
77
      AUTOMAKE=
 
78
    fi
 
79
  else
 
80
    echo -n "checking for automake $AM_NEEDED or later... "
 
81
    majneeded=`echo $AM_NEEDED | $VERSIONMKMAJ`
 
82
    minneeded=`echo $AM_NEEDED | $VERSIONMKMIN`
 
83
    for am in automake-$AM_NEEDED automake$AM_NEEDED \
 
84
        automake automake-1.7 automake-1.8 automake-1.9 automake-1.10; do
 
85
      ($am --version < /dev/null > /dev/null 2>&1) || continue
 
86
      ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP`
 
87
      maj=`echo $ver | $VERSIONMKMAJ`
 
88
      min=`echo $ver | $VERSIONMKMIN`
 
89
      if test $maj -eq $majneeded -a $min -ge $minneeded; then
 
90
        AUTOMAKE=$am
 
91
        echo $AUTOMAKE
 
92
        break
 
93
      fi
 
94
    done
 
95
    test -z $AUTOMAKE &&  echo "no"
 
96
    echo -n "checking for aclocal $AM_NEEDED or later... "
 
97
    for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED \
 
98
        aclocal aclocal-1.7 aclocal-1.8 aclocal-1.9 aclocal-1.10; do
 
99
      ($ac --version < /dev/null > /dev/null 2>&1) || continue
 
100
      ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP`
 
101
      maj=`echo $ver | $VERSIONMKMAJ`
 
102
      min=`echo $ver | $VERSIONMKMIN`
 
103
      if test $maj -eq $majneeded -a $min -ge $minneeded; then
 
104
        ACLOCAL=$ac
 
105
        echo $ACLOCAL
 
106
        break
 
107
      fi
 
108
    done
 
109
    test -z $ACLOCAL && echo "no"
 
110
  fi
 
111
  test -z $AUTOMAKE || test -z $ACLOCAL && {
 
112
        echo
 
113
        echo "You must have automake installed to compile $package."
 
114
        echo "Download the appropriate package for your distribution,"
 
115
        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
 
116
        exit 1
 
117
  }
 
118
fi
 
119
 
 
120
echo -n "checking for libtool... "
 
121
for LIBTOOLIZE in libtoolize glibtoolize nope; do
 
122
  ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break
 
123
done
 
124
if test x$LIBTOOLIZE = xnope; then
 
125
  echo "nope."
 
126
  LIBTOOLIZE=libtoolize
 
127
else
 
128
  echo $LIBTOOLIZE
 
129
fi
 
130
($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
 
131
        echo
 
132
        echo "You must have libtool installed to compile $package."
 
133
        echo "Download the appropriate package for your system,"
 
134
        echo "or get the source from one of the GNU ftp sites"
 
135
        echo "listed in http://www.gnu.org/order/ftp.html"
 
136
        DIE=1
 
137
}
 
138
 
 
139
if test "$DIE" -eq 1; then
 
140
        exit 1
 
141
fi
 
142
 
 
143
if test -z "$*"; then
 
144
        echo "I am going to run ./configure with no arguments - if you wish "
 
145
        echo "to pass any to it, please specify them on the $0 command line."
 
146
fi
 
147
 
 
148
echo "Generating configuration files for $package, please wait...."
 
149
 
 
150
echo "  $ACLOCAL $ACLOCAL_FLAGS"
 
151
$ACLOCAL $ACLOCAL_FLAGS || exit 1
 
152
echo "  $LIBTOOLIZE --automake"
 
153
$LIBTOOLIZE --automake || exit 1
 
154
echo "  autoheader"
 
155
autoheader || exit 1
 
156
echo "  $AUTOMAKE --add-missing $AUTOMAKE_FLAGS"
 
157
$AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1
 
158
echo "  autoconf"
 
159
autoconf || exit 1
 
160
 
 
161
cd $olddir
 
162
$srcdir/configure --enable-maintainer-mode "$@" && echo