autogen.sh
author J. Ali Harlow <ali@juiblex.co.uk>
Thu Feb 09 20:45:27 2012 +0000 (2012-02-09)
changeset 418 33b825d3128d
parent 262 63644cc28e0b
child 438 fab0b8a61dcb
permissions -rwxr-xr-x
Add transaction barriers
These allow packages to be installed and removed which have scripts
that depend on each other when atomic transactions are involved.
Note that yum supports pre, but not other requires flags. post will
need similar support to the post scripts themselves pulling in the
requires flags from the rpms. Likewise preun and postun will need
similar handling to those scrips since the requires flags will need
to be stored in the razor database.
     1 #!/bin/sh
     2 # Run this to generate all the initial makefiles, etc.
     3 
     4 srcdir=`dirname $0`
     5 test -z "$srcdir" && srcdir=.
     6 
     7 DIE=0
     8 
     9 (test -f $srcdir/configure.ac) || {
    10     echo -n "**Error**: Directory $srcdir does not look like the"
    11     echo " top-level package directory"
    12     exit 1
    13 }
    14 
    15 (autoconf --version) < /dev/null > /dev/null 2>&1 || {
    16   echo
    17   echo "**Error**: You must have autoconf installed."
    18   echo "Download the appropriate package for your distribution,"
    19   echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
    20   DIE=1
    21 }
    22 
    23 (grep "^AM_PROG_LIBTOOL" $srcdir/configure.ac >/dev/null) && {
    24   (libtool --version) < /dev/null > /dev/null 2>&1 || {
    25     echo
    26     echo "**Error**: You must have libtool installed."
    27     echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
    28     DIE=1
    29   }
    30 }
    31 
    32 (automake --version) < /dev/null > /dev/null 2>&1 || {
    33   echo
    34   echo "**Error**: You must have automake installed."
    35   echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
    36   DIE=1
    37   NO_AUTOMAKE=yes
    38 }
    39 
    40 
    41 # if no automake, don't bother testing for aclocal
    42 test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
    43   echo
    44   echo "**Error**: Missing aclocal.  The version of automake"
    45   echo "installed doesn't appear recent enough."
    46   echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
    47   DIE=1
    48 }
    49 
    50 if [ -z "$GNULIB_TOOL" ]; then
    51   GNULIB_TOOL=`which gnulib-tool`
    52   if [ -z "$GNULIB_TOOL" ]; then
    53     echo
    54     echo "**Error**: Missing gnulib-tool.  Set GNULIB_TOOL to point"
    55     echo "to a copy of gnulib-tool which is not in your PATH."
    56     echo "You can get gnulib from http://www.gnu.org/software/gnulib/"
    57     DIE=1
    58   fi
    59 fi
    60 
    61 if test "$DIE" -eq 1; then
    62   exit 1
    63 fi
    64 
    65 if test -z "$*"; then
    66   echo "**Warning**: I am going to run configure with no arguments."
    67   echo "If you wish to pass any to it, please specify them on the"
    68   echo $0 " command line."
    69   echo
    70 fi
    71 
    72 case $CC in
    73 xlc )
    74   am_opt=--include-deps;;
    75 esac
    76 
    77       aclocalinclude="-I gl/m4 $ACLOCAL_FLAGS"
    78 
    79       if grep "^AM_PROG_LIBTOOL" configure.ac >/dev/null; then
    80 	if test -z "$NO_LIBTOOLIZE" ; then 
    81 	  echo "Running libtoolize..."
    82 	  libtoolize --force --copy
    83 	fi
    84       fi
    85       echo "Running aclocal $aclocalinclude ..."
    86       aclocal $aclocalinclude
    87       if grep "^AM_CONFIG_HEADER" configure.ac >/dev/null; then
    88 	echo "Running autoheader..."
    89 	autoheader
    90       fi
    91       echo "Running automake --gnu -Wno-portability $am_opt ..."
    92       automake --add-missing --gnu -Wno-portability $am_opt
    93       echo "Running autoconf ..."
    94       autoconf
    95 
    96 intltoolize --copy --force --automake                  || exit 1
    97 
    98 gtkdocize --copy --flavour no-tmpl
    99 
   100 echo "Running $GNULIB_TOOL --update ..."
   101 $GNULIB_TOOL --update
   102 
   103 conf_flags="--enable-maintainer-mode"
   104 
   105 if test x$NOCONFIGURE = x; then
   106   echo "Running $srcdir/configure $conf_flags $@ ..."
   107   $srcdir/configure $conf_flags "$@" \
   108   && echo "Now type make to compile." || exit 1
   109 else
   110   echo "Skipping configure process."
   111 fi