diff options
author | Kalle Wallin <kaw@linux.se> | 2004-06-05 11:21:43 +0000 |
---|---|---|
committer | Kalle Wallin <kaw@linux.se> | 2004-06-05 11:21:43 +0000 |
commit | f55a67b3f882641abe5a9b14b045d7ce71964af7 (patch) | |
tree | 181c15b1c59df30b2e28058f2648e5e701e57c4f /autogen.sh | |
parent | 677eb1ad30321d83f6196672ea1798c0e1712870 (diff) | |
download | mpd-f55a67b3f882641abe5a9b14b045d7ce71964af7.tar.gz mpd-f55a67b3f882641abe5a9b14b045d7ce71964af7.tar.xz mpd-f55a67b3f882641abe5a9b14b045d7ce71964af7.zip |
Changed directory layout (for future use of gettext)
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1342 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rwxr-xr-x | autogen.sh | 162 |
1 files changed, 115 insertions, 47 deletions
diff --git a/autogen.sh b/autogen.sh index 72a235234..22e7897d7 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,54 +1,122 @@ -#! /bin/sh -# Check Autoconf version -if [ -x `which autoconf` ]; then - AC_VER=`autoconf --version | head -n 1 | sed 's/^[^0-9]*//'` - AC_VER_MAJOR=`echo $AC_VER | cut -f1 -d'.'` - AC_VER_MINOR=`echo $AC_VER | cut -f2 -d'.' | sed 's/[^0-9]*$//'` - - if [ "$AC_VER_MAJOR" -lt "2" ]; then - echo "Autoconf 2.13 or greater needed to build configure." - exit 1 - fi - - if [ "$AC_VER_MINOR" -lt "13" ]; then - echo "Autoconf 2.13 or greater needed to build configure." - exit 1 - fi - - if [ "$AC_VER_MINOR" -lt "50" ]; then - if [ ! -e configure.in ]; then - ln -s configure.ac configure.in - fi - echo "If you see some warnings about cross-compiling, don't worry; this is normal." - else - echo "rm -f configure.in ?" - fi -else - echo Autoconf not found. AlsaPlayer CVS requires autoconf to bootstrap itself. - exit 1 -fi +#!/bin/sh +# Run this to set up the build system: configure, makefiles, etc. +# (based on the version in enlightenment's cvs) + +package="ncmpc" + +olddir=`pwd` +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +cd "$srcdir" +DIE=0 + +echo "checking for autoconf... " +(autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have autoconf installed to compile $package." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} + +VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/" +VERSIONMKINT="sed -e s/[^0-9]//" -run_cmd() { - echo running $* ... - if ! $*; then - echo failed! - exit 1 +# do we need automake? +if test -r Makefile.am; then + AM_NEEDED=`fgrep AUTOMAKE_OPTIONS Makefile.am | $VERSIONGREP` + if test -z $AM_NEEDED; then + echo -n "checking for automake... " + AUTOMAKE=automake + ACLOCAL=aclocal + if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then + echo "no" + AUTOMAKE= + else + echo "yes" fi + else + echo -n "checking for automake $AM_NEEDED or later... " + for am in automake-$AM_NEEDED automake$AM_NEEDED automake; do + ($am --version < /dev/null > /dev/null 2>&1) || continue + ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT` + verneeded=`echo $AM_NEEDED | $VERSIONMKINT` + if test $ver -ge $verneeded; then + AUTOMAKE=$am + echo $AUTOMAKE + break + fi + done + test -z $AUTOMAKE && echo "no" + echo -n "checking for aclocal $AM_NEEDED or later... " + for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED aclocal; do + ($ac --version < /dev/null > /dev/null 2>&1) || continue + ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT` + verneeded=`echo $AM_NEEDED | $VERSIONMKINT` + if test $ver -ge $verneeded; then + ACLOCAL=$ac + echo $ACLOCAL + break + fi + done + test -z $ACLOCAL && echo "no" + fi + test -z $AUTOMAKE || test -z $ACLOCAL && { + echo + echo "You must have automake installed to compile $package." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + exit 1 + } +fi + +echo -n "checking for libtool... " +for LIBTOOLIZE in libtoolize glibtoolize nope; do + (which $LIBTOOLIZE) > /dev/null 2>&1 && break +done +if test x$LIBTOOLIZE = xnope; then + echo "nope." + LIBTOOLIZE=libtoolize +else + echo $LIBTOOLIZE +fi +($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have libtool installed to compile $package." + echo "Download the appropriate package for your system," + echo "or get the source from one of the GNU ftp sites" + echo "listed in http://www.gnu.org/order/ftp.html" + DIE=1 } -# Check if /usr/local/share/aclocal exists -if [ -d /usr/local/share/aclocal ]; then - ACLOCAL_INCLUDE="$ACLOCAL_INCLUDE -I /usr/local/share/aclocal" -fi +if test "$DIE" -eq 1; then + exit 1 +fi + +echo "Generating configuration files for $package, please wait...." if [ -d m4 ] ; then - run_cmd cat m4/*.m4 > acinclude.m4 + cat m4/*.m4 > acinclude.m4 +fi + +if [ -d /usr/local/share/aclocal ]; then + ACLOCAL_FLAGS="$ACLOCAL_FLAGS -I /usr/local/share/aclocal" fi -run_cmd aclocal $ACLOCAL_INCLUDE -run_cmd autoheader -run_cmd libtoolize --automake -run_cmd automake --add-missing -run_cmd autoconf -echo -echo "Now run './configure'" -echo +echo " $ACLOCAL $ACLOCAL_FLAGS" +$ACLOCAL $ACLOCAL_FLAGS + +echo " autoheader" +autoheader + +echo " $LIBTOOLIZE --automake" +$LIBTOOLIZE --automake + +echo " $AUTOMAKE --add-missing $AUTOMAKE_FLAGS" +$AUTOMAKE --add-missing $AUTOMAKE_FLAGS + +echo " autoconf" +autoconf + +cd $olddir +$srcdir/configure "$@" && echo |