dnl
dnl autoconf script for XgIRC
dnl

VERSION=0.1
PACKAGE=XgIRC

AM_INIT_AUTOMAKE(XgIRC, 0.1)
AC_INIT(main.c)

dnl Sets options for the C compiler.
CFLAGS="-O2 -s -pipe"

OPTIONS=""

AC_DEFUN(AC_XMIRC_CHECK,
[
        AM_PATH_GTK(1.0.0,,
          AC_MSG_ERROR(Cannot include/link gtk/gdk/glib--check CFLAGS/LDFLAGS))
        X_LIBS=$GTK_LIBS
        X_CFLAGS=$GTK_CFLAGS
        AC_SUBST(X_LIBS)
        AC_SUBST(X_CFLAGS)
])

dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_ARG_PROGRAM

dnl Debug support ?
sup=no
AC_ARG_ENABLE(debug,
 [ --enable-debug         enables debugging messages],
        sup=yes, sup=no)

if test "$sup" = yes; then
        AC_MSG_WARN("including debugging support")
        OPTIONS="$OPTIONS -DDEBUG"
fi

dnl Raw server messages ?
sup=no
AC_ARG_ENABLE(raw_server_msgs,
 [ --enable-raw_server_msgs         enables raw server messages],
        sup=yes, sup=no)

if test "$sup" = yes; then
        AC_MSG_WARN("including raw server messages display support")
        OPTIONS="$OPTIONS -DRAW_SERVER_MSGS"
fi

dnl Checks for libraries.
AC_XMIRC_CHECK

dnl Checks for header files.
dnl AC_CHECK_HEADERS(strings.h)
dnl AC_CHECK_HEADERS(sys/utsname.h)
dnl AC_CHECK_HEADERS(pwd.h)

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

dnl Checks for library functions.
dnl AC_CHECK_FUNCS(socket)

dnl Finds the X11 include and library directories.
AC_PATH_X

AC_SUBST(OPTIONS)

AC_OUTPUT(Makefile)
