# GLTT configure.in

AC_INIT(FTBitmapFont.C)

AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM

dnl make $GLTT_DIR the default for the installation
AC_PREFIX_DEFAULT(${GLTT_DIR:-/usr/local})

dnl generate the config header
AC_CONFIG_HEADER(config.h) dnl at the distribution this done

dnl Checks for programs.
AC_CHECK_COMPILERS
AC_PROG_RANLIB
AC_PROG_INSTALL

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(sys/time.h unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_HEADER_TIME

dnl Checks for library functions.
AC_CHECK_FUNCS(gettimeofday select usleep)

AC_PATH_TTF

dnl I need to check for libsocket before testing X
AC_CHECK_LIB(socket, socket, [LIBSOCKET="-lsocket -lnsl"]) dnl for Solaris
AC_SUBST(LIBSOCKET)
AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
AC_SUBST(LIBUCB)

GLTT_PATH_X

dnl Checks for libraries.

dnl Replace `main' with a function in -lm:
AC_CHECK_LIB(m, sin)
dnl Replace `main' with a function in -lX11:
AC_CHECK_LIB(X11, XOpenDisplay)
dnl Replace `main' with a function in -lXext:
AC_CHECK_LIB(Xext, XShmCreateImage)
dnl Replace `main' with a function in -lXt:
AC_CHECK_LIB(Xt, XtDisplay)
dnl Replace `main' with a function in -lXi:
AC_CHECK_LIB(Xi, XOpenDevice)
dnl Replace `main' with a function in -lICE:
AC_CHECK_LIB(ICE, IceSetIOErrorHandler)
#dnl Replace `main' with a function in -lMesaGL:
#AC_CHECK_LIB(MesaGL, glEnd)
#dnl Replace `main' with a function in -lMesaGLU:
#AC_CHECK_LIB(MesaGLU, gluNewNurbsRenderer)
dnl Replace `main' with a function in -lSM:
AC_CHECK_LIB(SM, SmsSetErrorHandler)
dnl Replace `main' with a function in -lXmu:
AC_CHECK_LIB(Xmu, XmuSimpleErrorHandler)

dnl Replace `main' with a function in -lglut:
dnl AC_CHECK_LIB(glut, glutInit,,,$GL_INCLUDES $GL_LDFLAGS -l${GL_LIBNAME}GL -l${GL_LIBNAME}GLU $LIBSOCKET)

AC_HAVE_GL

AC_PATH_GLUT

#dnl Replace `main' with a function in -lttf:
#AC_CHECK_LIB(ttf, TT_Init_FreeType,,,$GLLIB $GLULIB $LIBSOCKET)

dnl output files
topdir=`pwd`
AC_SUBST(topdir)

AC_OUTPUT(Makefile)
