#!/bin/sh

# $Id: glue.sh,v 1.8 2006/12/31 15:27:58 jason Exp $

MODULETYPE="$1"
shift

echo "/*  This file is automatically generated by utils/glue.sh,"
echo " *  called from the configure script.  Do not edit by hand!"
echo " */"
echo
echo "#include \"shntool.h\""
echo

for module in "$@"; do
  echo "extern ${MODULETYPE}_module ${MODULETYPE}_${module};"
done

echo
echo "${MODULETYPE}_module *st_${MODULETYPE}s[] = {"

for module in "$@"; do
  echo "  &${MODULETYPE}_${module},"
done

echo "  NULL"
echo "};"
