dnl
dnl Process this file with autoconf to produce a configure script.
dnl ie autoconf
dnl
dnl The generated configure script is used to install Rexx/Wrapper
dnl
AC_INIT(intbuild.c)
AC_PREFIX_DEFAULT(/usr)

VER="23"
VER_DOT="2.3"
VER_DATE="3-Jan-2004"
AC_SUBST(VER)
AC_SUBST(VER_DOT)
AC_SUBST(VER_DATE)

dnl -------------- Setup substitutions for rexxwrapper-config ------------
AC_SUBST(prefix)
AC_SUBST(exec_prefix)
AC_SUBST(bindir)

dnl ---------------------- check for REXX argument -----------------
dnl allow --with-rexx for Rexx support
AC_ARG_WITH(rexx,
	[  --with-rexx=int         specify Rexx interpeter to build rexxwrapper (rexxtrans|regina|rexximc|objrexx|unirexx|rexx6000)],
	[with_rexx=$withval],
	[with_rexx=no],
)
CHECK_REXX
INTERPRETER=$with_rexx
AC_SUBST(INTERPRETER)

AC_PATH_PROG( REXXEXE, rexx )
if test "$REXXEXE" = no; then
	AC_MSG_ERROR(Cannot find a Rexx interpreter executable in PATH; cannot configure)
fi

AC_OUTPUT(Makefile rexxwrapper-config)

dnl
dnl Ensure that rexxwrapper-config can be run from the current directory for building
dnl rexxwrapper
dnl
chmod 755 rexxwrapper-config
