X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=include%2Fedit_cfg.sh;h=8d64fee18013b37137f1c2b157790d064286b206;hp=baa31f687d1e17b365bb366a7149d547a0bdb06e;hb=03a795bde58b3280a4e9d80029a3b7fec13c79ad;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1 diff --git a/include/edit_cfg.sh b/include/edit_cfg.sh index baa31f68..8d64fee1 100755 --- a/include/edit_cfg.sh +++ b/include/edit_cfg.sh @@ -1,7 +1,7 @@ #!/bin/sh -# $Id: edit_cfg.sh,v 1.9 1998/02/11 12:13:46 tom Exp $ +# $Id: edit_cfg.sh,v 1.12 2001/12/23 00:52:40 tom Exp $ ############################################################################## -# Copyright (c) 1998 Free Software Foundation, Inc. # +# Copyright (c) 1998,2000,2001 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -28,7 +28,7 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey 1996,1997 +# Author: Thomas E. Dickey 1996,1997,2000 # # Edit the default value of the term.h file based on the autoconf-generated # values: @@ -43,24 +43,25 @@ for name in \ HAVE_TCGETATTR \ HAVE_TERMIOS_H \ HAVE_TERMIO_H \ - NCURSES_CONST \ BROKEN_LINKER do mv $2 $BAK if ( grep "[ ]$name[ ]" $1 2>&1 >$TMP ) then - sed -e 's@#define '$name'.*$@'"`cat $TMP`@" $BAK >$2 - elif test "$name" = "NCURSES_CONST" ; then - sed -e 's/define '$name'.*$/define '$name' \/\*nothing\*\//' $BAK >$2 + value=1 else - sed -e 's/define '$name'.*$/define '$name' 0/' $BAK >$2 + value=0 fi + echo '** edit: '$name $value + sed \ + -e "s@#define ${name}.*\$@#define $name $value@" \ + -e "s@#if $name\$@#if $value /* $name */@" \ + -e "s@#if !$name\$@#if $value /* !$name */@" \ + $BAK >$2 if (cmp -s $2 $BAK) then - echo '** same: '$name mv $BAK $2 else - echo '** edit: '$name rm -f $BAK fi done