# Adapted from Tcl and Welch p. 545

AC_INIT(Makefile.in)

# Get the application library directory.
AC_ARG_WITH(libdir,
            [  --with-libdir=DIR       library directory for application],
            [LIBDIR=$withval;INCDIR="$LIBDIR/include"],
            [LIBDIR=`cd ../..; pwd`;INCDIR=$LIBDIR])
if test ! -d $LIBDIR; then
  AC_MSG_ERROR(library directory $LIBDIR does not exist)
fi

# Recover system configuration information.
. $LIBDIR/shlibconfig.sh

# Register configuration variables for substitution.
AC_SUBST(CC)
AC_SUBST(SHLIB_CFLAGS)
AC_SUBST(SHLIB_LD)
AC_SUBST(SHLIB_SUFFIX)
AC_SUBST(SHLIB_LD_LIBS)
AC_SUBST(LIBDIR)
AC_SUBST(INCDIR)

# Output the Makefile
AC_OUTPUT(Makefile)
