dnl withenable.ac: --with and --enable options.

dnl The implementation of the defaults for the next three options is found
dnl in configure.in.

dnl Do we compile Omega?
dnl We default to yes if the sources are available.
AC_ARG_WITH(omega,
[  --without-omega            don't compile and install Omega])

dnl Do we compile pdfTeX?
dnl We default to yes if the sources are available.
AC_ARG_WITH(pdftex,
[  --without-pdftex           don't compile and install pdfTeX])

dnl Do we compile pdfeTeX?
dnl We default to yes if the sources are available.
AC_ARG_WITH(pdfetex,
[  --without-pdfetex          don't compile and install pdfeTeX])

dnl Do we compile e-TeX?
dnl Here we have three choices: yes, no, and to use etex as tex.
dnl We default to yes if the sources are available.
AC_ARG_WITH(etex,
[  --with-etex=ETEX           ETEX=no  don't compile and install e-TeX
                             ETEX=tex install e-TeX as tex])

AC_ARG_WITH(editor, changequote(`,')dnl
`  --with-editor=CMD       invoke CMD from the e option [vi +%d %s]',
changequote([,])dnl
  AC_DEFINE_UNQUOTED(EDITOR, "$with_editor")
)

AC_ARG_ENABLE(ipc,
[  --enable-ipc            enable TeX's --ipc option, i.e., pipe to a program],
  AC_DEFINE(IPC)
  # -lsocket is needed on Solaris, at least.  Maybe -lnsl on SCO, too?
  # See ac_path_xtra.
  AC_CHECK_FUNC(connect)
  if test x$ac_cv_func_connect = xno; then
    AC_CHECK_LIB(socket, connect, socketlibs="-lsocket $socketlibs")
  fi
)
AC_SUBST(socketlibs)

AC_ARG_ENABLE(auto-core,
[  --enable-auto-core      cause TeX&MF to dump core given a certain filename],
  AC_DEFINE(FUNNY_CORE_DUMP))

AC_ARG_ENABLE(dump-share,
[  --disable-dump-share    make fmt/base/mem files architecture-dependent],
if test "x$enableval" = xno; then
  AC_DEFINE(NO_DUMP_SHARE)
fi
)


dnl Do we include Window system support in MF?
dnl Here we have three choices: yes, no, and as a separate executable mfw.
dnl We default to mf.
AC_ARG_WITH(mfw,
[  --with-mfw=MFW             MFW=yes  window-capable METAFONT is mfw
                             MFW=mf   window-capable METAFONT is mf
                             MFW=no   no window-capable METAFONT])

# Window system support for Metafont.
AC_ARG_WITH(epsfwin,
  [  --with-epsfwin          include EPSF pseudo-window support],
if test "x$withval" = xyes; then
  AC_DEFINE(EPSFWIN)
fi
)
AC_ARG_WITH(hp2627win,
  [  --with-hp2627win        include HP 2627 window support in Metafont],
if test "x$withval" = xyes; then
  AC_DEFINE(HP2627WIN)
fi
)
AC_ARG_WITH(mftalkwin,
  [  --with-mftalkwin        include mftalk (generic server) window support],
if test "x$withval" = xyes; then
  AC_DEFINE(MFTALKWIN)
fi
)
AC_ARG_WITH(nextwin,
  [  --with-nextwin          include NeXT window support],
if test "x$withval" = xyes; then
  AC_DEFINE(NEXTWIN)
fi
)
AC_ARG_WITH(regiswin,
  [  --with-regiswin         include Regis window support],
if test "x$withval" = xyes; then
  AC_DEFINE(REGISWIN)
fi
)
AC_ARG_WITH(suntoolswin,
  [  --with-suntoolswin      include old Suntools window support (this is not X)],
if test "x$withval" = xyes; then
  wlibs="-lsuntool -lsunwindow -lpixrect $wlibs"
  AC_DEFINE(SUNWIN)
fi
)
AC_ARG_WITH(tektronixwin,
  [  --with-tektronixwin     include Tektronix window support],
if test "x$withval" = xyes; then
  AC_DEFINE(TEKTRONIXWIN)
fi
)
AC_ARG_WITH(unitermwin,
  [  --with-unitermwin       include Uniterm window support],
if test "x$withval" = xyes; then
  AC_DEFINE(UNITERMWIN)
fi
)

dnl The second is apparently superfluous.
sinclude(../kpathsea/xt.ac)dnl for web2c/configure
dnl sinclude(kpathsea/xt.ac)dnl for top-level configure

AC_ARG_WITH(x11win,
  [  --with-x11win           same as --with-x],
  with_x="$withval")
AC_ARG_WITH(x11,
  [  --with-x11              same as --with-x],
  with_x="$withval")
