dnl $Id: configure.in,v 1.5 2002/01/05 02:19:00 c-hey Exp $ dnl Process this file with autoconf to produce a configure script. dnl Initialise. This can be passed any old file. AC_INIT(hey_arg.h) AC_CONFIG_HEADER(config.h) AC_ARG_VAR(WRITE, path to a write-like utility) dnl Checks for programs. AC_PROG_CC dnl dnl if the user hasn't specified CFLAGS, then dnl if compiler is gcc, then use -O2 and some warning flags dnl else use os-specific flags or -O dnl if test -n "$GCC"; then CFLAGS="-O2 -Wall -pedantic" else case "$host_os" in *hpux*) CFLAGS=" +O3" ;; *ultrix* | *osf*) CFLAGS=" -O -Olimit 2000" ;; *) CFLAGS=" -O" ;; esac fi AC_PROG_INSTALL AC_PROG_LN_S AC_PATH_PROG(WRITE, write , :) if test "$WRITE" = ":" ; then echo "Sorry, but write is a requirement to build hey." echo "please run ./configure write=/path/to/binary to" echo "compile with a different write-like utility" exit fi AC_PROG_MAKE_SET dnl Checks for libraries. dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(utmpx.h) dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for library functions. AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(strdup,,STRDUP_OBJ=mystrdup.o) AC_CHECK_FUNCS(getutent,,UT_OBJ=utent.o) dnl we have to initalise this dnl using success arg of lib check skews config.h EDIT_OBJ=hey_edit.o dnl the following two checks are ugly but neccessary dnl autoconfs extra library feature for AC_CHECK_LIB dnl simply does not work, and fails to register readline dnl on systems where curses isnt needed for it dnl vanilla readline check, works on 90% of systems AC_CHECK_LIB(readline, readline, , NOREADLINE=1) dnl readline doesnt work, try it with curses dnl dnl this stuff is overly dependent on autoconf internals dnl better suggestions welcome dnl if test -n "$NOREADLINE" ; then AC_CHECK_LIB(readline -lcurses ,readline, AC_DEFINE(HAVE_LIBREADLINE) LIBS="$LIBS -lreadline -lcurses" , echo echo "WARNING: you are compiling c-hey WITHOUT readline support" echo " we recommend you install the readline library and" echo " associated development materials to utilise the" echo " full functionality of c-hey" echo echo " get it at: " echo " http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html" echo # dont want edit object now EDIT_OBJ="" ) fi dnl check for rl_ding() AC_CHECK_FUNCS(rl_ding) dnl Make any macro substitutions that we ought to. AC_SUBST(UT_OBJ) AC_SUBST(EDIT_OBJ) AC_SUBST(WRITE) AC_OUTPUT(Makefile)