home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / System / Mesa-3.1 / fixam < prev    next >
Text File  |  1999-09-23  |  1KB  |  52 lines

  1. #! /bin/sh
  2.  
  3. # (c) Copyright 1999, Thomas Tanner <tanner@ffii.org>
  4. # Disables/enables automake's automatic dependency tracking
  5. # since automake 1.4 doesn't support this feature on non-GNU systems.
  6. # Developers using a non-GNU system (no GNU make and GCC installed)
  7. # must execute
  8. #    fixam
  9. # before running bootstrap and
  10. #    fixam -r
  11. # before doing a CVS checkin.
  12. # Normally, on GNU systems (both GCC and GNU make installed) 
  13. # this script has no effect. However, you can let it assume
  14. # a non-GNU system using the -f argument.
  15.  
  16. undo=no
  17. force=no
  18. while test $# -gt 0
  19. do
  20.   arg="$1"
  21.   shift
  22.   case "$arg" in
  23.   -f) force=yes ;;
  24.   -r) undo=yes ;;
  25.   esac
  26. done
  27.  
  28. if test $force = no && (cc -v 2>&1 | grep gcc > /dev/null) &&
  29.    (make -v 2>&1 | grep GNU > /dev/null); then 
  30.   # GCC and GNU make installed
  31.   echo "nothing to do."
  32.   exit 0
  33. fi
  34.  
  35.   files=`find -name "Makefile.am"`
  36.   for file in $files; do
  37.     if grep "AUTOMAKE_OPTIONS = no-dependencies" $file > /dev/null; then
  38.       echo "fixing $file"
  39.     if test $undo = no; then
  40.       # uncomment it -> disable automatic dependency tracking
  41.         sed -e "s/^\#AUTOMAKE_OPTIONS/AUTOMAKE_OPTIONS/g" $file > $file.tmp
  42.       else
  43.       # comment it out -> enable automatic dependency tracking
  44.         sed -e "s/^AUTOMAKE_OPTIONS/\#AUTOMAKE_OPTIONS/g" $file > $file.tmp
  45.       fi
  46.       mv -f $file.tmp $file
  47.     fi
  48.   done
  49. echo "done."
  50.  
  51. exit 0
  52.