"SfR Fresh" - the SfR Freeware/Shareware Archive

Member "gxine-0.5.903/autogen.sh" of archive gxine-0.5.903.tar.gz:


As a special service "SfR Fresh" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
    1 #!/bin/sh
    2 #
    3 # Copyright (C) 2000-2006 the xine project
    4 #
    5 # This file is part of xine, a unix video player.
    6 #
    7 # xine is free software; you can redistribute it and/or modify
    8 # it under the terms of the GNU General Public License as published by
    9 # the Free Software Foundation; either version 2 of the License, or
   10 # (at your option) any later version.
   11 #
   12 # xine is distributed in the hope that it will be useful,
   13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15 # GNU General Public License for more details.
   16 #
   17 # You should have received a copy of the GNU General Public License
   18 # along with this program; if not, write to the Free Software
   19 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
   20 #
   21 # Maintained by Stephen Torri <storri@users.sourceforge.net>
   22 #
   23 # run this to generate all the initial makefiles, etc.
   24 
   25 PROG=gxine
   26 
   27 # Minimum value required to build
   28 WANT_AUTOMAKE_1_8=1 export WANT_AUTOMAKE_1_8
   29 WANT_AUTOMAKE=1.8 export WANT_AUTOMAKE
   30 AUTOMAKE_MIN=1.8.0
   31 AUTOCONF_MIN=2.59
   32 LIBTOOL_MIN=1.4.0
   33 
   34 # Check how echo works in this /bin/sh
   35 case `echo -n` in
   36 -n)     _echo_n=   _echo_c='\c';;
   37 *)      _echo_n=-n _echo_c=;;
   38 esac
   39 
   40 detect_configure_ac() {
   41 
   42   srcdir=`dirname $0`
   43   test -z "$srcdir" && srcdir=.
   44 
   45   (test -f $srcdir/configure.ac) || {
   46     echo $_echo_n "*** Error ***: Directory "\`$srcdir\`" does not look like the"
   47     echo " top-level directory"
   48     exit 1
   49   }
   50 }
   51 
   52 parse_version_no() {
   53   # version no. is extended/truncated to three parts; only digits are handled
   54   perl -e 'my $v = <>;
   55 	   chomp $v;
   56 	   my @v = split (" ", $v);
   57 	   $v = $v[$#v];
   58 	   $v =~ s/[^0-9.].*$//;
   59 	   @v = split (/\./, $v);
   60 	   push @v, 0 while $#v < 2;
   61 	   print $v[0] * 10000 + $v[1] * 100 + $v[2], "\n"'
   62 }
   63 
   64 #--------------------
   65 # AUTOCONF
   66 #-------------------
   67 detect_autoconf() {
   68   set -- `type autoconf 2>/dev/null`
   69   RETVAL=$?
   70   NUM_RESULT=$#
   71   RESULT_FILE=$3
   72   if [ $RETVAL -eq 0 -a $NUM_RESULT -eq 3 -a -f "$RESULT_FILE" ]; then
   73     AC="`autoconf --version | parse_version_no`"
   74     if [ `expr $AC` -ge "`echo $AUTOCONF_MIN | parse_version_no`" ]; then
   75       autoconf_ok=yes
   76     fi
   77   else
   78     echo
   79     echo "**Error**: You must have \`autoconf' >= $AUTOCONF_MIN installed to"
   80     echo "           compile $PROG. Download the appropriate package"
   81     echo "           for your distribution or source from ftp.gnu.org."
   82     exit 1
   83   fi
   84 }
   85 
   86 run_autoheader () {
   87   if test x"$autoconf_ok" != x"yes"; then
   88     echo
   89     echo "**Warning**: Version of autoconf is less than $AUTOCONF_MIN."
   90     echo "             Some warning message might occur from autoconf"
   91     echo
   92   fi
   93 
   94   echo $_echo_n " + Running autoheader: $_echo_c";
   95     autoheader;
   96   echo "done."
   97 }
   98 
   99 run_autoconf () {
  100   if test x"$autoconf_ok" != x"yes"; then
  101     echo
  102     echo "**Warning**: Version of autoconf is less than $AUTOCONF_MIN."
  103     echo "             Some warning message might occur from autoconf"
  104     echo
  105   fi
  106 
  107   echo $_echo_n " + Running autoconf: $_echo_c";
  108     autoconf;
  109   echo "done."
  110 }
  111 
  112 #--------------------
  113 # LIBTOOL
  114 #-------------------
  115 try_libtool_executable() {
  116   libtool=$1
  117   set -- `type $libtool 2>/dev/null`
  118   RETVAL=$?
  119   NUM_RESULT=$#
  120   RESULT_FILE=$3
  121   if [ $RETVAL -eq 0 -a $NUM_RESULT -eq 3 -a -f "$RESULT_FILE" ]; then
  122     LT="`$libtool --version | awk '{ print $4 }' | parse_version_no`"
  123     if [ `expr $LT` -ge "`echo $LIBTOOL_MIN | parse_version_no`" ]; then
  124       libtool_ok=yes
  125     fi
  126   fi
  127 }
  128 
  129 detect_libtool() {
  130   # try glibtool first, then libtool
  131   try_libtool_executable 'glibtool'
  132   if [ "x$libtool_ok" != "xyes" ]; then
  133     try_libtool_executable 'libtool'
  134     if [ "x$libtool_ok" != "xyes" ]; then
  135       echo
  136       echo "**Error**: You must have \`libtool' >= $LIBTOOL_MIN installed to"
  137       echo "           compile $PROG. Download the appropriate package"
  138       echo "           for your distribution or source from ftp.gnu.org."
  139       exit 1
  140     fi
  141   fi
  142 }
  143 
  144 run_libtoolize() {
  145   if test x"$libtool_ok" != x"yes"; then
  146     echo
  147     echo "**Warning**: Version of libtool is less than $LIBTOOL_MIN."
  148     echo "             Some warning message might occur from libtool"
  149     echo
  150   fi
  151 
  152   echo $_echo_n " + Running libtoolize: $_echo_c";
  153     "${libtool}ize" --force --copy >/dev/null 2>&1;
  154   echo "done."
  155 }
  156 
  157 #--------------------
  158 # AUTOMAKE
  159 #--------------------
  160 detect_automake() {
  161   #
  162   # expected output from 'type' is
  163   #   automake is /usr/local/bin/automake
  164   #
  165   set -- `type automake 2>/dev/null`
  166   RETVAL=$?
  167   NUM_RESULT=$#
  168   RESULT_FILE=$3
  169   if [ $RETVAL -eq 0 -a $NUM_RESULT -eq 3 -a -f "$RESULT_FILE" ]; then
  170     AM="`automake --version | parse_version_no`"
  171     if [ `expr $AM` -ge "`echo $AUTOMAKE_MIN | parse_version_no`" ]; then
  172       automake_ok=yes
  173     fi
  174   else
  175     echo
  176     echo "**Error**: You must have \`automake' >= $AUTOMAKE_MIN installed to"
  177     echo "           compile $PROG. Download the appropriate package"
  178     echo "           for your distribution or source from ftp.gnu.org."
  179     exit 1
  180   fi
  181 }
  182 
  183 run_automake () {
  184   if test x"$automake_ok" != x"yes"; then
  185     echo
  186     echo "**Warning**: Version of automake is less than $AUTOMAKE_MIN."
  187     echo "             Some warning message might occur from automake"
  188     echo
  189   fi
  190 
  191   echo $_echo_n " + Running automake: $_echo_c";
  192 
  193   automake --gnu --add-missing --copy;
  194   echo "done."
  195 }
  196 
  197 #--------------------
  198 # ACLOCAL
  199 #-------------------
  200 detect_aclocal() {
  201 
  202   # if no automake, don't bother testing for aclocal;
  203   set -- `type aclocal 2>/dev/null`
  204   RETVAL=$?
  205   NUM_RESULT=$#
  206   RESULT_FILE=$3
  207   if [ $RETVAL -eq 0 -a $NUM_RESULT -eq 3 -a -f "$RESULT_FILE" ]; then
  208     AC="`aclocal --version | parse_version_no`"
  209     if [ `expr $AC` -ge "`echo $AUTOMAKE_MIN | parse_version_no`" ]; then
  210       aclocal_ok=yes
  211     fi
  212   else
  213     echo
  214     echo "**Error**: You must have \`automake' >= $AUTOMAKE_MIN installed to"
  215     echo "           compile $PROG. Download the appropriate package"
  216     echo "           for your distribution or source from ftp.gnu.org."
  217     exit 1
  218   fi
  219 }
  220 
  221 run_aclocal () {
  222 
  223   if test x"$aclocal_ok" != x"yes"; then
  224     echo
  225     echo "**Warning**: Version of aclocal is less than $AUTOMAKE_MIN."
  226     echo "             Some warning message might occur from aclocal"
  227     echo
  228   fi
  229 
  230   echo $_echo_n " + Running aclocal: $_echo_c"
  231 
  232   aclocalinclude=`if [ ! -z "$XINE_CONFIG" ]; then
  233 		    $XINE_CONFIG --acflags
  234 		  else
  235 		    pkg-config --atleast-version 1.1.90 libxine && pkg-config --variable=acflags libxine || xine-config --acflags
  236 		  fi`
  237 
  238   aclocal -I m4 -I m4/gettext $aclocalinclude
  239   echo "done."
  240 }
  241 
  242 #--------------------
  243 # CONFIGURE
  244 #-------------------
  245 run_configure () {
  246   rm -f config.cache
  247   echo " + Running 'configure $@':"
  248   if [ -z "$*" ]; then
  249     echo "   ** If you wish to pass arguments to ./configure, please"
  250     echo "   ** specify them on the command line."
  251   fi
  252   ./configure "$@"
  253 }
  254 
  255 
  256 #---------------
  257 # MAIN
  258 #---------------
  259 detect_configure_ac
  260 detect_autoconf
  261 detect_libtool
  262 detect_automake
  263 detect_aclocal
  264 
  265 
  266 #   help: print out usage message
  267 #   *) run aclocal, autoheader, automake, autoconf, configure
  268 case "$1" in
  269   aclocal)
  270     run_aclocal
  271     ;;
  272   autoheader)
  273     run_autoheader
  274     ;;
  275   automake)
  276     run_aclocal
  277     run_automake
  278     ;;
  279   autoconf)
  280     run_aclocal
  281     run_autoconf
  282     ;;
  283   libtoolize)
  284     run_libtoolize
  285     ;;
  286   noconfig)
  287     run_aclocal
  288     run_libtoolize
  289     run_autoheader
  290     run_automake
  291     run_autoconf
  292     ;;
  293   *)
  294     run_aclocal
  295     run_libtoolize
  296     run_autoheader
  297     run_automake
  298     run_autoconf
  299     run_configure "$@"
  300     ;;
  301 esac