[svn r936] fixed autotools scripst trunk
authorrenatofilho
Mon Feb 25 18:09:36 2008 +0000 (2008-02-25)
branchtrunk
changeset 927e00cde497192
parent 926 84b9b65e511f
child 928 2cd533f0c637
[svn r936] fixed autotools scripst
gmyth/Makefile.am
gmyth/autogen.sh
gmyth/common/Makefile.am
gmyth/common/autogen-helper.sh
gmyth/configure.ac
gmyth/m4/Makefile.am
     1.1 --- a/gmyth/Makefile.am	Mon Feb 25 18:04:30 2008 +0000
     1.2 +++ b/gmyth/Makefile.am	Mon Feb 25 18:09:36 2008 +0000
     1.3 @@ -1,4 +1,5 @@
     1.4  SUBDIRS= gmyth samples tests
     1.5 +DIST_SUBDIRS= m4 gmyth samples tests
     1.6  
     1.7  pkgconfigdir = $(libdir)/pkgconfig
     1.8  pkgconfig_DATA = gmyth.pc
     2.1 --- a/gmyth/autogen.sh	Mon Feb 25 18:04:30 2008 +0000
     2.2 +++ b/gmyth/autogen.sh	Mon Feb 25 18:09:36 2008 +0000
     2.3 @@ -1,102 +1,19 @@
     2.4  #!/bin/sh
     2.5  # Run this to generate all the initial makefiles, etc.
     2.6  
     2.7 -DIE=0
     2.8 -package=gmyth
     2.9 -srcfile=configure.ac
    2.10 +srcdir=`dirname $0`
    2.11 +test -z "$srcdir" && srcdir=.
    2.12  
    2.13 -# a quick cvs co if necessary to alleviate the pain - may remove this
    2.14 -# when developers get a clue ;)
    2.15 -if test ! -d common; 
    2.16 -then 
    2.17 -  echo "+ getting common/ from svn"
    2.18 - svn co common 
    2.19 -fi
    2.20 +PKG_NAME="gmythdbus"
    2.21  
    2.22 -# source helper functions
    2.23 -if test ! -f common/autogen-helper.sh;
    2.24 -then
    2.25 -  echo There is something wrong with your source tree.
    2.26 -  echo You are missing common/autogen-helper.sh
    2.27 -  exit 1
    2.28 -fi
    2.29 -. common/autogen-helper.sh
    2.30 -
    2.31 -CONFIGURE_DEF_OPT='--enable-maintainer-mode'
    2.32 -# uncomment below to disable the UPnP features
    2.33 -CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --disable-upnp"
    2.34 -CONFIGURE_EXT_OPT="$@"
    2.35 -
    2.36 -autogen_options 
    2.37 -
    2.38 -echo -n "+ check for build tools"
    2.39 -if test ! -z "$NOCHECK"; then echo " skipped"; else  echo; fi
    2.40 -version_check "autoconf" "$AUTOCONF autoconf autoconf-2.54 autoconf-2.53" \
    2.41 -              "ftp://ftp.gnu.org/pub/gnu/autoconf/" 2 53 || DIE=1
    2.42 -version_check "automake" "$AUTOMAKE automake automake-1.9 automake-1.8 automake-1.7 automake-1.6" \
    2.43 -              "ftp://ftp.gnu.org/pub/gnu/automake/" 1 6 || DIE=1
    2.44 -version_check "libtoolize" "$LIBTOOLIZE libtoolize" \
    2.45 -              "ftp://ftp.gnu.org/pub/gnu/libtool/" 1 5 0 || DIE=1
    2.46 -version_check "pkg-config" "" \
    2.47 -              "http://www.freedesktop.org/software/pkgconfig" 0 8 0 || DIE=1
    2.48 -
    2.49 -die_check $DIE
    2.50 -
    2.51 -aclocal_check || DIE=1
    2.52 -autoheader_check || DIE=1
    2.53 -
    2.54 -die_check $DIE
    2.55 -
    2.56 -# if no arguments specified then this will be printed
    2.57 -if test -z "$*"; then
    2.58 -  echo "+ checking for autogen.sh options"
    2.59 -  echo "  This autogen script will automatically run ./configure as:"
    2.60 -  echo "  ./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT"
    2.61 -  echo "  To pass any additional options, please specify them on the $0"
    2.62 -  echo "  command line."
    2.63 -fi
    2.64 -
    2.65 -toplevel_check $srcfile
    2.66 -
    2.67 -tool_run "$aclocal" "-I m4 $ACLOCAL_FLAGS"
    2.68 -tool_run "$libtoolize" "--copy --force"
    2.69 -tool_run "$autoheader"
    2.70 -
    2.71 -# touch the stamp-h.in build stamp so we don't re-run autoheader in maintainer mode -- wingo
    2.72 -echo timestamp > stamp-h.in 2> /dev/null
    2.73 -
    2.74 -tool_run "$autoconf"
    2.75 -tool_run "$automake" "-a -c"
    2.76 -
    2.77 -# if enable exists, add an -enable option for each of the lines in that file
    2.78 -if test -f enable; then
    2.79 -  for a in `cat enable`; do
    2.80 -    CONFIGURE_FILE_OPT="--enable-$a"
    2.81 -  done
    2.82 -fi
    2.83 -
    2.84 -# if disable exists, add an -disable option for each of the lines in that file
    2.85 -if test -f disable; then
    2.86 -  for a in `cat disable`; do
    2.87 -    CONFIGURE_FILE_OPT="$CONFIGURE_FILE_OPT --disable-$a"
    2.88 -  done
    2.89 -fi
    2.90 -
    2.91 -test -n "$NOCONFIGURE" && {
    2.92 -  echo "+ skipping configure stage for package $package, as requested."
    2.93 -  echo "+ autogen.sh done."
    2.94 -  exit 0
    2.95 +(test -f $srcdir/configure.ac) || {
    2.96 +    echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
    2.97 +    echo " top-level $PKG_NAME directory"
    2.98 +    exit 1
    2.99  }
   2.100  
   2.101 -echo "+ running configure ... "
   2.102 -test ! -z "$CONFIGURE_DEF_OPT" && echo "  ./configure default flags: $CONFIGURE_DEF_OPT"
   2.103 -test ! -z "$CONFIGURE_EXT_OPT" && echo "  ./configure external flags: $CONFIGURE_EXT_OPT"
   2.104 -test ! -z "$CONFIGURE_FILE_OPT" && echo "  ./configure enable/disable flags: $CONFIGURE_FILE_OPT"
   2.105 -echo
   2.106 -
   2.107 -./configure $CONFIGURE_DEF_OPT $CONFIGURE_EXT_OPT $CONFIGURE_FILE_OPT || {
   2.108 -        echo "  configure failed"
   2.109 -        exit 1
   2.110 +which gnome-autogen.sh || {
   2.111 +    echo "You need to install gnome-common from the GNOME CVS"
   2.112 +    exit 1
   2.113  }
   2.114 -
   2.115 -echo "Now type 'make' to compile $package."
   2.116 +REQUIRED_AUTOMAKE_VERSION=1.9 USE_GNOME2_MACROS=1 . gnome-autogen.sh -I./m4
     3.1 --- a/gmyth/common/Makefile.am	Mon Feb 25 18:04:30 2008 +0000
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,1 +0,0 @@
     3.4 -EXTRA_DIST = autogen-helper.sh
     4.1 --- a/gmyth/common/autogen-helper.sh	Mon Feb 25 18:04:30 2008 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,302 +0,0 @@
     4.4 -# a silly hack that generates autoregen.sh but it's handy
     4.5 -echo "#!/bin/sh" > autoregen.sh
     4.6 -echo "./autogen.sh $@ \$@" >> autoregen.sh
     4.7 -chmod +x autoregen.sh
     4.8 -
     4.9 -# helper functions for autogen.sh
    4.10 -
    4.11 -debug ()
    4.12 -# print out a debug message if DEBUG is a defined variable
    4.13 -{
    4.14 -  if test ! -z "$DEBUG"
    4.15 -  then
    4.16 -    echo "DEBUG: $1"
    4.17 -  fi
    4.18 -}
    4.19 -
    4.20 -version_check ()
    4.21 -# check the version of a package
    4.22 -# first argument : package name (executable)
    4.23 -# second argument : optional path where to look for it instead
    4.24 -# third argument : source download url
    4.25 -# rest of arguments : major, minor, micro version
    4.26 -# all consecutive ones : suggestions for binaries to use
    4.27 -# (if not specified in second argument)
    4.28 -{
    4.29 -  PACKAGE=$1
    4.30 -  PKG_PATH=$2
    4.31 -  URL=$3
    4.32 -  MAJOR=$4
    4.33 -  MINOR=$5
    4.34 -  MICRO=$6
    4.35 -
    4.36 -  # for backwards compatibility, we let PKG_PATH=PACKAGE when PKG_PATH null
    4.37 -  if test -z "$PKG_PATH"; then PKG_PATH=$PACKAGE; fi
    4.38 -  debug "major $MAJOR minor $MINOR micro $MICRO"
    4.39 -  VERSION=$MAJOR
    4.40 -  if test ! -z "$MINOR"; then VERSION=$VERSION.$MINOR; else MINOR=0; fi
    4.41 -  if test ! -z "$MICRO"; then VERSION=$VERSION.$MICRO; else MICRO=0; fi
    4.42 -
    4.43 -  debug "major $MAJOR minor $MINOR micro $MICRO"
    4.44 -  
    4.45 -  for SUGGESTION in $PKG_PATH; do 
    4.46 -    COMMAND="$SUGGESTION"
    4.47 -
    4.48 -    # don't check if asked not to
    4.49 -    test -z "$NOCHECK" && {
    4.50 -      echo -n "  checking for $COMMAND >= $VERSION ... "
    4.51 -    } || {
    4.52 -      # we set a var with the same name as the package, but stripped of
    4.53 -      # unwanted chars
    4.54 -      VAR=`echo $PACKAGE | sed 's/-//g'`
    4.55 -      debug "setting $VAR"
    4.56 -      eval $VAR="$COMMAND"
    4.57 -      return 0
    4.58 -    }
    4.59 -
    4.60 -    debug "checking version with $COMMAND"
    4.61 -    ($COMMAND --version) < /dev/null > /dev/null 2>&1 || 
    4.62 -    {
    4.63 -      echo "not found."
    4.64 -      continue
    4.65 -    }
    4.66 -    # strip everything that's not a digit, then use cut to get the first field
    4.67 -    pkg_version=`$COMMAND --version|head -n 1|sed 's/^[^0-9]*//'|cut -d' ' -f1`
    4.68 -    debug "pkg_version $pkg_version"
    4.69 -    # remove any non-digit characters from the version numbers to permit numeric
    4.70 -    # comparison
    4.71 -    pkg_major=`echo $pkg_version | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
    4.72 -    pkg_minor=`echo $pkg_version | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
    4.73 -    pkg_micro=`echo $pkg_version | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
    4.74 -    test -z "$pkg_major" && pkg_major=0
    4.75 -    test -z "$pkg_minor" && pkg_minor=0
    4.76 -    test -z "$pkg_micro" && pkg_micro=0
    4.77 -    debug "found major $pkg_major minor $pkg_minor micro $pkg_micro"
    4.78 -
    4.79 -    #start checking the version
    4.80 -    debug "version check"
    4.81 -
    4.82 -    # reset check
    4.83 -    WRONG=
    4.84 -
    4.85 -    if [ ! "$pkg_major" -gt "$MAJOR" ]; then
    4.86 -      debug "major: $pkg_major <= $MAJOR"
    4.87 -      if [ "$pkg_major" -lt "$MAJOR" ]; then
    4.88 -        debug "major: $pkg_major < $MAJOR"
    4.89 -        WRONG=1
    4.90 -      elif [ ! "$pkg_minor" -gt "$MINOR" ]; then
    4.91 -        debug "minor: $pkg_minor <= $MINOR"
    4.92 -        if [ "$pkg_minor" -lt "$MINOR" ]; then
    4.93 -          debug "minor: $pkg_minor < $MINOR"
    4.94 -          WRONG=1
    4.95 -        elif [ "$pkg_micro" -lt "$MICRO" ]; then
    4.96 -          debug "micro: $pkg_micro < $MICRO"
    4.97 -	  WRONG=1
    4.98 -        fi
    4.99 -      fi
   4.100 -    fi
   4.101 -
   4.102 -    if test ! -z "$WRONG"; then
   4.103 -      echo "found $pkg_version, not ok !"
   4.104 -      continue
   4.105 -    else
   4.106 -      echo "found $pkg_version, ok."
   4.107 -      # we set a var with the same name as the package, but stripped of
   4.108 -      # unwanted chars
   4.109 -      VAR=`echo $PACKAGE | sed 's/-//g'`
   4.110 -      debug "setting $VAR"
   4.111 -      eval $VAR="$COMMAND"
   4.112 -      return 0
   4.113 -    fi
   4.114 -  done
   4.115 -
   4.116 -  echo "not found !"
   4.117 -  echo "You must have $PACKAGE installed to compile $package."
   4.118 -  echo "Download the appropriate package for your distribution,"
   4.119 -  echo "or get the source tarball at $URL"
   4.120 -  return 1;
   4.121 -}
   4.122 -
   4.123 -aclocal_check ()
   4.124 -{
   4.125 -  # normally aclocal is part of automake
   4.126 -  # so we expect it to be in the same place as automake
   4.127 -  # so if a different automake is supplied, we need to adapt as well
   4.128 -  # so how's about replacing automake with aclocal in the set var,
   4.129 -  # and saving that in $aclocal ?
   4.130 -  # note, this will fail if the actual automake isn't called automake*
   4.131 -  # or if part of the path before it contains it
   4.132 -  if [ -z "$automake" ]; then
   4.133 -    echo "Error: no automake variable set !"
   4.134 -    return 1
   4.135 -  else
   4.136 -    aclocal=`echo $automake | sed s/automake/aclocal/`
   4.137 -    debug "aclocal: $aclocal"
   4.138 -    if [ "$aclocal" != "aclocal" ];
   4.139 -    then
   4.140 -      CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-aclocal=$aclocal"
   4.141 -    fi
   4.142 -    if [ ! -x `which $aclocal` ]; then
   4.143 -      echo "Error: cannot execute $aclocal !"
   4.144 -      return 1
   4.145 -    fi
   4.146 -  fi
   4.147 -}
   4.148 -
   4.149 -autoheader_check ()
   4.150 -{
   4.151 -  # same here - autoheader is part of autoconf
   4.152 -  # use the same voodoo
   4.153 -  if [ -z "$autoconf" ]; then
   4.154 -    echo "Error: no autoconf variable set !"
   4.155 -    return 1
   4.156 -  else
   4.157 -    autoheader=`echo $autoconf | sed s/autoconf/autoheader/`
   4.158 -    debug "autoheader: $autoheader"
   4.159 -    if [ "$autoheader" != "autoheader" ];
   4.160 -    then
   4.161 -      CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoheader=$autoheader"
   4.162 -    fi
   4.163 -    if [ ! -x `which $autoheader` ]; then
   4.164 -      echo "Error: cannot execute $autoheader !"
   4.165 -      return 1
   4.166 -    fi
   4.167 -  fi
   4.168 -
   4.169 -}
   4.170 -
   4.171 -autoconf_2_52d_check ()
   4.172 -{
   4.173 -  # autoconf 2.52d has a weird issue involving a yes:no error
   4.174 -  # so don't allow it's use
   4.175 -  test -z "$NOCHECK" && {
   4.176 -    ac_version=`$autoconf --version|head -n 1|sed 's/^[a-zA-Z\.\ ()]*//;s/ .*$//'`
   4.177 -    if test "$ac_version" = "2.52d"; then
   4.178 -      echo "autoconf 2.52d has an issue with our current build."
   4.179 -      echo "We don't know who's to blame however.  So until we do, get a"
   4.180 -      echo "regular version.  RPM's of a working version are on the gstreamer site."
   4.181 -      exit 1
   4.182 -    fi
   4.183 -  }
   4.184 -  return 0
   4.185 -}
   4.186 -
   4.187 -die_check ()
   4.188 -{
   4.189 -  # call with $DIE
   4.190 -  # if set to 1, we need to print something helpful then die
   4.191 -  DIE=$1
   4.192 -  if test "x$DIE" = "x1";
   4.193 -  then
   4.194 -    echo
   4.195 -    echo "- Please get the right tools before proceeding."
   4.196 -    echo "- Alternatively, if you're sure we're wrong, run with --nocheck."
   4.197 -    exit 1
   4.198 -  fi
   4.199 -}
   4.200 -
   4.201 -autogen_options ()
   4.202 -{
   4.203 -  if test "x$1" = "x"; then
   4.204 -    return 0
   4.205 -  fi
   4.206 -
   4.207 -  while test "x$1" != "x" ; do
   4.208 -    optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
   4.209 -    case "$1" in
   4.210 -      --noconfigure)
   4.211 -          NOCONFIGURE=defined
   4.212 -	  AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --noconfigure"
   4.213 -          echo "+ configure run disabled"
   4.214 -          shift
   4.215 -          ;;
   4.216 -      --nocheck)
   4.217 -	  AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --nocheck"
   4.218 -          NOCHECK=defined
   4.219 -          echo "+ autotools version check disabled"
   4.220 -          shift
   4.221 -          ;;
   4.222 -      --debug)
   4.223 -          DEBUG=defined
   4.224 -	  AUTOGEN_EXT_OPT="$AUTOGEN_EXT_OPT --debug"
   4.225 -          echo "+ debug output enabled"
   4.226 -          shift
   4.227 -          ;;
   4.228 -      --prefix=*)
   4.229 -	  CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT --prefix=$optarg"
   4.230 -	  echo "+ passing --prefix=$optarg to configure"
   4.231 -          shift
   4.232 -          ;;
   4.233 -      --prefix)
   4.234 -	  shift
   4.235 -	  echo "DEBUG: $1"
   4.236 -	  CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT --prefix=$1"
   4.237 -	  echo "+ passing --prefix=$1 to configure"
   4.238 -          shift
   4.239 -          ;;
   4.240 -      -h|--help)
   4.241 -          echo "autogen.sh (autogen options) -- (configure options)"
   4.242 -          echo "autogen.sh help options: "
   4.243 -          echo " --noconfigure            don't run the configure script"
   4.244 -          echo " --nocheck                don't do version checks"
   4.245 -          echo " --debug                  debug the autogen process"
   4.246 -	  echo " --prefix		  will be passed on to configure"
   4.247 -          echo
   4.248 -          echo " --with-autoconf PATH     use autoconf in PATH"
   4.249 -          echo " --with-automake PATH     use automake in PATH"
   4.250 -          echo
   4.251 -          echo "to pass options to configure, put them as arguments after -- "
   4.252 -	  exit 1
   4.253 -          ;;
   4.254 -      --with-automake=*)
   4.255 -          AUTOMAKE=$optarg
   4.256 -          echo "+ using alternate automake in $optarg"
   4.257 -	  CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-automake=$AUTOMAKE"
   4.258 -          shift
   4.259 -          ;;
   4.260 -      --with-autoconf=*)
   4.261 -          AUTOCONF=$optarg
   4.262 -          echo "+ using alternate autoconf in $optarg"
   4.263 -	  CONFIGURE_DEF_OPT="$CONFIGURE_DEF_OPT --with-autoconf=$AUTOCONF"
   4.264 -          shift
   4.265 -          ;;
   4.266 -      --disable*|--enable*|--with*)
   4.267 -          echo "+ passing option $1 to configure"
   4.268 -	  CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $1"
   4.269 -          shift
   4.270 -          ;;
   4.271 -       --) shift ; break ;;
   4.272 -      *) echo "- ignoring unknown autogen.sh argument $1"; shift ;;
   4.273 -    esac
   4.274 -  done
   4.275 -
   4.276 -  for arg do CONFIGURE_EXT_OPT="$CONFIGURE_EXT_OPT $arg"; done
   4.277 -  if test ! -z "$CONFIGURE_EXT_OPT"
   4.278 -  then
   4.279 -    echo "+ options passed to configure: $CONFIGURE_EXT_OPT"
   4.280 -  fi
   4.281 -}
   4.282 -
   4.283 -toplevel_check ()
   4.284 -{
   4.285 -  srcfile=$1
   4.286 -  test -f $srcfile || {
   4.287 -        echo "You must run this script in the top-level $package directory"
   4.288 -        exit 1
   4.289 -  }
   4.290 -}
   4.291 -
   4.292 -
   4.293 -tool_run ()
   4.294 -{
   4.295 -  tool=$1
   4.296 -  options=$2
   4.297 -  run_if_fail=$3
   4.298 -  echo "+ running $tool $options..."
   4.299 -  $tool $options || {
   4.300 -    echo
   4.301 -    echo $tool failed
   4.302 -    eval $run_if_fail
   4.303 -    exit 1
   4.304 -  }
   4.305 -}
     5.1 --- a/gmyth/configure.ac	Mon Feb 25 18:04:30 2008 +0000
     5.2 +++ b/gmyth/configure.ac	Mon Feb 25 18:09:36 2008 +0000
     5.3 @@ -121,6 +121,7 @@
     5.4  
     5.5  AC_OUTPUT(
     5.6  Makefile
     5.7 +m4/Makefile
     5.8  gmyth/Makefile
     5.9  samples/Makefile
    5.10  tests/Makefile
     6.1 --- a/gmyth/m4/Makefile.am	Mon Feb 25 18:04:30 2008 +0000
     6.2 +++ b/gmyth/m4/Makefile.am	Mon Feb 25 18:09:36 2008 +0000
     6.3 @@ -1,10 +1,5 @@
     6.4 -SUBDIRS= src pixmaps
     6.5 -
     6.6 -include aminclude.am
     6.7 -
     6.8 -EXTRA_DIST =                            \
     6.9 -        autogen.sh                      \
    6.10 -        AUTHORS                         \
    6.11 -        COPYING                         \
    6.12 -        README
    6.13 -
    6.14 +EXTRA_DIST = \
    6.15 +	ac_doxygen.m4 \
    6.16 +	as-compiler-flag.m4 \
    6.17 +	as-expand.m4 \
    6.18 +	as-version.m4