dnl Process this file with autoconf to produce a configure script. AC_INIT(enigma.h) dnl Check for broken VPATH handling on older NetBSD makes. AC_DEFUN(AC_PROG_MAKE_VPATHOK, [AC_MSG_CHECKING(whether ${MAKE-make} has sane VPATH handling) set dummy ${MAKE-make}; ac_make=`echo "[$]2" | sed 'y%./+-%__p_%'` AC_CACHE_VAL(ac_cv_prog_make_vpathok, [mkdir conftestdir cat > conftestdir/conftestmake <<\EOF VPATH = .. conftestfoo: conftestbar @echo ac_make2temp=ok conftestbar: conftestbaz @echo ac_maketemp=broken @touch conftestbar EOF echo > conftestbaz # these two lines need to be... echo > conftestbar # ... in this order not the other changequote(, )dnl unset ac_maketemp unset ac_make2temp # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `cd conftestdir; ${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` changequote([, ])dnl if test -n "$ac_maketemp"; then ac_cv_prog_make_vpathok=no else if test -n "$ac_make2temp"; then ac_cv_prog_make_vpathok=yes else ac_cv_prog_make_vpathok=no fi fi rm -rf conftestdir rm -f conftestbar conftestbaz])dnl if test $ac_cv_prog_make_vpathok = yes; then AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi ]) AC_PREFIX_PROGRAM(enigma) dnl Checks for programs. AC_PROG_CC AC_PROG_LN_S AC_PROG_MAKE_SET if test -f enigma.h; then # we're building in the source dir, so we don't need this check at all ac_cv_prog_make_vpathok=yes else AC_PROG_MAKE_VPATHOK fi AC_PROG_INSTALL if test "$GCC" = "yes"; then GCCFLAGS="-Wall -W" else GCCFLAGS= fi AC_SUBST(GCCFLAGS) dnl Look for "nroff" or "groff" AC_CHECK_PROGS(NROFF, nroff, echo) AC_SUBST(NROFF) dnl Checks for header files. AC_HEADER_STDC if test $ac_cv_header_stdc = no; then AC_MSG_ERROR([Enigma requires ANSI C header files to compile]) fi AC_TYPE_SIZE_T if test $ac_cv_type_size_t = no; then AC_MSG_ERROR([Enigma requires ANSI C (specifically, "size_t")]) fi AC_CHECK_FUNCS(strcspn) if test $ac_cv_func_strcspn = no; then AC_MSG_ERROR([Enigma requires ANSI C (specifically, "strcspn")]) fi AC_CHECK_FUNCS(strspn) if test $ac_cv_func_strspn = no; then AC_MSG_ERROR([Enigma requires ANSI C (specifically, "strspn")]) fi dnl Checks for Curses library. curslib=ncurses AC_CHECK_LIB(ncurses,initscr) AC_CHECK_HEADER(ncurses.h) if test $ac_cv_lib_ncurses_initscr = no || test $ac_cv_header_ncurses_h = no; then curslib=curses AC_CHECK_LIB(curses,initscr) AC_CHECK_HEADER(curses.h) if test $ac_cv_lib_curses_initscr = no || test $ac_cv_header_curses_h = no; then AC_MSG_ERROR([Enigma requires libcurses and curses.h]) fi fi dnl Checks for attr_t in curses header. AC_MSG_CHECKING(for attr_t in ${curslib}.h) AC_TRY_COMPILE(#include <${curslib}.h> ,attr_t i; ,cursattr=" -DHAS_ATTR_T" AC_MSG_RESULT(yes), AC_MSG_RESULT(no)) CURSES="-DCURSES_HDR=\"<${curslib}.h>\"$cursattr" AC_SUBST(CURSES) AC_OUTPUT(Makefile)