]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/MKfallback.sh
ncurses 5.3
[ncurses.git] / ncurses / tinfo / MKfallback.sh
index 2a76f6239b2b755f680b746c3b7afcc5897155b9..d1abcd2eed3f85d1f9c3f80c3ac786612e3c370e 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
-# $Id: MKfallback.sh,v 1.9 1999/06/15 22:57:45 tom Exp $
+# $Id: MKfallback.sh,v 1.11 2001/12/02 01:55:30 tom Exp $
 #
 # MKfallback.sh -- create fallback table for entry reads
 #
@@ -8,6 +8,28 @@
 # from an on-disk terminfo tree) tries to match the type with one of a
 # specified list of types generated in.
 #
+
+terminfo_dir=$1
+shift
+
+terminfo_src=$1
+shift
+
+if test $# != 0 ; then
+       tmp_info=tmp_info
+       echo creating temporary terminfo directory... >&2
+
+       TERMINFO=`pwd`/$tmp_info
+       export TERMINFO
+
+       TERMINFO_DIRS=$TERMINFO:$terminfo_dir
+       export TERMINFO_DIRS
+
+       tic $terminfo_src >&2
+else
+       tmp_info=
+fi
+
 cat <<EOF
 /*
  * DO NOT EDIT THIS FILE BY HAND!  It is generated by MKfallback.sh.
@@ -50,7 +72,7 @@ EOF
 fi
 
 cat <<EOF
-const TERMTYPE *_nc_fallback(const char *name GCC_UNUSED)
+NCURSES_EXPORT(const TERMTYPE *) _nc_fallback (const char *name GCC_UNUSED)
 {
 EOF
 
@@ -73,3 +95,8 @@ cat <<EOF
        return((TERMTYPE *)0);
 }
 EOF
+
+if test -n "$tmp_info" ; then
+       echo removing temporary terminfo directory... >&2
+       rm -rf $tmp_info
+fi