home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / gnu / gawk-2.15.5-src.lha / gawk-2.15.5 / mungeconf < prev    next >
Text File  |  1991-07-02  |  464b  |  21 lines

  1. #! /bin/sh
  2.  
  3. # stdout is normally config.h
  4.  
  5. case $# in
  6. 2)    ;;
  7. *)    echo "Usage: mungeconf sysfile distfile" >&2 ; exit 2 ;;
  8. esac
  9.  
  10. sed '/^#/d; /^MAKE_*/d' $1 |    # strip comments and Makefile stuff
  11. sed '1s:.*:s~__SYSTEM__~&~:
  12. 2,$s:^\([^     ]*\)[     ].*:s~^/\\* #define[     ]*\1.*~#define    &~:' >sedscr
  13.  
  14. sed -f sedscr $2
  15.  
  16. echo
  17. echo '/* anything that follows is for system-specific short-term kludges */'
  18. grep '^#define' $1        # for system-specific short-term kludges
  19.  
  20. rm -f sedscr
  21.