misc/libtremor/tremor/autogen.sh
changeset 7697 767d3c4153a1
parent 6045 9a7cc0f29430
child 7849 a12155461b34
equal deleted inserted replaced
7696:78a00bc68913 7697:767d3c4153a1
     1 #!/bin/sh
     1 #!/bin/sh
     2 # Run this to set up the build system: configure, makefiles, etc.
     2 # Run this to set up the build system: configure, makefiles, etc.
     3 # (based on the version in enlightenment's cvs)
     3 # (based on the version in enlightenment's cvs)
     4 
     4 
     5 package="vorbisdec"
     5 package="vorbisidec"
     6 
     6 
     7 olddir=`pwd`
       
     8 srcdir=`dirname $0`
     7 srcdir=`dirname $0`
     9 test -z "$srcdir" && srcdir=.
     8 test -z "$srcdir" && srcdir=.
    10 
     9 
    11 cd "$srcdir"
    10 cd "$srcdir"
    12 DIE=0
    11 DIE=0
    13 
    12 
    14 echo "checking for autoconf... "
       
    15 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
    13 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
    16         echo
    14         echo
    17         echo "You must have autoconf installed to compile $package."
    15         echo "You must have autoconf installed to compile $package."
    18         echo "Download the appropriate package for your distribution,"
    16         echo "Download the appropriate package for your distribution,"
    19         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
    17         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
    20         DIE=1
    18         DIE=1
    21 }
    19 }
    22 
    20 
    23 VERSIONGREP="sed -e s/.*[^0-9\.]\([0-9]\.[0-9]\).*/\1/"
    21 (automake --version) < /dev/null > /dev/null 2>&1 || {
    24 VERSIONMKINT="sed -e s/[^0-9]//"
       
    25                                                                                 
       
    26 # do we need automake?
       
    27 if test -r Makefile.am; then
       
    28   AM_OPTIONS=`fgrep AUTOMAKE_OPTIONS Makefile.am`
       
    29   AM_NEEDED=`echo $AM_OPTIONS | $VERSIONGREP`
       
    30   if test x"$AM_NEEDED" = "x$AM_OPTIONS"; then
       
    31     AM_NEEDED=""
       
    32   fi
       
    33   if test -z $AM_NEEDED; then
       
    34     echo -n "checking for automake... "
       
    35     AUTOMAKE=automake
       
    36     ACLOCAL=aclocal
       
    37     if ($AUTOMAKE --version < /dev/null > /dev/null 2>&1); then
       
    38       echo "yes"
       
    39     else
       
    40       echo "no"
       
    41       AUTOMAKE=
       
    42     fi
       
    43   else
       
    44     echo -n "checking for automake $AM_NEEDED or later... "
       
    45     for am in automake-$AM_NEEDED automake$AM_NEEDED automake; do
       
    46       ($am --version < /dev/null > /dev/null 2>&1) || continue
       
    47       ver=`$am --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT`
       
    48       verneeded=`echo $AM_NEEDED | $VERSIONMKINT`
       
    49       if test $ver -ge $verneeded; then
       
    50         AUTOMAKE=$am
       
    51         echo $AUTOMAKE
       
    52         break
       
    53       fi
       
    54     done
       
    55     test -z $AUTOMAKE &&  echo "no"
       
    56     echo -n "checking for aclocal $AM_NEEDED or later... "
       
    57     for ac in aclocal-$AM_NEEDED aclocal$AM_NEEDED aclocal; do
       
    58       ($ac --version < /dev/null > /dev/null 2>&1) || continue
       
    59       ver=`$ac --version < /dev/null | head -n 1 | $VERSIONGREP | $VERSIONMKINT`
       
    60       verneeded=`echo $AM_NEEDED | $VERSIONMKINT`
       
    61       if test $ver -ge $verneeded; then
       
    62         ACLOCAL=$ac
       
    63         echo $ACLOCAL
       
    64         break
       
    65       fi
       
    66     done
       
    67     test -z $ACLOCAL && echo "no"
       
    68   fi
       
    69   test -z $AUTOMAKE || test -z $ACLOCAL && {
       
    70         echo
    22         echo
    71         echo "You must have automake installed to compile $package."
    23         echo "You must have automake installed to compile $package."
    72         echo "Download the appropriate package for your distribution,"
    24 	echo "Download the appropriate package for your system,"
    73         echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
    25 	echo "or get the source from one of the GNU ftp sites"
    74         exit 1
    26 	echo "listed in http://www.gnu.org/order/ftp.html"
    75   }
    27         DIE=1
    76 fi
    28 }
    77 
    29 
    78 echo -n "checking for libtool... "
    30 (libtool --version) < /dev/null > /dev/null 2>&1 || {
    79 for LIBTOOLIZE in libtoolize glibtoolize nope; do
       
    80   ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 && break
       
    81 done
       
    82 if test x$LIBTOOLIZE = xnope; then
       
    83   echo "nope."
       
    84   LIBTOOLIZE=libtoolize
       
    85 else
       
    86   echo $LIBTOOLIZE
       
    87 fi
       
    88 ($LIBTOOLIZE --version) < /dev/null > /dev/null 2>&1 || {
       
    89 	echo
    31 	echo
    90 	echo "You must have libtool installed to compile $package."
    32 	echo "You must have libtool installed to compile $package."
    91 	echo "Download the appropriate package for your system,"
    33 	echo "Download the appropriate package for your system,"
    92 	echo "or get the source from one of the GNU ftp sites"
    34 	echo "or get the source from one of the GNU ftp sites"
    93 	echo "listed in http://www.gnu.org/order/ftp.html"
    35 	echo "listed in http://www.gnu.org/order/ftp.html"
   103         echo "to pass any to it, please specify them on the $0 command line."
    45         echo "to pass any to it, please specify them on the $0 command line."
   104 fi
    46 fi
   105 
    47 
   106 echo "Generating configuration files for $package, please wait...."
    48 echo "Generating configuration files for $package, please wait...."
   107 
    49 
   108 echo "  $ACLOCAL $ACLOCAL_FLAGS"
    50 echo "  aclocal $ACLOCAL_FLAGS"
   109 $ACLOCAL $ACLOCAL_FLAGS || exit 1
    51 aclocal $ACLOCAL_FLAGS || exit 1
   110 echo "  $LIBTOOLIZE --automake"
       
   111 $LIBTOOLIZE --automake || exit 1
       
   112 echo "  autoheader"
    52 echo "  autoheader"
   113 autoheader || exit 1
    53 autoheader || exit 1
   114 echo "  $AUTOMAKE --add-missing $AUTOMAKE_FLAGS"
    54 echo "  libtoolize --automake"
   115 $AUTOMAKE --add-missing $AUTOMAKE_FLAGS || exit 1
    55 libtoolize --automake || exit 1
       
    56 echo "  automake --add-missing $AUTOMAKE_FLAGS"
       
    57 automake --add-missing $AUTOMAKE_FLAGS  || exit 1
   116 echo "  autoconf"
    58 echo "  autoconf"
   117 autoconf || exit 1
    59 autoconf || exit 1
   118 
    60 
   119 cd $olddir
    61 $srcdir/configure "$@" && echo
   120 $srcdir/configure --enable-maintainer-mode "$@" && echo