#!/usr/bin/sh
#
# Copyright (c) 1999 Sun Microsystems, Inc.
# Copyright (c) 1999 Nihon Sun Microsystems K.K.
# All rights reserved.
#
# $Id: ct_conf.sh,v 1.1.1.1 2000/10/29 16:44:42 himi Exp $
#
# @(#)ct_conf.sh 1.4	99/07/02 SMI
#

ME=`basename $0`
SED=${SED:=sed}
CT_CONF_SED=${CT_CONF_SED:=ct_conf.sed}
CT_CONF_LIST=ct_conf.list

echo "/*"
echo " * Generated automatically from ${CT_CONF_LIST} by ${ME}"
echo " */"
echo
echo '#include "ct_conf.h"'
echo
echo '#include <stddef.h>'
echo

${SED} -e 's;#.*;;' -e '/^$/d' ${CT_CONF_LIST} |
while read f
do
    b=`basename ${f} | sed -e 's;\.;_;'`
    echo "static const char	csc_ct_conf_${b}[] ="
    ${SED} -f ${CT_CONF_SED} ${f}
done
    echo
#
#
echo
echo
echo "const csc_ct_conf_def_t csc_ct_conf_internal[] = {"

${SED} -e 's;#.*;;' -e '/^$/d' ${CT_CONF_LIST} |
while read f
do
    b=`basename ${f} | sed -e 's;\.;_;'`
    bb=`basename ${f}`
    echo "	{\"${bb}\",	csc_ct_conf_${b},"
    echo "	 ((sizeof (csc_ct_conf_${b})) - 1)},"
done

echo "	{NULL,		NULL,			0}"
echo "};"
