home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / ncurses-1.9.9e-src.tgz / tar.out / fsf / ncurses / include / MKcurses.sh < prev    next >
Linux/UNIX/POSIX Shell Script  |  1996-09-28  |  724b  |  28 lines

  1. #!/bin/sh
  2. #
  3. # MKcurses.sh
  4. #
  5. ### Generate curses.h from curses.h.in.  Insert the proper type for bool,
  6. ### also the current version stamp (get these from arguments).
  7. version=$1
  8. builtin_bool=$2
  9. type_of_bool=$3
  10.  
  11. trap 'rm -f conftest.tmp; exit 0' 0 1 2 15
  12.  
  13. sed \
  14.     -e "s/#\\(define\\)[     ][     ]*\\(CXX_BUILTIN_BOOL\\).*/#\\1 \\2 $builtin_bool/" \
  15.     -e "s/#\\(define\\)[     ][     ]*\\(CXX_TYPE_OF_BOOL\\).*/#\\1 \\2 $type_of_bool/" \
  16.     -e "s/@VERSION@/$version/" \
  17.     $4/curses.h.in >conftest.tmp
  18.  
  19. if cmp -s curses.h conftest.tmp 2>/dev/null; then
  20.     echo include/curses.h is unchanged
  21.     rm -f conftest.tmp
  22. else
  23.     echo updating include/curses.h
  24.     rm -f curses.h~
  25.     if test -f curses.h; then mv curses.h curses.h~; fi
  26.     mv conftest.tmp curses.h
  27. fi
  28.