]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - include/edit_cfg.sh
ncurses 6.0 - patch 20170311
[ncurses.git] / include / edit_cfg.sh
index baa31f687d1e17b365bb366a7149d547a0bdb06e..8d64fee18013b37137f1c2b157790d064286b206 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 #!/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"), #
 #                                                                            #
 # 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.                                                             #
 ##############################################################################
 #
 # authorization.                                                             #
 ##############################################################################
 #
-# Author: Thomas E. Dickey <dickey@clark.net> 1996,1997
+# Author: Thomas E. Dickey <dickey@clark.net> 1996,1997,2000
 #
 # Edit the default value of the term.h file based on the autoconf-generated
 # values:
 #
 # 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 \
        HAVE_TCGETATTR \
        HAVE_TERMIOS_H \
        HAVE_TERMIO_H \
-       NCURSES_CONST \
        BROKEN_LINKER
 do
        mv $2 $BAK
        if ( grep "[    ]$name[         ]" $1 2>&1 >$TMP )
        then
        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
        else
-               sed -e 's/define '$name'.*$/define '$name' 0/' $BAK >$2
+               value=0
        fi
        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
        if (cmp -s $2 $BAK)
        then
-               echo '** same: '$name
                mv $BAK $2
        else
                mv $BAK $2
        else
-               echo '** edit: '$name
                rm -f $BAK
        fi
 done
                rm -f $BAK
        fi
 done