dnl Process this file with autoconf to produce a configure script.

AC_INIT(aclocal.m4)
AC_CONFIG_HEADER(config.h)

: ${CFLAGS=""}

AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AM_PROG_LIBTOOL

test "$GCC" && : ${CFLAGS:="-pipe -Wall -O2 -fomit-frame-pointer"}

AC_CHECK_LIB(pthread, pthread_create, PTHREAD=-lpthread)
if test $ac_cv_lib_pthread_pthread_create = no; then
AC_CHECK_LIB(pthreads, pthread_create, PTHREAD=-lpthreads)
fi
AC_SUBST(PTHREAD)

AC_CHECK_LIB(dl, dlopen)
AC_CHECK_LIB(Foundation, NSLog,,, -lobjc -lm $PTHREAD)
if test $ac_cv_lib_Foundation_NSLog = no; then
AC_CHECK_LIB(gnustep-base, NSLog,,, -lobjc -lm $PTHREAD)
fi

AC_OUTPUT(GToolKit/Makefile Examples/Makefile
	  Examples/calc/Makefile Examples/p/Makefile)
