home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / zip / gnu / gawk213s.lzh / GAWK213S / MKCONF < prev    next >
Text File  |  1993-07-29  |  707b  |  33 lines

  1. #! /bin/sh
  2. #
  3. # configure -- produce a config.h from a known configuration
  4.  
  5. case "$#" in
  6. 1)    ;;
  7. *)    echo "Usage:  $0 system_type" >&2
  8.     echo "Known systems:  `cd config; echo ;ls -C`" >&2
  9.     exit 2
  10.     ;;
  11. esac
  12.  
  13. if [ -f config/$1 ]; then
  14.     sh ./mungeconf config/$1 config.h-dist >config.h
  15.  
  16.     # echo #echo lines to stdout
  17.     sed -n '/^#echo /s///p' config/$1
  18.  
  19.     sed -n '/^MAKE_.*/s//s,^##&## ,,/p' config/$1 >sedscr
  20.     if [ -s sedscr ]
  21.     then
  22.         sed -f sedscr Makefile-dist >Makefile
  23.     else
  24.         cp Makefile-dist Makefile
  25.     fi
  26.     rm -f sedscr
  27. else
  28.     echo "\`$1' is not a known configuration."
  29.     echo "Either construct one based on the examples in the config directory,"
  30.     echo "or copy config.h-dist to config.h and edit it."
  31.     exit 1
  32. fi
  33.