dnl Process this file with autoconf to produce a configure script. AC_INIT(cmatrix.c) AM_INIT_AUTOMAKE(cmatrix, 1.2a) AM_CONFIG_HEADER(config.h) dnl Checks for programs. AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET dnl Checks for libraries. dnl Replace `main' with a function in -lncurses: AC_CHECK_LIB(ncurses, main) dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(fcntl.h sys/ioctl.h unistd.h termios.h termio.h) dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. AC_TYPE_SIGNAL AC_CHECK_FUNCS(putenv) dnl Checks for libraries. AC_CHECK_HEADERS(curses.h ncurses.h) CURSES_LIB_NAME="" AC_CHECK_LIB(ncurses, tgetent, CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses) if eval "test x$CURSES_LIB_NAME = x" then AC_CHECK_LIB(curses, tgetent, CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses) fi if eval "test x$CURSES_LIB_NAME = x" then AC_CHECK_LIB(termcap, tgetent, CURSES_LIB="-ltermcap" CURSES_LIB_NAME=termcap) fi if eval "test x$CURSES_LIB_NAME = x" then AC_MSG_WARN([ *** No termcap lib available, consider getting the official ncurses *** distribution from ftp://ftp.gnu.org/pub/gnu/ncurses if you get *** errors compiling nano.]) else AC_MSG_RESULT("Using $CURSES_LIB_NAME as the termcap library") fi AC_CHECK_LIB($CURSES_LIB_NAME, use_default_colors, AC_DEFINE(HAVE_USE_DEFAULT_COLORS)) AC_CHECK_LIB($CURSES_LIB_NAME, resizeterm, [AC_DEFINE(HAVE_RESIZETERM)]) AC_CHECK_LIB([$CURSES_LIB_NAME], wresize, [AC_DEFINE(HAVE_WRESIZE)]) dnl Only change gcc options if we are using gcc. if test "$ac_cv_prog_CC" = gcc -o "$ac_cv_prog_CC" = g++; then CFLAGS="$CFLAGS -Wall -Wno-comment" fi dnl Stuff we want at the end so people can actually see it... dnl Parse any configure options LIBS="$LIBS $CURSES_LIB" AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging (def disabled)],) AC_SUBST(CURSES_LIB) AC_OUTPUT(Makefile cmatrix.spec)