home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / gawk-2.15.6-base.tgz / gawk-2.15.6-base.tar / fsf / gawk / pc / mkconf.cmd < prev    next >
OS/2 REXX Batch file  |  1991-06-27  |  728b  |  32 lines

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